3D PLM Enterprise Architecture |
User Interface - Frame |
Defining the Activated WorkbenchUsing CATIAfrActivateWorkbench |
Use Case |
AbstractThis article shows how to use the CATIAfrActivateWorkbench interface to define the workbench to activate when an object is UI-activated. |
This use case is intended to show you how to use the CATIAfrActivateWorkbench interface to define the workbench [1] to launch when an object is UI-activated. An UI-active object [2] is editable thanks commands distributed in workbenches. When the end user double clicks such object, opens or creates a document, the application must choose a workbench among those of the current UI-active object. The choice for a given UI-active object is done according to this protocol:
This interface enables you to modify this protocol. You have the possibility imposing such or such workbenches according to your criteria.
This interface may be implemented on the following UI-active objects:
However, for the following UI-active objects it is useless since this UI-active object has no workbench, but only a workshop [2].
This interface can be only once implemented for a given object.
[Top]
CAAAfrInitialWorkbench is a use case of the CAAApplicationFrame.edu framework that illustrates ApplicationFrame framework capabilities.
[Top]
This article shows an implementation of the CATIAfrActivateWorkbench interface on the MechanicalPart object. The activated workbench, among the Part workbenches, is the Part Design workbench.
[Top]
To launch CAAAfrInitialWorkbench, you will need to set up the build time environment, then compile CAAAfrInitialWorkbench along with its prerequisites, set up the run time environment, and then execute the use case [3].
But just before launching the execution, edit the CAAApplicationFrame.edu.dico interface dictionary file located in the dictionary directory of the CAAApplicationFrame.edu framework:
Windows | InstallRootDirectory\CAAApplicationFrame.edu\CNext\code\dictionary\ |
UNIX | InstallRootDirectory/CAAApplicationFrame.edu/CNext/code/dictionary/ |
where InstallRootDirectory
is the directory where the CAA CD-ROM
is installed.
In this file, remove the "#" character before the following line,
... #MechanicalPart CATIAfrActivateWorkbench libCAAAfrInitialWorkbench ... |
and run mkCreateRuntimeView.
Then, in the window where you run the mkrun command, do not type the module name on the command line, but type CNEXT instead. When the application is ready, do the following:
Without the CATIAfrActivateWorkbench implementation, the current workbench would have been FreeStyle, the last used workbench kept in a setting file.
You have explicitly ask a workbench, it is the new current one.
Without the CATIAfrActivateWorkbench implementation, the current workbench would have been Wireframe and Surface Design, the last used workbench in the session.
Without the CATIAfrActivateWorkbench implementation, the current workbench would have been Wireframe and Surface Design, the last used workbench for a Part.
You have explicitly ask a workbench, it is the new current one.
Without the CATIAfrActivateWorkbench implementation, the current workbench would have been Wireframe and Surface Design, the last used workbench for a Part.
(*)The document is located in the InputData directory of the CAAApplicationFrame.edu framework:
Windows | InstallRootDirectory\CAACATIAApplicationFrm.edu\InputData\ |
Unix | InstallRootDirectory/CAACATIAApplicationFrm.edu/InputData/ |
where InstallRootDirectory
is the directory where
the CAA CD-ROM is installed.
[Top]
The CAAAfrInitialWorkbench use case is made of one single class, the CAAEAfrActivateWorkbenchOnPart class, located in the CAAAfrInitialWorkbench.m module of the CAAApplicationFrame.edu framework:
Windows | InstallRootDirectory\CAAApplicationFrame.edu\CAAAfrInitialWorkbench.m\ |
Unix | InstallRootDirectory/CAAApplicationFrame.edu/CAAAfrInitialWorkbench.m/ |
where InstallRootDirectory
is the directory where the CAA CD-ROM
is installed.
[Top]
To implement the CATIAfrActivateWorkbench interface, there are two steps:
[Top]
// System framework #include "CATBaseUnknown.h" #include "CATString.h" class CAAEAfrActivateWorkbenchOnPart: public CATBaseUnknown { CATDeclareClass; public: CAAEAfrActivateWorkbenchOnPart(); virtual ~CAAEAfrActivateWorkbenchOnPart(); CATString & GetInitialWorkbench(); private: CAAEAfrActivateWorkbenchOnPart(const CAAEAfrActivateWorkbenchOnPart &iObjectToCopy); CAAEAfrActivateWorkbenchOnPart & operator = (const CAAEAfrActivateWorkbenchOnPart &iObjectToCopy); private: CATString _WbName ; }; |
The CAAEAfrActivateWorkbenchOnPart class derives from CATBaseUnkown.
The GetInitialWorkbench
method is the only one method of the CATIAfrActivateWorkbench
interface. The CATDeclareClass
macro declares that the CAAEAfrActivateWorkbenchOnPart
class belongs to a component. Note that the copy constructor and the assignment
operator are set as private, and are not implemented in the source file. This
prevents the compiler from creating them as public without you know. _WbName
is the data returned by the GetInitialWorkbench
method.
[Top]
#include "CAAEAfrActivateWorkbenchOnPart.h" #include "TIE_CATIAfrActivateWorkbench.h" TIE_CATIAfrActivateWorkbench(CAAEAfrActivateWorkbenchOnPart); CATImplementClass (CAAEAfrActivateWorkbenchOnPart,DataExtension, CATBaseUnknown, MechanicalPart); |
The CAAEAfrActivateWorkbenchOnPart class states that it implements the
CATIAfrActivateWorkbench interface thanks to the TIE_CATIAfrActivateWorkbench
macro. The CATImplementClass
macro declares that the CAAEAfrActivateWorkbenchOnPart
class is a data extension, thanks to the DataExtension
keyword,
that extends MechanicalPart
. The third argument must always be set
as CATBaseUnknown or CATNull for any kind of extension.
... CAAEAfrActivateWorkbenchOnPart::CAAEAfrActivateWorkbenchOnPart() { _WbName = "PrtCfg" ; } CAAEAfrActivateWorkbenchOnPart::~CAAEAfrActivateWorkbenchOnPart() { } CATString & CAAEAfrActivateWorkbenchOnPart::GetInitialWorkbench() { return _WbName; } |
In this implementation, the workbench is always the Part Design workbench. The name of this workbench is PrtCfg.
[Top]
This use case explains how to implement the CATIAfrActivateWorkbench interface.
[Top]
[1] | Creating a Workbench |
[2] | Application Frame Overview |
[3] | Building and Launching a CAA V5 Use Case |
[Top] |
Version: 1 [Aug 2003] | Document created |
[Top] |
Copyright © 2003, Dassault Systèmes. All rights reserved.