Mechanical Modeler |
Defining the Combined Curve's TypeImplementing CATIMf3DBehavior |
|
Use Case |
AbstractThe main goal of this use case is to describe how to implement the CATIMf3DBehavior interface to define the type (surfacic) of the Combined Curve. |
The main goal of this use case is to describe how to implement the CATIMf3DBehavior interface on the Combined Curve StartUp. Since the V5R14, this implementation is mandatory for a StartUp deriving from the GeometricalElement3D StartUp [1].
[Top]
CAACombinedCurveMf3DBehavior is a use case of the CAAMechanicalModeler.edu framework that illustrates MechanicalModeler framework capabilities.
[Top]
The use case is an implementation of the CATIMf3DBehavior interface to specify that the combined curve is a surfacic feature.
A such feature can be included into:
A solid and surfacic features set (SSS) (CombinedCurve.3
into Body.1
),
A non ordered surfacic features set (CombinedCurve.1
into Geometrical Set.1)
An ordered surfacic features set (CombinedCurve.2
into Ordered Geometrical Set.2
)
If you do not implement the CATIMf3DBehavior interface, you will have wrong behaviors such as the graphic properties. Your feature, inserted into a SSS, will be seen such as a solid feature by the default implementation of the CATIMf3DBehavior interface, and for example, the wireframe properties will not be accessible such as shown by the picture below:
You can see that only the options in the "Fill" frame are available. The other options, included into the "Edges", Lines and Curves", and "Points" frames, are unavailable. |
But, if you implement the CATIMf3DBehavior interface you will have the good valid options in the same dialog box.
Now, only the "Lines and Curves" frame is available. It is the frame corresponding to the wireframe objects. |
[Top]
See the section entitled "How to Launch the Combined Curve Use Case" in the "Creating a New Geometrical Feature: The Combined Curve" use case for a detailed description of how this use case should be launched.
[Top]
The CAACombinedCurveMf3DBehavior use case is made one class,CAAEMmrCombCrvMf3DBehavior, located in the CAAMmrCombinedCurve.m module of the CAAMechanicalModeler.edu framework:
Windows | InstallRootDirectory\CAAMechanicalModeler.edu\CAAMmrCombinedCurve.m\ |
Unix | InstallRootDirectory/CAAMechanicalModeler.edu/CAAMmrCombinedCurve.m/ |
where InstallRootDirectory
is the directory where the CAA CD-ROM
is installed
[Top]
This use case is divided into two steps:
#include "CATBaseUnknown.h" class CAAEMmrCombCrvMf3DBehavior: public CATBaseUnknown { CATDeclareClass; public: CAAEMmrCombCrvMf3DBehavior (); virtual ~CAAEMmrCombCrvMf3DBehavior (); virtual HRESULT IsASolid() const ; virtual HRESULT IsAShape() const ; virtual HRESULT IsADatum() const ; private: CAAEMmrCombCrvMf3DBehavior (CAAEMmrCombCrvMf3DBehavior &iObjectToCopy); CAAEMmrCombCrvMf3DBehavior& operator=(CAAEMmrCombCrvMf3DBehavior &iObjectToCopy); }; |
The CATDeclareClass
macro declares that the CAAEMmrCombCrvMf3DBehavior
class belongs to a component. The copy constructor and the "="
operator are set as private to prevent the compiler from automatically creating
as public.
The CATIMf3DBehavior interface contains three methods which are exclusive. Only one must return S_OK, while the another must return E_FAIL.
[Top]
... CATImplementClass ( CAAEMmrCombCrvMf3DBehavior , DataExtension , CATBaseUnknown , CombinedCurve ); #include "TIE_CATIMf3DBehavior.h" TIE_CATIMf3DBehavior( CAAEMmrCombCrvMf3DBehavior); ... |
TIE_
CATIMf3DBehavior
macro.
This extension class is dedicated to this component, and the CATImplementClass
macro declares that the CAAEMmrCombCrvMf3DBehavior class is data
extension class, thanks to the DataExtension
keyword, and that it
extends the component whose main class is CombinedCurve. The third parameter
must always be set to CATBaseUnknown, makes no sense, and is unused for
extensions.
Do not forget to update the interface dictionary. Here it is an extract of the CAAMechanicalModeler.edu.dico file located in the CNext directory of the CAAMechanicalModeler.edu framework.
... CombinedCurve CATIMf3DBehavior libCAAMmrCombinedCurve ... |
The Combined Curve feature is not a solid feature, the method returns E_FAIL.
HRESULT CAAEMmrCombCrvMf3DBehavior::IsASolid() const { return E_FAIL ; } |
IsAShape
The Combined Curve feature is a surfacic feature, the method returns S_OK.
HRESULT CAAEMmrCombCrvMf3DBehavior::IsAShape() const { return S_OK ; } |
The Combined Curve feature is not a datum feature, the method returns E_FAIL.
HRESULT CAAEMmrCombCrvMf3DBehavior::IsADatum() const { return E_FAIL ; } |
[Top]
This use case explains how to implement the CATIMf3DBehavior interface for a surfacic feature.
[Top]
[1] | ntegrating a New Mechanical Feature in V5 |
[Top] |
Version: 1 [Apr 2004] | Document created |
[Top] |
Copyright © 2004, Dassault Systèmes. All rights reserved.