33 #ifndef DART_GUI_OSG_DRAGANDDROP_HPP_ 34 #define DART_GUI_OSG_DRAGANDDROP_HPP_ 38 #include <Eigen/Geometry> 40 #include "dart/common/sub_ptr.hpp" 41 #include "dart/dynamics/Entity.hpp" 42 #include "dart/dynamics/Shape.hpp" 43 #include "DefaultEventHandler.hpp" 55 class InteractiveFrame;
62 enum class RotationOption : int
81 virtual void update();
85 void setObstructable(
bool _obstructable);
90 bool isObstructable()
const;
93 virtual void move() = 0;
97 virtual void saveState() = 0;
101 virtual void release();
104 virtual Eigen::Vector3d getConstrainedDx()
const;
107 virtual Eigen::AngleAxisd getConstrainedRotation()
const;
115 void constrainToLine(
const Eigen::Vector3d& slope);
120 void constrainToPlane(
const Eigen::Vector3d& normal);
123 bool isMoving()
const;
126 void setRotationOption(RotationOption option);
129 RotationOption getRotationOption()
const;
132 void setRotationModKey(::osgGA::GUIEventAdapter::ModKeyMask rotationModKey);
135 ::osgGA::GUIEventAdapter::ModKeyMask getRotationModKey()
const;
139 void handleDestructionNotification(
189 void move()
override;
192 void saveState()
override;
222 void update()
override;
226 void handleDestructionNotification(
247 void update()
override;
250 void move()
override;
253 void saveState()
override;
271 bool useExternalIK =
true,
272 bool useWholeBody =
false);
281 void update()
override;
284 void move()
override;
287 void saveState()
override;
290 void release()
override;
296 void useExternalIK(
bool external);
299 bool isUsingExternalIK()
const;
302 void useWholeBody(
bool wholeBody);
305 bool isUsingWholeBody()
const;
308 void setPreserveOrientationModKey(
309 ::osgGA::GUIEventAdapter::ModKeyMask modkey);
312 ::osgGA::GUIEventAdapter::ModKeyMask getPreserveOrientationModKey()
const;
315 void setJointRestrictionModKey(::osgGA::GUIEventAdapter::ModKeyMask modkey);
318 ::osgGA::GUIEventAdapter::ModKeyMask getJointRestrictionModKey()
const;
325 dart::dynamics::InverseKinematicsPtr
mIK;
358 #endif // DART_GUI_OSG_DRAGANDDROP_HPP_ Eigen::Vector3d mVector
Reference vector for constraint (slope for line constraint, or normal for plane constraint) ...
Definition: DragAndDrop.hpp:153
The Subject class is a base class for any object that wants to report when it gets destroyed...
Definition: Subject.hpp:57
DragAndDrop is a class that facilitates enabling various kinds of dart Entities to be dragged and dro...
Definition: DragAndDrop.hpp:59
dart::dynamics::Shape * mShape
Shape associated with this DnD.
Definition: DragAndDrop.hpp:230
Eigen::AngleAxisd mSavedRotation
The saved rotation of the frame.
Definition: DragAndDrop.hpp:199
bool mUseExternalIK
Whether to use an external IK.
Definition: DragAndDrop.hpp:339
Eigen::AngleAxisd mSavedRotation
The rotation of the BodyNode.
Definition: DragAndDrop.hpp:336
Definition: InteractiveFrame.hpp:109
bool mAmMoving
Whether this DnD is currently moving.
Definition: DragAndDrop.hpp:165
::osgGA::GUIEventAdapter::ModKeyMask mPreserveOrientationModKey
Key for preserving orientation.
Definition: DragAndDrop.hpp:345
Entity class is a base class for any objects that exist in the kinematic tree structure of DART...
Definition: Entity.hpp:60
::osgGA::GUIEventAdapter::ModKeyMask mJointRestrictionModKey
Key for restricting joint usage.
Definition: DragAndDrop.hpp:348
Definition: test_Signal.cpp:68
std::vector< DragAndDrop * > mDnDs
Vector of DnD components that are united under this DnD.
Definition: DragAndDrop.hpp:257
Definition: Aspect.cpp:40
Definition: DragAndDrop.hpp:234
ConstraintType mConstraintType
Constraint type for this DnD.
Definition: DragAndDrop.hpp:159
Definition: DragAndDrop.hpp:264
dart::dynamics::InverseKinematicsPtr mIK
The IK module being used by this DnD.
Definition: DragAndDrop.hpp:325
Viewer * mViewer
Pointer to the DnD's Viewer.
Definition: DragAndDrop.hpp:143
BodyNode class represents a single node of the skeleton.
Definition: BodyNode.hpp:74
std::size_t mAdditionalBodyNodes
Currently unused, but this will change in the future.
Definition: DragAndDrop.hpp:351
Eigen::Vector3d mPivot
Point in space about which rotations should happen.
Definition: DragAndDrop.hpp:156
dart::dynamics::Entity * mEntity
Pointer to the DnD's Entity.
Definition: DragAndDrop.hpp:146
RotationOption mRotationOption
Option for rotation settings.
Definition: DragAndDrop.hpp:168
bool mAmObstructable
Whether other objects can block this one from being picked.
Definition: DragAndDrop.hpp:162
bool mUseWholeBody
Whether to use the whole body.
Definition: DragAndDrop.hpp:342
dart::dynamics::SimpleFrame * mFrame
SimpleFrame pointer.
Definition: DragAndDrop.hpp:196
SimpleFrameShapeDnD is a version of SimpleFrameDnD that allows a specific Shape within the SimpleFram...
Definition: DragAndDrop.hpp:206
InteractiveFrame * mInteractiveFrame
Pointer to the interactive frame.
Definition: DragAndDrop.hpp:260
::osgGA::GUIEventAdapter::ModKeyMask mRotationModKey
Modkey for rotation.
Definition: DragAndDrop.hpp:171
Eigen::Vector3d mPickedPosition
The location in the world that was picked by the user.
Definition: DragAndDrop.hpp:149
dart::dynamics::WeakBodyNodePtr mBodyNode
The BodyNode associated with this DnD.
Definition: DragAndDrop.hpp:322
Definition: Viewer.hpp:111
Eigen::Vector3d mSavedGlobalOffset
The offset of the pick from the BodyNode origin, expressed in global coordinates. ...
Definition: DragAndDrop.hpp:329
SimpleFrameDnD is a DragAndDrop implementation for SimpleFrame objects.
Definition: DragAndDrop.hpp:176
The Observer class should be inherited by any class that wants to respond in a customized way to the ...
Definition: Observer.hpp:51
Eigen::Vector3d mSavedLocalOffset
The offset of the pick from the BodyNode origin, expressed in local coordinates.
Definition: DragAndDrop.hpp:333
The SimpleFrame class offers a user-friendly way of creating arbitrary Frames within the kinematic tr...
Definition: SimpleFrame.hpp:51