Mechanical Modeler

Defining the Combined Curve's Type

Implementing CATIMf3DBehavior
Use Case

Abstract

The main goal of this use case is to describe how to implement the CATIMf3DBehavior interface to define the type (surfacic) of the Combined Curve.


What You Will Learn With This Use Case

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]

The CAACombinedCurveMf3DBehavior Use Case

CAACombinedCurveMf3DBehavior is a use case of the CAAMechanicalModeler.edu framework that illustrates MechanicalModeler framework capabilities.

[Top]

What Does CAACombinedCurveMf3DBehavior Do

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:

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]

How to Launch CAACombinedCurveMf3DBehavior

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]

Where to Find the CAACombinedCurveMf3DBehavior Code

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]

Step-by-Step

This use case is divided into two steps:

 

Defining the CAAEMmrCombCrvMf3DBehavior Class

#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]

Implementing the CAAEMmrCombCrvMf3DBehavior Class

 
...
CATImplementClass ( CAAEMmrCombCrvMf3DBehavior ,
                   DataExtension       ,    
                   CATBaseUnknown      ,
                   CombinedCurve        );

#include "TIE_CATIMf3DBehavior.h"  
TIE_CATIMf3DBehavior( CAAEMmrCombCrvMf3DBehavior);
...
The CAAEMmrCombCrvMf3DBehavior  class states that it implements the CATIMf3DBehavior interface thanks to the 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 ;
}

IsADatum

The Combined Curve feature is not a datum feature, the method returns E_FAIL.

HRESULT CAAEMmrCombCrvMf3DBehavior::IsADatum() const
                         
{
    return E_FAIL ;
}

[Top]


In Short

This use case explains how to implement the CATIMf3DBehavior  interface for a surfacic feature.

[Top]


References

[1] ntegrating a New Mechanical Feature in V5
[Top]

History

Version: 1 [Apr 2004] Document created
[Top]

Copyright © 2004, Dassault Systèmes. All rights reserved.