53 #ifndef ACG_TRANSLATIONMANIPULATOR_NODE_HH
54 #define ACG_TRANSLATIONMANIPULATOR_NODE_HH
60 #include "BaseNode.hh"
61 #include "TransformNode.hh"
65 #include <QMouseEvent>
67 #include <ACG/GL/GLPrimitives.hh>
73 namespace SceneGraph {
118 ALL_AXIS = X_AXIS | Y_AXIS | Z_AXIS
123 const std::string& _name=
"<TranslationTranslationManipulatorNode>" );
137 virtual void setIdentity();
146 void set_direction(
const Vec3d& _directionX,
const Vec3d& _directionY);
149 Vec3d directionX()
const;
151 Vec3d directionY()
const;
153 Vec3d directionZ()
const;
156 void set_size(
double _size) { set_manipulator_height_ = _size;
157 set_manipulator_radius_ = _size/10.0;
161 double size()
const {
return set_manipulator_height_; }
167 AutoSizeMode
autosize ()
const {
return auto_size_; }
177 activeRotations_ = _active;
186 return activeRotations_;
189 void rotate (
double _angle,
Vec3d _axis)
195 void draw(
GLState& _state,
const DrawModes::DrawMode& _drawMode);
204 virtual void mouseEvent(
GLState& _state, QMouseEvent* _event);
207 void boundingBox(
Vec3d& _bbMin,
Vec3d& _bbMax);
210 void setMode (ManipulatorMode _mode);
242 Vec4f active_target_color_;
243 Vec4f active_current_color_;
244 Vec4f inactive_target_color_;
245 Vec4f inactive_current_color_;
252 void update_manipulator_system(
GLState& _state);
255 void update_rotation(
GLState& _state);
260 void drawManipulator (
GLState& _state,
bool _active);
262 bool mapToCylinder (
GLState& _state,
const Vec2i& _v2,
double& axis_hit, StateUpdates _updateStates =
None);
263 bool mapToCylinderTop (
GLState& _state,
const Vec2i& _v2,
double& axis_hit, StateUpdates _updateStates =
None);
267 void updateTargetColors ();
268 bool updateCurrentColors (
GLState& _state);
270 double get_screen_length (
GLState& _state,
Vec3d& _point)
const;
272 void updateSize (
GLState& _state);
275 bool draw_manipulator_;
285 double manipulator_radius_;
286 double manipulator_height_;
287 double set_manipulator_radius_;
288 double set_manipulator_height_;
289 int manipulator_slices_;
290 int manipulator_stacks_;
292 bool any_axis_clicked_;
293 bool any_top_clicked_;
294 bool outer_ring_clicked_;
298 bool outer_ring_over_;
302 float resize_current_;
308 Vec3d draggingOrigin3D_;
315 AutoSizeMode auto_size_;
316 double auto_size_length_;
326 #endif // ACG_TRANSLATIONMANIPULATOR_NODE_HH defined