====== XDocument ====== **//Inherited from//** NULL **//Inherited by//** NULL **//Friend class//** NULL **//Description//** XDocument是XT框架中的数据中心,它构建了一个应用空间,应用空间的基础是它所管理的数据对象管理器(XManager),而数据对象管理器则负责具体对象(XItem)的创建、修改与删除,因此可将XDocument看作是数据的树根,由根长出树干(数据对象管理器),再由树干长出树枝树叶(数据对象)。应用程序要完成哪些工作,这些决定了应用空间里应该管理哪些数据。在文档的初始化过程(init())中,应逐项加入数据对象管理器,只有加入到文档的数据对象管理器才能被功能接口访问进而根据需要创建、销毁或者修改指定类型的数据对象。\\ 在XDocument中构建的任何数据对象都可以通过下面的步骤访问: - 通过对象的类型调用XDocument的getItemManager获取对象管理器; - 通过对象的ID调用XManager的getItem获取对象指针; 这种访问方式适用于任何基于XDocument继承的应用,因此在编写应用功能函数时可以使用通用的接口函数形式而无需考虑具体的应用。\\ 一般来说,XDocument会保有一份视图数据(XViewData)以记录文档当前的状态并组织成易于展示的形式。 **//Members//** * int [[xdocument#m_uldoctype|m_ulDocType]] * int [[xdocument#m_bmodified|m_bModified]] * int64 [[xdocument#m_createtime|m_CreateTime]] * int64 [[xdocument#m_lastmodifytime|m_LastModifyTime]] * bool [[xdocument#m_benableundo|m_bEnableUndo]] * XTree * [[xdocument#m_ptree|m_pTree]] * XTree * [[xdocument#m_psecondtree|m_pSecondTree]] * XMemPool * [[xdocument#m_pdocmem|m_pDocMem]] * Name [[xdocument#m_strguid|m_strGUID]] * Name [[xdocument#m_strdocname|m_strDocName]] * Name [[xdocument#m_strvender|m_strVender]] * Name [[xdocument#m_strextension|m_strExtension]] * DBVersion [[xdocument#m_version|m_Version]] * int [[xdocument#m_idocindex|m_iDocIndex]] * Path [[xdocument#m_strdocpath|m_strDocPath]] * unordered_map * [[xdocument#m_pbranchnamemap|m_pBranchNameMap]] * vector [[xdocument#m_psessions|m_pSessions]] * vector [[xdocument#m_pmgrs|m_pMgrs]] * unordered_map * [[xdocument#m_ptreenodemap|m_pTreeNodeMap]] * int [[xdocument#m_inexttreenodetype|m_iNextTreeNodeType]] * Path [[xdocument#m_strlogfile|m_strLogFile]] * const XUnitSystem * [[xdocument#m_pdocunitsys|m_pDocUnitSys]] * OpnRecorder * [[xdocument#m_pdocrecord|m_pDocRecord]] **//Public interface//** * [[xdocument#xdocument1|XDocument]]() * void [[xdocument#setname|setName]](const char * dname) * const char * [[xdocument#getextension|getExtension]]() * const char * [[xdocument#getname|getName]]() * const char * [[xdocument#getpath|getPath]]() * const char * [[xdocument#getguid|getGUID]]() * const char * [[xdocument#getdocidstring|getDocIDString]]() * const DBVersion & [[xdocument#getversion|getVersion]]() * void [[xdocument#setversion|setVersion]](int major, int minor, int sub, int build) * const char * [[xdocument#getvender|getVender]]() * void [[xdocument#setvender|setVender]](const char * s) * XSession * [[xdocument#getsession|getSession]](const char * name) * int64 [[xdocument#getcreatetime|getCreateTime]]() const * int64 [[xdocument#getmodifytime|getModifyTime]]() const * virtual void [[xdocument#save|save]](const char * fname, const char * scheme) * virtual bool [[xdocument#load|load]](const char * fname) * virtual void [[xdocument#saveh5|saveH5]](const char * fname, const char * scheme) * virtual bool [[xdocument#loadh5|loadH5]](const char * fname) * virtual void [[xdocument#reset|reset]]() * virtual bool [[xdocument#isempty|isEmpty]]() const * virtual void [[xdocument#clear|clear]]() * virtual bool [[xdocument#isclosable|isClosable]]() * virtual void [[xdocument#buildobjecttree|buildObjectTree]]() * virtual void [[xdocument#buildsubtree|buildSubTree]]() * XTree * [[xdocument#getobjecttree|getObjectTree]]() * XTree * [[xdocument#getsecondtree|getSecondTree]]() * void [[xdocument#updatedomaintree|updateDomainTree]](XManager * mgr, const char * branchName = NULL, TypeID domainType = Domain_Unknown, TreeNode * category = NULL) * TreeNode * [[xdocument#updatemodelparttree|updateModelPartTree]](const XPart * p, bool bDelete) * virtual TreeNode * [[xdocument#updateobjecttree|updateObjectTree]](const XItem * obj, bool bDelete = false) * virtual TreeNode * [[xdocument#updatesecondtree|updateSecondTree]](const XItem * obj, bool bDelete = false) * TypeID [[xdocument#ctype|ctype]]() const * const char * [[xdocument#ctypestring|ctypeString]]() const * virtual void [[xdocument#release|release]]() * virtual void [[xdocument#init|init]]() * bool [[xdocument#ismodified|isModified]]() * void [[xdocument#setmodified|setModified]](bool b) * void [[xdocument#saveconfig|saveConfig]](const char * scheme) * void [[xdocument#loadconfig|loadConfig]](const char * scheme) * virtual void [[xdocument#registerenumstring|registerEnumString]]() * XMemPool * [[xdocument#getdocmem|getDocMem]]() * virtual const char * [[xdocument#getextensionnames|getExtensionNames]]() * void [[xdocument#setlogfile|setLogFile]](const char * name) * void [[xdocument#enableundo|enableUndo]]() * void [[xdocument#disableundo|disableUndo]]() * virtual void [[xdocument#clearcachedata|clearCacheData]]() * virtual void [[xdocument#clearreference|clearReference]](const XItem* obj) * void [[xdocument#setunitsystem|setUnitSystem]](const XUnitSystem * unitSys) * const XUnitSystem * [[xdocument#getunitsystem|getUnitSystem]]() * virtual XViewData * [[xdocument#getviewdata|getViewData]]() * virtual const XItem [[xdocument#*getitem|*getItem]](TypeID tid, ulong id, DomainID did) * virtual const XItem [[xdocument#*getitem|*getItem]](const XUniqueObjectID * ue) * virtual XModel * [[xdocument#getmodel|getModel]]() * XManager * [[xdocument#getitemmanager|getItemManager]](TypeID mgrType) * void [[xdocument#insertitemmanager|insertItemManager]](XManager * mgr) * void [[xdocument#creatematerialmanager|createMaterialManager]]() * void [[xdocument#createpropertymanager|createPropertyManager]](XModel * mdl) * void [[xdocument#createconditionmanager|createConditionManager]]() * void [[xdocument#createjobmanager|createJobManager]]() * virtual void [[xdocument#getiteminformation|getItemInformation]](const XUniqueObjectID * ue, string * infoStr) * virtual void [[xdocument#getitemtargets|getItemTargets]](const XItem* item, vector * ues) * virtual void [[xdocument#setitemtargets|setItemTargets]](const XItem* item, vector * ues) * virtual void [[xdocument#createviewdata|createViewData]]() * TreeNode * [[xdocument#findleafnode|findLeafNode]](TreeNode * branchNode, TreeNodeData leafObj) * TreeNode * [[xdocument#gettreeitem|getTreeItem]](TreeNodeData domain, TreeNodeData obj, bool bSecondTree = false) * TreeNode * [[xdocument#gettreeitem|getTreeItem]](XManager * domain, TreeNodeData obj, bool bSecondTree = false) * virtual bool [[xdocument#checknodestatus|checkNodeStatus]](TreeNode * node) * TreeNode * [[xdocument#getbranchnode|getBranchNode]](TreeNodeData branchObj, bool bSecondTree = false) * OpnRecorder * [[xdocument#getrecorder|getRecorder]]() * void [[xdocument#getdoctempfilepath|getDocTempFilePath]](const char * file, string * strPath) * void [[xdocument#exchangejsonitems|exchangeJsonItems]](vector * items, JsonParams * parr, const char * key, int domanID = 0) * static TypeID [[xdocument#registerdocument|registerDocument]](const char * docString, CreateDocFunc cfunc = 0, DestroyDocFunc dfunc = 0, TypeID docType = Document_None) * static bool [[xdocument#registeruiproxy|registerUIProxy]](TypeID docID, CreateUIProxyFunc cUIFunc, DestroyUIProxyFunc dUIFunc) * static bool [[xdocument#registersession|registerSession]](const char * sname, FuncCreateSession cFunc, FuncDestroySession dFunc) * static bool [[xdocument#querydocumenttypes|queryDocumentTypes]](vector * docTypes) * static const char * [[xdocument#getdocumenttypestring|getDocumentTypeString]](TypeID docID) * static TypeID [[xdocument#getdocumenttypeid|getDocumentTypeID]](const char * docString) * static XDocument * [[xdocument#create|create]](const char * docString) * static void [[xdocument#destroy|destroy]](XDocument *) * static UIProxy * [[xdocument#createuiproxy|createUIProxy]](MainFrame * mf, XDocument * doc) * static void [[xdocument#destroyuiproxy|destroyUIProxy]](TypeID docID, UIProxy *) * static const char * [[xdocument#resolvedocumenttype|resolveDocumentType]](const char * fname) * static XSession * [[xdocument#createsession|createSession]](const char * sname) * static void [[xdocument#destroysession|destroySession]](XSession * session) * virtual ResultIndexMap * [[xdocument#getresultindexmap|getResultIndexMap]](XModel * mesh) * void [[xdocument#registertreenodetype|registerTreeNodeType]](const char * tString) * TypeID [[xdocument#gettreenodetype|getTreeNodeType]](const char * tString) * bool [[xdocument#getmodelsheet|getModelSheet]](const XModel * obj, vector * prpSheet, bool bMesh) * bool [[xdocument#getpartsheet|getPartSheet]](const XPart * obj, vector * prpSheet, bool bMesh) * bool [[xdocument#getassemblysheet|getAssemblySheet]](const XAssembly * obj, vector * prpSheet, bool bMesh) * bool [[xdocument#getshapesheet|getShapeSheet]](const XGeometry * obj, vector * prpSheet) * bool [[xdocument#getnodesheet|getNodeSheet]](const XNode * obj, vector * prpSheet) * bool [[xdocument#getelementsheet|getElementSheet]](const XElement * obj, vector * prpSheet) * bool [[xdocument#updateexternalreference|updateExternalReference]](const char * extpath) **//Protected interface//** * TreeNode * [[xdocument#updateitemtree|updateItemTree]](XManager * mgr, const XItem * obj, bool bDelete = false) * void [[xdocument#updatedocfolder|updateDocFolder]]() * void [[xdocument#saveheader|saveHeader]](XBinaryIO * io, const char * scheme) * bool [[xdocument#loadheader|loadHeader]](XBinaryIO * io) * void [[xdocument#saveheader|saveHeader]](XH5IO * io, const char * scheme, H5Object * hroot) * bool [[xdocument#loadheader|loadHeader]](XH5IO * io, H5Object * hroot) ---- {{anchor:m_uldoctype}} **int m_ulDocType** 文档类型,注册时由程序自动生成,注册功能命令时需要用到。 {{anchor:m_bmodified}} **int m_bModified** 文档是否发生修改的标识位 {{anchor:m_createtime}} **int64 m_CreateTime** {{anchor:m_lastmodifytime}} **int64 m_LastModifyTime** {{anchor:m_benableundo}} **bool m_bEnableUndo** 文档是否支持Undo/Redo操作 {{anchor:m_ptree}} **XTree * m_pTree** 文档对象树,用于构建对象树视图 {{anchor:m_psecondtree}} **XTree * m_pSecondTree** {{anchor:m_pdocmem}} **XMemPool * m_pDocMem** 文档的内存池 {{anchor:m_strguid}} **Name m_strGUID** 文档的GUID标识符,与文档类型一一对应 {{anchor:m_strdocname}} **Name m_strDocName** 文档名,不超过64个字符 {{anchor:m_strvender}} **Name m_strVender** {{anchor:m_strextension}} **Name m_strExtension** {{anchor:m_version}} **DBVersion m_Version** {{anchor:m_idocindex}} **int m_iDocIndex** {{anchor:m_strdocpath}} **Path m_strDocPath** 文档路径,不超过256个字符 {{anchor:m_pbranchnamemap}} **unordered_map * m_pBranchNameMap** {{anchor:m_psessions}} **vector m_pSessions** {{anchor:m_pmgrs}} **vector m_pMgrs** {{anchor:m_ptreenodemap}} **unordered_map * m_pTreeNodeMap** {{anchor:m_inexttreenodetype}} **int m_iNextTreeNodeType** {{anchor:m_strlogfile}} **Path m_strLogFile** 应用文档的日志文件名,不超过256个字符 {{anchor:m_pdocunitsys}} **const XUnitSystem * m_pDocUnitSys** {{anchor:m_pdocrecord}} **OpnRecorder * m_pDocRecord** 记录文档操作中数据的修改(包括增加、删除) ---- {{anchor:xdocument1}} **XDocument()** *function: 应用文档构造函数 *parameters: NULL *return value: 无 {{anchor:setname}} **void setName(const char * dname)** *function: 设置文档名,文件保存时将以该名字为文件名 *parameters: - [i]const char * dname: 文档名 *return value: 无 {{anchor:getextension}} **const char * getExtension()** *function: 获取文档扩展名 *parameters: NULL *return value: 文档扩展名 {{anchor:getname}} **const char * getName()** *function: 获取文档名 *parameters: NULL *return value: 文档名字符串 {{anchor:getpath}} **const char * getPath()** *function: 获取文档路径,保存时按该路径保存 *parameters: NULL *return value: 文档路径字符串 {{anchor:getguid}} **const char * getGUID()** *function: 获取文档的GUID,用以和其他类型的文档区分 *parameters: NULL *return value: 文档GUID字符串 {{anchor:getdocidstring}} **const char * getDocIDString()** *function: 获取文档ID字符串 *parameters: NULL *return value: 文档ID字符串 {{anchor:getversion}} **const DBVersion & getVersion()** *function: 获取文档版本信息 *parameters: NULL *return value: 版本信息 {{anchor:setversion}} **void setVersion(int major, int minor, int sub, int build)** *function: 设置文档版本信息 *parameters: - [i]int major: 主版本号 - [i] int minor: 副版本号 - [i] int sub: 小版本号 - [i] int build: 构建序号 *return value: 无 {{anchor:getvender}} **const char * getVender()** *function: 获取程序服务提供商名称 *parameters: NULL *return value: 服务提供商名称 {{anchor:setvender}} **void setVender(const char * s)** *function: 设置程序服务提供商名称 *parameters: - [i]const char * s: 服务提供商名称 *return value: 无 {{anchor:getsession}} **XSession * getSession(const char * name)** *function: 获取名称为name的应用会话 *parameters: - [i]const char * name: 应用会话名 *return value: 如名称为name的会话存在返回该会话,否则返回NULL {{anchor:getcreatetime}} **int64 getCreateTime() const** *function: 获取创建时间 *parameters: NULL *return value: 创建时间戳 {{anchor:getmodifytime}} **int64 getModifyTime() const** *function: 获取修改时间戳 *parameters: NULL *return value: 修改时间戳 {{anchor:save}} **virtual void save(const char * fname, const char * scheme)** *function: 将文档保存到指定文件中 *parameters: - [i]const char * fname: 文件名 - [i] const char * scheme: 应用方案名 *return value: 无 {{anchor:load}} **virtual bool load(const char * fname)** *function: 从文件中载入文档数据 *parameters: - [i]const char * fname: 文件名 *return value: 无 {{anchor:saveh5}} **virtual void saveH5(const char * fname, const char * scheme)** *function: 将文档保存为H5文件 *parameters: - [i]const char * fname: H5文件名 - [i] const char * scheme: 应用方案名 *return value: 无 {{anchor:loadh5}} **virtual bool loadH5(const char * fname)** *function: 从H5文件中导入文档 *parameters: - [i]const char * fname: H5文件名 *return value: 如成功导入返回true,否则返回false {{anchor:reset}} **virtual void reset()** *function: 清空所有数据对象,重置文档 *parameters: NULL *return value: 无 {{anchor:isempty}} **virtual bool isEmpty() const** *function: 判断文档是否为空(不包含任何数据对象) *parameters: NULL *return value: 如文档为空返回true,否则返回false {{anchor:clear}} **virtual void clear()** *function: 清空文档所有数据对象 *parameters: NULL *return value: 无 {{anchor:isclosable}} **virtual bool isClosable()** *function: 判断当前文档是否可关闭,在某些应用场景,需要保持一份全局的文档,在不关闭整个程序的情况下,不可以单独关闭该文档 *parameters: NULL *return value: 如文档可关闭,返回true,否则返回false {{anchor:buildobjecttree}} **virtual void buildObjectTree()** *function: 重建对象树 *parameters: NULL *return value: 无 {{anchor:getobjecttree}} **XTree * getObjectTree()** *function: 获取文档对象树 *parameters: NULL *return value: 对象树指针 {{anchor:getsecondtree}} **XTree * getSecondTree()** *function: 获取第二文档对象树 *parameters: NULL *return value: 第二文档对象树 {{anchor:updatedomaintree}} **void updateDomainTree(XManager * mgr, const char * branchName = NULL, TypeID domainType = Domain_Unknown, TreeNode * category = NULL)** *function: 更新对象树的域分支 *parameters: - [i]XManager * mgr: 域分支对应的对象管理器 - [i] const char * branchName = NULL: 域分支名 - [i] TypeID domainType = Domain_Unknown: 域分支类型 - [i] TreeNode * category = NULL: 域分支节点 *return value: 无 {{anchor:updatemodelparttree}} **TreeNode * updateModelPartTree(const XPart * p, bool bDelete)** *function: 更新对象树的部件分支 *parameters: - [i]const XPart * p: 待更新的部件 - [i] bool bDelete: 为true时删除部件节点 *return value: 更新时返回部件对应的节点,删除时返会部件节点的父节点 {{anchor:updateobjecttree}} **virtual TreeNode * updateObjectTree(const XItem * obj, bool bDelete = false)** *function: 更新对象树的对象节点 *parameters: - [i]const XItem * obj: 待更新的对象 - [i] bool bDelete = false: 为true时删除对象节点 *return value: 更新时返回对象对应的节点,删除时返会对象的父节点 {{anchor:updatesecondtree}} **virtual TreeNode * updateSecondTree(const XItem * obj, bool bDelete = false)** *function: *parameters: - [i]const XItem * obj: - [i] bool bDelete = false: *return value: {{anchor:ctype}} **TypeID ctype() const** *function: 获取文档类型ID *parameters: NULL *return value: 整型文档类型ID {{anchor:ctypestring}} **const char * ctypeString() const** *function: 获取文档类型字符串 *parameters: NULL *return value: 文档类型字符串 {{anchor:release}} **virtual void release()** *function: 释放文档所占内存空间 *parameters: NULL *return value: 无 {{anchor:init}} **virtual void init()** *function: 初始化文档 *parameters: NULL *return value: 无 {{anchor:ismodified}} **bool isModified()** *function: 判断文档是否发生修改(数据对象的增加、修改、删除) *parameters: NULL *return value: 如文档发生修改返回true,否则返回false {{anchor:setmodified}} **void setModified(bool b)** *function: 设置文档修改标志 *parameters: - [i]bool b: 文档修改标志 *return value: 无 {{anchor:saveconfig}} **void saveConfig(const char * scheme)** *function: 保存文档的全局配置 *parameters: - [i]const char * scheme: *return value: 无 {{anchor:loadconfig}} **void loadConfig(const char * scheme)** *function: 载入文档的全局配置 *parameters: - [i]const char * scheme: *return value: {{anchor:registerenumstring}} **virtual void registerEnumString()** *function: 注册枚举变量-字符串映射关系表 *parameters: NULL *return value: 无 {{anchor:getdocmem}} **XMemPool * getDocMem()** *function: 获取文档公用内存池 *parameters: NULL *return value: 文档公用内存池 {{anchor:getextensionnames}} **virtual const char * getExtensionNames()** *function: 获取文档扩展名 *parameters: NULL *return value: 文档扩展名字符串 {{anchor:setlogfile}} **void setLogFile(const char * name)** *function: 设置日志文件名 *parameters: - [i]const char * name: 日志文件名 *return value: 无 {{anchor:enableundo}} **void enableUndo()** *function: 激活undo/redo模式 *parameters: NULL *return value: 无 {{anchor:disableundo}} **void disableUndo()** *function: 使undo/redo模式失效 *parameters: NULL *return value: 无 {{anchor:clearcachedata}} **virtual void clearCacheData()** *function: 清空文档缓存数据 *parameters: NULL *return value: 无 {{anchor:clearreference}} **virtual void clearReference(const XItem* obj)** *function: 清空参考或者引用对象的其他所有对象 *parameters: - [i]const XItem* obj: 引用对象 *return value: 无 {{anchor:setunitsystem}} **void setUnitSystem(const XUnitSystem * unitSys)** *function: *parameters: - [i]const XUnitSystem * unitSys: *return value: {{anchor:getunitsystem}} **const XUnitSystem * getUnitSystem()** *function: *parameters: NULL *return value: {{anchor:getviewdata}} **virtual XViewData * getViewData()** *function: 获取文档视图数据,文档视图数据包含用于显示的数据以及状态信息 *parameters: NULL *return value: 文档视图指针 {{anchor:*getitem}} **virtual 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:*getitem}} **virtual const XItem *getItem(const XUniqueObjectID * ue)** *function: 通过唯一对象标识访问数据对象 *parameters: - [i]const XUniqueObjectID * ue: 唯一对象标识 *return value: 数据对象指针 {{anchor:getmodel}} **virtual XModel * getModel()** *function: 获取文档当前模型对象 *parameters: NULL *return value: 文档当前模型对象 {{anchor:getitemmanager}} **XManager * getItemManager(TypeID mgrType)** *function: 获取对象管理器 *parameters: - [i]TypeID mgrType: 对象域类型码 *return value: 对象管理器 {{anchor:insertitemmanager}} **void insertItemManager(XManager * mgr)** *function: 插入对象管理器,文档就可以创建它所管理的任何对象 *parameters: - [i]XManager * mgr: 对象管理器 *return value: 无 {{anchor:creatematerialmanager}} **void createMaterialManager()** *function: 创建材料对象管理器 *parameters: NULL *return value: 无 {{anchor:createpropertymanager}} **void createPropertyManager(XModel * mdl)** *function: 创建单元属性对象管理器 *parameters: - [i]XModel * mdl: 参考模型 *return value: 无 {{anchor:createconditionmanager}} **void createConditionManager()** *function: 创建条件对象管理器 *parameters: NULL *return value: 无 {{anchor:createjobmanager}} **void createJobManager()** *function: 创建作业对象管理器 *parameters: NULL *return value: 无 {{anchor:getiteminformation}} **virtual void getItemInformation(const XUniqueObjectID * ue, string * infoStr)** *function: 通过唯一对象标识获取数据对象的信息 *parameters: - [i]const XUniqueObjectID * ue: 唯一对象标识 - [i] string * infoStr: 数据对象信息 *return value: 无 {{anchor:getitemtargets}} **virtual void getItemTargets(const XItem* item, vector * ues)** *function: *parameters: - [i]const XItem* item: - [i] vector * ues: *return value: {{anchor:setitemtargets}} **virtual void setItemTargets(const XItem* item, vector * ues)** *function: *parameters: - [i]const XItem* item: - [i] vector * ues: *return value: {{anchor:createviewdata}} **virtual void createViewData()** *function: 创建文档视图 *parameters: NULL *return value: 文档视图对象指针 {{anchor:findleafnode}} **TreeNode * findLeafNode(TreeNode * branchNode, TreeNodeData leafObj)** *function: 从指定对象树分支搜索数据对象叶节点 *parameters: - [i]TreeNode * branchNode: 对象树分支 - [i] TreeNodeData leafObj: 数据对象 *return value: 数据对象对应的树节点 {{anchor:gettreeitem}} **TreeNode * getTreeItem(TreeNodeData domain, TreeNodeData obj, bool bSecondTree = false)** *function: 获取数据对象对应的树节点 *parameters: - [i]TreeNodeData domain: 数据对象所属的域(一般为对象管理器) - [i] TreeNodeData obj: 数据对象 - [i] bool bSecondTree = false: 是否第二对象树 *return value: 数据对象对应的树节点 {{anchor:gettreeitem}} **TreeNode * getTreeItem(XManager * domain, TreeNodeData obj, bool bSecondTree = false)** *function: 获取数据对象对应的树节点 *parameters: - [i]XManager * domain: 对象管理器 - [i] TreeNodeData obj: 数据对象 - [i] bool bSecondTree = false: 是否第二对象树 *return value: 数据对象对应的树节点 {{anchor:checknodestatus}} **virtual bool checkNodeStatus(TreeNode * node)** *function: 检查树节点当前的状态 *parameters: - [i]TreeNode * node: 树节点 *return value: 如当前树节点包含的数据对象可用返回true,否则返回false {{anchor:getbranchnode}} **TreeNode * getBranchNode(TreeNodeData branchObj, bool bSecondTree = false)** *function: 获取数据对象所对应的分支 *parameters: - [i]TreeNodeData branchObj: 数据对象 - [i] bool bSecondTree = false: 是否第二对象树 *return value: 数据对象所对应的分支 {{anchor:getrecorder}} **OpnRecorder * getRecorder()** *function: 获取文档的数据记录器 *parameters: NULL *return value: 数据记录器对象指针 {{anchor:getdoctempfilepath}} **void getDocTempFilePath(const char * file, string * strPath)** *function: 获取文档临时目录路径下文件的全路径 *parameters: - [i]const char * file: 文件名 - [o] string * strPath: 文件全路径 *return value: {{anchor:exchangejsonitems}} **void exchangeJsonItems(vector * items, JsonParams * parr, const char * key, int domanID = 0)** *function: 对象选择器与脚本交换选择对象 *parameters: - [i]vector * items: 选择对象数组 - [i] JsonParams * parr: 脚本参数对象 - [i] const char * key: 选择对象所对应的关键字 - [i] int domanID = 0: 选择对象所属域类型(模型ID) *return value: 无 {{anchor:registerdocument}} **static TypeID registerDocument(const char * docString, CreateDocFunc cfunc = 0, DestroyDocFunc dfunc = 0, TypeID docType = Document_None)** *function: 注册文档 *parameters: - [i]const char * docString: 文档类型名 - [i] CreateDocFunc cfunc = 0: 文档构造函数 - [i] DestroyDocFunc dfunc = 0: 文档析构函数 - [i] TypeID docType = Document_None: 当为Document_None时强制指定文档类型ID,否则自动获取类型ID(可能会变化) *return value: 返回文档类型ID {{anchor:registeruiproxy}} **static bool registerUIProxy(TypeID docID, CreateUIProxyFunc cUIFunc, DestroyUIProxyFunc dUIFunc)** *function: 注册界面代理 *parameters: - [i]TypeID docID: 界面代理所对应的文档类型ID - [i] CreateUIProxyFunc cUIFunc: 界面代理构造函数 - [i] DestroyUIProxyFunc dUIFunc: 界面代理析构函数 *return value: 成功注册返回true,否则返回false {{anchor:registersession}} **static bool registerSession(const char * sname, FuncCreateSession cFunc, FuncDestroySession dFunc)** *function: 注册应用会话 *parameters: - [i]const char * sname: 应用会话名 - [i] FuncCreateSession cFunc: 应用会话构造函数 - [i] FuncDestroySession dFunc: 应用会话析构函数 *return value: 成功注册返回true,否则返回false {{anchor:querydocumenttypes}} **static bool queryDocumentTypes(vector * docTypes)** *function: 查询已注册的文档类型字符串数组 *parameters: - [i]vector * docTypes: 已注册的文档类型字符串数组 *return value: 查询成功返回true,否则返回false {{anchor:getdocumenttypestring}} **static const char * getDocumentTypeString(TypeID docID)** *function: 查询文档类型ID对应的文档类型字符串 *parameters: - [i]TypeID docID: 整数文档类型ID *return value: 文档类型名 {{anchor:getdocumenttypeid}} **static TypeID getDocumentTypeID(const char * docString)** *function: 获取类型名为docstring的文档类型ID *parameters: - [i]const char * docString: 文档类型名 *return value: 文档类型ID {{anchor:create}} **static XDocument * create(const char * docString)** *function: 创建类型名为docstring的文档 *parameters: - [i]const char * docString: 文档类型名 *return value: 文档指针 {{anchor:destroy}} **static void destroy(XDocument *)** *function: 销毁文档 *parameters: - [i]XDocument *: 文档指针 *return value: 无 {{anchor:createuiproxy}} **static UIProxy * createUIProxy(MainFrame * mf, XDocument * doc)** *function: 为文档doc创建界面代理 *parameters: - [i]MainFrame * mf: 主框架 - [i] XDocument * doc: 文档指针 *return value: 界面代理指针 {{anchor:destroyuiproxy}} **static void destroyUIProxy(TypeID docID, UIProxy *)** *function: 销毁界面代理 *parameters: - [i]TypeID docID: 文档类型ID - [i] UIProxy *: 界面代理指针 *return value: 无 {{anchor:resolvedocumenttype}} **static const char * resolveDocumentType(const char * fname)** *function: 从文件中解析获取文件类型 *parameters: - [i]const char * fname: 文件名 *return value: 成功解析返回文件类型名,否则返回NULL {{anchor:createsession}} **static XSession * createSession(const char * sname)** *function: 创建临时会话 *parameters: - [i]const char * sname: 会话类型名 *return value: 会话指针 {{anchor:destroysession}} **static void destroySession(XSession * session)** *function: 销毁临时会话 *parameters: - [i]XSession * session: 会话指针 *return value: 无 {{anchor:getresultindexmap}} **virtual ResultIndexMap * getResultIndexMap(XModel * mesh)** *function: 获取结果索引 *parameters: - [i]XModel * mesh: 结果所属的网格模型 *return value: 结果索引 {{anchor:registertreenodetype}} **void registerTreeNodeType(const char * tString)** *function: 注册树节点类型,在该节点不与任何数据对象对应时使用 *parameters: - [i]const char * tString: 节点类型字符串 *return value: 无 {{anchor:gettreenodetype}} **TypeID getTreeNodeType(const char * tString)** *function: 获取树节点数据类型ID *parameters: - [i]const char * tString: 树节点类型字符串 *return value: 树节点数据类型ID {{anchor:getmodelsheet}} **bool getModelSheet(const XModel * obj, vector * prpSheet, bool bMesh)** *function: 获取模型的属性清单 *parameters: - [i]const XModel * obj: 模型对象 - [i] vector * prpSheet: 属性清单 - [i] bool bMesh: 模型是否为网格 *return value: 成功获取返回true,否则返回false {{anchor:getpartsheet}} **bool getPartSheet(const XPart * obj, vector * prpSheet, bool bMesh)** *function: 获取部件的属性清单 *parameters: - [i]const XPart * obj: 部件对象 - [i] vector * prpSheet: 属性清单 - [i] bool bMesh: 部件是否属于网格模型 *return value: 成功获取返回true,否则返回false {{anchor:getassemblysheet}} **bool getAssemblySheet(const XAssembly * obj, vector * prpSheet, bool bMesh)** *function: 获取装配体的属性清单 *parameters: - [i]const XAssembly * obj: 装配体对象 - [i] vector * prpSheet: 属性清单 - [i] bool bMesh: 装配体是否属于网格模型 *return value: 成功获取返回true,否则返回false {{anchor:getshapesheet}} **bool getShapeSheet(const XGeometry * obj, vector * prpSheet)** *function: 获取几何的属性清单 *parameters: - [i]const XGeometry * obj: 几何对象 - [i] vector * prpSheet: 属性清单 *return value: 成功获取返回true,否则返回false {{anchor:getnodesheet}} **bool getNodeSheet(const XNode * obj, vector * prpSheet)** *function: 获取节点属性清单 *parameters: - [i]const XNode * obj: 节点对象 - [i] vector * prpSheet: 属性清单 *return value: 成功获取返回true,否则返回false {{anchor:getelementsheet}} **bool getElementSheet(const XElement * obj, vector * prpSheet)** *function: 获取单元属性清单 *parameters: - [i]const XElement * obj: 单元对象 - [i] vector * prpSheet: 属性清单 *return value: 成功获取返回true,否则返回false {{anchor:updateexternalreference}} **bool updateExternalReference(const char * extpath)** *function: 更新参考指定路径的外部数据的所有数据对象 *parameters: - [i]const char * extpath: 外部引用的路径 *return value: 成功更新返回true,否则返回false ---- {{anchor:updateitemtree}} **TreeNode * updateItemTree(XManager * mgr, const XItem * obj, bool bDelete = false)** *function: 更新对象树 *parameters: - [i]XManager * mgr: 对象管理器 - [i] const XItem * obj: 数据对象 - [i] bool bDelete = false: 是否删除树节点 *return value: 更新时返回数据对象对应的树节点,删除时返回父节点 {{anchor:updatedocfolder}} **void updateDocFolder()** *function: 更新文档文件夹 *parameters: NULL *return value: 无 {{anchor:saveheader}} **void saveHeader(XBinaryIO * io, const char * scheme)** *function: 将文件头写入二进制文件 *parameters: - [i]XBinaryIO * io: 二进制文件句柄 - [i] const char * scheme: 应用方案名 *return value: 无 {{anchor:loadheader}} **bool loadHeader(XBinaryIO * io)** *function: 从二进制文件中载入文件头 *parameters: - [i]XBinaryIO * io: 二进制文件句柄 *return value: 成功载入返回true,否则返回false {{anchor:saveheader}} **void saveHeader(XH5IO * io, const char * scheme, H5Object * hroot)** *function: 将文件头写入H5文件 *parameters: - [i]XH5IO * io: H5文件句柄 - [i] const char * scheme: 应用方案名 - [i] H5Object * hroot: H5文件根节点 *return value: 无 {{anchor:loadheader}} **bool loadHeader(XH5IO * io, H5Object * hroot)** *function: 从H5文件中载入文件头 *parameters: - [i]XH5IO * io: H5文件句柄 - [i] H5Object * hroot: H5文件根节点 *return value: 成功载入返回true,否则返回false