iCub-main
bvhnoderpy_xyz.h
Go to the documentation of this file.
1 /*
2  * bvhnoderpy_xyz.h
3  */
4 
5 /*
6  * Copyright (C) 2009 RobotCub Consortium
7  * Author: Alessandro Scalzo alessandro.scalzo@iit.it
8  * CopyPolicy: Released under the terms of the GNU GPL v2.0.
9  *
10  * Based on:
11  *
12  * Qavimator
13  * Copyright (C) 2006 by Zi Ree *
14  * Zi Ree @ SecondLife *
15  * Released under the terms of the GNU GPL v2.0.
16  */
17 
18 #ifndef BVHNODERPY_XYZ_H
19 #define BVHNODERPY_XYZ_H
20 
21 #include "bvhnode.h"
22 
23 class BVHNodeXYZ_RPY : public BVHNode
24 {
25 public:
26  BVHNodeXYZ_RPY(const QString& name,double x,double y,double z,double yaw=0.0,double pitch=0.0,double roll=0.0)
27  : BVHNode(name,-1,NULL)
28  {
29  dX=x; dY=y; dZ=z;
30 
31  dYaw=yaw; dPitch=pitch; dRoll=roll;
32  }
33 
34  virtual void draw(double *encoders,BVHNode *pSelected)
35  {
36  glPushMatrix();
37 
38  glTranslated(dX,dY,dZ);
39 
40  glColor4f(0.5,0.5,0.5,1.0);
41  glLineWidth(3.0);
42  glBegin(GL_LINES);
43  glVertex3d(0.0,0.0,0.0);
44  glVertex3d(-dX,-dY,-dZ);
45  glEnd();
46 
47  glRotated(dYaw, 0.0,0.0,1.0);
48  glRotated(dPitch,0.0,1.0,0.0);
49  glRotated(dRoll, 1.0,0.0,0.0);
50 
51  glColor4f(0.5,0.5,0.5,1.0);
52 
53  drawJoint();
54 
55  for(int i=0; i<children.count(); ++i)
56  {
57  children[i]->draw(encoders,pSelected);
58  }
59 
60  glPopMatrix();
61  }
62 
63 protected:
64  double dX,dY,dZ;
65  double dYaw,dPitch,dRoll;
66 };
67 
68 #endif
virtual void draw(double *encoders, BVHNode *pSelected)
BVHNodeXYZ_RPY(const QString &name, double x, double y, double z, double yaw=0.0, double pitch=0.0, double roll=0.0)
const QString & name() const
Definition: bvhnode.h:221
virtual void drawJoint()
Definition: bvhnode.h:255
QList< BVHNode * > children
Definition: bvhnode.h:283