All Frameworks Class Hierarchy This Framework Previous Next Indexes
VisualizationBase Class CAT3DManipulator
System.IUnknown
|
+---System.IDispatch
|
+---System.CATBaseUnknown
|
+---System.CATEventSubscriber
|
+---System.CATCommand
|
+---VisualizationBase.CATManipulator
|
+---CAT3DManipulator
Usage: you must use this class as is. You should never derive it.
public class CAT3DManipulator
Class to control a 3D representation.
Role:
A CAT3DManipulator is a Controller attached to a 3D representation providing
a proposition of a new position for 3D manipulation after the representation
selected by the user has been manipulated.
Usage of manipulators
- In the instanciation :
- Instanciate a manipulator connected to the representation :
CAT3DManipulator * _Manip = new
CAT3DManipulator( this, "MYName", MYRep, CAT3DManipulator::Translation);
- Position the manipulator
_Manip->SetPosition( PositionComputedFromNewModelization)
- Set characteristics (Invariants) Note: Do it after SetPosition()
Manip->SetTranslationDirection( CATMathJ);
- Branch a callback in you father command to be informed about the manipulation
AddAnalyseNotificationCB( _Manip, CATManipulator::GetCATManipulate(),
(CATCommandMethod) &MYCommand::MYCallback, NULL);
- In the callback,
- Read data of manipulation
- read the RESULT of the manipulation
CATMathAxis Position = ((CAT3DManipulator *)Command)->GetPosition();
- read the event elementary TRANSFORMATION of the manipulation
CATTransformationNotification *TransfoNotif =
((CATTransformationNotification *) Command->SendCommandSpecificObject(
CATTransformationNotification::ClassName(), Notification));
CATMathTransformation *Transformation = TransfoNotif->GetNotification();
- In the callback, Update your modelization
- In the callback, Reposition the manipulator if needed (usualy when there is constraints)
_Manip->SetPosition( PositionComputedFromNewModelization)
Constructor and Destructor Index
- o
CAT3DManipulator(CATCommand*,CATString&,CAT3DRep*,ManipulationStyle,ManipulationStyle)
- Construction of the manipulator.
Method Index
- o
GetPosition()
- Gets the current position of the manipulator.
- o
SetPosition(CATMathAxis&)
- Sets the position of the manipulator.
- o
SetRotationLine(CATMathLine&)
- Sets the invariant line of LineRotation and PlaneMovement.
- o
SetRotationPoint(CATMathPoint&)
- Sets the invariant point of PointRotation.
- o
SetTranslationDirection(CATMathDirection&)
- Sets the invariant direction of DirectionTranslation.
- o
SetTranslationPlane(CATMathPlane&)
- Sets the invariant plane of PlaneTranslation and PlaneMovement.
Enumerated Type Index
- o
ManipulationStyle
- Defines the different types of manipulation available for
a 3D representation.
Constructor and Destructor
o CAT3DManipulator
public CAT3DManipulator( | CATCommand* | iFather, |
| const CATString& | iName, |
| CAT3DRep* | iRep, |
| const ManipulationStyle | iFirstStyle | =NoManipulation, |
| const ManipulationStyle | iSecondStyle | =NoManipulation) |
-
Construction of the manipulator.
- Parameters:
-
- iFirstStyle
- = style of manipulation used by Mouse Left button drag
- iSecondStyle
- = style of manipulation used by Mouse Left+Middle buttons drag (left THEN middle)
Methods
o GetPosition
-
Gets the current position of the manipulator.
o SetPosition
public virtual void SetPosition( | const CATMathAxis& | iPosition) |
-
Sets the position of the manipulator.
o SetRotationLine
public virtual void SetRotationLine( | const CATMathLine& | iLine) |
-
Sets the invariant line of LineRotation and PlaneMovement.
o SetRotationPoint
public virtual void SetRotationPoint( | const CATMathPoint& | iPoint) |
-
Sets the invariant point of PointRotation.
o SetTranslationDirection
-
Sets the invariant direction of DirectionTranslation.
o SetTranslationPlane
public virtual void SetTranslationPlane( | const CATMathPlane& | iPlane) |
-
Sets the invariant plane of PlaneTranslation and PlaneMovement.
Enumerated Types
o ManipulationStyle
-
enum ManipulationStyle {
NoManipulation,
DirectionTranslation,
PlaneTranslation,
PlaneMovement,
LineRotation,
PointRotation,
FrontestPlaneTranslation
}
Defines the different types of manipulation available for
a 3D representation.
- Parameters:
-
- NoManipulation
- The CAT3DManipulator does no specific work
- DirectionTranslation
- The CAT3Dmanipulator contrains its position along a given direction during the manipulation
- PlaneTranslation
- The CAT3Dmanipulator contrains its position along a given plane during the manipulation
- PlaneMovement
- Do not use
- LineRotation
- The CAT3Dmanipulator contrains its position on a circle normal to a given axis
- PointRotation
- The CAT3Dmanipulator contrains its position on a sphere centered on a given point
- FrontestPlaneTranslation
- The CAT3Dmanipulator contrains its position along a plane parallel to the screen
This object is included in the file: CAT3DManipulator.h
If needed, your Imakefile.mk should include the module: CATViz