My Project
parameterSamples.h
1 #ifndef PARAMETER_SAMPLES_INCLUDED
2 #define PARAMETER_SAMPLES_INCLUDED
3 
4 enum{
5  LINEAR,
6  CATMULL_ROM,
7  UNIFORM_CUBIC_B_SPLINE
8 };
11 public:
13  virtual int set(int count)=0;
16  virtual void setCurrentValue(double t,int type=LINEAR)=0;
17 };
22 template <class Vector>
24 public:
26  Vector* samples;
28  int count;
30  Vector currentValue;
31 
32  ParameterSamples(void);
33  ~ParameterSamples(void);
35  int set(int count);
37  Vector& operator[] (int i);
40  void setCurrentValue(double t,int type=LINEAR);
41 };
42 
43 
44 
45 template <class Vector>
47  samples=NULL;
48  count=0;
49 }
50 template <class Vector>
52  if(samples){delete[] samples;}
53  samples=NULL;
54  count=0;
55 }
56 template <class Vector>
58  if(samples){delete[] samples;}
59  samples=NULL;
60  count=0;
61 
62  if(c<=0){return 1;}
63  samples=new Vector[c];
64  if(!samples){return 0;}
65  count=c;
66  return 1;
67 }
68 
69 template <class Vector>
70 Vector& ParameterSamples<Vector>::operator [] (int i){return samples[i];}
71 
72 #include "parameterSamples.todo.inl"
73 
74 #endif //PARAMETER_SAMPLES_INCLUDED
Vector * samples
Definition: parameterSamples.h:26
Definition: parameterSamples.h:23
Definition: parameterSamples.h:10
virtual void setCurrentValue(double t, int type=LINEAR)=0
Vector & operator[](int i)
Definition: parameterSamples.h:70
int count
Definition: parameterSamples.h:28
int set(int count)
Definition: parameterSamples.h:57
Vector currentValue
Definition: parameterSamples.h:30