V-ART
modifier.cpp
Go to the documentation of this file.
1 
5 #include "vart/modifier.h"
6 #include "vart/dof.h"
7 
9  dofList = NULL;
10  maxPonderatorList = NULL;
11  minPonderatorList = NULL;
12  numDofs = 0;
13 }
14 
15 VART::Modifier::Modifier( VART::Dof **dofs, VART::Curve *mins, VART::Curve *maxs, int numD ) {
16  dofList = dofs;
17  maxPonderatorList = maxs;
18  minPonderatorList = mins;
19  numDofs = numD;
20 }
21 
23  if( dofList != NULL ) delete [] dofList;
24  if( minPonderatorList != NULL ) delete [] minPonderatorList;
25  if( maxPonderatorList != NULL ) delete [] maxPonderatorList;
26 }
27 
29  return minPonderatorList;
30 }
31 
33  return maxPonderatorList;
34 }
35 
37  VART::Bezier* ptrMinPonderator;
38  VART::Point4D ponderatorPoint;
39  float aux;
40  float min = -7; // FixMe: It seems this is just an odd initialization (-7 = 2 * -PI)
41  for( int ind = 0; ind < numDofs; ind++ ) {
42  ptrMinPonderator = dynamic_cast<VART::Bezier*>(&(minPonderatorList[ind]));
43  ptrMinPonderator->GetPoint(dofList[ind]->GetCurrent(), &ponderatorPoint);
44  aux = ponderatorPoint.GetY(); // why GetY?
45  if( aux > min ) min = aux;
46  }
47  return min;
48 }
49 
51  VART::Bezier* ptrMaxPonderator;
52  VART::Point4D ponderatorPoint;
53  float aux;
54  float max = 7; // FixMe: It seems this is just an odd initialization (7 = 2 * PI)
55  for( int ind = 0; ind < numDofs; ind++ ) {
56  ptrMaxPonderator = dynamic_cast<VART::Bezier*>(&(maxPonderatorList[ind]));
57  ptrMaxPonderator->GetPoint(dofList[ind]->GetCurrent(), &ponderatorPoint);
58  aux = ponderatorPoint.GetY();
59  if( aux < max ) max = aux;
60  }
61  return max;
62 }
Header file for V-ART class "Dof".
Points and vectors using homogeneous coordinates.
Definition: point4d.h:22
float GetMin()
Definition: modifier.cpp:36
double GetY() const
Definition: point4d.h:79
A paramteric curve in 3D/4D space.
Definition: curve.h:18
A Bezier curve.
Definition: bezier.h:16
Header file for V-ART class "Modifier".
Curve * GetMaxPonderatorList()
Definition: modifier.cpp:32
float GetMax()
Definition: modifier.cpp:50
Curve * GetMinPonderatorList()
Definition: modifier.cpp:28
Degree Of Freedom - basic component of a Joint.
Definition: dof.h:28
virtual void GetPoint(double t, Point4D *result)
Returns a point of the curve.
Definition: bezier.cpp:28