CAA⽤户界⾯开发——实例说明(CATIA⼆次开发)
⽤户界⾯开发——实例说明
——Creating a Workbench
⼀、⽬标
1.1 ⽬标
Showing how to create a workbench to be added to a given workshop.
三年级编写童话故事拔草寻蛇1.2 显⽰界⾯(workbench )
Like the workshop, the workbench is an object that gathers the commands to work on the document and arrange them in toolbars and menus.
1.3 命令标签(command header )
Command headers are ud to make the link between the workbench and the commands.
⼆、CAAAfrGeoCreationWbench 实例说明
2.1 功能
The CAAAfrGeoCreationWbench u ca creates a workbench named CAA Geometrical Creation for the CAAGeometry document. Its specifications cover most of the cas you will meet. Two toolbars are
provided:
The Solids toolbar. It includes five new commands: Cuboid, Sphere, Torus,
and Cylinder 1 and 2.
The Surfaces toolbar. It includes three new commands: Revolution Surface,
The only change in the menu bar is the addition of the commands in the Inrt menu using two
submenus below the existing ones.
2.2 运⾏
运⾏CATIA系统,并依次选择Start->Infrastructure->CAA V5: Geometrical Creation:
This creates a new CAAGeometry document with the CAA V5: Geometrical Creation workbench active.
2.3 框架组成
CAAAfrGeoCreationWkb Workbench description class CAAAfrGeoCreationWkbFactory Factory class for the workbench class CAAIAfrGeoCreationWkbFactory Factory interface implemented by CAAAfrGeoCreationWkbFactory
TIE_CAAIAfrGeoCreationWkbFactory TIE class for the factory interface
CAAIAfrGeoCreationWkbAddin Add-in interface expod by the workbench and that all its add-ins must implement
TIE_CAAIAfrGeoCreationWkbAddin TIE class for the add-in interface
三、程序结构(Step-by-Step)
3.1 编程准备
3.1.1 确认
Make sure that the workshop to which it is dedicated expos the CATIxxxConfiguration interface, where xxx is the workshop identifier, in a PublicInterfaces or ProtectedInterfaces directory.
Create the module directory to store the workbench code along with its two subdirectories LocalInterfaces and src. Then you will need to create the following files.
In the framework's ProtectedInterfaces directory
CAAIAfrGeoCreationWkbAddin.h The header file of the workbench expod interface
to enable clients to create add-ins In the CAAAfrGeoCreationWbench.m\LocalInterfaces directory CAAIAfrGeoCreationWkbFactory.h The header file of the workbench factory interface CAAAfrGeoCreationWkbFactory.h The header file of the workbench factory class
CAAAfrGeoCreationWkb.h The header file of the workbench description class In the CAAAfrGeoCreationWbench.m\src directory
CAAIAfrGeoCreationWkbAddin.cpp The source file of the workbench expod interface
to enable clients to create add-ins CAAIAfrGeoCreationWkbFactory.cpp The source file of the workb
ench factory interface CAAAfrGeoCreationWkbFactory.cpp The source file of the workbench factory class
无边落木萧萧下不尽长江滚滚来CAAAfrGeoCreationWkb.cpp The source file of the workbench description class TIE_CAAIAfrGeoCreationWkbAddin.tsrc The file to create the TIE for
CAAIAfrGeometryWksAddin
TIE_CAAIAfrGeoCreationWkbFactory.tsrc The file to create the TIE for
CAAIAfrGeometryWksFactory
In the dictionary, that is the CNext\code\dictionary directory, referenced at run time using the
CATDictionaryPath environment variable, create or update
护肤流程对的顺序
/doc/72a8bed1195f312b3169a5be.html .dico The interface dictionary
/doc/72a8bed1195f312b3169a5be.html .fact The factory dictionary
In the CNext\resources\msgcatalog directory, referenced at run time using the
CATMsgCatalogPath environment variable
CAAAfrGeoCreationWkb.CATNls The workbench message file
The command header resource files CAAAfrGeoCreationWkbHeader.CATNls and CAAAfrGeoCreationWkbHeader.CATRsc
3.1.2 开发步骤
# Step Where
1 Create the workbench factory interface LocalInterfaces and src
2 Create the workbench factory LocalInterfaces and src
3 Create the workbench description class LocalInterfaces and src
4 Create the command headers CreateCommands method
5 Create the workbench and arrange the commands CreateWorkbench method
6 Provide the resources and inrt the workbench into the Start menu Resource files
7 Create the workbench expod interface ProtectedInterfaces and src 3.2 建⽴Workbench 的Factory Interface
(Creating the Workbench Factory Interface)
3.2.1 命名
CAAIAfrGeoCreationWkb Factory
3.2.2 头⽂件(the header file )
CAAIAfrGeoCreationWkbFactory.h
A factory interface is a CAA interface, that is, an abstract class that derives from CATIGenericFactory.
As any interface, it has an IID declared as IID_ followed by the interface name, and includes the CATDeclareInterface macro that declares that this abstract class is an interface. No additional
method than tho of CATIGenericFactory is necessary. Don't forget the public keyword required by the TIE compiler.
()
3.2.3 源⽂件(The source file )
CAAIAfrGeoCreationWkbFactory.cpp鲅鱼水饺
#include
IID IID_CAAIAfrGeoCreationWkbFactory = {
0xb32eed10,
0xd4c1,
0x11d3,
{0xb7, 0xf5, 0x00, 0x08, 0xc7, 0x4f, 0xe8, 0xdd}
};
CATImplementInterface(CAAIAfrGeoCreationWkbFactory, CATIGenericFactory);
The CATImplementInterface macro is ud in conjunction with CATDeclareInterface in the header file to make an interface from this abstract class and to declare that it OM-derives from
CATIGenericfactory.
3.2.4 TIE⽂件(The TIE tsrc file)
The Multi-Workspace Application Builder (mkmk) will generate the TIE for this interface for you, that is, the
我是狗
最美好的时光作文
TIE_CAAIAfrGeoCreationWkbFactory.h file in the ProtectedGenerated directory.
3.3 建⽴Workbench 的Factory
(Creating the Workbench Factory)
3.3.1 注意事项
The factory class that creates workbench instances must concatenate the name of the class to instantiate, that is, the workbench description class CAAAfrGeoCreationWkb, with the string Factory. This gives CAAAfrGeoCreationWkbFactory.
3.3.2 头⽂件
CATDeclareConfigurationFactory
class.
3.3.3 源⽂件
The CATImplementConfigurationFactory arguments are the name of the workbench description class and the name of the workbench factory interface respectively. The
CATDeclareConfigurationFactory and CATImplementConfigurationFactory macros create the workbench factory implementation class as a data extension of the CATApplicationFrame component
3.3.4 更新字典
3.3.
4.1 The interface dictionary
that is a file who name is the framework name suffixed by dico, such as CAAApplicationFrame.dico, and that you should
create or update in the framework CNext/code/dictionary directory. The interface dictionary contains the following declaration to state that the CATApplicationFrame component implements the CAAIAfrGeoCreationWkbFactory interface, by means of the extension class created by the macros, who code is located in the libCAAAfrGeoCreationWbench shared library or DLL:(不太明⽩)
3.3.
4.2 The factory dictionary
that is a file who name is the framework name suffixed by fact, such as CAAApplicationFrame.fact, and that you should create or update in the framework CNext/code/dictionary directory. The factory dictionary contains the following declaration to state that the CAAIAfrGeoCreationWkbFactory interface is an
class instance:
3.4 定义与实现Workbench 类
(Creating the Workbench Description Class)
3.4.1 说明
The CAAAfrGeoCreationWkb class implements the CATICAAAfrGeometryWksConfiguration interface expod by the CAAGeometry workshop . It includes the following methods:
CreateCommands to instantiate the command headers for the commands of the workbench
CreateWorkbench to create the containers for the workbench, the menus, and the toolbars, and arrange the commands in the menus and toolbars
GetCustomInterface s which returns the names of the interfaces expod by the workbench to enable its customization GetAddinInterface which returns the name of the interface expod by the workbench to create add-ins.
3.4.2 头⽂件
CAAAfrGeoCreationWkb.h
#include "CATBaUnknown.h"
#include "CATListPV.h"
class CATCmdWorkbench;素炒豆芽菜
class CAAAfrGeoCreationWkb : public CATBaUnknown
{
CATDeclareClass;
public:
CAAAfrGeoCreationWkb();
virtual ~CAAAfrGeoCreationWkb();
void CreateCommands();
CATCmdWorkbench * CreateWorkbench();
CATClassId GetAddinInterface();
void GetCustomInterfaces(CATListPV * oDefaultIIDList ,
CATListPV * oCustomIIDList) ;