Hide menu
cadex::ModelPrs_Manipulator Class Reference

Provides the ability to position and rotate scene nodes using mouse. More...

Inheritance diagram for cadex::ModelPrs_Manipulator:

Public Types

typedef cadex::internal::ModelPrs_ManipulatorImpl ImplType

Public Member Functions

 ModelPrs_Manipulator ()
ModelPrs_SceneNode AttachedTo () const
 Returns the current scene node to which the manipulator is attached.
void AttachTo (const ModelPrs_SceneNode &theSceneNode)
 Attaches manipulator to scene node.
void Detach ()
 Detachs manipulator.
ModelPrs_ManipulatorMode Mode () const
 Returns the current manipulator mode.
void SetMode (const ModelPrs_ManipulatorMode &theMode)
 Sets the current manipulator mode.
void ResetTransformation ()
 Resets the last transformation changes for the attached ModelPrs_SceneNode.
void Register (ModelPrs_ManipulatorObserver &theObserver)
 Registers observer.
void Unregister ()
 Unregisters observer.
- Public Member Functions inherited from cadex::Base_PublicObject
 Base_PublicObject ()
 Constructor. More...
void Nullify ()
 Resets reference to implementation object.
bool IsNull () const
 Returns true if the object is nullified. More...
 operator bool () const
 Casts the object to the bool type. More...
internal::Base_HandledObject * Impl () const
 Return a handle to backend (reserved for internal use).
const internal::Base_Handle & HImpl () const
template<typename T >
T * Impl () const
 Reserved for internal use.
bool operator== (const Base_PublicObject &theObject) const
bool operator!= (const Base_PublicObject &theObject) const

Additional Inherited Members

- Protected Member Functions inherited from cadex::Base_PublicObject
 Base_PublicObject (const internal::Base_HandledObject *theObject)
 Constructor (reserved for internal use).
template<typename T >
T * GetOrCreateImpl ()
 Reserved for internal use.

Detailed Description

Provides the ability to position and rotate scene nodes using mouse.

This class is a part of Visualization Toolkit add-on, which is licensed separately from the base CAD Exchanger SDK.

The manipulator is used to interact with scene nodes via specific interactive graphical object. To make this object visible one needs to attach manipulator to a scene node. This scene node's sub-tree must contain geometry, so that there's something to transform. If the scene node's sub-tree has no geometry, the attachment will be ignored.

The example below demonstrates how to attach manipulator to a scene node:

ModelPrs_SceneNode aSceneNode = ...;
myViewPort.Manipulator().AttachTo (aSceneNode);

There are two supported types of transformations: rotation and translation. The transformation of the attached ModelPrs_SceneNode will be updated at the end of a transformation, so you don't need to make any changes manually. Nevertheless, you can register observer which inherits ModelPrs_ManipulatorObserver with overridden methods and use transformation for own purposes.

ModelPrs_Scene::Update() should not be used during the manipulator interactaction with the scene node.

Transformation change to the attached scene node or its children has undefined behavior.

See also