5 #ifndef CNOID_BASE_POSITION_DRAGGER_H
6 #define CNOID_BASE_POSITION_DRAGGER_H
9 #include "exportdecl.h"
17 TX = 1 << 0, TY = 1 << 1, TZ = 1 << 2,
18 TranslationAxes = (TX | TY | TZ),
19 RX = 1 << 3, RY = 1 << 4, RZ = 1 << 5,
20 RotationAxes = (RX | RY | RZ),
21 AllAxes = (TX | TY | TZ | RX | RY | RZ),
24 TRANSLATION_AXES = TranslationAxes,
25 ROTATION_AXES = RotationAxes,
31 PositiveOnlyHandle = 1,
41 void setDraggableAxes(
int axisBitSet,
SgUpdateRef update);
42 int draggableAxes()
const;
43 SignalProxy<void(
int axisBitSet)> sigDraggableAxesChanged();
45 double handleSize()
const;
46 void setHandleSize(
double s);
47 void setHandleWidthRatio(
double w);
49 double rotationHandleSizeRatio()
const;
50 void setRotationHandleSizeRatio(
double r);
52 [[deprecated(
"Use setHandleSize and setRotationHandlerSizeRatio")]]
53 void setRadius(
double r,
double translationAxisRatio = 2.0f);
54 [[deprecated(
"Use handleSize")]]
55 double radius()
const;
60 void setPixelSize(
int length,
int width);
67 void setScreenFixedSize(
double length,
double width);
69 bool isScreenFixedSizeMode()
const;
71 [[deprecated(
"Use setFixedPixelSize")]]
72 void setFixedPixelSizeMode(
bool on,
double pixelSizeRatio = 1.0);
73 [[deprecated(
"Use isFixedScreenSizeMode")]]
74 bool isFixedPixelSizeMode()
const;
76 void setTransparency(
float t);
77 float transparency()
const;
79 void setOverlayMode(
bool on);
80 bool isOverlayMode()
const;
82 bool isContainerMode()
const;
83 void setContainerMode(
bool on);
85 void setContentsDragEnabled(
bool on);
86 bool isContentsDragEnabled()
const;
88 enum DisplayMode { DisplayAlways, DisplayInEditMode, DisplayInFocus, DisplayNever };
89 DisplayMode displayMode()
const;
90 void setDisplayMode(DisplayMode mode,
SgUpdateRef update =
nullptr);
92 [[deprecated(
"This function does nothing.")]]
93 void setUndoEnabled(
bool on);
94 [[deprecated(
"This function always returns false.")]]
95 bool isUndoEnabled()
const;
96 [[deprecated(
"This function does nothing.")]]
97 void storeCurrentPositionToHistory();
99 bool isDragEnabled()
const;
100 void setDragEnabled(
bool on);
101 bool isDragging()
const;
103 [[deprecated(
"Use globalDraggingPosition to get the global coordinate, or "
104 "draggingPosition to get the local position in the parent node coordinate.")]]
108 Isometry3 globalDraggingPosition()
const;
122 [[deprecated(
"Use setDisplayMode.")]]
123 void setDraggerAlwaysShown(
bool on,
SgUpdateRef update);
124 [[deprecated(
"Use displayMode.")]]
125 bool isDraggerAlwaysShown()
const;
126 [[deprecated(
"Use setDisplayMode.")]]
127 void setDraggerAlwaysHidden(
bool on,
SgUpdateRef update);
128 [[deprecated(
"Use displayMode.")]]
129 bool isDraggerAlwaysHidden()
const;