167 |
jab |
1 |
#ifndef __GLGRAPHICS_DRAW_H_
|
|
|
2 |
#define __GLGRAPHICS_DRAW_H_
|
|
|
3 |
|
|
|
4 |
#include "Geometry/TriMesh.h"
|
299 |
jrf |
5 |
#include "Geometry/AABox.h"
|
|
|
6 |
#include "Geometry/OBox.h"
|
|
|
7 |
#include "Geometry/BoundingINode.h"
|
|
|
8 |
#include "Geometry/BoundingLNode.h"
|
|
|
9 |
#include "Geometry/BoundingTree.h"
|
331 |
jab |
10 |
#include "HMesh/Manifold.h"
|
167 |
jab |
11 |
|
396 |
jab |
12 |
#include "SinglePassWireframeRenderer.h"
|
|
|
13 |
#include "IDBufferWireFrameRenderer.h"
|
|
|
14 |
|
299 |
jrf |
15 |
namespace GLGraphics
|
|
|
16 |
{
|
432 |
jab |
17 |
/// Draw an indexed face set (just a triangle list) with normals computed on the fly.
|
|
|
18 |
void draw(const Geometry::IndexedFaceSet& geometry);
|
|
|
19 |
|
396 |
jab |
20 |
/// Draw a triangles mesh. Inefficient function that should be compiled into a display list.
|
|
|
21 |
void draw(const Geometry::TriMesh& tm, bool per_vertex_norms=true);
|
|
|
22 |
|
441 |
jab |
23 |
/// Load textures if available
|
|
|
24 |
void load_textures(Geometry::TriMesh& tm);
|
|
|
25 |
|
396 |
jab |
26 |
/// Draw a HMesh Manifold. Inefficient and should be compiled into display list
|
|
|
27 |
void draw(HMesh::Manifold& m, bool per_vertex_norms=true);
|
368 |
jrf |
28 |
|
396 |
jab |
29 |
|
|
|
30 |
/// Draw an axis aligned bounding box
|
|
|
31 |
void draw(const Geometry::AABox& box);
|
|
|
32 |
|
|
|
33 |
/// Draw an oriented bounding box
|
|
|
34 |
void draw(const Geometry::OBox& box);
|
|
|
35 |
|
400 |
jab |
36 |
/// Draw an object of type T which contains only triangles as wireframe. In practice T = Manifold or TriMesh.
|
396 |
jab |
37 |
template<typename T>
|
|
|
38 |
inline void draw_triangles_in_wireframe(T& m, bool per_vertex_norms, const CGLA::Vec3f& line_color)
|
|
|
39 |
{
|
|
|
40 |
static SinglePassWireframeRenderer swr;
|
|
|
41 |
swr.enable(line_color);
|
|
|
42 |
draw(m, per_vertex_norms);
|
|
|
43 |
swr.disable();
|
|
|
44 |
}
|
|
|
45 |
|
400 |
jab |
46 |
/// Draw an object of type T as wireframe. In practice T = Manifold or TriMesh.
|
396 |
jab |
47 |
template<class T>
|
|
|
48 |
void draw_wireframe_oldfashioned(T& m, bool per_vertex_norms, const CGLA::Vec3f& line_color);
|
|
|
49 |
|
|
|
50 |
|
|
|
51 |
|
|
|
52 |
template<class BoxType>
|
299 |
jrf |
53 |
void draw(const Geometry::BoundingINode<BoxType>& node, int level, int max_level);
|
396 |
jab |
54 |
template<class BoxType>
|
299 |
jrf |
55 |
void draw(const Geometry::BoundingLNode<BoxType>& node, int level, int max_level);
|
396 |
jab |
56 |
template<class BoxType>
|
299 |
jrf |
57 |
void draw(const Geometry::BoundingTree<BoxType>& tree, int max_level = 1e6);
|
396 |
jab |
58 |
|
299 |
jrf |
59 |
}
|
167 |
jab |
60 |
#endif
|