Machining |
NC Review |
Implementing User Data Feature EditorImplementing the CATIMfgUserDataFeature interface |
Use Case |
AbstractThis article discusses the CAAMaiUserDataFeature use case and explains how to implement the CATIMfgUserDataFeature manufacturing interface. |
This use case is intended to help you customize the editor of a user data feature by implementing the CATIMfgUserDataFeature manufacturing interface. This involves the following:
[Top]
CAAMaiUserDataFeature is a use case of the CAAManufacturingItf.edu framework that illustrates ManufacturingInterfaces framework capabilities.
[Top]
CAAMaiUserDataFeature runs with the Process document shown on Fig.1 that contains a Manufacturing Setup linked to a user data feature (through the interface CATIMfgUserDataAccess) and a Manufacturing Program linked to another user data feature.
The use case builds the editor of this user data feature whose modelization is the following:
![]() |
[Top]
To launch CAAMaiUserDataFeature, you will need to:
Windows | InstallRootDirectory\CAADoc\CAAManufacturingItf.edu\CNext\resources\graphic\ |
Unix | InstallRootDirectory/CAADoc/CAAManufacturingItf.edu/CNext/resources/graphic/ |
[Top]
The CAAMaiUserDataFeature use case is made of a class named CAAEMaiUserDataFeature located in the CAAMaiUserDataFeature.m module of the CAAManufacturingItf.edu framework:
Windows | InstallRootDirectory\CAADoc\CAAManufacturingItf.edu\CAAMaiUserDataFeature.m |
Unix | InstallRootDirectory/CAADoc/CAAManufacturingItf.edu/CAAMaiUserDataFeature.m |
where InstallRootDirectory
is the directory where the CAA CD-ROM
is installed.
[Top]
There are three logical steps in CAAMaiUserDataFeature:
We now comment each of those sections by looking at the code.
[Top]
The extension class that will implement CATIMfgUserDataFeature is named CAAEMaiUserDataFeature. Creating this class is done is three sub steps:
// System #include "CATBaseUnknown.h" // Dialog #include "CATDlgInclude.h" class CAAEMaiUserDataFeature : public CATBaseUnknown { // Used in conjonction with CATImplementClass in the .cpp file CATDeclareClass; public: // Constructor and destructor CAAEMaiUserDataFeature(); virtual ~CAAEMaiUserDataFeature(); // Implementation of the CATIMfgUserDataFeature interface HRESULT GetEditor (CATDialog *iFather, CATDlgFrame *&oEditor); HRESULT GetNLSDescription (CATUnicodeString &oNLSDescription); private: // Copy constructor, not implemented // Set as private to prevent from compiler automatic creation as public. CAAEMaiUserDataFeature (const CAAEMaiUserDataFeature&iObjectToCopy); // Assignment operator, not implemented // Set as private to prevent from compiler automatic creation as public. CAAEMaiUserDataFeature& operator = (const CAAEMaiUserDataFeature&iObjectToCopy); }; |
The CAAEMaiUserDataFeature class C++-derives from CATBaseUnknown.
The CATDeclareClass
macro declares that the class CAAEMaiUserDataFeature
belongs to a component. The class has a constructor, a destructor, the
GetEditor and GetNLSDescription methods of CATIMfgUserDataFeature,
and a copy constructor. Note that the copy constructor is set as private.
This is very important for extensions. Since extensions must never be
directly instantiated by client applications, this prevents the compiler
from creating the copy constructor as public without you know. This copy
constructor is not implemented in the source file.
... #include "TIE_CATIMfgUserDataFeature.h" TIE_CATIMfgUserDataFeature(CAAEMaiUserDataFeature); CATImplementClass(CAAEMaiUserDataFeature, DataExtension, CATBaseUnknown, MyUserDataFeature); ... HRESULT CAAEMaiUserDataFeature::GetEditor(CATDialog *iFather, CATDlgFrame * &oEditor) { HRESULT RC = S_OK; ... |
The CAAEMaiUserDataFeature class states that it implements the CATIMfgUserDataFeature
interface thanks to the TIE_CATIMfgUserDataFeature
macro. The CATImplementClass
macro declares that the CAAEMaiUserDataFeature class is data
extension class, thanks to the DataExtension
keyword, and that
it extends the feature whose type is MyUserDataFeature. The third
parameter must always be set to CATBaseUnknown, makes no sense, and
is unused for extensions.
The dictionary, that is a file named, for example in this case, CAAManufacturingItf.edu.dico, whose directory's pathname is concatenated at run time in the CATDictionaryPath environment variable, and containing the following declaration to state that the MyUserDataFeaturefeature implements the CATIMfgUserDataFeature interface, and whose code is located in the libCAAMaiUserDataFeature shared library or DLL.
MyUserDataFeature CATIMfgUserDataFeature libCAAMaiUserDataFeature
The CAAManufacturingItf.edu.dico file is located in:
Windows | InstallRootDirectory\CAADoc\CAAManufacturingItf.edu\CNext\code\dictionary\ |
Unix | InstallRootDirectory/CAADoc/CAAManufacturingItf.edu/Cnext/code/dictionary/ |
[Top]
The aim of this method is to create a frame and fill it with the editor of the feature. It creates a Frame, then looks for the attribute 'MyAttribute' thanks to the Object Specs Modeler interfaces, then reads the object that modelizes it (in this case a Literal Feature) and gets its editor thanks to the Literal Features interfaces.
... // Creates a Frame oEditor = new CATDlgFrame (iFather,CATString("Parameter 1")); ... |
[Top]
The aim of this method is to give the NLS string that will appear as name of the menu item (see figure above) and as name of the editor. In this use case, the string is hardcoded with 'Standards...'.
... // Builds the string that will appear in the menu item oNLSDescription = CATUnicodeString("Standards..."); |
[Top]
[1] | Building and Launching a CAA V5 Use Case |
[2] | Process Modeler Home Page |
[Top] |
Version: 1 [Sep 2000] | Document created |
[Top] |
Copyright © 2002, Dassault Systèmes. All rights reserved.