V-ART
uniaxialjoint.cpp
Go to the documentation of this file.
1 
5 #include "vart/uniaxialjoint.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::UniaxialJoint(*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 
44 // virtual
45 VART::Dof* VART::UniaxialJoint::AddDof(const Point4D& vec, const Point4D& pos, float min, float max)
46 {
47  assert(GetNumDofs() == 0);
48  Dof* result = Joint::AddDof(vec, pos, min, max);
49  MakeLim();
50  return result;
51 }
52 
53 // virtual
55 {
56  assert(GetNumDofs() == 0);
57  Joint::AddDof(dof);
58  MakeLim();
59 }
A joint with one rotational degrees of freedom.
Definition: uniaxialjoint.h:16
Base class for objects that compose a scene graph.
Definition: scenenode.h:25
UniaxialJoint()
Creates an uninitialized biaxial (1 DOF) joint.
void SetFlexionTo(float value)
Sets the first DOF.
Representation of joints.
Definition: joint.h:34
Points and vectors using homogeneous coordinates.
Definition: point4d.h:22
VART::UniaxialJoint & operator=(const VART::UniaxialJoint &joint)
Copies all data of an UniaxialJoint to another.
virtual VART::SceneNode * Copy()
Returns a copy of an Joint. Every derived class must reimplements this method, to avoid errors with V...
Header file for V-ART class "UniaxialJoint".
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
void MoveTo(float pos)
Sets DOF's current position.
Definition: dof.cpp:257
virtual void AddDof(Dof *dof)
Add a DOF to the joint.
Degree Of Freedom - basic component of a Joint.
Definition: dof.h:28