DART
6.7.3
|
SimpleFrameShapeDnD is a version of SimpleFrameDnD that allows a specific Shape within the SimpleFrame to be dragged and dropped (although it will carry the entire SimpleFrame with it) More...
#include <DragAndDrop.hpp>
Public Types | |
enum class | RotationOption : int { HOLD_MODKEY = 0 , ALWAYS_ON , ALWAYS_OFF } |
Public Member Functions | |
SimpleFrameShapeDnD (Viewer *viewer, dart::dynamics::SimpleFrame *frame, dart::dynamics::Shape *shape) | |
Constructor. More... | |
virtual | ~SimpleFrameShapeDnD ()=default |
Virtual destructor. More... | |
dart::dynamics::Shape * | getShape () const |
Get the Shape associated with this DnD. More... | |
void | update () override |
Called when mouse events are being handled. More... | |
dart::dynamics::SimpleFrame * | getSimpleFrame () const |
Get the SimpleFrame associated with this DnD. More... | |
void | move () override |
Called to specify how the Entity should be moved. More... | |
void | saveState () override |
Called when a point gets picked, and is used to save the current state of the Entity. More... | |
dart::dynamics::Entity * | getEntity () const |
Get the Entity that this DragAndDrop is associated with. More... | |
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 void | release () |
Called when the user lets go of the object that they are dragging and dropping. More... | |
virtual Eigen::Vector3d | getConstrainedDx () const |
Default method for getting the translation requested by the user. More... | |
virtual Eigen::AngleAxisd | getConstrainedRotation () const |
Default method for getting the rotation requested by the user. More... | |
void | unconstrain () |
Remove all constraints from the dragging and dropping. More... | |
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. More... | |
void | setRotationOption (RotationOption option) |
Set the option for triggering rotations instead of translations. More... | |
RotationOption | getRotationOption () const |
Get the current rotation option for this DnD. More... | |
void | setRotationModKey (::osgGA::GUIEventAdapter::ModKeyMask rotationModKey) |
Set the modkey that will be used to toggle rotation for this DnD. More... | |
::osgGA::GUIEventAdapter::ModKeyMask | getRotationModKey () const |
Get the modkey that will be used to toggle rotation for this DnD. More... | |
Protected Member Functions | |
void | handleDestructionNotification (const dart::common::Subject *subscription) override |
Perform cleanup when the subject is destroyed. More... | |
void | sendDestructionNotification () const |
Send a destruction notification to all Observers. More... | |
void | addObserver (Observer *_observer) const |
Add an Observer to the list of Observers. More... | |
void | removeObserver (Observer *_observer) const |
Remove an Observer from the list of Observers. More... | |
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. More... | |
void | removeSubject (const Subject *_subject) |
Remove a Subject from this Observer. More... | |
void | removeAllSubjects () |
Remove all Subjects from this Observer. More... | |
Protected Attributes | |
dart::dynamics::Shape * | mShape |
Shape associated with this DnD. More... | |
dart::dynamics::SimpleFrame * | mFrame |
SimpleFrame pointer. More... | |
Eigen::AngleAxisd | mSavedRotation |
The saved rotation of the frame. More... | |
Viewer * | mViewer |
Pointer to the DnD's Viewer. More... | |
dart::dynamics::Entity * | mEntity |
Pointer to the DnD's Entity. More... | |
Eigen::Vector3d | mPickedPosition |
The location in the world that was picked by the user. More... | |
Eigen::Vector3d | mVector |
Reference vector for constraint (slope for line constraint, or normal for plane constraint) More... | |
Eigen::Vector3d | mPivot |
Point in space about which rotations should happen. More... | |
ConstraintType | mConstraintType |
Constraint type for this DnD. More... | |
bool | mAmObstructable |
Whether other objects can block this one from being picked. More... | |
bool | mAmMoving |
Whether this DnD is currently moving. More... | |
RotationOption | mRotationOption |
Option for rotation settings. More... | |
::osgGA::GUIEventAdapter::ModKeyMask | mRotationModKey |
Modkey for rotation. More... | |
std::set< Observer * > | mObservers |
List of current Observers. More... | |
std::set< const Subject * > | mSubjects |
List of current Subjects for this Observer. More... | |
SimpleFrameShapeDnD is a version of SimpleFrameDnD that allows a specific Shape within the SimpleFrame to be dragged and dropped (although it will carry the entire SimpleFrame with it)
|
stronginherited |
dart::gui::osg::SimpleFrameShapeDnD::SimpleFrameShapeDnD | ( | Viewer * | viewer, |
dart::dynamics::SimpleFrame * | frame, | ||
dart::dynamics::Shape * | shape | ||
) |
Constructor.
|
virtualdefault |
Virtual destructor.
|
protectedinherited |
Add an Observer to the list of Observers.
|
protectedinherited |
Add a Subject for this Observer.
|
inherited |
Constrain translation to only occur along the given slope, or constrain rotation to only occur about the given slope.
For rotation, this function is equivalent to constrainToPlane
|
inherited |
Constrain translation to only occur within the plane defined by the given normal, or constrain rotation to only occur about the given normal.
For rotation, this function is equivalent to constrainToLine
|
virtualinherited |
Default method for getting the translation requested by the user.
|
virtualinherited |
Default method for getting the rotation requested by the user.
|
inherited |
Get the Entity that this DragAndDrop is associated with.
|
inherited |
Get the modkey that will be used to toggle rotation for this DnD.
|
inherited |
Get the current rotation option for this DnD.
dart::dynamics::Shape * dart::gui::osg::SimpleFrameShapeDnD::getShape | ( | ) | const |
Get the Shape associated with this DnD.
|
inherited |
Get the SimpleFrame associated with this DnD.
|
overrideprotectedvirtual |
Perform cleanup when the subject is destroyed.
Reimplemented from dart::gui::osg::DragAndDrop.
|
inherited |
Returns the mAmMoving flag.
|
inherited |
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.
Default is true.
|
overridevirtualinherited |
Called to specify how the Entity should be moved.
Implements dart::gui::osg::DragAndDrop.
|
protectedinherited |
Called whenever a Subject is destroyed (or sends out a destruction notification).
Override handleDestructionNotification() in order to customize your class's response to destruction notifications.
|
virtualinherited |
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 in dart::gui::osg::BodyNodeDnD.
|
protectedinherited |
Remove all Subjects from this Observer.
|
protectedinherited |
Remove an Observer from the list of Observers.
|
protectedinherited |
Remove a Subject from this Observer.
|
overridevirtualinherited |
Called when a point gets picked, and is used to save the current state of the Entity.
Implements dart::gui::osg::DragAndDrop.
|
protectedinherited |
Send a destruction notification to all Observers.
This will cause all Observers to behave as if this Subject has been permanently deleted, so it should only be called when that behavior is desired.
|
inherited |
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.
|
inherited |
Set the modkey that will be used to toggle rotation for this DnD.
|
inherited |
Set the option for triggering rotations instead of translations.
|
inherited |
Remove all constraints from the dragging and dropping.
|
overridevirtual |
Called when mouse events are being handled.
Reimplemented from dart::gui::osg::DragAndDrop.
|
protectedinherited |
Whether this DnD is currently moving.
|
protectedinherited |
Whether other objects can block this one from being picked.
|
protectedinherited |
Constraint type for this DnD.
|
protectedinherited |
Pointer to the DnD's Entity.
|
protectedinherited |
SimpleFrame pointer.
|
mutableprotectedinherited |
List of current Observers.
|
protectedinherited |
The location in the world that was picked by the user.
|
protectedinherited |
Point in space about which rotations should happen.
|
protectedinherited |
Modkey for rotation.
|
protectedinherited |
Option for rotation settings.
|
protectedinherited |
The saved rotation of the frame.
|
protected |
Shape associated with this DnD.
|
protectedinherited |
List of current Subjects for this Observer.
|
protectedinherited |
Reference vector for constraint (slope for line constraint, or normal for plane constraint)