Track::EditAssist::VertexRotationHandle Class Reference

#include <VertexRotationHandle.h>

Inheritance diagram for Track::EditAssist::VertexRotationHandle:

Track::EditAssist::RotationHandle Track::EditAssist::ControlPoint Track::EditAssist::Dragable Track::EditAssist::Selectable List of all members.

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.

Detailed Description

Definition at line 24 of file VertexRotationHandle.h.


Member Enumeration Documentation

enum Track::EditAssist::VertexRotationHandle::Direction

Directions from centre point.

Enumerator:
DIR_UP  +z direction
DIR_FORWARD  +y direction

Definition at line 29 of file VertexRotationHandle.h.


Constructor & Destructor Documentation

Track::EditAssist::VertexRotationHandle::VertexRotationHandle ( std::size_t  vertex_id,
Direction  direction = DIR_FORWARD 
)

Create for indicating a direction at a vertex.

Parameters:
vertex_id The name of the vertex to associate with.
direction The direction to indicate.

Definition at line 31 of file VertexRotationHandle.cpp.


Member Function Documentation

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.

Parameters:
position The desired new location of the vertex. This should have been generated by Snap().
Returns:
shared pointer to a new DocumentDelta that rotates the associated vertex to the most appropriate angle.

Todo:
In 180 degree case use another handle's direction?

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.

Parameters:
angle The new angle of the vertex.

Definition at line 106 of file VertexRotationHandle.cpp.


Member Data Documentation

Direction Track::EditAssist::VertexRotationHandle::direction [protected]

Which direction the handle represents.

Definition at line 65 of file VertexRotationHandle.h.

btQuaternion Track::EditAssist::VertexRotationHandle::rotation [protected]

The current angle of the vertex.

Definition at line 67 of file VertexRotationHandle.h.

std::size_t Track::EditAssist::VertexRotationHandle::vertex_id [protected]

The name of the associated vertex.

Definition at line 63 of file VertexRotationHandle.h.


The documentation for this class was generated from the following files:
Get Racer at SourceForge.net. Fast, secure and Free Open Source software downloads

Generated at Mon Sep 6 00:41:19 2010 by Doxygen version 1.4.7 for Racer version svn335.