24#include <OpenGL/glu.h>
27#if defined(WIN32) || defined(WIN64)
42#include <yarp/os/Network.h>
43#include <yarp/os/BufferedPort.h>
44#include <yarp/os/Bottle.h>
45#include <yarp/os/Time.h>
50 ForceArrow(
double x,
double y,
double z,
double f,
double fx,
double fy,
double fz,
double mx,
double my,
double mz)
52 static const double dRad2Deg=180.0/
M_PI;
75 fth=dRad2Deg*atan2(a,fz);
94 double m=mx*mx+my*my+mz*mz;
108 double a=mx*mx+my*my;
113 mth=dRad2Deg*atan2(a,mz);
127 gluQuadricDrawStyle(
cyl=gluNewQuadric(),GLU_FILL);
131 if (
cyl) gluDeleteQuadric(
cyl);
141 glColor4f(1.0f,0.0f,0.0f,1.0f);
144 glTranslated(0.0,0.0,-20.0);
145 glutSolidCone(5.0,20.0,16,4);
146 glTranslated(0.0,0.0,-
fm);
154 glColor4f(0.0f,0.0f,1.0f,1.0f);
157 glTranslated(0.0,0.0,-20.0);
158 glutSolidCone(5.0,20.0,16,4);
159 glTranslated(0.0,0.0,-
mm);
165 static void setParams(
double fg,
double ft,
double tg,
double tt)
202 gluQuadricDrawStyle(
cyl,GLU_FILL);
208 for(
int i=0; i<
children.count(); ++i)
214 gluDeleteQuadric(
cyl);
237 virtual void setSliders(QSlider *rx,QSlider *ry,QSlider *rz,QSlider *px,QSlider *py,QSlider *pz){}
246 for (
int a=0; a<(int)
mArrows.size(); ++a)
257 glTranslated(0.0,0.0,-12.7);
258 gluDisk(
cyl,0.0,10.16,16,16);
259 gluCylinder(
cyl,10.16,10.16,25.4,16,16);
260 glTranslated(0.0,0.0,25.4);
261 gluDisk(
cyl,0.0,10.16,16,16);
262 glTranslated(0.0,0.0,-12.7);
267 for (
int a=0; a<(int)
mArrows.size(); ++a)
virtual void draw(double *encoders, BVHNode *pSelected)=0
void addChild(BVHNode *pChild)
void setName(const QString &name)
BVHNode(const QString &name, int enc=-1, iCubMesh *mesh=0)
virtual void setSliders(QSlider *rx, QSlider *ry, QSlider *rz, QSlider *px, QSlider *py, QSlider *pz)
const QString & name() const
QList< BVHNode * > children
void addArrow(ForceArrow *pArrow)
std::vector< ForceArrow * > mArrows
static void setParams(double fg, double ft, double tg, double tt)
ForceArrow(double x, double y, double z, double f, double fx, double fy, double fz, double mx, double my, double mz)
static double mTorqueGain