欢迎来到天天文库
浏览记录
ID:14670660
大小:63.00 KB
页数:6页
时间:2018-07-29
《caa插件的开发方法(catia二次开发)》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、插件的开发方法2004-8-24一、创建插件接口1.1头文件如:#ifndefCAAIAfrGeoCreationWkbAddin_h#defineCAAIAfrGeoCreationWkbAddin_h//ApplicationFrameFramework#include//NeededtoderivefromCATIWorkbenchAddin//LocalFramework#include"CAAAfrGeoCreationWbench.h"//NeededtoexporttheIID//G
2、lobalUniqueIDentifierdefinedin.cpp//exportedbyCAAAfrGeoCreationWbenchexternIIDExportedByCAAAfrGeoCreationWbenchIID_CAAIAfrGeoCreationWkbAddin;classExportedByCAAAfrGeoCreationWbenchCAAIAfrGeoCreationWkbAddin:publicCATIWorkbenchAddin{//UsedinconjunctionwithCATImplementInterf
3、aceinthe.cppfileCATDeclareInterface;public:};#endif1.2源文件1.2.1组成1)接口标识符(IID)构造2)接口实现1.2.2实例如:#include//Useuuid_gen-ConUNIXoruuidgen-sonNTtogeneratetheIIDIIDIID_CAAIAfrGeoCreationWkbAddin={/*a4188b88-d4c1-11d3-b7f5-0008c74fe8dd*/0xa4188b88,0xd4
4、c1,60x11d3,{0xb7,0xf5,0x00,0x08,0xc7,0x4f,0xe8,0xdd}};//DeclaresthatCAAIAfrGeoCreationWkbAddinisaninterfacethat//OM-derivesfromCATIWorkbenchAddinCATImplementInterface(CAAIAfrGeoCreationWkbAddin,CATIWorkbenchAddin);1.3TIE文件1.3.1内容头文件引用1.3.2实例如://UsedbymkmktocreateTIE_CAAIAf
5、rGeoCreationWkbAddin.h#include详见《接口开发》二、插件开发2.1头文件2.1.1结构#ifndef<插件类>_H#define<插件类>_H//Systemframework#include"CATBaseUnknown.h"//NeededtoderivefromCATBaseUnknown//ApplicationFrameframworkclassCATCmdContainer;//NeededbyCreateToolbarsclass<插件类>
6、:publicCATBaseUnknown{//UsedinconjunctionwithCATImplementClassinthe.cppfileCATDeclareClass;public:<插件类>();//构造函数virtual~<插件类>();//析构函数6//InstantiatesthecommandheadersforthecommandsvoidCreateCommands();//定义命令标签//CreatestoolbarsandarrangesthecommandsinsideCATCmdContainer*Cre
7、ateToolbars();//创建菜单和工具条private:};#endif2.1.2实例#ifndefCAAAfrGeoOperationAdn_H#defineCAAAfrGeoOperationAdn_H//Systemframework#include"CATBaseUnknown.h"//NeededtoderivefromCATBaseUnknown//ApplicationFrameframworkclassCATCmdContainer;//NeededbyCreateToolbarsclassCAAAfrGeoOper
8、ationAdn:publicCATBaseUnknown{//UsedinconjunctionwithCATImplementClassinthe.cppfileCATDec
此文档下载收益归作者所有