====== PreDocument ====== **//Inherited from//** [[class::xdocument|XDocument]], **//Inherited by//** NULL **//Friend class//** NULL **//Description//** **//Members//** * XModel * [[predocument#m_pmdl|m_pMdl]] * XMap * [[predocument#m_ppsentityidmap|m_pPSEntityIDMap]] * int [[predocument#m_ulactivemeshid|m_ulActiveMeshID]] * PreViewData * [[predocument#m_pgldata|m_pGLData]] **//Public interface//** * [[predocument#predocument1|PreDocument]]() * [[predocument#~predocument|~PreDocument]]() * bool [[predocument#isempty|isEmpty]]() * void [[predocument#save|save]](const char * fname, const char * scheme) * bool [[predocument#load|load]](const char * fname) * void [[predocument#clear|clear]]() * void [[predocument#clearcachedata|clearCacheData]]() * void [[predocument#clearreference|clearReference]](const XItem* obj) * void [[predocument#buildobjecttree|buildObjectTree]]() * TreeNode* [[predocument#updateobjecttree|updateObjectTree]](const XItem * obj, bool bDelete = false) * void [[predocument#updatemeshtree|updateMeshTree]](const XModel * mesh, bool bDelete = false) * bool [[predocument#checknodestatus|checkNodeStatus]](TreeNode * node) * const XItem [[predocument#*getitem|*getItem]](const XUniqueObjectID * ue) * void [[predocument#getiteminformation|getItemInformation]](const XUniqueObjectID * ue, string * infoStr) * void [[predocument#savemodel|saveModel]](const char * fname,int ioFlag) * void [[predocument#loadmodel|loadModel]](const char * fname,int ioFlag) * XModel * [[predocument#createmodel|createModel]](ulong mid = 0) * void [[predocument#destroymodel|destroyModel]](XModel * mdl) * XModel * [[predocument#getmodelbypart|getModelByPart]](const XPart * p) * XModel * [[predocument#getmodel|getModel]](ulong mid = 0) * ModelManager * [[predocument#getmodelmanager|getModelManager]]() * XModel * [[predocument#getmesh|getMesh]]() * void [[predocument#setmesh|setMesh]](ulong mid) * void [[predocument#release|release]]() * void [[predocument#synchronizemodelparts|synchronizeModelParts]](ulong pid = 0,bool bGeomToMesh = true) * virtual void [[predocument#reset|reset]]() * void [[predocument#registerenumstring|registerEnumString]]() * void [[predocument#createviewdata|createViewData]]() * void [[predocument#createitemmanager|createItemManager]](TypeID imt) * void [[predocument#init|init]]() * XViewData * [[predocument#getviewdata|getViewData]]() * const XItem * [[predocument#getitem|getItem]](TypeID tid,ulong id,DomainID did) * XMap * [[predocument#getpsentityidmap|getPSEntityIDMap]]() **//Protected interface//** * void [[predocument#buildanalysistree|buildAnalysisTree]]() * void [[predocument#buildcontacttree|buildContactTree]]() * void [[predocument#buildmaterialtree|buildMaterialTree]]() * TreeNode* [[predocument#updateanalysistree|updateAnalysisTree]](const XItem * obj, bool bDelete) * TreeNode* [[predocument#updatecontacttree|updateContactTree]](const XItem * obj, bool bDelete) * TreeNode* [[predocument#updatematerialtree|updateMaterialTree]](const XItem * obj, bool bDelete) ---- {{anchor:m_pmdl}} **XModel * m_pMdl** 当前模型对象 {{anchor:m_ppsentityidmap}} **XMap * m_pPSEntityIDMap** {{anchor:m_ulactivemeshid}} **int m_ulActiveMeshID** 当前网格对象ID {{anchor:m_pgldata}} **PreViewData * m_pGLData** 文档视图对象 ---- {{anchor:predocument1}} **PreDocument()** *function: 应用文档构造函数 *parameters: NULL *return value: 无 {{anchor:~predocument}} **~PreDocument()** *function: 析构函数 *parameters: NULL *return value: 无 {{anchor:isempty}} **bool isEmpty()** *function: 判断文件是否为空 *parameters: NULL *return value: 文件为空返回true,否则返回false {{anchor:save}} **void save(const char * fname, const char * scheme)** *function: 将文档保存到指定文件中 *parameters: - [i]const char * fname: 文件名 - [i] const char * scheme: 应用方案名 *return value: 无 {{anchor:load}} **bool load(const char * fname)** *function: 从文件中载入文档数据 *parameters: - [i]const char * fname: 文件名 *return value: 无 {{anchor:clear}} **void clear()** *function: 清空文档所有数据对象 *parameters: NULL *return value: 无 {{anchor:clearcachedata}} **void clearCacheData()** *function: 清空缓冲数据 *parameters: NULL *return value: 无 {{anchor:clearreference}} **void clearReference(const XItem* obj)** *function: 清空与指定对象关联的其它数据对象 *parameters: - [i]const XItem* obj: 被关联的对象 *return value: 无 {{anchor:buildobjecttree}} **void buildObjectTree()** *function: 重建对象树 *parameters: NULL *return value: 无 {{anchor:updateobjecttree}} **TreeNode* updateObjectTree(const XItem * obj, bool bDelete = false)** *function: 更新对象树的对象节点 *parameters: - [i]const XItem * obj: 待更新的对象 - [i] bool bDelete = false: 为true时删除对象节点 *return value: 更新时返回对象对应的节点,删除时返会对象的父节点 {{anchor:updatemeshtree}} **void updateMeshTree(const XModel * mesh, bool bDelete = false)** *function: 更新网格树 *parameters: - [i]const XModel * mesh: 网格对象 - [i] bool bDelete = false: 是否删除网格对象 *return value: 无 {{anchor:checknodestatus}} **bool checkNodeStatus(TreeNode * node)** *function: 检查树节点状态 *parameters: - [i]TreeNode * node: 模型树节点 *return value: 如节点对应的对象可用返回true,否则返回false {{anchor:*getitem}} **const XItem *getItem(const XUniqueObjectID * ue)** *function: 访问数据对象 *parameters: - [i]TypeID tid: 对象类型 - [i] ulong id: 对象ID - [i] DomainID did: 对象域类型(访问模型里的对象时,为模型的ID) *return value: 数据对象指针 {{anchor:getiteminformation}} **void getItemInformation(const XUniqueObjectID * ue, string * infoStr)** *function: 通过唯一对象标识获取数据对象的信息 *parameters: - [i]const XUniqueObjectID * ue: 唯一对象标识 - [i] string * infoStr: 数据对象信息 *return value: 无 {{anchor:savemodel}} **void saveModel(const char * fname,int ioFlag)** *function: 保存模型为文件 *parameters: - [i]const char * fname: 文件路径名 - [i]int ioFlag: 文件格式 *return value: 无 {{anchor:loadmodel}} **void loadModel(const char * fname,int ioFlag)** *function: 从文件中载入模型 *parameters: - [i]const char * fname: 文件路径名 - [i]int ioFlag: 文件格式 *return value: 无 {{anchor:createmodel}} **XModel * createModel(ulong mid = 0)** *function: 创建模型对象 *parameters: - [i]ulong mid = 0: 模型ID *return value: 模型对象 {{anchor:destroymodel}} **void destroyModel(XModel * mdl)** *function: 销毁模型对象 *parameters: - [i]XModel * mdl: 模型对象 *return value: 无 {{anchor:getmodelbypart}} **XModel * getModelByPart(const XPart * p)** *function: 获取部件所在模型对象 *parameters: - [i]const XPart * p: 部件对象 *return value: 部件所在模型对象 {{anchor:getmodel}} **XModel * getModel(ulong mid = 0)** *function: 获取模型对象 *parameters: - [i]ulong mid = 0: 模型对象ID *return value: 模型对象 {{anchor:getmodelmanager}} **ModelManager * getModelManager()** *function: 获取模型对象管理器 *parameters: NULL *return value: 模型对象管理器 {{anchor:getmesh}} **XModel * getMesh()** *function: 获取网格对象 *parameters: NULL *return value: 网格对象 {{anchor:setmesh}} **void setMesh(ulong mid)** *function: 设置网格对象ID *parameters: - [i]ulong mid: 网格对象ID *return value: 无 {{anchor:release}} **void release()** *function: 释放文档所占内存空间 *parameters: NULL *return value: 无 {{anchor:synchronizemodelparts}} **void synchronizeModelParts(ulong pid = 0,bool bGeomToMesh = true)** *function: *parameters: - [i]ulong pid = 0: - [i]bool bGeomToMesh = true: *return value: {{anchor:reset}} **virtual void reset()** *function: 重置文档,清空所有对象 *parameters: NULL *return value: 无 {{anchor:createviewdata}} **void createViewData()** *function: 获取文档视图数据,文档视图数据包含用于显示的数据以及状态信息 *parameters: NULL *return value: 文档视图指针 {{anchor:createitemmanager}} **void createItemManager(TypeID imt)** *function: 创建对象管理器 *parameters: - [i]TypeID imt: 对象域类型 *return value: 无 {{anchor:init}} **void init()** *function: 初始化文档 *parameters: NULL *return value: 无 {{anchor:getviewdata}} **XViewData * getViewData()** *function: 获取文档视图对象 *parameters: NULL *return value: 文档视图对象 {{anchor:getitem}} **const XItem * getItem(TypeID tid,ulong id,DomainID did)** *function: 访问数据对象 *parameters: - [i]TypeID tid: 对象类型 - [i] ulong id: 对象ID - [i] DomainID did: 对象域类型(访问模型里的对象时,为模型的ID) *return value: 数据对象指针 {{anchor:getpsentityidmap}} **XMap * getPSEntityIDMap()** *function: *parameters: NULL *return value: ---- {{anchor:buildanalysistree}} **void buildAnalysisTree()** *function: 构造分析树 *parameters: NULL *return value: 无 {{anchor:buildcontacttree}} **void buildContactTree()** *function: 构造接触树 *parameters: NULL *return value: 无 {{anchor:buildmaterialtree}} **void buildMaterialTree()** *function: 构造材料树 *parameters: NULL *return value: 无 {{anchor:updateanalysistree}} **TreeNode* updateAnalysisTree(const XItem * obj, bool bDelete)** *function: 更新分析树 *parameters: - [i]const XItem * obj: 分析步所使用的对象 - [i] bool bDelete: 是否删除对象 *return value: 返回对象所对应的树节点(删除时返回其父节点) {{anchor:updatecontacttree}} **TreeNode* updateContactTree(const XItem * obj, bool bDelete)** *function: 更新接触树 *parameters: - [i]const XItem * obj: 接触对象 - [i] bool bDelete: 是否删除对象 *return value: 返回对象所对应的树节点(删除时返回其父节点) {{anchor:updatematerialtree}} **TreeNode* updateMaterialTree(const XItem * obj, bool bDelete)** *function: 更新材料树 *parameters: - [i]const XItem * obj: 材料对象 - [i] bool bDelete: 是否删除对象 *return value: 返回对象所对应的树节点(删除时返回其父节点)