Subversion Repositories gelsvn

Rev

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

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