dart
Public Member Functions | Protected Attributes | List of all members
dart::gui::osg::BodyNodeDnD Class Reference
Inheritance diagram for dart::gui::osg::BodyNodeDnD:
Inheritance graph
[legend]
Collaboration diagram for dart::gui::osg::BodyNodeDnD:
Collaboration graph
[legend]

Public Member Functions

 BodyNodeDnD (Viewer *viewer, dart::dynamics::BodyNode *bn, bool useExternalIK=true, bool useWholeBody=false)
 Constructor.
 
virtual ~BodyNodeDnD ()=default
 Virtual destructor.
 
dart::dynamics::BodyNodegetBodyNode () const
 Get the BodyNode associated with this DnD.
 
void update () override
 Called when mouse events are being handled.
 
void move () override
 Called to specify how the Entity should be moved.
 
void saveState () override
 Called when a point gets picked, and is used to save the current state of the Entity.
 
void release () override
 Called when the user lets go of the object that they are dragging and dropping. More...
 
void useExternalIK (bool external)
 Tell this DnD to use an external IK instead of the one embedded in the BodyNode. More...
 
bool isUsingExternalIK () const
 Returns true if it is using an external IK.
 
void useWholeBody (bool wholeBody)
 Tell this DnD to use the whole body.
 
bool isUsingWholeBody () const
 Returns true if this DnD is using the whole body.
 
void setPreserveOrientationModKey (::osgGA::GUIEventAdapter::ModKeyMask modkey)
 Set the key that will preserve the orientation of the body.
 
::osgGA::GUIEventAdapter::ModKeyMask getPreserveOrientationModKey () const
 Get the key that will preserve the orientation of the body.
 
void setJointRestrictionModKey (::osgGA::GUIEventAdapter::ModKeyMask modkey)
 Set the key that will restrict which joints are used by the DnD.
 
::osgGA::GUIEventAdapter::ModKeyMask getJointRestrictionModKey () const
 Get the key that will restrict which joints are used by the DnD.
 
- Public Member Functions inherited from dart::gui::osg::DragAndDrop
 DragAndDrop (Viewer *viewer, dart::dynamics::Entity *entity)
 Constructor.
 
virtual ~DragAndDrop ()
 Virtual destructor.
 
dart::dynamics::EntitygetEntity () const
 Get the Entity that this DragAndDrop is associated with.
 
void setObstructable (bool _obstructable)
 If true is passed in, this object will only be drag and droppable if there are no other objects between its picked point and the camera. More...
 
bool isObstructable () const
 If this is true, then this object will only be drag and droppable if there are no other objects between its picked point and the camera. More...
 
virtual Eigen::Vector3d getConstrainedDx () const
 Default method for getting the translation requested by the user.
 
virtual Eigen::AngleAxisd getConstrainedRotation () const
 Default method for getting the rotation requested by the user.
 
void unconstrain ()
 Remove all constraints from the dragging and dropping.
 
void constrainToLine (const Eigen::Vector3d &slope)
 Constrain translation to only occur along the given slope, or constrain rotation to only occur about the given slope. More...
 
void constrainToPlane (const Eigen::Vector3d &normal)
 Constrain translation to only occur within the plane defined by the given normal, or constrain rotation to only occur about the given normal. More...
 
bool isMoving () const
 Returns the mAmMoving flag.
 
void setRotationOption (RotationOption option)
 Set the option for triggering rotations instead of translations.
 
RotationOption getRotationOption () const
 Get the current rotation option for this DnD.
 
void setRotationModKey (::osgGA::GUIEventAdapter::ModKeyMask rotationModKey)
 Set the modkey that will be used to toggle rotation for this DnD.
 
::osgGA::GUIEventAdapter::ModKeyMask getRotationModKey () const
 Get the modkey that will be used to toggle rotation for this DnD.
 
- Public Member Functions inherited from dart::common::Subject
virtual ~Subject ()
 Destructor will notify all Observers that it is destructing.
 
- Public Member Functions inherited from dart::common::Observer
virtual ~Observer ()
 Destructor will notify all Subjects that it is destructing.
 

