Choreonoid  1.8
Public Types | Public Member Functions | List of all members
cnoid::PositionDragger Class Reference

#include <PositionDragger.h>

Inheritance diagram for cnoid::PositionDragger:
cnoid::SgPosTransform cnoid::SceneWidgetEventHandler cnoid::SgTransform cnoid::SgGroup cnoid::SgNode cnoid::SgObject cnoid::ClonableReferenced cnoid::Referenced cnoid::CoordinateFrameMarker

Public Types

enum  AxisBit {
  TX = 1 << 0, TY = 1 << 1, TZ = 1 << 2, TranslationAxes = (TX | TY | TZ),
  RX = 1 << 3, RY = 1 << 4, RZ = 1 << 5, RotationAxes = (RX | RY | RZ),
  AllAxes = (TX | TY | TZ | RX | RY | RZ), TRANSLATION_AXES = TranslationAxes, ROTATION_AXES = RotationAxes, ALL_AXES = AllAxes
}
 
enum  HandleType { PositiveOnlyHandle = 0, SymmetricHandle = 1, WideHandle = 2, StandardHandle = PositiveOnlyHandle }
 
enum  DisplayMode { DisplayAlways, DisplayInEditMode, DisplayInFocus, DisplayNever }
 
- Public Types inherited from cnoid::SgGroup
typedef Container::iterator iterator
 
typedef Container::reverse_iterator reverse_iterator
 
typedef Container::const_iterator const_iterator
 
typedef Container::const_reverse_iterator const_reverse_iterator
 
- Public Types inherited from cnoid::SgObject
enum  Attribute {
  Node = 1 << 0, GroupNode = 1 << 1, TransformNode = 1 << 2, Composite = 1 << 3,
  Geometry = 1 << 4, Appearance = 1 << 5, NodeDecoration = 1 << 6, Marker = 1 << 7,
  Operable = 1 << 8, MaxAttributeBit = 9, GroupAttribute = GroupNode, NodeDecorationGroup = NodeDecoration,
  MarkerAttribute = Marker
}
 
typedef std::set< SgObject * > ParentContainer
 
typedef ParentContainer::iterator parentIter
 
typedef ParentContainer::const_iterator const_parentIter
 

Public Member Functions

 PositionDragger (int axes=AllAxes, int handleType=StandardHandle)
 
 PositionDragger (const PositionDragger &org)=delete
 
void setOffset (const Isometry3 &T)
 
void setDraggableAxes (int axisBitSet, SgUpdateRef update)
 
int draggableAxes () const
 
SignalProxy< void(int axisBitSet)> sigDraggableAxesChanged ()
 
double handleSize () const
 
void setHandleSize (double s)
 
void setHandleWidthRatio (double w)
 
double rotationHandleSizeRatio () const
 
void setRotationHandleSizeRatio (double r)
 
void setRadius (double r, double translationAxisRatio=2.0f)
 
double radius () const
 
bool adjustSize ()
 
bool adjustSize (const BoundingBox &bb)
 
void setPixelSize (int length, int width)
 
bool isScreenFixedSizeMode () const
 
void setFixedPixelSizeMode (bool on, double pixelSizeRatio=1.0)
 
bool isFixedPixelSizeMode () const
 
void setTransparency (float t)
 
float transparency () const
 
void setOverlayMode (bool on)
 
bool isOverlayMode () const
 
bool isContainerMode () const
 
void setContainerMode (bool on)
 
void setContentsDragEnabled (bool on)
 
bool isContentsDragEnabled () const
 
DisplayMode displayMode () const
 
void setDisplayMode (DisplayMode mode, SgUpdateRef update=nullptr)
 
void setUndoEnabled (bool on)
 
bool isUndoEnabled () const
 
void storeCurrentPositionToHistory ()
 
bool isDragEnabled () const
 
void setDragEnabled (bool on)
 
bool isDragging () const
 
Isometry3 draggedPosition () const
 
Isometry3 draggingPosition () const
 
Isometry3 globalDraggingPosition () const
 
SignalProxy< void()> sigDragStarted ()
 
SignalProxy< void()> sigPositionDragged ()
 
SignalProxy< void()> sigDragFinished ()
 
virtual void onSceneModeChanged (SceneWidgetEvent *event) override
 
