CATMecModUIUseItf CATFeatureAgent
Usage: you must use this class as is. You should never derive it.
public class CATFeatureAgent
Class to select in Mechanical context.
Role:This agent of selection is dedicated for mechanical features. In addition to the
possibilities, this agent enables you to:
- Featurize the selected object and manage the featurization options
- Authorize or not, in assembly context, the selection outside the current component.
( see
)
In addition, this agent automatically transforms a document in Visu mode in Design mode,
when the end user selects one element of this document.
The featurization of the selected object should be used only if it is necessary. This
feature is named a BRep feature.
The
method enables you to know if the selected object (
) has been featurized. Once the BRep feature has been created you have only two possibilities:
- Keep the feature: It must be aggregated, with the CATIDescendants interface,
in order to manage its automatic deletion.
- Delete the feature: The CATICutAndPastable interface must be used.
Constructor and Destructor Index
- o
CATFeatureAgent(CATString&,CATClassId,CATDlgEngBehavior,CATMfFeaturizeMode,CATBaseUnknown_var&,CATFeatureAgentBehavior)
- Constructs a path element agent.
- o
~CATFeatureAgent()
-
Method Index
- o
AgentError()
- Returns the agent error codes.
- o
ElementInContext(CATPathElement*)
- Returns the selection context.
- o
FeaturizedElement(CATPathElement*)
- Returns the featurization status.
- o
GetAgentBehavior(CATMfFeaturizeMode&,CATBaseUnknown_var&,CATFeatureAgentBehavior&)
- Gets the agent behavior.
- o
GetElementValue(CATPathElement*)
- Returns the selected object.
- o
SetActiveObjectPath(CATPathElement&)
- Sets the active object path.
- o
SetAgentBehavior(CATMfFeaturizeMode,CATBaseUnknown_var&,CATFeatureAgentBehavior)
- Sets the agent behavior.
- o
SetListOfValuesToSelect(CATSO*)
- Sets the agent list of values as the selection would do.
- o
SetValueToSelect(CATPathElement*)
- Sets the agent value as the selection would do.
Constructor and Destructor
o CATFeatureAgent
public CATFeatureAgent( | const | iId, |
| | iType | = NULL, |
| | iBehavior | = NULL, |
| | iMode | = 0, |
| const | iSupport | = NULL_var, |
| | iAgBehavior | = NULL) |
-
Constructs a path element agent.
- Parameters:
-
- iId
- The agent identifier. It is used to retrieve the undo/redo titles in
the command resource file.
- iType
- The type of the expected objects.
The type corresponds to an interface implemented by the object.
If it is NULL, all the objects
are accepted.
You can add interfaces with
or you can specified later an ordered list thanks to the
method.
- iBehavior
- The agent behavior. The behavior is given in the form of a
concatenation of the facet values using the | character. Refer to the
method for details about the valid facets.
However, for the two following facets the default value is the opposite
of the CATPathElementAgent class.
- Tooltip: CATDlgEngWithTooltip is the default and not
CATDlgEngWithoutTooltip.
- User Selection Filter: CATDlgEngWithUserSelectionFilter is the default and not
CATDlgEngWithoutUserSelectionFilter.
The behavior may be specified later with the
method.
- iMode
- The featurization mode to featurized the selected geometry.
Legal values: The featurization mode is defined with options
separeted with the | character.
e.g.: MfRelimitedFeaturization|MfPermanentBody
The default featurization mode is the MfNoFeaturization option (=0).
The featurization mode may be specified later with the
method.
- iSupport
- The support of the featurized object.
Legal values:
- NULL_var when iMode is MfNoFeaturization or
MfFunctionalFeaturization.
- Otherwise a feature, if it required by the featurization option.
The support of the featurized object may be specified later with
the
method.
- iAgBehavior
- The specific agent behavior. The default behavior (NULL) means:
- The optimization mode which keeps the decode result is activated.
- In assembly context, selection of geometry outside the current component is prohibited. The
method enables you to change the current component which is by default the current UI active object.
This behavior may be specified later with the
method.
o ~CATFeatureAgent
public virtual ~CATFeatureAgent( | ) |
-
Methods
o AgentError
public virtual AgentError( | ) |
-
Returns the agent error codes.
- Returns:
- The value.
Legal values:
- 0: no error.
- !=0: otherwise
o ElementInContext
public virtual ElementInContext( | | iPath) |
-
Returns the selection context.
Role:This methode enables you to know, in assembly context, if the
the selection has been done in the current Part or outside.
- Parameters:
-
- iPath
- The agent value that you retrieve with the
(mono-sel) and the
(multi-sel)methods.
- Returns:
- The selection context.
Legal values:
- 0:the selected element is in the current Part.
- 1: the selected element is in another Part.
o FeaturizedElement
public virtual FeaturizedElement( | | iPath) |
-
Returns the featurization status.
- Parameters:
-
- iPath
- The agent value that you retrieve with the
(mono-sel) and the
(multi-sel) methods.
- Returns:
- The value.
Legal values:
- TRUE the selected element has been featurized. The value returned by
the
method is a BRep feature.
- FALSE the selected element is not featurized.
o GetAgentBehavior
public GetAgentBehavior( | | ioMode, |
| | ioSupport, |
| | ioAgBehavior) |
-
Gets the agent behavior.
- Parameters:
-
- ioMode
- The featurization mode to featurize the selected geometry.
- ioSupport
- The support of the featurized object.
- ioAgBehavior
-
- The optimization mode which keeps the decode result is activated.
- In assembly context, selection of geometry outside the current component is prohibited. The
method enables you to change the current component which is by default the current UI active object.
o GetElementValue
public virtual GetElementValue( | | iPath) |
-
Returns the selected object.
Role: This method returns the leaf of the input path.
- Parameters:
-
- iPath
- The agent value that you retrieve with the
(mono-sel) and the
(multi-sel)methods. If the value is NULL, the
is used.
- Returns:
- The selected object.
o SetActiveObjectPath
public SetActiveObjectPath( | | iPath) |
-
Sets the active object path.
Role: In assembly context, i.e. when the current document is a Product document,
this method enables you to declare a context (a path)
different from the current User Interface active object one.
The role of this method is different from the classes and their behaviors:
- For CATFeatureAgent:
The role of iPath depends on the agent behavior:(
)
- CATFAgAllowSelectionInContext is not set (default behavior): It is possible to select only
in the document whose the path is specified by iPath.
- CATFAgAllowSelectionInContext is set: This method is useless. It is possible
to select anywhere.
- For
: iPath is the path of a Part document where will be imported the selected objects.
- Parameters:
-
- iPath
- The active object path. Its default value is the current UI active object, the value returned
by the
method.
o SetAgentBehavior
public SetAgentBehavior( | | iMode, |
| const | iSupport | = NULL_var, |
| | iAgBehavior | = NULL) |
-
Sets the agent behavior.
- Parameters:
-
- iMode
- The featurization mode to featurize the selected geometry.
- iSupport
- The support of the featurized object.
Legal values: NULL_var when iMode is MfNoFeaturization or
MfFunctionalFeaturization otherwise the support feature if it is required by
the featurization option.
- iAgBehavior
-
- The optimization mode which keeps the decode result is activated.
- In assembly context, selection of geometry outside the current component is prohibited. The
method enables you to change the current component which is by default the current UI active object.
o SetListOfValuesToSelect
public SetListOfValuesToSelect( | | iList) |
-
Sets the agent list of values as the selection would do.
Role: This method is usable only on MultiAcquisition objects,
otherwise use the
method.
This method does not register an undo step.
Postcondition: Use the
method to make the agent accept the value list, otherwise this list is not
taken into account.
- Parameters:
-
- iList
- The list of values.
Cyclic reference: A copy of iList is kept and
AddRef'ed. It is Released in the agent destructor.
- Returns:
- The number of path element was successfully treated.
o SetValueToSelect
public SetValueToSelect( | | iValue) |
-
Sets the agent value as the selection would do.
Role: The value is a path element to be treated.
This method does not register an undo step.
Postcondition: Use the
method to make the agent accept the value, otherwise this value is not
taken into account.
- Parameters:
-
- iValue
- The value.
Cyclic reference: A copy of iValue is kept and
AddRef'ed. It is Released in the agent destructor.
- Returns:
- 1 if the path element was successfully treated, 0 otherwise.
This object is included in the file: CATFeatureAgent.h
If needed, your Imakefile.mk should include the module: CATMecModUIUseItf
Copyright © 1999-2014, Dassault Systèmes. All rights reserved.