60 #ifndef ACG_TRANSLATIONMANIPULATOR_NODE_HH 61 #define ACG_TRANSLATIONMANIPULATOR_NODE_HH 67 #include "BaseNode.hh" 68 #include "TransformNode.hh" 72 #include <QMouseEvent> 74 #include <ACG/GL/GLPrimitives.hh> 125 ALL_AXIS = X_AXIS | Y_AXIS | Z_AXIS
130 const std::string& _name=
"<TranslationTranslationManipulatorNode>" );
144 virtual void setIdentity();
153 void set_direction(
const Vec3d& _directionX,
const Vec3d& _directionY);
156 Vec3d directionX()
const;
158 Vec3d directionY()
const;
160 Vec3d directionZ()
const;
166 set_manipulator_height_ = _size;
167 set_manipulator_radius_ = _size/10.0;
173 double size()
const {
return set_manipulator_height_; }
179 AutoSizeMode
autosize ()
const {
return auto_size_; }
189 activeRotations_ = _active;
198 return activeRotations_;
201 void rotate (
double _angle,
Vec3d _axis)
222 virtual void mouseEvent(
GLState& _state, QMouseEvent* _event);
225 void boundingBox(
Vec3d& _bbMin,
Vec3d& _bbMax);
264 Vec4f active_target_color_;
265 Vec4f active_current_color_;
266 Vec4f inactive_target_color_;
267 Vec4f inactive_current_color_;
274 void update_manipulator_system(
GLState& _state);
277 void update_rotation(
GLState& _state);
282 void drawManipulator (
GLState& _state,
bool _active);
288 bool mapToCylinder (
GLState& _state,
const Vec2i& _v2, StateUpdates _updateStates =
None);
289 bool mapToCylinderTop (
GLState& _state,
const Vec2i& _v2, StateUpdates _updateStates =
None);
293 void updateTargetColors ();
294 bool updateCurrentColors (
GLState& _state);
296 double get_screen_length (
GLState& _state,
Vec3d& _point)
const;
298 void updateSize (
GLState& _state);
301 bool draw_manipulator_;
313 double manipulator_radius_;
314 double manipulator_height_;
315 double set_manipulator_radius_;
316 double set_manipulator_height_;
317 int manipulator_slices_;
318 int manipulator_stacks_;
320 bool any_axis_clicked_;
321 bool any_top_clicked_;
322 bool outer_ring_clicked_;
326 bool outer_ring_over_;
330 float resize_current_;
336 Vec3d draggingOrigin3D_;
343 AutoSizeMode auto_size_;
344 double auto_size_length_;
354 #endif // ACG_TRANSLATIONMANIPULATOR_NODE_HH defined
void enable_rotations(ActiveRotations _active)
Enable or disable manipulator handles for specific orientations.
void set_draw_cylinder(bool _b)
set draw_cylinder_
PickTarget
What target to use for picking.
ActiveRotations
enum to define which rotation axis should be enabled
Clear all attribute bits.
ManipulatorMode
enum to define the manipulator mode
bool draw_manipulator() const
get drawCylinder
bool touched_
stores if this manipulator was used in order to avoid emitting manipulatorMoved unnecessarily ...
Namespace providing different geometric functions concerning angles.
AutoSizeMode autosize() const
get autosize mode
void rotate(double _angle, const Vec3d &_axis)
void set_size(double _size)
set cylindersize (height + radius). _size parameter has to be greater than zero
Interface class between scenegraph and renderer.
double size() const
get cylindersize
ActiveRotations enabled_rotations() const
Get the current setting, which rotation handles are active.
void set_autosize(AutoSizeMode _mode)
set auto size mode