virtual bool onButtonPressEvent (SceneWidgetEvent *event) override
 
virtual bool onButtonReleaseEvent (SceneWidgetEvent *event) override
 
virtual bool onPointerMoveEvent (SceneWidgetEvent *event) override
 
virtual void onPointerLeaveEvent (SceneWidgetEvent *event) override
 
virtual void onFocusChanged (SceneWidgetEvent *event, bool on) override
 
void setDraggerAlwaysShown (bool on, SgUpdateRef update)
 
bool isDraggerAlwaysShown () const
 
void setDraggerAlwaysHidden (bool on, SgUpdateRef update)
 
bool isDraggerAlwaysHidden () const
 
- Public Member Functions inherited from cnoid::SgPosTransform
EIGEN_MAKE_ALIGNED_OPERATOR_NEW SgPosTransform ()
 
 SgPosTransform (const Isometry3 &T)
 
 SgPosTransform (const Affine3 &T)
 
 SgPosTransform (const SgPosTransform &org, CloneMap *cloneMap=nullptr)
 
virtual const BoundingBoxboundingBox () const override
 
virtual void getTransform (Affine3 &out_T) const override
 
Isometry3T ()
 
const Isometry3T () const
 
Isometry3position ()
 
const Isometry3position () const
 
Isometry3::TranslationPart translation ()
 
Isometry3::ConstTranslationPart translation () const
 
Isometry3::LinearPart rotation ()
 
Isometry3::ConstLinearPart rotation () const
 
template<class Scalar , int Mode, int Options>
void setPosition (const Eigen::Transform< Scalar, 3, Mode, Options > &T)
 
template<class Derived >
void setPosition (const Eigen::MatrixBase< Derived > &T)
 
template<class Scalar , int Mode, int Options>
void setTransform (const Eigen::Transform< Scalar, 3, Mode, Options > &T)
 
template<typename Derived >
void setRotation (const Eigen::MatrixBase< Derived > &R)
 
template<typename T >
void setRotation (const Eigen::AngleAxis< T > &aa)
 
template<typename T >
void setRotation (const Eigen::Quaternion< T > &q)
 
template<typename Derived >
void setTranslation (const Eigen::MatrixBase< Derived > &p)
 
- Public Member Functions inherited from cnoid::SgTransform
virtual const BoundingBoxuntransformedBoundingBox () const override
 
- Public Member Functions inherited from cnoid::SgGroup
 SgGroup ()
 
 SgGroup (const SgGroup &org, CloneMap *cloneMap=nullptr)
 
 ~SgGroup ()
 
virtual int numChildObjects () const override
 
virtual SgObjectchildObject (int index) override
 
iterator begin ()
 
iterator end ()
 
const_iterator cbegin ()
 
const_iterator cend ()
 
reverse_iterator rbegin ()
 
reverse_iterator rend ()
 
const_iterator begin () const
 
const_iterator end () const
 
const_reverse_iterator rbegin () const
 
const_reverse_iterator rend () const
 
iterator erase (iterator pos)
 
bool empty () const
 
int numChildren () const
 
SgNodechild (int index)
 
const SgNodechild (int index) const
 
bool contains (SgNode *node) const
 
int findChildIndex (SgNode *child) const
 
template<class NodeType >
NodeType * getChild (int index)
 This throws an exeption when the index is invalid or the type is not matched. More...
 
void addChild (SgNode *node, SgUpdateRef update=nullptr)
 
bool addChildOnce (SgNode *node, SgUpdateRef update=nullptr)
 
void insertChild (int index, SgNode *node, SgUpdateRef update=nullptr)
 
void insertChild (SgNode *nextNode, SgNode *node, SgUpdateRef update=nullptr)
 
void setSingleChild (SgNode *node, SgUpdateRef update=nullptr)
 
iterator removeChild (iterator childIter, SgUpdateRef update=nullptr)
 
bool removeChild (SgNode *node, SgUpdateRef update=nullptr)
 
void removeChildAt (int index, SgUpdateRef update=nullptr)
 
void clearChildren (SgUpdateRef update=nullptr)
 
void copyChildrenTo (SgGroup *group, SgUpdateRef update=nullptr)
 
