GEL
2
GEL is a library for Geometry and Linear Algebra
|
00001 #ifndef __GLGRAPHICS_DRAW_H_ 00002 #define __GLGRAPHICS_DRAW_H_ 00003 00004 #include "Geometry/TriMesh.h" 00005 #include "Geometry/AABox.h" 00006 #include "Geometry/OBox.h" 00007 #include "Geometry/BoundingINode.h" 00008 #include "Geometry/BoundingLNode.h" 00009 #include "Geometry/BoundingTree.h" 00010 00011 #include "SinglePassWireframeRenderer.h" 00012 #include "IDBufferWireFrameRenderer.h" 00013 00014 namespace HMesh 00015 { 00016 class Manifold; 00017 } 00018 00019 namespace GLGraphics 00020 { 00022 void draw(const Geometry::IndexedFaceSet& geometry); 00023 00025 void draw(const Geometry::TriMesh& tm, bool per_vertex_norms=true); 00026 00028 void load_textures(Geometry::TriMesh& tm); 00029 00031 void draw(const HMesh::Manifold& m, bool per_vertex_norms=true); 00032 00033 00035 void draw(const Geometry::AABox& box); 00036 00038 void draw(const Geometry::OBox& box); 00039 00041 template<typename T> 00042 inline void draw_triangles_in_wireframe(T& m, bool per_vertex_norms, const CGLA::Vec3f& line_color) 00043 { 00044 static SinglePassWireframeRenderer swr; 00045 swr.enable(line_color); 00046 draw(m, per_vertex_norms); 00047 swr.disable(); 00048 } 00049 00051 template<class T> 00052 void draw_wireframe_oldfashioned(const T& m, bool per_vertex_norms, const CGLA::Vec3f& line_color); 00053 00054 00055 00056 template<class BoxType> 00057 void draw(const Geometry::BoundingINode<BoxType>& node, int level, int max_level); 00058 template<class BoxType> 00059 void draw(const Geometry::BoundingLNode<BoxType>& node, int level, int max_level); 00060 template<class BoxType> 00061 void draw(const Geometry::BoundingTree<BoxType>& tree, int max_level = 1e6); 00062 00063 } 00064 #endif