Subversion Repositories gelsvn

Rev

Rev 594 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 594 Rev 601
1
/* ----------------------------------------------------------------------- *
1
/* ----------------------------------------------------------------------- *
2
 * This file is part of GEL, http://www.imm.dtu.dk/GEL
2
 * This file is part of GEL, http://www.imm.dtu.dk/GEL
3
 * Copyright (C) the authors and DTU Informatics
3
 * Copyright (C) the authors and DTU Informatics
4
 * For license and list of authors, see ../../doc/intro.pdf
4
 * For license and list of authors, see ../../doc/intro.pdf
5
 * ----------------------------------------------------------------------- */
5
 * ----------------------------------------------------------------------- */
6
 
6
 
7
/**
7
/**
8
 * @file draw.h
8
 * @file draw.h
9
 * @brief Draw various GEL entities.
9
 * @brief Draw various GEL entities.
10
 */
10
 */
11
 
11
 
12
#ifndef __GLGRAPHICS_DRAW_H_
12
#ifndef __GLGRAPHICS_DRAW_H_
13
#define __GLGRAPHICS_DRAW_H_
13
#define __GLGRAPHICS_DRAW_H_
14
 
14
 
15
#include "Geometry/TriMesh.h"
15
#include "../Geometry/TriMesh.h"
16
#include "Geometry/AABox.h"
16
#include "../Geometry/AABox.h"
17
#include "Geometry/OBox.h"
17
#include "../Geometry/OBox.h"
18
#include "Geometry/BoundingINode.h"
18
#include "../Geometry/BoundingINode.h"
19
#include "Geometry/BoundingLNode.h"
19
#include "../Geometry/BoundingLNode.h"
20
#include "Geometry/BoundingTree.h"
20
#include "../Geometry/BoundingTree.h"
21
 
21
 
22
namespace HMesh
22
namespace HMesh
23
{
23
{
24
    class Manifold;
24
    class Manifold;
25
}
25
}
26
 
26
 
27
namespace GLGraphics
27
namespace GLGraphics
28
{
28
{
29
	/// Draw an indexed face set (just a triangle list) with normals computed on the fly.
29
	/// Draw an indexed face set (just a triangle list) with normals computed on the fly.
30
	void draw(const Geometry::IndexedFaceSet& geometry);
30
	void draw(const Geometry::IndexedFaceSet& geometry);
31
 
31
 
32
	/// Draw a triangles mesh. Inefficient function that should be compiled into a display list.
32
	/// Draw a triangles mesh. Inefficient function that should be compiled into a display list.
33
	void draw(const Geometry::TriMesh& tm, bool per_vertex_norms=true);
33
	void draw(const Geometry::TriMesh& tm, bool per_vertex_norms=true);
34
	
34
	
35
	/// Load textures if available
35
	/// Load textures if available
36
	void load_textures(Geometry::TriMesh& tm);	
36
	void load_textures(Geometry::TriMesh& tm);	
37
	
37
	
38
	/// Draw a HMesh Manifold. Inefficient and should be compiled into display list
38
	/// Draw a HMesh Manifold. Inefficient and should be compiled into display list
39
	void draw(const HMesh::Manifold& m, bool per_vertex_norms=true);
39
	void draw(const HMesh::Manifold& m, bool per_vertex_norms=true);
40
 
40
 
41
	
41
	
42
	/// Draw an axis aligned bounding box
42
	/// Draw an axis aligned bounding box
43
	void draw(const Geometry::AABox& box);
43
	void draw(const Geometry::AABox& box);
44
	
44
	
45
	/// Draw an oriented bounding box
45
	/// Draw an oriented bounding box
46
	void draw(const Geometry::OBox& box);
46
	void draw(const Geometry::OBox& box);
47
	
47
	
48
	/// Draw an object of type T which contains only triangles as wireframe. In practice T = Manifold or TriMesh.
48
	/// Draw an object of type T which contains only triangles as wireframe. In practice T = Manifold or TriMesh.
49
	template<typename T>
49
	template<typename T>
50
	inline void draw_triangles_in_wireframe(T& m, bool per_vertex_norms, const CGLA::Vec3f& line_color);
50
	inline void draw_triangles_in_wireframe(T& m, bool per_vertex_norms, const CGLA::Vec3f& line_color);
51
 
51
 
52
  /// Draw an object of type T as wireframe.  In practice T = Manifold or TriMesh.
52
  /// Draw an object of type T as wireframe.  In practice T = Manifold or TriMesh.
53
	template<class T>
53
	template<class T>
54
	void draw_wireframe_oldfashioned(const T& m, bool per_vertex_norms, const CGLA::Vec3f& line_color);
54
	void draw_wireframe_oldfashioned(const T& m, bool per_vertex_norms, const CGLA::Vec3f& line_color);
55
	
55
	
56
	
56
	
57
	template<class BoxType>
57
	template<class BoxType>
58
	void draw(const Geometry::BoundingINode<BoxType>& node, int level, int max_level);
58
	void draw(const Geometry::BoundingINode<BoxType>& node, int level, int max_level);
59
	template<class BoxType>
59
	template<class BoxType>
60
    void draw(const Geometry::BoundingLNode<BoxType>& node, int level, int max_level);
60
    void draw(const Geometry::BoundingLNode<BoxType>& node, int level, int max_level);
61
	template<class BoxType>
61
	template<class BoxType>
62
    void draw(const Geometry::BoundingTree<BoxType>& tree, int max_level = 1e6);
62
    void draw(const Geometry::BoundingTree<BoxType>& tree, int max_level = 1e6);
63
	
63
	
64
}
64
}
65
#endif
65
#endif
66
 
66