Subversion Repositories gelsvn

Rev

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

Rev 443 Rev 595
-
 
1
/* ----------------------------------------------------------------------- *
-
 
2
 * This file is part of GEL, http://www.imm.dtu.dk/GEL
-
 
3
 * Copyright (C) the authors and DTU Informatics
-
 
4
 * For license and list of authors, see ../../doc/intro.pdf
-
 
5
 * ----------------------------------------------------------------------- */
-
 
6
 
-
 
7
/**
-
 
8
 * @file tessellate.h
-
 
9
 * @brief Tessellation of a parametric surface. Based on algorithm by Velho.
-
 
10
 */
-
 
11
 
1
#ifndef __GEOMETRY_TESSELATE_H
12
#ifndef __GEOMETRY_TESSELATE_H
2
#define __GEOMETRY_TESSELATE_H
13
#define __GEOMETRY_TESSELATE_H
3
 
14
 
4
#include "CGLA/Vec3f.h"
15
#include "CGLA/Vec3f.h"
5
#include "Util/Grid2D.h"
16
#include "Util/Grid2D.h"
6
#include "IndexedFaceSet.h"
17
#include "IndexedFaceSet.h"
7
 
18
 
8
namespace Geometry
19
namespace Geometry
9
{
20
{
10
	
21
	
11
	class ParSurf
22
	class ParSurf
12
{
23
{
13
public:
24
public:
14
	virtual CGLA::Vec3f operator()(float u, float v) const = 0;
25
	virtual CGLA::Vec3f operator()(float u, float v) const = 0;
15
};
26
};
16
 
27
 
17
extern float MAX_ERR;
28
extern float MAX_ERR;
18
extern float MAX_DIST;
29
extern float MAX_DIST;
19
extern int ADAPTIVE;
30
extern int ADAPTIVE;
20
 
31
 
21
 
32
 
22
void tessellate(IndexedFaceSet& face_set, ParSurf& s,
33
void tessellate(IndexedFaceSet& face_set, ParSurf& s,
23
			   float u_min, float u_max, float v_min, float v_max, 
34
			   float u_min, float u_max, float v_min, float v_max, 
24
			   int n, int m);
35
			   int n, int m);
25
 
36
 
26
void tessellate(IndexedFaceSet& face_set, ParSurf& s, 
37
void tessellate(IndexedFaceSet& face_set, ParSurf& s, 
27
			   Util::Grid2D<CGLA::Vec3f>& inigrid);
38
			   Util::Grid2D<CGLA::Vec3f>& inigrid);
28
 
39
 
29
void tessellate(IndexedFaceSet& face_set, ParSurf& s, 
40
void tessellate(IndexedFaceSet& face_set, ParSurf& s, 
30
			   std::vector<CGLA::Vec2f> uv_points,
41
			   std::vector<CGLA::Vec2f> uv_points,
31
			   std::vector<CGLA::Vec3i> triangles);
42
			   std::vector<CGLA::Vec3i> triangles);
32
}
43
}
33
 
44
 
34
#endif
45
#endif
35
 
46