Subversion Repositories gelsvn

Rev

Rev 400 | Rev 441 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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