iCub-main
bvhnoderoot.h
Go to the documentation of this file.
1 /*
2  * bvhnoderoot.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 BVHNODEROOT_H
19 #define BVHNODEROOT_H
20 
21 #include "bvhnoderpy_xyz.h"
22 #include "objectsthread.h"
23 
25 {
26 public:
27  BVHNodeROOT(const QString& name,int enc,double x,double y,double z,iCubMesh* mesh,ObjectsManager* objManager)
29  {
30  nEnc=enc;
31  pMesh=mesh;
32  mObjectsManager=objManager;
33  }
34 
35  virtual void drawJoint(){}
36 
37  virtual void draw(double *encoders,BVHNode *pSelected)
38  {
39  // world coordinates
40  glPushMatrix();
41 
42  glTranslated(dX+encoders[nEnc+3],dY+encoders[nEnc+4],dZ+encoders[nEnc+5]);
43 
44  glRotated(encoders[nEnc+2],0.0,0.0,1.0); // yaw
45  glRotated(encoders[nEnc+1],0.0,1.0,0.0); // pitch
46  glRotated(encoders[nEnc ],1.0,0.0,0.0); // roll
47 
48  // root coordinates
49  glPushMatrix();
50 
51  if (pMesh)
52  {
53  glColor4f(0.9,0.8,0.7,1.0);
54  pMesh->Draw();
55  }
56 
57  drawArrows();
58 
59  for (int i=0; i<children.count(); ++i)
60  {
61  children[i]->draw(encoders,pSelected);
62  }
63 
64  glPopMatrix();
65  // root coordinates
66 
67  if (mObjectsManager)
68  {
71  }
72 
73  glPopMatrix();
74  // world coordinates
75 
77  }
78 
79 protected:
81 };
82 
83 #endif
ObjectsManager * mObjectsManager
Definition: bvhnoderoot.h:80
virtual void drawJoint()
Definition: bvhnoderoot.h:35
virtual void draw(double *encoders, BVHNode *pSelected)
Definition: bvhnoderoot.h:37
BVHNodeROOT(const QString &name, int enc, double x, double y, double z, iCubMesh *mesh, ObjectsManager *objManager)
Definition: bvhnoderoot.h:27
const QString & name() const
Definition: bvhnode.h:221
iCubMesh * pMesh
Definition: bvhnode.h:286
int nEnc
Definition: bvhnode.h:285
void drawArrows()
Definition: bvhnode.h:265
QList< BVHNode * > children
Definition: bvhnode.h:283
void drawWorldObjects()
void drawRootObjects()
Definition: mesh.h:54
void Draw()
Definition: mesh.h:187