50 char arg0[]=
"iCubimator";
67 setMouseTracking(
true);
76 yarp::os::Bottle skinParams=config.findGroup(
"SKIN");
77 if (!skinParams.isNull())
80 skinParams.find(
"force_gain").asFloat64(),
81 skinParams.find(
"force_thr").asFloat64(),
82 skinParams.find(
"torque_gain").asFloat64(),
83 skinParams.find(
"torque_thr").asFloat64()
87 mObjectsManager=
new ObjectsManager(config.find(
"objport").asString().c_str(),config.find(
"texport").asString().c_str(),config.find(
"forceport").asString().c_str());
92 setFocusPolicy(Qt::StrongFocus);
122 for (
int i=-10; i<10; ++i)
124 for (
int j=-10; j<10; ++j)
128 glColor4f(0.1,0.1,0.1,alpha);
132 glColor4f(0.6,0.6,0.6,alpha);
135 glVertex3f(i*40,0,j*40);
136 glVertex3f(i*40,0,(j+1)*40);
137 glVertex3f((i+1)*40,0,(j+1)*40);
138 glVertex3f((i+1)*40,0,j*40);
146 gluPerspective(60.0,((
float)width())/height(),1,2000);
161 GLfloat position0[]={0.0,80.0,100.0,1.0};
162 GLfloat ambient0[]={0.2,0.2,0.2,1.0};
166 GLfloat position1[]={0.0,80.0,-100.0,1.0};
167 GLfloat ambient1[]={0.2,0.2,0.2,1.0};
168 GLfloat diffuse1[]={0.5,0.5,0.5,1.0};
169 GLfloat specular1[]={1.0,1.0,1.0,1.0};
171 glViewport(0,0,width(),height());
174 glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
176 glLightfv(GL_LIGHT0,GL_AMBIENT,ambient0);
180 glLightfv(GL_LIGHT1,GL_AMBIENT,ambient1);
181 glLightfv(GL_LIGHT1,GL_DIFFUSE,diffuse1);
182 glLightfv(GL_LIGHT1,GL_SPECULAR,specular1);
184 glEnable(GL_NORMALIZE);
185 glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);
188 glMatrixMode(GL_PROJECTION);
192 glLightfv(GL_LIGHT0,GL_POSITION,position0);
193 glLightfv(GL_LIGHT1,GL_POSITION,position1);
206 GLfloat fogColor[4]={0.5,0.5,0.5,0.3};
208 glFogi(GL_FOG_MODE,fogMode);
209 glFogfv(GL_FOG_COLOR,fogColor);
210 glFogf(GL_FOG_DENSITY,0.005);
211 glHint(GL_FOG_HINT,GL_DONT_CARE);
212 glFogf(GL_FOG_START,200.0);
213 glFogf(GL_FOG_END,2000.0);
219 glClearColor(0.5,0.5,0.5,0.3);
220 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
221 glDisable(GL_LIGHTING);
222 glEnable(GL_DEPTH_TEST);
223 glEnable(GL_COLOR_MATERIAL);
224 glShadeModel(GL_FLAT);
225 glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);
233 glRotated(-90.0,1.0,0.0,0.0);
234 glRotated( 90.0,0.0,0.0,1.0);
246 QPoint dragPos=QCursor::pos();
285 if (event->button()==Qt::LeftButton)
297 if(event->button()==Qt::LeftButton)
334 case Qt::Key_PageDown:
348 case Qt::Key_Control:
371 case Qt::Key_Control:
428 int w=newSize->size().width();
429 int h=newSize->size().height();
432 glMatrixMode(GL_PROJECTION);
441 glMatrixMode(GL_MODELVIEW);
virtual void keyReleaseEvent(QKeyEvent *event)
SubtitlesManager * mSubtitlesManager
virtual void keyPressEvent(QKeyEvent *event)
virtual void mouseDoubleClickEvent(QMouseEvent *event)
AnimationView(QWidget *parent)
virtual void wheelEvent(QWheelEvent *event)
virtual void mouseMoveEvent(QMouseEvent *event)
virtual void mousePressEvent(QMouseEvent *event)
virtual void initializeGL()
ObjectsManager * mObjectsManager
virtual void paintOverlayGL()
virtual void mouseReleaseEvent(QMouseEvent *event)
virtual void resizeEvent(QResizeEvent *newSize)
void init(yarp::os::ResourceFinder &config)
bool Create(yarp::os::ResourceFinder &config)
void rotate(float x, float y)
void pan(float x, float y, float z)
static void setParams(double fg, double ft, double tg, double tt)
static int floorTranslucency()