]> git.mxchange.org Git - flightgear.git/commitdiff
Shuffled stl type names a bit.
authorcurt <curt>
Mon, 29 Mar 1999 13:11:00 +0000 (13:11 +0000)
committercurt <curt>
Mon, 29 Mar 1999 13:11:00 +0000 (13:11 +0000)
Began adding support for tri-fanning (or maybe other arrangments too.)

13 files changed:
Array/Makefile.am
Array/array.hxx
Construct/Makefile.am
GenOutput/genobj.cxx
GenOutput/genobj.hxx
Main/Makefile.am
Main/construct.cxx
Triangulate/triangle.cxx
Triangulate/triangle.hxx
Triangulate/trinodes.hxx
Triangulate/tripoly.cxx
Triangulate/tripoly.hxx
Triangulate/trisegs.cxx

index 8f9897423113a6d97e8645ff7be101f0ac56a377..a62648005132887e62bd365c735bf73990896dc1 100644 (file)
@@ -13,7 +13,10 @@ testarray_LDADD = \
        $(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
index ee3c8a37bd8458a8e4f27146832ba51bf1bb3f3f..601d0fb5671a8bd74a482e99e1adb04ba1c4ad9f 100644 (file)
@@ -39,6 +39,8 @@
 #include <Math/point3d.hxx>
 #include <Misc/fgstream.hxx>
 
+#include <Main/construct_types.hxx>
+
 FG_USING_STD(vector);
 
 
@@ -46,11 +48,6 @@ 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:
@@ -73,8 +70,8 @@ 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:
 
@@ -116,8 +113,8 @@ 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; }
 };
 
 
@@ -125,6 +122,10 @@ public:
 
 
 // $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.
index d3901496af5dd2f3fa30e5a92811da80e04588c8..7761fd4646a66bdea9bf96e64a69d0c1b33677ef 100644 (file)
@@ -1,6 +1,7 @@
 SUBDIRS = \
        Array \
        Clipper \
+       GenFans \
        GenOutput \
        Triangulate \
        Main
index d45a649ba8937d4536cdb1049794114ee2402957..ad2446d0753e4ac30ec567fc6a65c371974d5dbc 100644 (file)
@@ -64,7 +64,7 @@ void FGGenOutput::gen_wgs84_points( const FGArray& array ) {
 // 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
@@ -128,10 +128,10 @@ void FGGenOutput::gen_normals() {
 
     // 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 );
 
@@ -190,6 +190,10 @@ int FGGenOutput::build( const FGArray& array, const FGTriangle& t ) {
     // 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 );
 
@@ -400,6 +404,10 @@ int FGGenOutput::write( const string& base, const FGBucket& b ) {
 
 
 // $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,
index 2d89fbe66443dd900bf5a251fe9318bd4d125979..7d2d843748d19c6fdf37b3354015b11a713ac92a 100644 (file)
 #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;
 
@@ -74,6 +73,9 @@ private:
     // 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;
 
@@ -129,6 +131,10 @@ public:
 
 
 // $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,
index 06acce5b28136d3b096bca98d962e718f6360976..ffc387243d4a8a2c35adad18c84fa0a9407fa757 100644 (file)
@@ -1,11 +1,12 @@
 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 \
index fb0d76f0fcfdef7e6c51992dc2fdf5f2bba924c1..92b853b45cd28a17ae9a949b8c316ae39180f8b9 100644 (file)
@@ -37,7 +37,7 @@
 // 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 
@@ -138,8 +138,8 @@ void do_triangulate( const FGArray& array, const FGClipper& clipper,
     // 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;
@@ -184,7 +184,6 @@ void construct_tile( const string& work_base, const string& output_base,
 
 
 main(int argc, char **argv) {
-    fitnode_list fit_list;
     double lon, lat;
 
     fglog().setLogLevels( FG_ALL, FG_DEBUG );
@@ -204,16 +203,18 @@ main(int argc, char **argv) {
     // 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 );
@@ -237,6 +238,10 @@ main(int argc, char **argv) {
 
 
 // $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.
index 5aa396721cfcf837ea0a02a3a7df565edba3265a..dba74d10215e01bdaefd9630961c0af74f8f3276 100644 (file)
@@ -37,8 +37,8 @@ FGTriangle::~FGTriangle( void ) {
 
 // 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;
@@ -55,7 +55,7 @@ FGTriangle::build( const fitnode_list& corner_list,
     // 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 ) {
@@ -328,7 +328,7 @@ int FGTriangle::run_triangulate() {
     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
@@ -343,7 +343,7 @@ int FGTriangle::run_triangulate() {
     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
@@ -398,6 +398,10 @@ int FGTriangle::run_triangulate() {
 
 
 // $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
index 8106c3ab39cf0e3f0362f0a9ff828ea4a1d05846..b561bd2c120108f60827d4d2d0b160fa3ae16854 100644 (file)
@@ -76,8 +76,8 @@ public:
     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
@@ -92,6 +92,10 @@ public:
 
 
 // $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
index 860b63034e0d2baf24d1e5ebedfebf7aaa2093ac..6b05a42df5f07d19e546d68ca95068e689cdd176 100644 (file)
 
 #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:
@@ -119,6 +112,10 @@ inline bool FGTriNodes::course_close_enough( const Point3D& p1,
 
 
 // $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
index 763e369e44bc7312f310d32d41641cd0575ee41a..d01bb8b40f24c5e17064da787558ac3a67af4493 100644 (file)
@@ -95,7 +95,7 @@ void FGTriPoly::calc_point_inside( const FGTriNodes& trinodes ) {
     // int min_index;
     int min_node_index = 0;
 
-    tripoly_iterator current, last;
+    int_list_iterator current, last;
     current = poly.begin();
     last = poly.end();
 
@@ -180,6 +180,10 @@ void FGTriPoly::calc_point_inside( const FGTriNodes& trinodes ) {
 
 
 // $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.
 //
index 0cd87d00caa5491474af9cd56532956283b5c603..0e156dbae32f5f23bd1dee95d24a1b979461c424 100644 (file)
 
 #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:
@@ -85,6 +82,10 @@ typedef tripoly_list::const_iterator const_tripoly_list_iterator;
 
 
 // $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.
 //
index 62cf4d03ae9f946e7fd88a12ff4749857e2a26dc..1c1c386bf2facf963e3d7474890f5c72b7ae51fc 100644 (file)
@@ -76,7 +76,7 @@ void FGTriSegments::unique_divide_and_add( const point_list& nodes,
     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;
@@ -170,6 +170,10 @@ void FGTriSegments::unique_divide_and_add( const point_list& nodes,
 
 
 // $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