void moveChildrenTo (SgGroup *group, SgUpdateRef update=nullptr)
 
void insertChild (SgNode *node, int index, SgUpdateRef update=nullptr)
 
SgGroupnextChainedGroup ()
 
void insertChainedGroup (SgGroup *group, SgUpdateRef update=nullptr)
 
void removeChainedGroup (SgGroup *group, SgUpdateRef update=nullptr)
 
template<class NodeType >
NodeType * findNodeOfType (int depth=-1)
 
- Public Member Functions inherited from cnoid::SgNode
 SgNode ()
 
 SgNode (const SgNode &org)
 
 ~SgNode ()
 
int classId () const
 
SgNodecloneNode () const
 
SgNodecloneNode (CloneMap &cloneMap) const
 
SgNodePath findNode (const std::string &name, Affine3 &out_T)
 
void addDecorationReference ()
 
void releaseDecorationReference ()
 
bool isDecoratedSomewhere () const
 
- Public Member Functions inherited from cnoid::SgObject
SgObjectclone () const
 
SgObjectclone (CloneMap &cloneMap) const
 
void setAttribute (int attr)
 
void setAttributes (int attrs)
 
int attributes () const
 
bool hasAttribute (int attr) const
 
bool hasAttributes (int attrs) const
 
const std::string & name () const
 
void setName (const std::string &name)
 
SignalProxy< void(const SgUpdate &update)> sigUpdated ()
 
void notifyUpdate (SgUpdate &update)
 
void notifyUpdate (int action=SgUpdate::Modified)
 
void addParent (SgObject *parent, SgUpdateRef update=nullptr)
 
void removeParent (SgObject *parent)
 
int numParents () const
 
bool hasParents () const
 
const_parentIter parentBegin () const
 
const_parentIter parentEnd () const
 
SignalProxy< void(bool on)> sigGraphConnection ()
 
bool hasValidBoundingBoxCache () const
 
void invalidateBoundingBox ()
 
void setBoundingBoxCacheReady () const
 
bool hasUri () const
 
const std::string & uri () const
 
bool hasAbsoluteUri () const
 
const std::string & absoluteUri () const
 
bool hasUriFragment () const
 
const std::string & uriFragment () const
 
void setUriByFilePathAndBaseDirectory (const std::string &filePath, const std::string &baseDirectory)
 
void setUriByFilePathAndCurrentDirectory (const std::string &filePath)
 
void setUri (const std::string &uri, const std::string &absoluteUri)
 
void setUriFragment (const std::string &fragment)
 
void clearUri ()
 
bool isNode () const
 
SgNodetoNode ()
 
bool isGroupNode () const
 
SgGrouptoGroupNode ()
 
bool isTransformNode () const
 
SgTransformtoTransformNode ()
 
- Public Member Functions inherited from cnoid::Referenced
virtual ~Referenced ()
 
- Public Member Functions inherited from cnoid::SceneWidgetEventHandler
virtual bool onDoubleClickEvent (SceneWidgetEvent *event)
 
virtual bool onScrollEvent (SceneWidgetEvent *event)
 
virtual bool onKeyPressEvent (SceneWidgetEvent *event)
 
virtual bool onKeyReleaseEvent (SceneWidgetEvent *event)
 
virtual bool onContextMenuRequest (SceneWidgetEvent *event, MenuManager *menu)
 
virtual void onSceneModeChanged (const SceneWidgetEvent &event)
 
virtual bool onButtonPressEvent (const SceneWidgetEvent &event)
 
virtual bool onButtonReleaseEvent (const SceneWidgetEvent &event)
 
virtual bool onDoubleClickEvent (const SceneWidgetEvent &event)
 
virtual bool onPointerMoveEvent (const SceneWidgetEvent &event)
 
virtual void onPointerLeaveEvent (const SceneWidgetEvent &event)
 
virtual bool onScrollEvent (const SceneWidgetEvent &event)
 
virtual bool onKeyPressEvent (const SceneWidgetEvent &event)
 
virtual bool onKeyReleaseEvent (const SceneWidgetEvent &event)
 
virtual void onFocusChanged (const SceneWidgetEvent &event, bool on)
 
virtual bool onContextMenuRequest (const SceneWidgetEvent &event, MenuManager &menu)
 
