#include <VertexRotationHandle.h>
Inheritance diagram for Track::EditAssist::VertexRotationHandle:
Public Types | |
DIR_UP = 0 | |
+z direction | |
DIR_FORWARD = 1 | |
+y direction | |
enum | Direction { DIR_UP = 0, DIR_FORWARD = 1 } |
Directions from centre point. More... | |
Public Member Functions | |
VertexRotationHandle (std::size_t vertex_id, Direction direction=DIR_FORWARD) | |
Create for indicating a direction at a vertex. | |
virtual boost::shared_ptr< Document::DocumentDelta > | make_delta (btVector3 position) const |
Make a DocumentDelta performing the rotation. | |
void | update_angle (btQuaternion angle) |
Update the angle of the vertex. | |
virtual void | draw () const |
Draw the control point for the editor. | |
Protected Attributes | |
std::size_t | vertex_id |
The name of the associated vertex. | |
Direction | direction |
Which direction the handle represents. | |
btQuaternion | rotation |
The current angle of the vertex. |
Definition at line 24 of file VertexRotationHandle.h.
Track::EditAssist::VertexRotationHandle::VertexRotationHandle | ( | std::size_t | vertex_id, | |
Direction | direction = DIR_FORWARD | |||
) |
Create for indicating a direction at a vertex.
vertex_id | The name of the vertex to associate with. | |
direction | The direction to indicate. |
Definition at line 31 of file VertexRotationHandle.cpp.
void Track::EditAssist::VertexRotationHandle::draw | ( | ) | const [virtual] |
Draw the control point for the editor.
May draw additional lines to show bounds or to indicate what it relates to.
Uses OpenGL commands. It expects the modelview matrix to translate points from world space. Point and line primitives may be drawn. After calling, the current OpenGL colour could be anything.
Reimplemented from Track::EditAssist::RotationHandle.
Definition at line 116 of file VertexRotationHandle.cpp.
boost::shared_ptr< Document::DocumentDelta > Track::EditAssist::VertexRotationHandle::make_delta | ( | btVector3 | position | ) | const [virtual] |
Make a DocumentDelta performing the rotation.
The rotation is picked to keep the angle as close as it can be to its current value while moving the VertexRotationHandle to the requested position.
position | The desired new location of the vertex. This should have been generated by Snap(). |
Implements Track::EditAssist::Dragable.
Definition at line 38 of file VertexRotationHandle.cpp.
void Track::EditAssist::VertexRotationHandle::update_angle | ( | btQuaternion | angle | ) |
Update the angle of the vertex.
This must be called for make_delta() to work. This will automatically update the position to reflect the angle, centre, and length.
angle | The new angle of the vertex. |
Definition at line 106 of file VertexRotationHandle.cpp.
btQuaternion Track::EditAssist::VertexRotationHandle::rotation [protected] |
std::size_t Track::EditAssist::VertexRotationHandle::vertex_id [protected] |
Generated at Mon Sep 6 00:41:19 2010 by Doxygen version 1.4.7 for Racer version svn335.