← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 2189: fixes #571674

 

------------------------------------------------------------
revno: 2189
committer: Janek Kozicki <cosurgi@xxxxxxxxxx>
branch nick: trunk
timestamp: Sun 2010-05-02 16:45:30 +0200
message:
  fixes #571674
  
  'dof' and 'id' are now displayed, when checkboxes in Display tab are on.
  
  modified:
    pkg/common/RenderingEngine/OpenGLRenderingEngine.cpp
modified:
  pkg/common/RenderingEngine/OpenGLRenderingEngine.cpp


--
lp:yade
https://code.launchpad.net/~yade-dev/yade/trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription
=== modified file 'pkg/common/RenderingEngine/OpenGLRenderingEngine.cpp'
--- pkg/common/RenderingEngine/OpenGLRenderingEngine.cpp	2010-04-26 13:58:23 +0000
+++ pkg/common/RenderingEngine/OpenGLRenderingEngine.cpp	2010-05-02 14:45:30 +0000
@@ -227,11 +227,9 @@
 	FOREACH(const shared_ptr<Body> b, *scene->bodies){
 		if(!b) continue;
 		if(b->shape && ((b->getGroupMask() & mask) || b->getGroupMask()==0)){
-			if(b->state /* && FIXME: !b->physicalParameters->isDisplayed */) continue;
+			//if(b->state /* && FIXME: !b->physicalParameters->isDisplayed */) continue;
 			if(!id && b->state->blockedDOFs==0) continue;
 			const Se3r& se3=b->state->se3; // FIXME: should be dispSe3
-			glPushMatrix();
-			glTranslatef(se3.position[0],se3.position[1],se3.position[2]);
 			if(current_selection==b->getId()){glLightModelfv(GL_LIGHT_MODEL_AMBIENT,ambientColorSelected);}
 			{ // write text
 				glColor3f(1.0-bgColor[0],1.0-bgColor[1],1.0-bgColor[2]);
@@ -245,17 +243,13 @@
 										+ (((DOF & State::DOF_RZ)!=0)?"RZ":"  ");
 				std::string sId = boost::lexical_cast<std::string>(b->getId());
 				std::string str;
-				if(dof && id) id += " ";
+				if(dof && id) sId += " ";
 				if(id) str += sId;
 				if(dof) str += sDof;
-				glPushMatrix();
-				glRasterPos2i(0,0);
-				for(unsigned int i=0;i<str.length();i++)
-					glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12, str[i]);
-				glPopMatrix();
+				const Vector3r& h(current_selection==b->getId() ? highlightEmission0 : Vector3r(1,1,1));
+				GLUtils::GLDrawText(str,se3.position, h );
 			}
 			if(current_selection == b->getId()){glLightModelfv(GL_LIGHT_MODEL_AMBIENT,ambientColorUnselected);}
-			glPopMatrix();
 		}
 	}
 }