Subversion Repositories gelsvn

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
595 jab 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
 
443 jab 12
#ifndef __GEOMETRY_TESSELATE_H
13
#define __GEOMETRY_TESSELATE_H
362 jab 14
 
601 jab 15
#include "../CGLA/Vec3f.h"
16
#include "../Util/Grid2D.h"
362 jab 17
#include "IndexedFaceSet.h"
18
 
19
namespace Geometry
20
{
21
 
22
	class ParSurf
23
{
24
public:
25
	virtual CGLA::Vec3f operator()(float u, float v) const = 0;
26
};
27
 
28
extern float MAX_ERR;
29
extern float MAX_DIST;
30
extern int ADAPTIVE;
31
 
32
 
33
void tessellate(IndexedFaceSet& face_set, ParSurf& s,
34
			   float u_min, float u_max, float v_min, float v_max, 
35
			   int n, int m);
36
 
37
void tessellate(IndexedFaceSet& face_set, ParSurf& s, 
38
			   Util::Grid2D<CGLA::Vec3f>& inigrid);
39
 
40
void tessellate(IndexedFaceSet& face_set, ParSurf& s, 
41
			   std::vector<CGLA::Vec2f> uv_points,
42
			   std::vector<CGLA::Vec3i> triangles);
43
}
44
 
45
#endif