00001 00002 00003 00004 00005 // ChangeLog 00006 // May 20, 2005 - Bruno de Oliveira Schneider 00007 // - Added some documentation. 00008 // - SetAductionTo is now SetAdductionTo (fixed spelling, kept old name for compatibility). 00009 // Jan 10, 2005 - Bruno de Oliveira Schneider 00010 // - Fixed DoxyGen class description. 00011 // - Removed previously commented constructors. 00012 // Oct 07, 2004 - Bruno de Oliveira Schneider 00013 // - Code typing has been cleaned. Doxygen documentation started. 00014 // - Removed "#include <stdio.h>" from implementation file. 00015 // - Removed 'vp' preffix of every method name. 00016 // - Reimplemented "AddDof(VPDof*)" according to changes in VPDof and VPJoint. 00017 // - Commented out old constructors because they leak memory and because of changes 00018 // in VPJoint and VPDof. 00019 // Jan 15, 2001 - Anderson Maciel 00020 // - Class and new methods declaration. 00021 // Jan 16, 2000 - Anderson Maciel 00022 // - Methods implementation. 00023 00024 #include "vpbiaxialjoint.h" 00025 #include <cassert> 00026 00027 using namespace std; 00028 00029 VPBiaxialJoint::VPBiaxialJoint() 00030 { 00031 } 00032 00033 VPBiaxialJoint::~VPBiaxialJoint() 00034 { 00035 //? Perhaps we need to call VPJoint::~VPJoint to delete all DOFs. 00036 //~ cout << "VPBiaxialJoint::~VPBiaxialJoint()" << endl; 00037 } 00038 00039 void VPBiaxialJoint::SetFlexionTo(float value) 00040 { 00041 VPDof* ptrFirstDof = dofList.front(); 00042 ptrFirstDof->MoveTo(value); 00043 } 00044 00045 void VPBiaxialJoint::SetAductionTo(float value) 00046 { 00047 cerr << "Warning: VPBiaxialJoint::SetAductionTo is deprecated.\n"; 00048 SetAdductionTo(value); 00049 } 00050 00051 void VPBiaxialJoint::SetAdductionTo(float value) 00052 { 00053 assert(GetNumDofs() == 2); 00054 list<VPDof*>::iterator iter = dofList.begin(); 00055 ++iter; 00056 VPDof* ptrSecondDof = *iter; 00057 ptrSecondDof->MoveTo(value); 00058 } 00059 00060 void VPBiaxialJoint::Adduct(float variance) 00061 { 00062 assert(GetNumDofs() == 2); 00063 list<VPDof*>::iterator iter = dofList.begin(); 00064 ++iter; 00065 VPDof* ptrSecondDof = *iter; 00066 ptrSecondDof->Move(variance); 00067 } 00068 00069 void VPBiaxialJoint::AddDof(VPDof* dof) 00070 { 00071 assert(GetNumDofs() < 2); 00072 VPJoint::AddDof(dof); 00073 // If the second DOF was added, the joint should be made ready for use. 00074 if (GetNumDofs() == 2) MakeLim(); 00075 }