Go to the documentation of this file.00001 #ifndef OPENTISSUE_UTILITY_GL_GL_DRAW_PLANE_BOX_H
00002 #define OPENTISSUE_UTILITY_GL_GL_DRAW_PLANE_BOX_H
00003
00004
00005
00006
00007
00008
00009
00010 #include <OpenTissue/configuration.h>
00011
00012 #include <OpenTissue/utility/gl/gl.h>
00013
00014 #include <OpenTissue/utility/gl/gl_draw_aabb.h>
00015
00016 namespace OpenTissue
00017 {
00018 namespace gl
00019 {
00020
00027 template< typename plane_box_type>
00028 inline void DrawPlaneBox( plane_box_type const & box, bool wireframe = true )
00029 {
00030 DrawAABB(box.box(),true);
00031
00032 if(wireframe)
00033 glBegin(GL_LINE_LOOP);
00034 else
00035 glBegin(GL_POLYGON);
00036 glNormal3f( box.n()[0],box.n()[1],box.n()[2]);
00037 glVertex3f( box.p0()[0],box.p0()[1],box.p0()[2]);
00038 glNormal3f( box.n()[0],box.n()[1],box.n()[2]);
00039 glVertex3f( box.p1()[0],box.p1()[1],box.p1()[2]);
00040 glNormal3f( box.n()[0],box.n()[1],box.n()[2]);
00041 glVertex3f( box.p2()[0],box.p2()[1],box.p2()[2]);
00042 glNormal3f( box.n()[0],box.n()[1],box.n()[2]);
00043 glVertex3f( box.p3()[0],box.p3()[1],box.p3()[2]);
00044 glEnd();
00045 }
00046 }
00047
00048 }
00049
00050
00051 #endif