← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 2356: - restore Gl1_ChainedCylinder

 

------------------------------------------------------------
revno: 2356
committer: bchareyre <bchareyre@dt-rv020>
branch nick: trunk
timestamp: Mon 2010-07-12 19:49:15 +0200
message:
  - restore Gl1_ChainedCylinder
  - kdev4 : I failoed to commit this file apparently.
added:
  .kdev4/yade.kdev4
modified:
  pkg/common/DataClass/Shape/Cylinder.cpp
  pkg/common/DataClass/Shape/Cylinder.hpp


--
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
=== added file '.kdev4/yade.kdev4'
--- .kdev4/yade.kdev4	1970-01-01 00:00:00 +0000
+++ .kdev4/yade.kdev4	2010-07-12 17:49:15 +0000
@@ -0,0 +1,3 @@
+[MakeBuilder]
+Make Binary=scons
+Number Of Jobs=3

=== modified file 'pkg/common/DataClass/Shape/Cylinder.cpp'
--- pkg/common/DataClass/Shape/Cylinder.cpp	2010-07-12 17:44:48 +0000
+++ pkg/common/DataClass/Shape/Cylinder.cpp	2010-07-12 17:49:15 +0000
@@ -14,7 +14,7 @@
 YADE_PLUGIN(
 	(Cylinder)(ChainedCylinder)(ChainedState)(CylScGeom)(Ig2_Sphere_ChainedCylinder_CylScGeom)(Ig2_ChainedCylinder_ChainedCylinder_ScGeom)
 	#ifdef YADE_OPENGL
-		(Gl1_Cylinder)/*(Gl1_ChainedCylinder)*/
+		(Gl1_Cylinder)(Gl1_ChainedCylinder)
 	#endif
 	(Bo1_Cylinder_Aabb)/*(Bo1_ChainedCylinder_Aabb)*/
 );
@@ -201,22 +201,22 @@
 	return;
 }
 
-// void Gl1_ChainedCylinder::go(const shared_ptr<Shape>& cm, const shared_ptr<State>& ,bool wire2, const GLViewInfo&)
-// {
-// 	Real r=(static_cast<ChainedCylinder*>(cm.get()))->radius;
-// 	Real length=(static_cast<ChainedCylinder*>(cm.get()))->length;
-// 	Quaternionr shift = (static_cast<ChainedCylinder*>(cm.get()))->chainedOrientation;
-// 	//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
-// // 	glPushMatrix();
-//  	out(shift);
-// 	if (wire || wire2) drawCylinder(true, r,length,shift);
-// 	else drawCylinder(false, r,length,shift);
-// 	if(glutNormalize) glPopAttrib();
-// // 	glPopMatrix();
-// 	return;
-// }
+void Gl1_ChainedCylinder::go(const shared_ptr<Shape>& cm, const shared_ptr<State>& ,bool wire2, const GLViewInfo&)
+{
+	Real r=(static_cast<ChainedCylinder*>(cm.get()))->radius;
+	Real length=(static_cast<ChainedCylinder*>(cm.get()))->length;
+	Quaternionr shift = (static_cast<ChainedCylinder*>(cm.get()))->chainedOrientation;
+	//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
+// 	glPushMatrix();
+ 	out(shift);
+	if (wire || wire2) drawCylinder(true, r,length,shift);
+	else drawCylinder(false, r,length,shift);
+	if(glutNormalize) glPopAttrib();
+// 	glPopMatrix();
+	return;
+}
 
 void Gl1_Cylinder::drawCylinder(bool wire, Real radius, Real length, const Quaternionr& shift) const
 {

=== modified file 'pkg/common/DataClass/Shape/Cylinder.hpp'
--- pkg/common/DataClass/Shape/Cylinder.hpp	2010-07-12 17:44:48 +0000
+++ pkg/common/DataClass/Shape/Cylinder.hpp	2010-07-12 17:49:15 +0000
@@ -141,13 +141,13 @@
 #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{
-// 	public:
-// 		virtual void go(const shared_ptr<Shape>&, const shared_ptr<State>&,bool,const GLViewInfo&);
-// 	YADE_CLASS_BASE_DOC(Gl1_ChainedCylinder,Gl1_Cylinder,"Renders :yref:`ChainedCylinder` object including a shift for compensating flexion."
-// 	);
-// 	RENDERS(ChainedCylinder);
-// };
+class Gl1_ChainedCylinder : public Gl1_Cylinder{
+	public:
+		virtual void go(const shared_ptr<Shape>&, const shared_ptr<State>&,bool,const GLViewInfo&);
+	YADE_CLASS_BASE_DOC(Gl1_ChainedCylinder,Gl1_Cylinder,"Renders :yref:`ChainedCylinder` object including a shift for compensating flexion."
+	);
+	RENDERS(ChainedCylinder);
+};
 
 
 /*
@@ -197,8 +197,8 @@
 // REGISTER_SERIALIZABLE(Bo1_ChainedCylinder_Aabb);
 #ifdef YADE_OPENGL
 REGISTER_SERIALIZABLE(Gl1_Cylinder);
+REGISTER_SERIALIZABLE(Gl1_ChainedCylinder);
 #endif
-// REGISTER_SERIALIZABLE(Gl1_ChainedCylinder);
 REGISTER_SERIALIZABLE(Cylinder);
 REGISTER_SERIALIZABLE(ChainedCylinder);
 REGISTER_SERIALIZABLE(ChainedState);