yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #00905
[svn] r1645 - in trunk/pkg/snow: . RenderingEngine
Author: cosurgi
Date: 2009-01-27 02:35:09 +0100 (Tue, 27 Jan 2009)
New Revision: 1645
Added:
trunk/pkg/snow/RenderingEngine/Ef1_IstSnowLayersContact_glDraw.cpp
trunk/pkg/snow/RenderingEngine/Ef1_IstSnowLayersContact_glDraw.hpp
Modified:
trunk/pkg/snow/SConscript
Log:
a placeholder for drawing snow interactions
Added: trunk/pkg/snow/RenderingEngine/Ef1_IstSnowLayersContact_glDraw.cpp
===================================================================
--- trunk/pkg/snow/RenderingEngine/Ef1_IstSnowLayersContact_glDraw.cpp 2009-01-27 00:58:28 UTC (rev 1644)
+++ trunk/pkg/snow/RenderingEngine/Ef1_IstSnowLayersContact_glDraw.cpp 2009-01-27 01:35:09 UTC (rev 1645)
@@ -0,0 +1,43 @@
+// © 2009 Janek Kozicki <cosurgi@xxxxxxxxxxxxxxx>
+
+#include"Ef1_IstSnowLayersContact_glDraw.hpp"
+#include<yade/pkg-dem/SpheresContactGeometry.hpp>
+#include<yade/pkg-common/NormalShearInteractions.hpp>
+#include<yade/pkg-dem/ElasticContactInteraction.hpp>
+#include<yade/pkg-snow/IstSnowLayersContact.hpp>
+
+#include<yade/lib-opengl/OpenGLWrapper.hpp>
+#include<yade/lib-opengl/GLUtils.hpp>
+
+YADE_PLUGIN("Ef1_IstSnowLayersContact_glDraw");
+
+void Ef1_IstSnowLayersContact_glDraw::go(
+ const shared_ptr<InteractionGeometry>& ig,
+ const shared_ptr<Interaction>& ip,
+ const shared_ptr<Body>& b1,
+ const shared_ptr<Body>& b2,
+ bool wireFrame)
+{
+ IstSnowLayersContact* sc = static_cast<IstSnowLayersContact*>(ig.get());
+
+ const Se3r& se31=b1->physicalParameters->dispSe3,se32=b2->physicalParameters->dispSe3;
+ const Vector3r& pos1=se31.position,pos2=se32.position;
+
+ if(wireFrame)
+ {
+ glPushMatrix();
+ glTranslatev(sc->contactPoint);
+ glBegin(GL_LINES);
+ glColor3(0.0,0.0,1.0);
+ glVertex3(0.0,0.0,0.0);
+ glVertex3v(-1.0*(sc->normal*sc->radius1));
+ glVertex3(0.0,0.0,0.0);
+ glVertex3v( 1.0*(sc->normal*sc->radius2));
+ glEnd();
+ glPopMatrix();
+ }
+ else
+ {
+ }
+}
+
Added: trunk/pkg/snow/RenderingEngine/Ef1_IstSnowLayersContact_glDraw.hpp
===================================================================
--- trunk/pkg/snow/RenderingEngine/Ef1_IstSnowLayersContact_glDraw.hpp 2009-01-27 00:58:28 UTC (rev 1644)
+++ trunk/pkg/snow/RenderingEngine/Ef1_IstSnowLayersContact_glDraw.hpp 2009-01-27 01:35:09 UTC (rev 1645)
@@ -0,0 +1,18 @@
+// © 2009 Janek Kozicki <cosurgi@xxxxxxxxxxxxxxx>
+
+#pragma once
+
+#include<yade/pkg-common/GLDrawFunctors.hpp>
+
+class Ef1_IstSnowLayersContact_glDraw : public GLDrawInteractionGeometryFunctor{
+ public :
+ Ef1_IstSnowLayersContact_glDraw(){}
+ virtual void go(const shared_ptr<InteractionGeometry>&,const shared_ptr<Interaction>&,const shared_ptr<Body>&,const shared_ptr<Body>&,bool wireFrame);
+
+ RENDERS(IstSnowLayersContact);
+ REGISTER_CLASS_NAME(Ef1_IstSnowLayersContact_glDraw);
+ REGISTER_BASE_CLASS_NAME(GLDrawInteractionGeometryFunctor);
+};
+
+REGISTER_SERIALIZABLE(Ef1_IstSnowLayersContact_glDraw);
+
Modified: trunk/pkg/snow/SConscript
===================================================================
--- trunk/pkg/snow/SConscript 2009-01-27 00:58:28 UTC (rev 1644)
+++ trunk/pkg/snow/SConscript 2009-01-27 01:35:09 UTC (rev 1645)
@@ -4,6 +4,10 @@
env.Install('$PREFIX/lib/yade$SUFFIX/pkg-snow',[
+ env.SharedLibrary('Ef1_IstSnowLayersContact_glDraw',
+ ['RenderingEngine/Ef1_IstSnowLayersContact_glDraw.cpp'],
+ LIBS=env['LIBS']+['SpheresContactGeometry','ElasticContactInteraction','yade-opengl','IstSnowLayersContact','$QGLVIEWER_LIB']),
+
env.SharedLibrary('IstSnowLayersContact',
['DataClass/IstSnowLayersContact.cpp'],
LIBS=env['LIBS']+['yade-serialization','yade-base','SpheresContactGeometry']),