124 ALL_AXIS = X_AXIS | Y_AXIS | Z_AXIS
129 const std::string& _name=
"<TranslationTranslationManipulatorNode>" );
143 virtual void setIdentity()
override;
152 void set_direction(
const Vec3d& _directionX,
const Vec3d& _directionY);
155 Vec3d directionX()
const;
157 Vec3d directionY()
const;
159 Vec3d directionZ()
const;
165 set_manipulator_height_ = _size;
166 set_manipulator_radius_ = _size/10.0;
172 double size()
const {
return set_manipulator_height_; }
178 AutoSizeMode
autosize ()
const {
return auto_size_; }
188 activeRotations_ = _active;
197 return activeRotations_;
200 void rotate (
double _angle,
Vec3d _axis)
202 TransformNode::rotate(_angle, _axis);
206 void draw(
GLState& _state,
const DrawModes::DrawMode& _drawMode)
override;
209 void getRenderObjects(
IRenderer* _renderer,
GLState& _state,
const DrawModes::DrawMode& _drawMode,
const Material* _mat)
override;
218 void pick(
GLState& _state, PickTarget _target)
override;
221 virtual void mouseEvent(
GLState& _state, QMouseEvent* _event)
override;
224 void boundingBox(
Vec3d& _bbMin,
Vec3d& _bbMax)
override;
227 void setMode (ManipulatorMode _mode);
263 Vec4f active_target_color_;
264 Vec4f active_current_color_;
265 Vec4f inactive_target_color_;
266 Vec4f inactive_current_color_;
273 void update_manipulator_system(
GLState& _state);
276 void update_rotation(
GLState& _state);
281 void drawManipulator (
GLState& _state,
bool _active);
287 bool mapToCylinder (
GLState& _state,
const Vec2i& _v2, StateUpdates _updateStates = None);
288 bool mapToCylinderTop (
GLState& _state,
const Vec2i& _v2, StateUpdates _updateStates = None);
290 bool mapToSphere (
GLState& _state,
const Vec2i& _v2,
Vec3d& _v3, StateUpdates _updateStates = None);
292 void updateTargetColors ();
293 bool updateCurrentColors (
GLState& _state);
295 double get_screen_length (
const GLState &_state,
const Vec3d &_point)
const;
297 void updateSize (
const GLState& _state);
300 bool draw_manipulator_;
312 double manipulator_radius_;
313 double manipulator_height_;
314 double set_manipulator_radius_;
315 double set_manipulator_height_;
316 int manipulator_slices_;
317 int manipulator_stacks_;
319 bool any_axis_clicked_;
320 bool any_top_clicked_;
321 bool outer_ring_clicked_;
325 bool outer_ring_over_;
329 float resize_current_;
335 Vec3d draggingOrigin3D_;
342 AutoSizeMode auto_size_;
343 double auto_size_length_;