Protected Attributes

dart::dynamics::WeakBodyNodePtr mBodyNode
 The BodyNode associated with this DnD.
 
dart::dynamics::InverseKinematicsPtr mIK
 The IK module being used by this DnD.
 
Eigen::Vector3d mSavedGlobalOffset
 The offset of the pick from the BodyNode origin, expressed in global coordinates.
 
Eigen::Vector3d mSavedLocalOffset
 The offset of the pick from the BodyNode origin, expressed in local coordinates.
 
Eigen::AngleAxisd mSavedRotation
 The rotation of the BodyNode.
 
bool mUseExternalIK
 Whether to use an external IK.
 
bool mUseWholeBody
 Whether to use the whole body.
 
::osgGA::GUIEventAdapter::ModKeyMask mPreserveOrientationModKey
 Key for preserving orientation.
 
::osgGA::GUIEventAdapter::ModKeyMask mJointRestrictionModKey
 Key for restricting joint usage.
 
std::size_t mAdditionalBodyNodes
 Currently unused, but this will change in the future.
 
- Protected Attributes inherited from dart::gui::osg::DragAndDrop
ViewermViewer
 Pointer to the DnD's Viewer.
 
dart::dynamics::EntitymEntity
 Pointer to the DnD's Entity.
 
Eigen::Vector3d mPickedPosition
 The location in the world that was picked by the user.
 
Eigen::Vector3d mVector
 Reference vector for constraint (slope for line constraint, or normal for plane constraint)
 
Eigen::Vector3d mPivot
 Point in space about which rotations should happen.
 
ConstraintType mConstraintType
 Constraint type for this DnD.
 
bool mAmObstructable
 Whether other objects can block this one from being picked.
 
bool mAmMoving
 Whether this DnD is currently moving.
 
RotationOption mRotationOption
 Option for rotation settings.
 
::osgGA::GUIEventAdapter::ModKeyMask mRotationModKey
 Modkey for rotation.
 
- Protected Attributes inherited from dart::common::Subject
std::set< Observer * > mObservers
 List of current Observers.
 
- Protected Attributes inherited from dart::common::Observer
std::set< const Subject * > mSubjects
 List of current Subjects for this Observer.
 

Additional Inherited Members

- Public Types inherited from dart::gui::osg::DragAndDrop
enum  RotationOption : int { HOLD_MODKEY = 0, ALWAYS_ON, ALWAYS_OFF }
 
- Protected Member Functions inherited from dart::gui::osg::DragAndDrop
void handleDestructionNotification (const dart::common::Subject *subscription) override
 Perform cleanup when the subject is destroyed.
 
- Protected Member Functions inherited from dart::common::Subject
void sendDestructionNotification () const
 Send a destruction notification to all Observers. More...
 
void addObserver (Observer *_observer) const
 Add an Observer to the list of Observers.
 
void removeObserver (Observer *_observer) const
 Remove an Observer from the list of Observers.
 
- Protected Member Functions inherited from dart::common::Observer
void receiveDestructionNotification (const Subject *_subject)
 Called whenever a Subject is destroyed (or sends out a destruction notification). More...
 
void addSubject (const Subject *_subject)
 Add a Subject for this Observer.
 
void removeSubject (const Subject *_subject)
 Remove a Subject from this Observer.
 
void removeAllSubjects ()
 Remove all Subjects from this Observer.
 

Member Function Documentation

◆ release()

void dart::gui::osg::BodyNodeDnD::release ( )
overridevirtual

Called when the user lets go of the object that they are dragging and dropping.

This function does nothing by default, but you can override it.

Reimplemented from dart::gui::osg::DragAndDrop.

◆ useExternalIK()

void dart::gui::osg::BodyNodeDnD::useExternalIK ( bool  external)

Tell this DnD to use an external IK instead of the one embedded in the BodyNode.

Using the one embedded in the BodyNode allows it to automatically be used in a WholeBodyIK, but using an external IK allows it to be automatically solved without instructing a WholeBodyIK to solve.


The documentation for this class was generated from the following files: