diff --git a/wrap/gui/coordinateframe.cpp b/wrap/gui/coordinateframe.cpp index 99e25f9c..97e6c43c 100644 --- a/wrap/gui/coordinateframe.cpp +++ b/wrap/gui/coordinateframe.cpp @@ -74,7 +74,7 @@ void CoordinateFrame::Render(QGLWidget* glw,QPainter* p) glEnable(GL_POINT_SMOOTH); glLineWidth(linewidth); glPointSize(linewidth*1.5); - + glLabel::Mode md; Point3d o(0,0,0); Point3d a(size,0,0); Point3d b(0,size,0); @@ -126,46 +126,32 @@ void CoordinateFrame::Render(QGLWidget* glw,QPainter* p) glPopMatrix(); } if(drawlabels){ - font.setBold(true); - font.setPixelSize(12); + md.qFont.setBold(true); + md.qFont.setPixelSize(12); float d=size+scalefactor*linewidth*1.5; - if (p) - vcg::glLabel::render(p,vcg::Point3f(d,0,0),QString("X"),font,xcolor); - { - glColor(xcolor); - glw->renderText(d,0,0,QString("X"),font); - } - - if (p) - vcg::glLabel::render(p,vcg::Point3f(0,d,0),QString("Y"),font,ycolor); - { - glColor(ycolor); - glw->renderText(0,d,0,QString("Y"),font); - } - - if (p) - vcg::glLabel::render(p,vcg::Point3f(0,0,d),QString("Z"),font,zcolor); - { - glColor(zcolor); - glw->renderText(0,0,d,QString("Z"),font); - } - } + if (p) { + vcg::glLabel::render(p,vcg::Point3f(d,0,0),QString("X"),md); + vcg::glLabel::render(p,vcg::Point3f(0,d,0),QString("Y"),md); + vcg::glLabel::render(p,vcg::Point3f(0,0,d),QString("Z"),md); + } + } if(drawvalues){ - font.setBold(false); - font.setPixelSize(8); + md.qFont.setBold(false); + md.qFont.setPixelSize(8); + md.color=Color4b(Color4b::LightGray); float i; glColor(Color4b::LightGray); for(i=slope_a;irenderText( i,0,0,QString(" %1").arg(i,3,'f',1),font); - glw->renderText(-i,0,0,QString("-%1").arg(i,3,'f',1),font); + vcg::glLabel::render(p,vcg::Point3f( i,0,0),QString(" %1").arg(i,3,'f',1),md); + vcg::glLabel::render(p,vcg::Point3f(-i,0,0),QString(" %1").arg(i,3,'f',1),md); } for(i=slope_b;irenderText(0, i,0,QString(" %1").arg(i,3,'f',1),font); - glw->renderText(0,-i,0,QString("-%1").arg(i,3,'f',1),font); + vcg::glLabel::render(p,vcg::Point3f(0, i,0),QString(" %1").arg(i,3,'f',1),md); + vcg::glLabel::render(p,vcg::Point3f(0,-i,0),QString(" %1").arg(i,3,'f',1),md); } for(i=slope_c;irenderText(0,0, i,QString(" %1").arg(i,3,'f',1),font); - glw->renderText(0,0,-i,QString("-%1").arg(i,3,'f',1),font); + vcg::glLabel::render(p,vcg::Point3f(0,0, i),QString(" %1").arg(i,3,'f',1),md); + vcg::glLabel::render(p,vcg::Point3f(0,0,-i),QString(" %1").arg(i,3,'f',1),md); } } glGetError(); // Patch to buggy qt rendertext;