Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

vpmodifier.cpp

Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 // ChangeLog
00006 // Oct 08, 2004 - Bruno de Oliveira Schneider
00007 // - Code typing has been cleaned. DoxyGen documentation started.
00008 // - Removed "vp" prefix from every method name.
00009 // - Minor changes to "GetMin" and "GetMax" because of changes in VPCurve/VPBezier.
00010 // Feb 28, 2001 - Anderson Maciel
00011 // - Classes declaration.
00012 // Feb 08, 2001 - Anderson Maciel
00013 // - Classes declaration.
00014 
00015 #include "vpmodifier.h"
00016 #include "vpdof.h"
00017 
00018 VPModifier::VPModifier() {
00019     dofList = NULL;
00020     maxPonderatorList = NULL;
00021     minPonderatorList = NULL;
00022     numDofs = 0;
00023 }
00024 
00025 VPModifier::VPModifier( VPDof **dofs, VPCurve *mins, VPCurve *maxs, int numD ) {
00026     dofList = dofs;
00027     maxPonderatorList = maxs;
00028     minPonderatorList = mins;
00029     numDofs = numD;
00030 }
00031 
00032 VPModifier::~VPModifier() {
00033     if( dofList != NULL ) delete [] dofList;
00034     if( minPonderatorList != NULL ) delete [] minPonderatorList;
00035     if( maxPonderatorList != NULL ) delete [] maxPonderatorList;
00036 }
00037 
00038 VPCurve*
00039 VPModifier::GetMinPonderatorList() {
00040     return minPonderatorList;
00041 }
00042 
00043 VPCurve*
00044 VPModifier::GetMaxPonderatorList() {
00045     return maxPonderatorList;
00046 }
00047 
00048 float
00049 VPModifier::GetMin() {
00050     VPBezier* ptrMinPonderator;
00051     VPPoint4D ponderatorPoint;
00052     float aux;
00053     float min = MINANG;
00054     for( int ind = 0; ind < numDofs; ind++ ) {
00055         ptrMinPonderator = dynamic_cast<VPBezier*>(&(minPonderatorList[ind]));
00056         ptrMinPonderator->GetPoint(dofList[ind]->GetCurrent(), &ponderatorPoint);
00057         aux = ponderatorPoint.GetY();
00058         if( aux > min ) min = aux;
00059     }
00060     return min;
00061 }
00062 
00063 float
00064 VPModifier::GetMax() {
00065     VPBezier* ptrMaxPonderator;
00066     VPPoint4D ponderatorPoint;
00067     float aux;
00068     float max = MAXANG;
00069     for( int ind = 0; ind < numDofs; ind++ ) {
00070         ptrMaxPonderator = dynamic_cast<VPBezier*>(&(maxPonderatorList[ind]));
00071         ptrMaxPonderator->GetPoint(dofList[ind]->GetCurrent(), &ponderatorPoint);
00072         aux = ponderatorPoint.GetY();
00073         if( aux < max ) max = aux;
00074     }
00075     return max;
00076 }

Generated on Tue Sep 6 10:00:05 2005 for VPAT by  doxygen 1.4.4