V-ART
biaxialjoint.cpp
Go to the documentation of this file.
1 
5 #include "vart/biaxialjoint.h"
6 #include <cassert>
7 
8 using namespace std;
9 
11 {
12 }
13 
15 {
16  this->operator=(joint);
17 }
18 
20 {
21  this->Joint::operator=(joint);
22  return *this;
23 }
24 
26 {
27  VART::Joint * copy;
28 
29  copy = new VART::BiaxialJoint(*this);
30  copy->CopyDofListFrom(*this);
31  return copy;
32 }
33 
35 {
36 }
37 
39 {
40  VART::Dof* ptrFirstDof = dofList.front();
41  ptrFirstDof->MoveTo(value);
42 }
43 
45 {
46  cerr << "Warning: VART::BiaxialJoint::SetAductionTo is deprecated.\n";
47  SetAdductionTo(value);
48 }
49 
51 {
52  assert(GetNumDofs() == 2);
53  list<VART::Dof*>::iterator iter = dofList.begin();
54  ++iter;
55  VART::Dof* ptrSecondDof = *iter;
56  ptrSecondDof->MoveTo(value);
57 }
58 
59 void VART::BiaxialJoint::Adduct(float variance)
60 {
61  assert(GetNumDofs() == 2);
62  list<VART::Dof*>::iterator iter = dofList.begin();
63  ++iter;
64  VART::Dof* ptrSecondDof = *iter;
65  ptrSecondDof->Move(variance);
66 }
67 
69 {
70  assert(GetNumDofs() < 2);
72  // If the second DOF was added, the joint should be made ready for use.
73  if (GetNumDofs() == 2) MakeLim();
74 }
void SetAductionTo(float value)
Sets the second DOF.
VART::BiaxialJoint & operator=(const VART::BiaxialJoint &joint)
Base class for objects that compose a scene graph.
Definition: scenenode.h:25
Representation of joints.
Definition: joint.h:34
void SetFlexionTo(float value)
Sets the first DOF.
virtual VART::SceneNode * Copy()
Returns a copy of an biaxialJoint. Every derived class must reimplements this method, to avoid errors with VART::SceneNode::RecursiveCopy.
void Adduct(float variance)
Moves the second DOF.
virtual Dof * AddDof(const Point4D &vec, const Point4D &pos, float min, float max)
Adds a Dof.
Definition: joint.cpp:69
Header file for V-ART class "BiaxialJoint".
A joint with two rotational degrees of freedom.
Definition: biaxialjoint.h:16
virtual void CopyDofListFrom(VART::Joint &joint)
Copy the dofList atribute from an joint, setting the ownerJoint atribute of copied dof to 'this' join...
Definition: joint.cpp:37
virtual ~BiaxialJoint()
void MoveTo(float pos)
Sets DOF's current position.
Definition: dof.cpp:257
void Move(float variance)
Changes DOF.
Definition: dof.h:99
void SetAdductionTo(float value)
Sets the second DOF.
Degree Of Freedom - basic component of a Joint.
Definition: dof.h:28
void AddDof(Dof *dof)
Add a DOF to the joint.
BiaxialJoint()
Creates an uninitialized biaxial (2 DOFs) joint.