$(top_builddir)/Lib/Misc/libMisc.a \
$(top_builddir)/Lib/zlib/libz.a
-INCLUDES += -I$(top_builddir) -I$(top_builddir)/Lib
+INCLUDES += \
+ -I$(top_builddir) \
+ -I$(top_builddir)/Lib \
+ -I$(top_builddir)/Tools/Construct
# We can't build this with "-O2" (optimization) since this causes a seg fault
# I haven't found a way to strip this out of the CXXFLAGS, so I'm just
#include <Math/point3d.hxx>
#include <Misc/fgstream.hxx>
+#include <Main/construct_types.hxx>
+
FG_USING_STD(vector);
#define ARRAY_SIZE_1 1201
-typedef vector < Point3D > fitnode_list;
-typedef fitnode_list::iterator fitnode_list_iterator;
-typedef fitnode_list::const_iterator const_fitnode_list_iterator;
-
-
class FGArray {
private:
// float (*out_data)[ARRAY_SIZE_1];
// output nodes
- fitnode_list corner_list;
- fitnode_list node_list;
+ point_list corner_list;
+ point_list node_list;
public:
inline double get_col_step() const { return col_step; }
inline double get_row_step() const { return row_step; }
- inline fitnode_list get_corner_node_list() const { return corner_list; }
- inline fitnode_list get_fit_node_list() const { return node_list; }
+ inline point_list get_corner_node_list() const { return corner_list; }
+ inline point_list get_fit_node_list() const { return node_list; }
};
// $Log$
+// Revision 1.5 1999/03/29 13:11:02 curt
+// Shuffled stl type names a bit.
+// Began adding support for tri-fanning (or maybe other arrangments too.)
+//
// Revision 1.4 1999/03/27 05:20:14 curt
// Handle corner nodes separately from the rest of the fitted nodes.
// Fixed some "const" related warnings.
SUBDIRS = \
Array \
Clipper \
+ GenFans \
GenOutput \
Triangulate \
Main
// is an entry for each point containing a list of all the triangles
// that share that point.
void FGGenOutput::gen_node_ele_lookup_table() {
- belongs_to ele_list;
+ int_list ele_list;
ele_list.erase( ele_list.begin(), ele_list.end() );
// initialize reverse_ele_lookup structure by creating an empty
// for each node
for ( int i = 0; i < (int)wgs84_nodes.size(); ++i ) {
- belongs_to tri_list = reverse_ele_lookup[i];
+ int_list tri_list = reverse_ele_lookup[i];
- belongs_to_iterator current = tri_list.begin();
- belongs_to_iterator last = tri_list.end();
+ int_list_iterator current = tri_list.begin();
+ int_list_iterator last = tri_list.end();
Point3D average( 0.0 );
// copy the triangle list into this class
tri_elements = t.get_elelist();
+ // build the trifan list
+ FGGenFans f;
+ fans = f.greedy_build( tri_elements );
+
// generate the point list in wgs-84 coordinates
gen_wgs84_points( array );
// $Log$
+// Revision 1.6 1999/03/29 13:11:03 curt
+// Shuffled stl type names a bit.
+// Began adding support for tri-fanning (or maybe other arrangments too.)
+//
// Revision 1.5 1999/03/27 14:06:42 curt
// Tweaks to bounding sphere calculation routines.
// Group like triangles together for output to be in a single display list,
#include <Bucket/newbucket.hxx>
#include <Math/fg_geodesy.hxx>
#include <Math/point3d.hxx>
+
+#include <GenFans/genfans.hxx>
+#include <Main/construct_types.hxx>
#include <Triangulate/triangle.hxx>
FG_USING_STD(string);
FG_USING_STD(vector);
-typedef vector < int > belongs_to;
-typedef belongs_to::iterator belongs_to_iterator;
-typedef belongs_to::const_iterator belongs_to_tripoly_iterator;
-
-typedef vector < belongs_to > belongs_to_list;
+typedef vector < int_list > belongs_to_list;
typedef belongs_to_list::iterator belongs_to_list_iterator;
typedef belongs_to_list::const_iterator belongs_to_list_tripoly_iterator;
// triangles (by index into point list)
triele_list tri_elements;
+ // fan list
+ fan_list fans;
+
// for each node, a list of triangle indices that contain this node
belongs_to_list reverse_ele_lookup;
// $Log$
+// Revision 1.7 1999/03/29 13:11:04 curt
+// Shuffled stl type names a bit.
+// Began adding support for tri-fanning (or maybe other arrangments too.)
+//
// Revision 1.6 1999/03/27 14:06:43 curt
// Tweaks to bounding sphere calculation routines.
// Group like triangles together for output to be in a single display list,
bin_PROGRAMS = construct
-construct_SOURCES = construct.cxx
+construct_SOURCES = construct.cxx construct_types.hxx
construct_LDADD = \
$(top_builddir)/Tools/Construct/Array/libArray.a \
$(top_builddir)/Tools/Construct/Clipper/libClipper.a \
$(top_builddir)/Tools/Construct/GenOutput/libGenOutput.a \
+ $(top_builddir)/Tools/Construct/GenFans/libGenFans.a \
$(top_builddir)/Tools/Construct/Triangulate/libTriangulate.a \
$(top_builddir)/Tools/Lib/Polygon/libPolygon.a \
$(top_builddir)/Tools/Lib/Triangle/libTriangle.a \
// load regular grid of elevation data (dem based), return list of
// fitted nodes
int load_dem(const string& work_base, FGBucket& b, FGArray& array) {
- fitnode_list result;
+ point_list result;
string base = b.gen_base_path();
string dem_path = work_base + ".dem" + "/Scenery/" + base
// first we need to consolidate the points of the DEM fit list and
// all the polygons into a more "Triangle" friendly format
- fitnode_list corner_list = array.get_corner_node_list();
- fitnode_list fit_list = array.get_fit_node_list();
+ point_list corner_list = array.get_corner_node_list();
+ point_list fit_list = array.get_fit_node_list();
FGgpcPolyList gpc_polys = clipper.get_polys_clipped();
cout << "ready to build node list and polygons" << endl;
main(int argc, char **argv) {
- fitnode_list fit_list;
double lon, lat;
fglog().setLogLevels( FG_ALL, FG_DEBUG );
// lon = -89.744682312011719; lat= 29.314495086669922;
// lon = -122.488090; lat = 42.743183; // 64S
// lon = -114.861097; lat = 35.947480; // 61B
- lon = -112.012175; lat = 41.195944; // KOGD
+ // lon = -112.012175; lat = 41.195944; // KOGD
+ lon = -90.757128; lat = 46.790212; // WI32
double min_x = lon - 1;
double min_y = lat - 1;
FGBucket b_min( min_x, min_y );
FGBucket b_max( lon + 1, lat + 1 );
- // FGBucket b(550363L);
- // construct_tile( work_base, output_base, b );
- // exit(0);
+ // FGBucket b(533955L);
+ FGBucket b(-146.248360, 61.133950);
+ construct_tile( work_base, output_base, b );
+ exit(0);
if ( b_min == b_max ) {
construct_tile( work_base, output_base, b_min );
// $Log$
+// Revision 1.11 1999/03/29 13:11:06 curt
+// Shuffled stl type names a bit.
+// Began adding support for tri-fanning (or maybe other arrangments too.)
+//
// Revision 1.10 1999/03/27 05:25:02 curt
// Fit with a value of 200 rather than 100.
// Handle corner nodes separately from the rest of the fitted nodes.
// populate this class based on the specified gpc_polys list
int
-FGTriangle::build( const fitnode_list& corner_list,
- const fitnode_list& fit_list,
+FGTriangle::build( const point_list& corner_list,
+ const point_list& fit_list,
const FGgpcPolyList& gpc_polys )
{
FGTriPoly poly;
// listing the points explicitely
// first the corners since these are important
- const_fitnode_list_iterator f_current, f_last;
+ const_point_list_iterator f_current, f_last;
f_current = corner_list.begin();
f_last = corner_list.end();
for ( ; f_current != f_last; ++f_current ) {
vorout.normlist = (REAL *) NULL; // Needed only if -v switch used.
// TEMPORARY
- write_out_data(&in);
+ // write_out_data(&in);
// Triangulate the points. Switches are chosen to read and write
// a PSLG (p), preserve the convex hull (c), number everything
triangulate(tri_options.c_str(), &in, &out, &vorout);
// TEMPORARY
- // write_out_data(&out);
+ write_out_data(&out);
// now copy the results back into the corresponding FGTriangle
// structures
// $Log$
+// Revision 1.13 1999/03/29 13:11:07 curt
+// Shuffled stl type names a bit.
+// Began adding support for tri-fanning (or maybe other arrangments too.)
+//
// Revision 1.12 1999/03/27 05:30:12 curt
// Handle corner nodes separately from the rest of the fitted nodes.
// Add fitted nodes in after corners and polygon nodes since the fitted nodes
int add_nodes();
// populate this class based on the specified gpc_polys list
- int build( const fitnode_list& corner_list,
- const fitnode_list& fit_list,
+ int build( const point_list& corner_list,
+ const point_list& fit_list,
const FGgpcPolyList& gpc_polys );
// front end triangulator for polygon list
// $Log$
+// Revision 1.10 1999/03/29 13:11:08 curt
+// Shuffled stl type names a bit.
+// Began adding support for tri-fanning (or maybe other arrangments too.)
+//
// Revision 1.9 1999/03/27 05:30:13 curt
// Handle corner nodes separately from the rest of the fitted nodes.
// Add fitted nodes in after corners and polygon nodes since the fitted nodes
#include <Include/compiler.h>
-#include <vector>
-
#include <Math/point3d.hxx>
-FG_USING_STD(vector);
+#include <Main/construct_types.hxx>
#define FG_PROXIMITY_EPSILON 0.000001
#define FG_COURSE_EPSILON 0.0003
-typedef vector < Point3D > point_list;
-typedef point_list::iterator point_list_iterator;
-typedef point_list::const_iterator const_point_list_iterator;
-
-
class FGTriNodes {
private:
// $Log$
+// Revision 1.7 1999/03/29 13:11:10 curt
+// Shuffled stl type names a bit.
+// Began adding support for tri-fanning (or maybe other arrangments too.)
+//
// Revision 1.6 1999/03/27 05:30:16 curt
// Handle corner nodes separately from the rest of the fitted nodes.
// Add fitted nodes in after corners and polygon nodes since the fitted nodes
// int min_index;
int min_node_index = 0;
- tripoly_iterator current, last;
+ int_list_iterator current, last;
current = poly.begin();
last = poly.end();
// $Log$
+// Revision 1.2 1999/03/29 13:11:11 curt
+// Shuffled stl type names a bit.
+// Began adding support for tri-fanning (or maybe other arrangments too.)
+//
// Revision 1.1 1999/03/20 13:21:36 curt
// Initial revision.
//
#include <vector>
+#include <Main/construct_types.hxx>
+
#include "trinodes.hxx"
FG_USING_STD(vector);
-typedef vector < int > tripoly;
-typedef tripoly::iterator tripoly_iterator;
-typedef tripoly::const_iterator const_tripoly_iterator;
-
-
class FGTriPoly {
private:
- tripoly poly;
+ int_list poly;
Point3D inside;
public:
// $Log$
+// Revision 1.5 1999/03/29 13:11:12 curt
+// Shuffled stl type names a bit.
+// Began adding support for tri-fanning (or maybe other arrangments too.)
+//
// Revision 1.4 1999/03/23 22:02:56 curt
// Refinements in naming and organization.
//
Point3D p1 = nodes[ s.get_n2() ];
bool found_extra = false;
- int extra_index;
+ int extra_index = 0;
int counter;
double m, b, y_err, x_err;
const_point_list_iterator current, last;
// $Log$
+// Revision 1.5 1999/03/29 13:11:13 curt
+// Shuffled stl type names a bit.
+// Began adding support for tri-fanning (or maybe other arrangments too.)
+//
// Revision 1.4 1999/03/27 05:30:17 curt
// Handle corner nodes separately from the rest of the fitted nodes.
// Add fitted nodes in after corners and polygon nodes since the fitted nodes