Assignments Assignments

keyFrames.h
Go to the documentation of this file.
1#ifndef KEY_FILE_INCLUDED
2#define KEY_FILE_INCLUDED
3
4#include <vector>
5#include <string>
6#include <Util/geometry.h>
7#include <Util/interpolation.h>
8
9 namespace Ray
10{
12 template< typename DataType >
13 class KeyFrameEvaluator
14 {
15 public:
17 virtual ~KeyFrameEvaluator( void );
18
20 virtual DataType evaluate( unsigned int dof , double t , int curveType ) = 0;
21 };
22
24 template< typename DataType >
25 class KeyFrameData
26 {
27 template< typename _DataType > friend std::ostream &operator << ( std::ostream & , const KeyFrameData<_DataType> & );
28 template< typename _DataType > friend std::istream &operator >> ( std::istream & , KeyFrameData<_DataType> & );
29 template< typename _DataType , typename ParameterType > friend class KeyFrameParameters;
30
32 float _duration;
33
35 std::vector< std::string > _dofNames;
36
38 std::vector< std::vector< DataType > > _data;
39
41 std::vector< DataType > _currentValues;
42
44 KeyFrameEvaluator< DataType > *_keyFrameEvaluator;
45 public:
47 KeyFrameData( void );
48
50 ~KeyFrameData( void );
51
53 float duration( void ) const;
54
56 int keyframes( void ) const;
57
59 int dofs( void ) const;
60
62 const DataType &current( const std::string &dofName ) const;
63
65 template< typename ParameterType >
66 void setEvaluator( void );
67
69 void setCurrentValues( double t , int curveType );
70 };
71
73 template< typename DataType > std::ostream &operator << ( std::ostream &stream , const KeyFrameData< DataType > &keyFrameData );
74
76 template< typename DataType > std::istream &operator >> ( std::istream &stream , KeyFrameData< DataType > &keyFrameData );
77
79 typedef KeyFrameData< Util::Matrix4D > KeyFrameMatrices;
80
89 template< typename DataType , typename ParameterType >
90 class KeyFrameParameters : public KeyFrameEvaluator< DataType >
91 {
93 std::vector< std::vector< ParameterType > > _parameters;
94 public:
96 KeyFrameParameters( const KeyFrameData< DataType > &data );
97
99 // KeyFrameEvaluator methods //
101 DataType evaluate( unsigned int dof , double t , int curveType );
102 };
103}
104#include "keyFrames.inl"
105#endif // KEY_FILE_INCLUDED
Ray::KeyFrameData
Definition keyFrames.h:26
Ray::KeyFrameData::_dofNames
std::vector< std::string > _dofNames
Definition keyFrames.h:35
Ray::KeyFrameData::_duration
float _duration
Definition keyFrames.h:32
Ray::KeyFrameData::_keyFrameEvaluator
KeyFrameEvaluator< DataType > * _keyFrameEvaluator
Definition keyFrames.h:44
Ray::KeyFrameData::current
const DataType & current(const std::string &dofName) const
Definition keyFrames.inl:28
Ray::KeyFrameData::_currentValues
std::vector< DataType > _currentValues
Definition keyFrames.h:41
Ray::KeyFrameData::operator>>
friend std::istream & operator>>(std::istream &, KeyFrameData< _DataType > &)
Ray::KeyFrameData::~KeyFrameData
~KeyFrameData(void)
Definition keyFrames.inl:16
Ray::KeyFrameData::operator<<
friend std::ostream & operator<<(std::ostream &, const KeyFrameData< _DataType > &)
Ray::KeyFrameData::setCurrentValues
void setCurrentValues(double t, int curveType)
Definition keyFrames.inl:44
Ray::KeyFrameData::duration
float duration(void) const
Definition keyFrames.inl:19
Ray::KeyFrameData::_data
std::vector< std::vector< DataType > > _data
Definition keyFrames.h:38
Ray::KeyFrameData::KeyFrameData
KeyFrameData(void)
Definition keyFrames.inl:13
Ray::KeyFrameData::dofs
int dofs(void) const
Definition keyFrames.inl:25
Ray::KeyFrameData::keyframes
int keyframes(void) const
Definition keyFrames.inl:22
Ray::KeyFrameData::setEvaluator
void setEvaluator(void)
Definition keyFrames.inl:37
Ray::KeyFrameEvaluator
Definition keyFrames.h:14
Ray::KeyFrameEvaluator::~KeyFrameEvaluator
virtual ~KeyFrameEvaluator(void)
Definition keyFrames.inl:7
Ray::KeyFrameEvaluator::evaluate
virtual DataType evaluate(unsigned int dof, double t, int curveType)=0
Ray::KeyFrameParameters
Definition keyFrames.h:91
Ray::KeyFrameParameters::evaluate
DataType evaluate(unsigned int dof, double t, int curveType)
Definition keyFrames.inl:113
Ray::KeyFrameParameters::_parameters
std::vector< std::vector< ParameterType > > _parameters
Definition keyFrames.h:93
Ray::KeyFrameParameters::KeyFrameParameters
KeyFrameParameters(const KeyFrameData< DataType > &data)
Definition keyFrames.inl:96
geometry.h
interpolation.h
data
JSAMPIMAGE data
Definition jpeglib.h:945
keyFrames.inl
Ray
Definition box.h:7
Ray::KeyFrameMatrices
KeyFrameData< Util::Matrix4D > KeyFrameMatrices
Definition keyFrames.h:79
Ray::operator>>
std::istream & operator>>(std::istream &stream, Camera &camera)
Definition camera.cpp:15
Ray::operator<<
std::ostream & operator<<(std::ostream &stream, const Camera &camera)
Definition camera.cpp:25