virtual bool onUndoRequest ()
 
virtual bool onRedoRequest ()
 

Additional Inherited Members

- Static Public Member Functions inherited from cnoid::SgNode
static int findClassId (const std::type_info &nodeType)
 
template<class NodeType >
static int findClassId ()
 
template<class NodeType >
static int findPolymorphicId ()
 
- Static Public Member Functions inherited from cnoid::SgObject
static bool checkNonNodeCloning (const CloneMap &cloneMap)
 
static void setNonNodeCloning (CloneMap &cloneMap, bool on)
 
- Protected Member Functions inherited from cnoid::SgPosTransform
 SgPosTransform (int classId)
 
virtual ReferenceddoClone (CloneMap *cloneMap) const override
 
- Protected Member Functions inherited from cnoid::SgTransform
 SgTransform (int classId)
 
 SgTransform (const SgTransform &org, CloneMap *cloneMap=nullptr)
 
- Protected Member Functions inherited from cnoid::SgGroup
 SgGroup (int classId)
 
- Protected Member Functions inherited from cnoid::SgNode
 SgNode (int classId)
 
- Protected Member Functions inherited from cnoid::SgObject
 SgObject ()
 
 SgObject (const SgObject &org)
 
void notifyUpperNodesOfUpdate (SgUpdate &update)
 
void notifyUpperNodesOfUpdate (SgUpdate &update, bool doInvalidateBoundingBox)
 
- Protected Member Functions inherited from cnoid::Referenced
 Referenced ()
 
 Referenced (const Referenced &)
 
int refCount () const
 
- Protected Attributes inherited from cnoid::SgTransform
BoundingBox untransformedBboxCache
 
- Protected Attributes inherited from cnoid::SgGroup
BoundingBox bboxCache
 

Member Enumeration Documentation

◆ AxisBit

Enumerator
TX 
TY 
TZ 
TranslationAxes 
RX 
RY 
RZ 
RotationAxes 
AllAxes 
TRANSLATION_AXES 
ROTATION_AXES 
ALL_AXES 

◆ DisplayMode

Enumerator
DisplayAlways 
DisplayInEditMode 
DisplayInFocus 
DisplayNever 

◆ HandleType

Enumerator
PositiveOnlyHandle 
SymmetricHandle 
WideHandle 
StandardHandle 

Constructor & Destructor Documentation

◆ PositionDragger() [1/2]

PositionDragger::PositionDragger ( int  axes = AllAxes,
int  handleType = StandardHandle 
)

◆ PositionDragger() [2/2]

cnoid::PositionDragger::PositionDragger ( const PositionDragger org)
delete

Member Function Documentation

◆ adjustSize() [1/2]

bool PositionDragger::adjustSize ( )

◆ adjustSize() [2/2]

bool PositionDragger::adjustSize ( const BoundingBox bb)

◆ displayMode()

PositionDragger::DisplayMode PositionDragger::displayMode ( ) const

◆ draggableAxes()

int PositionDragger::draggableAxes ( ) const

◆ draggedPosition()

Isometry3 cnoid::PositionDragger::draggedPosition ( ) const
inline

◆ draggingPosition()

Isometry3 PositionDragger::draggingPosition ( ) const

◆ globalDraggingPosition()

Isometry3 PositionDragger::globalDraggingPosition ( ) const

◆ handleSize()

double PositionDragger::handleSize ( ) const

◆ isContainerMode()

bool PositionDragger::isContainerMode ( ) const

◆ isContentsDragEnabled()

bool PositionDragger::isContentsDragEnabled ( ) const

◆ isDragEnabled()

bool PositionDragger::isDragEnabled ( ) const

◆ isDraggerAlwaysHidden()

bool PositionDragger::isDraggerAlwaysHidden ( ) const

◆ isDraggerAlwaysShown()

bool PositionDragger::isDraggerAlwaysShown ( ) const

◆ isDragging()

bool PositionDragger::isDragging ( ) const

◆ isFixedPixelSizeMode()

bool PositionDragger::isFixedPixelSizeMode ( ) const
Deprecated:
Use isScreenFixedSizeMode.

◆ isOverlayMode()

bool PositionDragger::isOverlayMode ( ) const

◆ isScreenFixedSizeMode()

bool PositionDragger::isScreenFixedSizeMode ( ) const
Note
The unit of the parameters is meter.

◆ isUndoEnabled()

bool PositionDragger::isUndoEnabled ( ) const

◆ onButtonPressEvent()

bool PositionDragger::onButtonPressEvent ( SceneWidgetEvent event)
overridevirtual

Reimplemented from cnoid::SceneWidgetEventHandler.

◆ onButtonReleaseEvent()

bool PositionDragger::onButtonReleaseEvent ( SceneWidgetEvent event)
overridevirtual

Reimplemented from cnoid::SceneWidgetEventHandler.

◆ onFocusChanged()

void PositionDragger::onFocusChanged ( SceneWidgetEvent event,
bool  on 
)
overridevirtual

Reimplemented from cnoid::SceneWidgetEventHandler.

◆ onPointerLeaveEvent()

void PositionDragger::onPointerLeaveEvent ( SceneWidgetEvent event)
overridevirtual

Reimplemented from cnoid::SceneWidgetEventHandler.

◆ onPointerMoveEvent()

bool PositionDragger::onPointerMoveEvent ( SceneWidgetEvent event)
overridevirtual

Reimplemented from cnoid::SceneWidgetEventHandler.

◆ onSceneModeChanged()

void PositionDragger::onSceneModeChanged ( SceneWidgetEvent event)
overridevirtual

Reimplemented from cnoid::SceneWidgetEventHandler.

◆ radius()

double PositionDragger::radius ( ) const

◆ rotationHandleSizeRatio()

double PositionDragger::rotationHandleSizeRatio ( ) const

◆ setContainerMode()

void PositionDragger::setContainerMode ( bool  on)

◆ setContentsDragEnabled()

void PositionDragger::setContentsDragEnabled ( bool  on)

◆ setDisplayMode()

void PositionDragger::setDisplayMode ( DisplayMode  mode,
SgUpdateRef  update = nullptr 
)

◆ setDragEnabled()

void PositionDragger::setDragEnabled ( bool  on)

◆ setDraggableAxes()

void PositionDragger::setDraggableAxes ( int  axisBitSet,
SgUpdateRef  update 
)

◆ setDraggerAlwaysHidden()

void PositionDragger::setDraggerAlwaysHidden ( bool  on,
SgUpdateRef  update 
)

◆ setDraggerAlwaysShown()

void PositionDragger::setDraggerAlwaysShown ( bool  on,
SgUpdateRef  update 
)

◆ setFixedPixelSizeMode()

void PositionDragger::setFixedPixelSizeMode ( bool  on,
double  pixelSizeRatio = 1.0 
)
Deprecated:
Use setPixelSize.

◆ setHandleSize()

void PositionDragger::setHandleSize ( double  s)

◆ setHandleWidthRatio()

void PositionDragger::setHandleWidthRatio ( double  w)

◆ setOffset()

void PositionDragger::setOffset ( const Isometry3 T)
Parameters
TLocal position from the virtual origin to the dragger central position

◆ setOverlayMode()

void PositionDragger::setOverlayMode ( bool  on)

◆ setPixelSize()

void PositionDragger::setPixelSize ( int  length,
int  width 
)

◆ setRadius()

void PositionDragger::setRadius ( double  r,
double  translationAxisRatio = 2.0f 
)

◆ setRotationHandleSizeRatio()

void PositionDragger::setRotationHandleSizeRatio ( double  r)

◆ setTransparency()

void PositionDragger::setTransparency ( float  t)

◆ setUndoEnabled()

void PositionDragger::setUndoEnabled ( bool  on)

◆ sigDragFinished()

SignalProxy< void()> PositionDragger::sigDragFinished ( )

◆ sigDraggableAxesChanged()

SignalProxy< void(int axisSet)> PositionDragger::sigDraggableAxesChanged ( )

◆ sigDragStarted()

SignalProxy< void()> PositionDragger::sigDragStarted ( )

◆ sigPositionDragged()

SignalProxy< void()> PositionDragger::sigPositionDragged ( )

◆ storeCurrentPositionToHistory()

void PositionDragger::storeCurrentPositionToHistory ( )

◆ transparency()

float PositionDragger::transparency ( ) const

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