← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 2359: 1. Fix the GL dispatch (was enumerating child classes non-recursively, and your Gl1_ChainedCylind...

 

------------------------------------------------------------
revno: 2359
committer: Václav Šmilauer <eudoxos@xxxxxxxx>
branch nick: trunk
timestamp: Mon 2010-07-12 21:41:57 +0200
message:
  1. Fix the GL dispatch (was enumerating child classes non-recursively, and your Gl1_ChainedCylinder did not inherit directly from GlShapeFunctor)
  2. Do not use '|||' to separate plot axes, use None instead (||| is deprecated)
  3. Move the Gl1_ChainedCylinder functor inside #ifdef YADE_OPENGL (please pay attention to that)
modified:
  gui/qt3/QtFileGenerator.cpp
  pkg/common/DataClass/Shape/Cylinder.cpp
  pkg/common/DataClass/Shape/Cylinder.hpp
  pkg/common/RenderingEngine/OpenGLRenderingEngine.cpp
  scripts/test/chained-cylinder-spring.py


--
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 'gui/qt3/QtFileGenerator.cpp'
--- gui/qt3/QtFileGenerator.cpp	2009-08-21 10:06:00 +0000
+++ gui/qt3/QtFileGenerator.cpp	2010-07-12 19:41:57 +0000
@@ -38,7 +38,7 @@
 	map<string,DynlibDescriptor>::const_iterator diEnd = Omega::instance().getDynlibsDescriptor().end();
 	for(;di!=diEnd;++di)
 	{
-		if (Omega::instance().isInheritingFrom((*di).first,"FileGenerator"))
+		if (Omega::instance().isInheritingFrom_recursive((*di).first,"FileGenerator"))
 			cbGeneratorName->insertItem((*di).first);
 	}
 

=== modified file 'pkg/common/DataClass/Shape/Cylinder.cpp'
--- pkg/common/DataClass/Shape/Cylinder.cpp	2010-07-12 19:19:53 +0000
+++ pkg/common/DataClass/Shape/Cylinder.cpp	2010-07-12 19:41:57 +0000
@@ -212,9 +212,8 @@
 	//glMaterialv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, Vector3f(cm->color[0],cm->color[1],cm->color[2]));
 	glColor3v(cm->color);
 	if(glutNormalize) glPushAttrib(GL_NORMALIZE); // as per http://lists.apple.com/archives/Mac-opengl/2002/Jul/msg00085.html
-	cerr<<"DispatchOK";
 // 	glPushMatrix();
- 	out(shift);
+ 	//out(shift);
 	if (wire || wire2) drawCylinder(true, r,length,shift);
 	else drawCylinder(false, r,length,shift);
 	if(glutNormalize) glPopAttrib();

=== modified file 'pkg/common/DataClass/Shape/Cylinder.hpp'
--- pkg/common/DataClass/Shape/Cylinder.hpp	2010-07-12 18:44:19 +0000
+++ pkg/common/DataClass/Shape/Cylinder.hpp	2010-07-12 19:41:57 +0000
@@ -138,7 +138,6 @@
 	RENDERS(Cylinder);
 	friend class Gl1_ChainedCylinder;
 };
-#endif
 
 //!This doesn't work : the 1D dispatcher will pick Gl1_Cylinder to display ChainedCylinders, workaround : add shift to cylinders (should be a variable of chained cylinders only).
 class Gl1_ChainedCylinder : public Gl1_Cylinder{
@@ -168,6 +167,8 @@
 	RENDERS(ChainedCylinder);
 };*/
 
+#endif
+
 
 class Bo1_Cylinder_Aabb : public BoundFunctor
 {

=== modified file 'pkg/common/RenderingEngine/OpenGLRenderingEngine.cpp'
--- pkg/common/RenderingEngine/OpenGLRenderingEngine.cpp	2010-07-12 17:36:42 +0000
+++ pkg/common/RenderingEngine/OpenGLRenderingEngine.cpp	2010-07-12 19:41:57 +0000
@@ -29,11 +29,11 @@
 	map<string,DynlibDescriptor>::const_iterator di = Omega::instance().getDynlibsDescriptor().begin();
 	map<string,DynlibDescriptor>::const_iterator diEnd = Omega::instance().getDynlibsDescriptor().end();
 	for(;di!=diEnd;++di){
-		if (Omega::instance().isInheritingFrom((*di).first,"GlStateFunctor")) addStateFunctor((*di).first);
-		if (Omega::instance().isInheritingFrom((*di).first,"GlBoundFunctor")) addBoundingVolumeFunctor((*di).first);
-		if (Omega::instance().isInheritingFrom((*di).first,"GlShapeFunctor")) addInteractingGeometryFunctor((*di).first);
-		if (Omega::instance().isInheritingFrom((*di).first,"GlInteractionGeometryFunctor")) addInteractionGeometryFunctor((*di).first);
-		if (Omega::instance().isInheritingFrom((*di).first,"GlInteractionPhysicsFunctor")) addInteractionPhysicsFunctor((*di).first);
+		if (Omega::instance().isInheritingFrom_recursive((*di).first,"GlStateFunctor")) addStateFunctor((*di).first);
+		if (Omega::instance().isInheritingFrom_recursive((*di).first,"GlBoundFunctor")) addBoundingVolumeFunctor((*di).first);
+		if (Omega::instance().isInheritingFrom_recursive((*di).first,"GlShapeFunctor")) addInteractingGeometryFunctor((*di).first);
+		if (Omega::instance().isInheritingFrom_recursive((*di).first,"GlInteractionGeometryFunctor")) addInteractionGeometryFunctor((*di).first);
+		if (Omega::instance().isInheritingFrom_recursive((*di).first,"GlInteractionPhysicsFunctor")) addInteractionPhysicsFunctor((*di).first);
 	}
 	postProcessAttributes(true);
 

=== modified file 'scripts/test/chained-cylinder-spring.py'
--- scripts/test/chained-cylinder-spring.py	2010-07-12 10:22:59 +0000
+++ scripts/test/chained-cylinder-spring.py	2010-07-12 19:41:57 +0000
@@ -59,7 +59,7 @@
  #plot some results
 from math import *
 from yade import plot
-plot.plots={'t':('pos1','|||','vel1')}
+plot.plots={'t':('pos1',None,'vel1')}
 def history():
   	plot.addData(pos1=O.bodies[0].state.pos[1], # potential elastic energy
 		     vel1=O.bodies[0].state.vel[1],


Follow ups