Analysis Solution |
Analysis Modeler |
Customization of the highlight of node and elementCustomize the highlight of node in your command |
Use Case |
Abstract NEW R18This use case explains how to customize the high light of node and element. This step includes the creation of a command of Node Selection and the definition of the Highlight method. |
This use case is intended to help you to generate the field model of an analysis entity associated to a support. This use case will also include the definition of the authorized support.
More specifically, the CAAAniSelectNodeCmd use case shows how to :
[Top]
CAAAniSelectNodeCmd is an use case of the CAAAnalysisInterfaces.edu framework that illustrates the CATIA Analysis modeler frameworks capabilities.
The goal of this use case is to illustrate the way of how defining your customized highlight for a node or element selection.
The main methods to use are:
[Top]
CAAAniSelectNodeCmd code is located in the CAAAniWB.m use case module of the CAAAnalysisInterfaces.edu framework:
Windows | InstallRootDirectory\CAAAnalysisInterfaces.edu\CAAAniWB.m\ |
Unix | InstallRootDirectory/CAAAnalysisInterfaces.edu/CAAAniWB.m/ |
where InstallRootDirectory
is the directory where the CAA CD-ROM
is installed. It is made of a source file named
The following table shows which code resources are used in this Use Case. These resources are physically located within the appropriate directories (with same names) of your CAA installation.
Framework | Module/Interface | Source | Content |
---|---|---|---|
CAAAnalysisInterfaces.edu | CAAAniWB.m | CAAAniSelectNodeCmd.cpp | Node Selection command |
[Top]
To launch this use case, you will need to set up the build time environment, then compile CAAAniWB and CAAAniAeroDTransition along with its prerequisites, set up the run time environment, and then execute the use case [2].
[Top]
The default highlight is a circle. We have customized our highlight in order to have a cross for node selection.
[Top]
There are seven logical sections in CAAAniExplicit.m. We will now comment each of those sections by looking at the code.
[Top]
Define your path element selection agent with specifying the type of object you want the user to be allowed to select. In order case we only allow the objects adherent to CATIMSHSelectedNode.
... _FeatSelectionAgent = new CATPathElementAgent ("FeatSelectionAgent"); if ( _FeatSelectionAgent) { _FeatSelectionAgent->AddElementType(IID_CATIMSHSelectedNode); _FeatSelectionAgent -> SetBehavior ( CATDlgEngWithPSOHSO | CATDlgEngWithPrevaluation ); AddCSOClient(_FeatSelectionAgent); } ... |
[Top]
Define your customized highlight by creating a CATMSHCustomHighlight or its derivated. Note that HighlightCustoNode is your own method that you have to define according to some nomenclatures. Refer to next step.
... CATMSHCustomHighlight* pFilter = new CATMSHCustomHighlight((CATMSHMethodHilight) &HighlightCustoNode,(void*)this); ... |
[Top]
Set this object CATMSHCustomHighlight as filter of your selection agent.
... _FeatSelectionAgent->SetFilter(pFilter); ... |
[Top]
This method must have the following arguments : (CAT3DCustomRep * iRep, CATBaseUnknown * iEntity, void * iHData) with :
Warning : Note that this method is a static method.
... HRESULT CAAAniSelectNodeCmd::HighlightCustoNode (CAT3DCustomRep * iRep, CATBaseUnknown * iEntity, void * iHData) { CATAssert ( iEntity ); CATAssert ( iRep ); CATIMSHSelectedNode * Node = NULL; iEntity -> QueryInterface ( IID_CATIMSHSelectedNode , (void **) &Node ); if ( !Node ) return E_FAIL; CATMSHNode * node = Node -> GetNode (); CATAssert ( node ); Node -> Release (); Node = NULL; float xyz[3]; const double * coor = node -> GetCoordinates (); xyz[0] = (float) coor[0]; xyz[1] = (float) coor[1]; xyz[2] = (float) coor[2]; CATGraphicAttributeSet attribute; attribute.SetColor ( GREEN ); CAT3DMarkerGP * marker = new CAT3DMarkerGP ( xyz, 1 , CROSS ); iRep -> AddGP ( marker , attribute ); return S_OK; } ... |
[Top]
his use case explains how to customize the high light of node and element. This step includes the creation of a command of Node Selection and the definition of the Highlight method.
|
||||
[Top] |
Version: 1 [Nov 2006] | Document created |
[Top] |
Copyright © 2006, Dassault Systèmes. All rights reserved.