Umasoft
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
vtAnimPath Class Reference

#include <AnimPath.h>

Inheritance diagram for vtAnimPath:

Public Types

enum  InterpMode { LINEAR, CUBIC_SPLINE }
 
typedef std::map< double,
ControlPoint
TimeControlPointMap
 

Public Member Functions

 vtAnimPath (const vtAnimPath &ap)
 
bool SetProjection (const vtProjection &proj)
 Must tell the AnimPath what projection its points are in, for serialization.
 
bool GetMatrix (double time, FMatrix4 &matrix, bool bPosOnly) const
 Get the transformation matrix for a point in time.
 
virtual bool GetInterpolatedControlPoint (double time, ControlPoint &controlPoint) const
 Get the local ControlPoint frame for a point in time.
 
void Insert (double time, const ControlPoint &controlPoint)
 Insert a control point on this path.
 
void RemovePoint (int index)
 Remove a control point from this path, by index.
 
uint GetNumPoints ()
 Return number of control points in this path.
 
void SetTimeFromLinearDistance ()
 
void ProcessPoints ()
 
double GetFirstTime () const
 
double GetLastTime () const
 
double GetPeriod () const
 
float GetTotalTime ()
 
void SetInterpMode (InterpMode mode)
 
InterpMode GetInterpMode () const
 Returns the interpolation mode, either LINEAR or CUBIC_SPLINE.
 
TimeControlPointMap & GetTimeControlPointMap ()
 
const TimeControlPointMap & GetTimeControlPointMap () const
 
void Empty ()
 
bool IsEmpty () const
 
void SetLoop (bool bFlag)
 
bool GetLoop () const
 Return true if interpolation is set to loop back to the first point.
 
bool Write (const char *fname)
 
bool Read (const char *fname)
 
bool CreateFromLineString (const vtProjection &proj, vtFeatureSet *pSet)
 

Protected Member Functions

void InterpolateControlPoints (TimeControlPointMap::const_iterator &a, TimeControlPointMap::const_iterator &b, double time, ControlPoint &c) const
 

Protected Attributes

TimeControlPointMap m_TimeControlPointMap
 
InterpMode m_InterpMode
 
CubicSpline m_Spline
 
bool m_bLoop
 
double m_fLoopSegmentTime
 
ControlPoint m_LoopControlPoint
 
vtProjection m_proj
 
OCT * m_pConvertToWGS
 
OCT * m_pConvertFromWGS
 

Friends

class AnimPathVisitor
 

Detailed Description

An animation path is a series of locations (class ControlPoint) which define a path through space in world coordinates. It is useful to use in conjunction with the vtAnimPathEngine class, which can move any transform (such as scene graph object or camera) along the path.

When this object is serialized to an XML file, the points are transformed to earth coordinates in GCS(WGS84) so that the result is interoperable and terrain-independent.

Member Function Documentation

bool vtAnimPath::Read ( const char *  fname)

Read the animation path from a .vtap file, a simple XML file format.

void vtAnimPath::SetInterpMode ( InterpMode  mode)
inline

Set the interpolation mode, either vtAnimPath::LINEAR or vtAnimPath::CUBIC_SPLINE.

  • LINEAR: the position is interpolated in a straight line between each of the control points.
  • CUBIC_SPLINE: the position is interpolated using a cubic spline, a smooth path which passes directly through each control point.
void vtAnimPath::SetLoop ( bool  bFlag)

If Loop is true, interpolation of the control points will loop back to the first point. Where N is the number of points, normal interpolation is 0,1,2,...,N-1. Loop interpolation is 0,1,2,...,N-1,0. This is like the difference between an open polyline and a closed polygon.

bool vtAnimPath::Write ( const char *  fname)

Write the animation path to a .vtap file, a simple XML file format.


The documentation for this class was generated from the following files: