]> git.mxchange.org Git - flightgear.git/blob - Triangulate/triangle.hxx
First mostly successful tile triangulation works. There's plenty of tweaking
[flightgear.git] / Triangulate / triangle.hxx
1 // triangle.hxx -- "Triangle" interface class
2 //
3 // Written by Curtis Olson, started March 1999.
4 //
5 // Copyright (C) 1999  Curtis L. Olson  - curt@flightgear.org
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 // General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 //
21 // $Id$
22 // (Log is kept at end of this file)
23
24
25 #ifndef _TRIANGLE_HXX
26 #define _TRIANGLE_HXX
27
28
29 #ifndef __cplusplus                                                          
30 # error This library requires C++
31 #endif                                   
32
33
34 #include <Include/compiler.h>
35
36 #include <vector>
37
38 #include <Array/array.hxx>
39 #include <Clipper/clipper.hxx>
40 #include <Math/point3d.hxx>
41 #include <Polygon/names.hxx>
42
43 #define REAL double
44 extern "C" {
45 #include <Triangle/triangle.h>
46 }
47
48 #include "trinodes.hxx"
49 #include "tripoly.hxx"
50 #include "trisegs.hxx"
51
52 FG_USING_STD(vector);
53
54
55 typedef vector < FGTriPoly > tripoly_list;
56 typedef tripoly_list::iterator tripoly_list_iterator;
57 typedef tripoly_list::const_iterator const_tripoly_list_iterator;
58
59
60 class FGTriangle {
61
62 private:
63
64     // list of nodes
65     FGTriNodes trinodes;
66
67     // list of segments
68     FGTriSegments trisegs;
69
70     // polygon list
71     tripoly_list polylist[FG_MAX_AREA_TYPES];
72     
73 public:
74
75     // Constructor and destructor
76     FGTriangle( void );
77     ~FGTriangle( void );
78
79     // add nodes from the dem fit
80     int add_nodes();
81
82     // populate this class based on the specified gpc_polys list
83     int build( const fitnode_list& fit_list, const FGgpcPolyList& gpc_polys );
84
85     // front end triangulator for polygon list
86     int run_triangulate();
87 };
88
89
90 #endif // _TRIANGLE_HXX
91
92
93 // $Log$
94 // Revision 1.6  1999/03/20 20:32:56  curt
95 // First mostly successful tile triangulation works.  There's plenty of tweaking
96 // to do, but we are marching in the right direction.
97 //
98 // Revision 1.5  1999/03/20 02:21:53  curt
99 // Continue shaping the code towards triangulation bliss.  Added code to
100 // calculate some point guaranteed to be inside a polygon.
101 //
102 // Revision 1.4  1999/03/19 22:29:05  curt
103 // Working on preparationsn for triangulation.
104 //
105 // Revision 1.3  1999/03/19 00:27:11  curt
106 // Continued work on triangulation preparation.
107 //
108 // Revision 1.2  1999/03/18 04:31:12  curt
109 // Let's not pass copies of huge structures on the stack ... ye might see a
110 // segfault ... :-)
111 //
112 // Revision 1.1  1999/03/17 23:51:59  curt
113 // Initial revision.
114 //