22 #include <yarp/os/Time.h>
25 #include <OpenGL/glu.h>
26 #include <GLUT/glut.h>
41 GuiObj(std::string& name,
int r,
int g,
int b,
double alpha)
44 mR=double(r)/255.0;
mG=double(g)/255.0;
mB=double(b)/255.0;
57 void printw(
float x,
float y,
float z,
const char* text)
59 glDisable(GL_LIGHTING);
61 for (
int i=0; text[i]!=
'\0'; ++i)
63 glutBitmapCharacter(GLUT_BITMAP_9_BY_15,text[i]);
65 glEnable(GL_LIGHTING);
75 TrajectoryObj(std::string name,std::string label,
int bufflen,
double persistence,
int r,
int g,
int b,
double alpha,GLfloat width,
bool world)
95 void set(std::string& label,
int bufflen,
double persistence,
int r,
int g,
int b,
double alpha,
double width)
100 mR=double(r)/255.0;
mG=double(g)/255.0;
mB=double(b)/255.0;
105 double *tX=
new double[bufflen];
106 double *tY=
new double[bufflen];
107 double *tZ=
new double[bufflen];
108 double *tT=
new double[bufflen];
112 for (
int i=0; i<
n; ++
n)
158 double now=yarp::os::Time::now();
160 glBegin(GL_LINE_STRIP);
168 for (
int i=0; i<
mIndex; ++i)
204 double dimx,
double dimy,
double dimz,
205 double posx,
double posy,
double posz,
206 double rotx,
double roty,
double rotz,
207 int r,
int g,
int b,
double alpha,std::string& label)
208 :
GuiObj(name,r,g,b,alpha)
215 set(dimx,dimy,dimz,posx,posy,posz,rotx,roty,rotz,r,g,b,alpha,label);
224 void set(
double dimx,
double dimy,
double dimz,
225 double posx,
double posy,
double posz,
226 double rotx,
double roty,
double rotz,
227 int r,
int g,
int b,
double alpha,std::string& label)
232 mR=double(r)/255.0;
mG=double(g)/255.0;
mB=double(b)/255.0;
241 glEnable(GL_TEXTURE_2D);
246 glGenTextures(1,&texture);
250 glBindTexture(GL_TEXTURE_2D,texture);
252 glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT);
253 glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT);
254 glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_DECAL);
258 glDisable(GL_TEXTURE_2D);
266 glRotated(
mRotz,0.0,0.0,1.0);
267 glRotated(
mRoty,0.0,1.0,0.0);
268 glRotated(
mRotx,1.0,0.0,0.0);
276 glEnable(GL_TEXTURE_2D);
277 glBindTexture(GL_TEXTURE_2D,
nTexID);
282 glutSolidSphere(
mDimx, 20.0, 20.0);
288 glDisable(GL_TEXTURE_2D);
293 glEnable(GL_TEXTURE_2D);
294 glBindTexture(GL_TEXTURE_2D,
nTexID);
330 glDisable(GL_TEXTURE_2D);
bool operator==(std::string &name)
GuiObj(std::string &name, int r, int g, int b, double alpha)
void printw(float x, float y, float z, const char *text)
TrajectoryObj(std::string name, std::string label, int bufflen, double persistence, int r, int g, int b, double alpha, GLfloat width, bool world)
void set(std::string &label, int bufflen, double persistence, int r, int g, int b, double alpha, double width)
void update(double x, double y, double z)
std::string optional_label
VisionObj(std::string name, double dimx, double dimy, double dimz, double posx, double posy, double posz, double rotx, double roty, double rotz, int r, int g, int b, double alpha, std::string &label)
unsigned char * mTextureBuffer
void set(double dimx, double dimy, double dimz, double posx, double posy, double posz, double rotx, double roty, double rotz, int r, int g, int b, double alpha, std::string &label)