]> git.mxchange.org Git - flightgear.git/commitdiff
Moved AreaType get_shapefile_type(GDBFile *dbf, int rec) to where it
authorcurt <curt>
Mon, 22 Mar 1999 23:49:29 +0000 (23:49 +0000)
committercurt <curt>
Mon, 22 Mar 1999 23:49:29 +0000 (23:49 +0000)
belongs in ShapeFile/

Polygon/names.cxx
Polygon/names.hxx
ShapeFile/main.cxx

index 7e6d2a320e5f002142823a77ea8a6917fb7a53ae..eabd8697efcd9beb2fb554d5457460f7219843c4 100644 (file)
 #include "names.hxx"
 
 
-// return the type of the shapefile record
-AreaType get_shapefile_type(GDBFile *dbf, int rec) {
-    // GDBFieldDesc *fdesc[128];       // 128 is an arbitrary number here
-    GDBFValue *fields;         //an array of field values
-    char* dbf_rec;             //a record containing all the fields
-
-    // grab the meta-information for all the fields
-    // this applies to all the records in the DBF file.
-    // for ( int i = 0; i < dbf->numFields(); i++ ) {
-    //   fdesc[i] = dbf->getFieldDesc(i);
-    //   cout << i << ") " << fdesc[i]->name << endl;
-    // }
-
-    // this is the whole name record
-    dbf_rec = dbf->getRecord( rec );
-
-    // parse it into individual fields
-    if ( dbf_rec ) {
-       fields = dbf->recordDeform( dbf_rec );
-    } else {
-       return UnknownArea;
-    }
-
-    string area = fields[4].str_v;
-    // strip leading spaces
-    while ( area[0] == ' ' ) {
-       area = area.substr(1, area.length() - 1);
-    }
-    // strip trailing spaces
-    while ( area[area.length() - 1] == ' ' ) {
-       area = area.substr(0, area.length() - 1);
-    }
-    // strip other junk encountered
-    while ( (int)area[area.length() - 1] == 9 ) {
-       area = area.substr(0, area.length() - 1);
-    }
-
-    return get_area_type( area );
-}
-
-
 // return area type from text name
 AreaType get_area_type( string area ) {
     if ( area == "AirportKeep" ) {
@@ -151,6 +110,10 @@ string get_area_name( AreaType area ) {
 
 
 // $Log$
+// Revision 1.5  1999/03/22 23:49:29  curt
+// Moved AreaType get_shapefile_type(GDBFile *dbf, int rec) to where it
+// belongs in ShapeFile/
+//
 // Revision 1.4  1999/03/13 18:47:04  curt
 // Removed an unused variable.
 //
index 168df64d86c9a1b066d1337503a30020a4943b85..78c85d339e68655fe418fb3ec04949ef27966435 100644 (file)
 #define _NAMES_HXX
 
 
-// libgfc.a includes need this bit o' strangeness
-#if defined ( linux )
-#  define _LINUX_
-#endif
-#include <gfc/gadt_polygon.h>
-#include <gfc/gdbf.h>
-#undef E
-#undef DEG_TO_RAD
-#undef RAD_TO_DEG
-
-
 // Posible shape file types.  Note the order of these is important and
 // defines the priority of these shapes if they should intersect.  The
 // smaller the number, the higher the priority.
@@ -59,9 +48,6 @@ enum AreaType {
 };
 
 
-// return the type of the shapefile record
-AreaType get_shapefile_type(GDBFile *dbf, int rec);
-
 // return area type from text name
 AreaType get_area_type( string area );
 
@@ -73,6 +59,10 @@ string get_area_name( AreaType area );
 
 
 // $Log$
+// Revision 1.4  1999/03/22 23:49:30  curt
+// Moved AreaType get_shapefile_type(GDBFile *dbf, int rec) to where it
+// belongs in ShapeFile/
+//
 // Revision 1.3  1999/03/01 15:35:53  curt
 // Generalized the routines a bit to make them more useful.
 //
index f85ec18b40d1d1ef7675c3edff1b056564333b5f..b0e629575be0c9fc86ce57c7cfef2bd748c0fddd 100644 (file)
@@ -53,6 +53,47 @@ extern "C" {
 #include "shape.hxx"
 
 
+// return the type of the shapefile record
+AreaType get_shapefile_type(GDBFile *dbf, int rec) {
+    // GDBFieldDesc *fdesc[128];       // 128 is an arbitrary number here
+    GDBFValue *fields;         //an array of field values
+    char* dbf_rec;             //a record containing all the fields
+
+    // grab the meta-information for all the fields
+    // this applies to all the records in the DBF file.
+    // for ( int i = 0; i < dbf->numFields(); i++ ) {
+    //   fdesc[i] = dbf->getFieldDesc(i);
+    //   cout << i << ") " << fdesc[i]->name << endl;
+    // }
+
+    // this is the whole name record
+    dbf_rec = dbf->getRecord( rec );
+
+    // parse it into individual fields
+    if ( dbf_rec ) {
+       fields = dbf->recordDeform( dbf_rec );
+    } else {
+       return UnknownArea;
+    }
+
+    string area = fields[4].str_v;
+    // strip leading spaces
+    while ( area[0] == ' ' ) {
+       area = area.substr(1, area.length() - 1);
+    }
+    // strip trailing spaces
+    while ( area[area.length() - 1] == ' ' ) {
+       area = area.substr(0, area.length() - 1);
+    }
+    // strip other junk encountered
+    while ( (int)area[area.length() - 1] == 9 ) {
+       area = area.substr(0, area.length() - 1);
+    }
+
+    return get_area_type( area );
+}
+
+
 int main( int argc, char **argv ) {
     gpc_polygon gpc_shape;
     int i, j;
@@ -265,6 +306,10 @@ int main( int argc, char **argv ) {
 
 
 // $Log$
+// Revision 1.8  1999/03/22 23:49:36  curt
+// Moved AreaType get_shapefile_type(GDBFile *dbf, int rec) to where it
+// belongs in ShapeFile/
+//
 // Revision 1.7  1999/03/17 23:51:29  curt
 // Changed polygon index counter file.
 //