iCub-main
Loading...
Searching...
No Matches
icub-main
src
tools
iCubGui
src
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
24
class
BVHNodeROOT
:
public
BVHNodeXYZ_RPY
25
{
26
public
:
27
BVHNodeROOT
(
const
QString&
name
,
int
enc,
double
x
,
double
y
,
double
z
,
iCubMesh
* mesh,
ObjectsManager
* objManager)
28
:
BVHNodeXYZ_RPY
(
name
,
x
,
y
,
z
)
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
{
69
mObjectsManager
->
update
();
70
mObjectsManager
->
drawRootObjects
();
71
}
72
73
glPopMatrix();
74
// world coordinates
75
76
if
(
mObjectsManager
)
mObjectsManager
->
drawWorldObjects
();
77
}
78
79
protected
:
80
ObjectsManager
*
mObjectsManager
;
81
};
82
83
#endif
bvhnoderpy_xyz.h
BVHNodeROOT
Definition
bvhnoderoot.h:25
BVHNodeROOT::mObjectsManager
ObjectsManager * mObjectsManager
Definition
bvhnoderoot.h:80
BVHNodeROOT::drawJoint
virtual void drawJoint()
Definition
bvhnoderoot.h:35
BVHNodeROOT::draw
virtual void draw(double *encoders, BVHNode *pSelected)
Definition
bvhnoderoot.h:37
BVHNodeROOT::BVHNodeROOT
BVHNodeROOT(const QString &name, int enc, double x, double y, double z, iCubMesh *mesh, ObjectsManager *objManager)
Definition
bvhnoderoot.h:27
BVHNodeXYZ_RPY
Definition
bvhnoderpy_xyz.h:24
BVHNodeXYZ_RPY::dY
double dY
Definition
bvhnoderpy_xyz.h:64
BVHNodeXYZ_RPY::dX
double dX
Definition
bvhnoderpy_xyz.h:64
BVHNodeXYZ_RPY::dZ
double dZ
Definition
bvhnoderpy_xyz.h:64
BVHNode
Definition
bvhnode.h:192
BVHNode::pMesh
iCubMesh * pMesh
Definition
bvhnode.h:286
BVHNode::nEnc
int nEnc
Definition
bvhnode.h:285
BVHNode::name
const QString & name() const
Definition
bvhnode.h:221
BVHNode::drawArrows
void drawArrows()
Definition
bvhnode.h:265
BVHNode::children
QList< BVHNode * > children
Definition
bvhnode.h:283
ObjectsManager
Definition
objectsthread.h:41
ObjectsManager::drawWorldObjects
void drawWorldObjects()
Definition
objectsthread.h:163
ObjectsManager::drawRootObjects
void drawRootObjects()
Definition
objectsthread.h:150
ObjectsManager::update
void update()
Definition
objectsthread.h:130
iCubMesh
Definition
mesh.h:54
iCubMesh::Draw
void Draw()
Definition
mesh.h:187
x
x
Definition
compute_ekf_sym.m:21
objectsthread.h
z
z
Definition
show_eyes_axes.m:22
y
y
Definition
show_eyes_axes.m:21
Generated on Wed Dec 18 2024 16:34:48 for iCub-main by
1.9.8