39 std::list<Dof*>::iterator iter;
43 for( iter = joint.
dofList.begin(); iter != joint.
dofList.end(); iter++ )
54 list<VART::Dof*>::iterator iter;
55 for (iter = dofList.begin(); iter != dofList.end(); ++iter)
57 if ((*iter)->autoDelete)
64 this->Transform::operator=(j);
71 Dof* dofPtr =
new Dof(vec, pos, min, max);
73 dofList.push_back(dofPtr);
79 dofList.push_back(dof);
87 list<VART::Dof*>::reverse_iterator iter = dofList.rbegin();
90 (*iter)->GetLim(
this);
92 while (iter != dofList.rend())
95 (*iter)->ApplyTransformTo(
this);
102 assert(static_cast<int>(dofList.size()) > dof);
103 list<VART::Dof*>::const_iterator iter = dofList.begin();
105 while (position < dof)
119 list<Dof*>::iterator iter = dofList.begin();
120 while (iter != dofList.end())
122 dofListPtr->push_back(*iter);
129 list<Dof*>::const_iterator iter = dofList.begin();
130 unsigned int dofIndex = 0;
132 while ((iter != dofList.end()) && (*iter != dofPtr))
137 assert(iter != dofList.end());
138 return static_cast<DofID>(dofIndex);
143 list<VART::Dof*>::iterator iter;
144 for(iter = dofList.begin(); iter != dofList.end(); ++iter)
150 unsigned int dofNum =
static_cast<unsigned int>(dof);
152 if (dofNum < dofList.size())
154 list<VART::Dof*>::iterator iter = dofList.begin();
160 (*iter)->Move(variance);
169 return static_cast<unsigned int>(dof) < dofList.size();
177 list<VART::SceneNode*>::const_iterator iter;
178 list<VART::Dof*>::const_iterator dofIter;
183 for (dofIter = dofList.begin(); dofIter != dofList.end(); ++dofIter)
185 glMultMatrixd((*dofIter)->GetLim().GetData());
186 GetMaterial(i).DrawOGL();
187 (*dofIter)->DrawInstanceOGL();
190 for (iter = childList.begin(); iter != childList.end(); ++iter)
191 result &= (*iter)->DrawOGL();
216 #endif // VISUAL_JOINTS
221 list<Dof*>::const_iterator dofIter = dofList.begin();
222 list<SceneNode*>::const_iterator iter = childList.begin();
223 string indentStr(indent,
' ');
225 os << indentStr <<
"<joint description=\"" << description <<
"\" type=\"";
226 switch (GetNumDofs())
238 while (dofIter != dofList.end())
240 (*dofIter)->XmlPrintOn(os, indent+2);
243 if (recursivePrinting)
244 while (iter != childList.end())
246 (*iter)->XmlPrintOn(os, indent+2);
249 os << indentStr <<
"</joint>\n";
261 output <<
"ADDUCTION";
274 if (buffer ==
"FLEXION")
278 if (buffer ==
"ADDUCTION")
282 if (buffer ==
"TWIST")
285 input.setstate(ios_base::failbit);
const Joint & operator=(const Joint &j)
std::istream & operator>>(std::istream &input, Joint::DofID &dofId)
Base class for objects that compose a scene graph.
static const Color & RED()
Red opaque color.
Header file for V-ART class "Dof".
Representation of joints.
static const Color & BLUE()
Blue opaque color.
Points and vectors using homogeneous coordinates.
std::list< Dof * > dofList
static const Color & GREEN()
Green opaque color.
std::ostream & operator<<(std::ostream &output, const Joint::DofID &dofId)
bool HasDof(DofID dof)
Checks whether a DOF exists in the joint.
void SetOwnerJoint(Joint *ow)
void MakeLim()
Updates the LIM, based on DOFs' situation.
bool MoveDof(DofID dof, float variance)
Moves a joint's DOF.
Header file for V-ART class "Joint".
virtual Dof * AddDof(const Point4D &vec, const Point4D &pos, float min, float max)
Adds a Dof.
virtual void CopyDofListFrom(VART::Joint &joint)
Copy the dofList atribute from an joint, setting the ownerJoint atribute of copied dof to 'this' join...
Material properties for graphical objects.
void SetAtRest()
Put the joint in a rest position.
virtual VART::SceneNode * Copy()
Returns a copy of a Joint. Every derived class must reimplement this method, to avoid errors with VAR...
void GetDofs(std::list< Dof * > *dofListPtr)
Returns all DOFs.
Joint()
Creates an uninitialized joint.
DofID GetDofID(const Dof *dofPtr) const
Returns the DofID of some member Dof.
const Dof & GetDof(DofID dof) const
Returns a joint's DOF.
Degree Of Freedom - basic component of a Joint.
virtual void XmlPrintOn(std::ostream &os, unsigned int indent) const
Outputs XML representation of the scene.