Biomechanical Joint Model
 Author: Anderson Maciel

comemodifier.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2001 by Anderson Maciel                                 *
00003  *   andi.maciel@gmail.com                                                 *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  **************************************************************************/
00020 
00022 //
00023 //  PROJECT.....: 
00024 //  RESPONSIBLE.: 
00025 //
00026 //  FILE........: COME_Modifier.cpp
00027 //  DESCRIPTION.: Contain the COME_Modifier class hierarchy declarations.
00028 //
00029 //  AUTHOR......: Anderson Maciel
00030 //  DATE........: 28/February/2001
00031 //  DESCRIPTION.: Classes declaration.
00032 //
00034 
00035 #include        <kinematics/comemodifier.h>
00036 #include        <kinematics/comedof.h>
00037 #include        <stdio.h>
00038 
00039 COME_Modifier::COME_Modifier(){
00040         dofList = NULL;
00041         maxPonderatorList = NULL;
00042         minPonderatorList = NULL;
00043         numDofs = 0;
00044 }
00045 
00046 
00047 COME_Modifier::COME_Modifier( COME_Dof **dofs, COME_Curve *mins, COME_Curve *maxs, int numD ){
00048         dofList = dofs;
00049         maxPonderatorList = maxs;
00050         minPonderatorList = mins;
00051         numDofs = numD;
00052 }
00053 
00054 
00055 COME_Modifier::~COME_Modifier(){
00056         
00057         if( dofList != NULL ) delete [] dofList;
00058         if( minPonderatorList != NULL ) delete [] minPonderatorList;
00059         if( maxPonderatorList != NULL ) delete [] maxPonderatorList;
00060 
00061 }
00062 
00063 COME_Curve*
00064 COME_Modifier::getMinPonderatorList(){
00065         return minPonderatorList;
00066 }
00067                 
00068 COME_Curve*
00069 COME_Modifier::getMaxPonderatorList(){
00070         return maxPonderatorList;
00071 }
00072 
00073 float
00074 COME_Modifier::getMin(){
00075 
00076         float min = MINANG;
00077         for( int ind = 0; ind < numDofs; ind++ ){
00078                 // Use getpointaspoit from bezier
00079                 float aux = ( ((COME_Bezier*)&(minPonderatorList[ ind ]))->getPointAsPoint( dofList[ind]->getCurrent() ) ).getY();
00080                 if( aux > min ) min = aux;
00081         }
00082         return min;
00083 }
00084 
00085 
00086 float
00087 COME_Modifier::getMax(){
00088 
00089         float max = MAXANG;
00090         for( int ind = 0; ind < numDofs; ind++ ){
00091                 // Use getpointaspoit from bezier
00092                 float aux = ( ((COME_Bezier*)&(maxPonderatorList[ ind ]))->getPointAsPoint( dofList[ind]->getCurrent() ) ).getY();
00093                 if( aux < max ) max = aux;
00094         }
00095         return max;
00096 }
00097 

Generated on Thu Dec 1 10:13:34 2005 for COME - Biomechanical Joint Model by  doxygen 1.4.5