VR-Forces 4.0.4 Class Documentation
include/ctdb/c4b.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 2003 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 /*******************************************************************************
00006 ** $RCSfile: c4b.h,v $ $Revision: 1.21 $ $State: Exp $
00007 *******************************************************************************/
00008 
00009 #ifndef c4b_H
00010 #define c4b_H
00011 
00012 #include "ctdb/ctdbDefines.h"
00013 #include <vlutil/vlNetTypes.h>
00014 
00015 #include <vlutil/vlPrint.h>
00016 
00017 #include "geometry/point.h"
00018 #include "gdb/gdbNode.h"
00019 #include "gdb/group.h"
00020 #include "gdb/feature.h"
00021 #include "gdb/gridPstLst.h"
00022 #include "gdb/surfMgr.h"
00023 #include "geometry/surface.h"
00024 #include "gdb/terrainReader.h"
00025 
00026 #include "gdb/terrainDb.h"
00027 
00028 #define DO_CANOPIES
00029 #define DO_TREES
00030 #define DO_TREELINES
00031 #define DO_LINEAR_FEATURES
00032 #define DO_BUILDINGS
00033 #define DO_GRID_POSTS
00034 #define DO_TINS
00035 #define DO_MICRO_TERRAIN
00036 
00037 
00038 static const int CTDB_N_SOILS = 16;
00039 
00040 static const int DATUM_ED50             = 0;
00041 static const int DATUM_ED79             = 1;
00042 static const int DATUM_WGS72            = 2;
00043 static const int DATUM_WGS84            = 3;
00044 static const int DATUM_CONUSNAD27       = 4;
00045 static const int DATUM_NASBNAD27        = 5;
00046 static const int DATUM_NASANAD27        = 6;
00047 static const int DATUM_NAD83            = 7;
00048 static const int DATUM_ADINDAN          = 8;
00049 static const int DATUM_ARC50            = 9;
00050 static const int DATUM_AUSTRALIAN       = 10;
00051 static const int DATUM_BUKITRIMPAH      = 11;
00052 static const int DATUM_CAMPAREAASTRO    = 12;
00053 static const int DATUM_DJAKARTA         = 13;
00054 static const int DATUM_GEOD49           = 14;
00055 static const int DATUM_GUAM63           = 15;
00056 static const int DATUM_GUNUNGSEGARA     = 16;
00057 static const int DATUM_HERATNORTH       = 17;
00058 static const int DATUM_HJORSEY55        = 18;
00059 static const int DATUM_INDIAN           = 19;
00060 static const int DATUM_IRELAND65        = 20;
00061 static const int DATUM_KERTAU48         = 21;
00062 static const int DATUM_LIBERIA64        = 22;
00063 static const int DATUM_LUZON            = 23;
00064 static const int DATUM_MERCHICH         = 24;
00065 static const int DATUM_NIGERIA          = 25;
00066 static const int DATUM_ALASKACANADA27   = 26;
00067 static const int DATUM_MAUI             = 27;
00068 static const int DATUM_OAHU             = 28;
00069 static const int DATUM_KAUAI            = 29;
00070 static const int DATUM_GREATBRITAIN36   = 30;
00071 static const int DATUM_QORNOQ           = 31;
00072 static const int DATUM_SACAMPOINCHAUSPE = 32;
00073 static const int DATUM_SACHUAASTRO      = 33;
00074 static const int DATUM_SACORREGOALEGRE  = 34;
00075 static const int DATUM_SAPROVISIONAL56  = 35;
00076 static const int DATUM_SAYACARE         = 36;
00077 static const int DATUM_TAMANARIVEOBSV25 = 37;
00078 static const int DATUM_TIMBOLAI48       = 38;
00079 static const int DATUM_TOKYO            = 39;
00080 
00081 static const int CTDB_PATCH_CACHES = 16;
00082 static const int CTDB_NAME_LENGTH = 14;
00083 static const int CTDB_DATE_LENGTH = 28;
00084 static const int CTDB_HEADER_RESERVED = 10;
00085 
00086 class DtC4bReader;
00087 
00088 DT_DLL_ctdb double scale_to_patch(double bar);  
00089 
00090 /*
00091  * Class definitions.
00092  */
00093 
00094 class DT_DLL_ctdb c4b_file_header_format
00095 {
00096   public:
00097 
00098     bool is_curved();
00099     bool is_sw_ne();
00100     bool is_gridded();
00101     bool is_tinned();
00102     void describe();
00103 
00104   private:
00105 
00106     DtNetU32   raw_bits;
00107 };
00108     
00109 
00110 /*
00111  * These values were determined from a combination of s1000 and modsaf rdr files.
00112  */
00113 
00114 typedef enum
00115 {
00116   C4B_SOIL_NON_C4B_SOIL = 0,  // Unknown type of soil 
00117   C4B_SOIL_ROAD = 1,    // Asphalt or other hard surface     
00118   C4B_SOIL_RCI250 = 2,     // Packed soil or dirt road          
00119   C4B_SOIL_RCI050 = 3,     // Soft sandy soil                   
00120   C4B_SOIL_DEEP_WATER = 4, // Impassable deep water             
00121   C4B_SOIL_SHALLOW_WATER = 5, // Passable shallow water            
00122   C4B_SOIL_MUD = 6,     // Muddy soil                        
00123   C4B_SOIL_MUDDY_ROAD = 7, // Wet dirt road                     
00124   C4B_SOIL_ICE = 8,     // Slick ice surface                 
00125   C4B_SOIL_SWAMP = 9,      // Very soft surface                 
00126   C4B_SOIL_FORRESTED = 10, // Canopy or forrested area          
00127   C4B_SOIL_US_RAILROAD = 11,  // Railroad w/ US specifications     
00128   C4B_SOIL_EURO_RAILROAD = 12,   // Railroad w/ European specs.       
00129   C4B_SOIL_ROCKY = 13,     // Small rocks <= 18 inches          
00130   C4B_SOIL_BOULDERS = 14,  // Large boulders 6 ft. high         
00131 
00132   // Weird, eh?  (What a kludge.) 
00133 
00134   C4B_SOIL_FLIMSY = 15,    // Indoor surface for DI             
00135   C4B_SOIL_NO_GO = 15      // General No Go Terrain for NTC     
00136 
00137 } c4b_s1000_soil_type;
00138 
00139 
00140 
00141 
00142 class DT_DLL_ctdb c4b_soil_map_entry
00143 {
00144   public:
00145 
00146     bool    is_water();
00147     bool    is_no_go();
00148     bool    is_slow_go();
00149     bool    is_road();
00150     unsigned int     CCTT_constant();
00151     c4b_s1000_soil_type SIMNET_constant();
00152     void    describe();
00153 
00154   private:
00155 
00156     DtNetU32   raw_bits;
00157 };
00158 
00159 
00160 class DT_DLL_ctdb c4b_file_header
00161 {
00162   public:
00163     bool       read(FILE *fp);
00164     void       describe();
00165 
00166     DtNetInt32       format;
00167     c4b_file_header_format db_format;
00168     DtNetFloat64     fixed_point_basis;
00169     c4b_soil_map_entry     soil_map[CTDB_N_SOILS];
00170     DtNetInt32       post_increment;
00171     DtNetInt32       posts_per_patch_side;
00172     DtNetInt32       pages_wide;
00173     DtNetInt32       pages_high;
00174     DtNetInt32       min_x;
00175     DtNetInt32       max_x;
00176     DtNetInt32       min_y;
00177     DtNetInt32       max_y;
00178     DtNetInt32       num_features; // physical features 
00179     DtNetInt32       patch_cache_size_map[CTDB_PATCH_CACHES];
00180     DtNetInt32       pad2;
00181     DtNetFloat64     origin_northing;
00182     DtNetFloat64     origin_easting;
00183     DtNetInt32       origin_zone_number;
00184     DtNetInt32       origin_zone_letter;
00185     DtNetInt32       datum;
00186     DtNetU8       name[CTDB_NAME_LENGTH];
00187     DtNetInt16       version;
00188     DtNetU8       date[CTDB_DATE_LENGTH];
00189     DtNetInt32       num_nodes;
00190     DtNetInt32       node_size;
00191     DtNetInt32       num_edges;
00192     DtNetInt32       edge_size;
00193     DtNetInt32       num_quad_data; // abstract features 
00194     DtNetInt32       n_patch_bytes;
00195     DtNetInt32       reserved[CTDB_HEADER_RESERVED];
00196 };
00197  
00198 
00199 /*
00200  * Patch group headers.
00201  */
00202 class DT_DLL_ctdb c4b_patch_group_entry
00203 {
00204   public:
00205 
00206     unsigned int  cache();
00207     bool mapped();
00208     bool contains_tins();
00209     bool patch0_occupied();
00210     bool patch0_dyn_terr();
00211     bool patch0_ta16();
00212     bool patch0_no_tas();
00213     bool patch1_occupied();
00214     bool patch1_dyn_terr();
00215     bool patch1_ta16();
00216     bool patch1_no_tas();
00217     bool patch2_occupied();
00218     bool patch2_dyn_terr();
00219     bool patch2_ta16();
00220     bool patch2_no_tas();
00221     bool patch3_occupied();
00222     bool patch3_dyn_terr();
00223     bool patch3_ta16();
00224     bool patch3_no_tas();
00225     unsigned int  unused();
00226 
00227     bool read(FILE* fp);
00228     void describe();
00229 
00230     unsigned int  offset();
00231 
00232   private:
00233 
00234     DtNetU32   data_start; // byte offset for patch group's data fromstart of all patch group data 
00235     DtNetU32   raw_bits;
00236 };
00237     
00238 
00239 class DT_DLL_ctdb c4b_patch_group_headers
00240 {
00241   public:
00242 
00243     c4b_patch_group_headers(unsigned int num_patch_groups);
00244 
00245     int  num_in_x;
00246     int  num_in_y;
00247     int  num_patch_groups;
00248 
00249     c4b_patch_group_entry* entry;
00250 
00251     bool read(FILE* fp, bool debug = false);
00252 };
00253 
00254 
00255 
00256 /*
00257  * Topology -- Nodes.
00258  */
00259 class DT_DLL_ctdb c4b_node_flags
00260 {
00261   public:
00262   
00263     bool is_bridge();
00264     unsigned int  padding();
00265     DtU8 num_connections();
00266 
00267     void describe();
00268 
00269   private:
00270     DtNetU32   raw_bits;
00271 };
00272 
00273 class DT_DLL_ctdb c4b_node_ctdb_connection
00274 {
00275   public:
00276 
00277     int  Node();
00278     int  Edge();
00279 
00280     bool read(FILE* fp);
00281     void describe();
00282 
00283   private:
00284 
00285     DtNetInt32 node;
00286     DtNetInt32 edge;
00287 };
00288 
00289 class DT_DLL_ctdb c4b_node
00290 {
00291   public:
00292 
00293     DtFloat32     X();
00294     DtFloat32     Y();
00295     bool    read(FILE* fp);
00296     void    describe();
00297 
00298     c4b_node_flags   flags;
00299     c4b_node_ctdb_connection* connection;
00300 
00301   private:
00302 
00303     DtNetFloat32  x;
00304     DtNetFloat32  y;
00305 };
00306     
00307 
00308 /*
00309  * Topology -- Edges.
00310  */
00311 class DT_DLL_ctdb c4b_edge_ctdb_feature_reference
00312 {
00313   public:
00314 
00315     unsigned int  patch_offset();
00316     unsigned int  quad_offset();
00317     bool reverse();
00318     unsigned int  padding();
00319     bool is_abstract_feature();
00320 
00321     bool read(FILE *fp);
00322     void describe();
00323 
00324   private:
00325 
00326     DtNetU32   patch_number;
00327     DtNetU32   raw_bits;
00328 };
00329 
00330 class DT_DLL_ctdb c4b_edge
00331 {
00332   public:
00333 
00334     bool read(FILE *fp);
00335     void describe();
00336 
00337   private:
00338 
00339     DtNetInt32 distance;
00340     DtNetInt32 first_node;
00341     DtNetInt32 last_node;
00342     DtNetInt32 num_features;
00343   
00344     c4b_edge_ctdb_feature_reference *feature;
00345 };
00346 
00347 
00348 /*
00349  * Abstract features. 
00350  */
00351 class DT_DLL_ctdb c4b_abstract_feature_info
00352 {
00353   public:
00354 
00355     bool read(FILE *fp);
00356     void describe();
00357 
00358   private:
00359 
00360     DtNetU8 type_code;
00361     DtNetU8 data_size;  // 4 byte units 
00362     DtNetU16   num_vertices;
00363 };
00364 
00365 
00366 /*
00367  * Feature data.
00368  */
00369 class DT_DLL_ctdb c4b_xyo_coord2d
00370 {
00371   public:
00372 
00373     void describe();
00374 
00375     void SetVec(DtPoint &v);
00376     double  X();
00377     double  Y();
00378 
00379   private:
00380 
00381     DtNetU16   x;
00382     DtNetU16   y;
00383 };
00384 
00385 class DT_DLL_ctdb c4b_patch_hdr
00386 {
00387   public:
00388 
00389     DtU16   Size();
00390     void describe();
00391 
00392   private:
00393 
00394     DtNetU16   size;    // number of CTDB_FEATURE_DATA things in this patch (incl this hdr) 
00395     DtNetU16   pad;
00396 };
00397 
00398 
00399 static const int FT_MICRO    = 0;
00400 static const int FT_BUILDING = 1;
00401 static const int FT_TREE     = 2;
00402 static const int FT_CANOPY   = 3;
00403 static const int FT_LINEAR   = 4;
00404 
00405 class DT_DLL_ctdb c4b_feature_info
00406 {
00407   public:
00408 
00409     DtU8 FeatureType();
00410     DtU8 Vertices();
00411     unsigned int  PostMask();
00412     DtU8 MicroTerrainType();
00413 
00414     void describe();
00415 
00416   private:
00417 
00418     DtNetU32   raw_bits;
00419 };
00420 
00421 
00422 static const int CTDB_EDGE_KEY   = 4096;
00423 
00424 class DT_DLL_ctdb c4b_linear_info
00425 {
00426   public:
00427 
00428     double  Width();
00429     DtU8 Soil();
00430     DtU16   EdgeKey();
00431 
00432     void describe();
00433 
00434   private:
00435 
00436     DtNetU16   width;
00437     DtNetU16   soil_and_edge_key;
00438 };
00439 
00440 
00441 class DT_DLL_ctdb c4b_treeline_info
00442 {
00443   public:
00444 
00445     double  Radius();
00446     bool First();
00447     bool Last();
00448     double  Height();
00449     void describe();
00450 
00451   private:
00452 
00453     DtNetU16   radius;
00454     DtNetU16   first_last_height;
00455 };
00456 
00457 
00458 class DT_DLL_ctdb c4b_micro_pts
00459 {
00460   public:
00461 
00462     DtU8 Soil0();
00463     DtU8 Soil1();
00464     DtU8 Vert0();
00465     DtU8 Vert1();
00466     DtU8 Vert2();
00467 
00468     void describe();
00469 
00470   private:
00471     DtNetU8 soil0_and_soil1;
00472     DtNetU8 vert0;
00473     DtNetU8 vert1;
00474     DtNetU8 vert2;
00475 };
00476 
00477 
00478 /*
00479  * Grid post.
00480  */
00481 class DT_DLL_ctdb c4b_grid_post
00482 {
00483   public:
00484 
00485     DtU8 soil_of_northern_tri();
00486     DtU8 soil_of_southern_tri();
00487     bool either_tri_has_features();
00488     bool either_tri_has_buildings();
00489     bool either_tri_has_trees_or_treelines();
00490     bool either_tri_has_microterrain();
00491     int  scaled_elevation();
00492 
00493     bool read(FILE* fp);
00494     void describe();
00495 
00496   private:
00497 
00498     DtNetU32   raw_bits;
00499 };
00500 
00501 
00502 /*
00503  * Patch Terrain Elements.
00504  */
00505 class DT_DLL_ctdb c4b_te_info
00506 {
00507   public:
00508 
00509     void describe();
00510 
00511     DtU8 Blank1() { return((bvp&0xc0) >> 6); };
00512     DtU8 Vertices()  { return((bvp&0x30) >> 4); };
00513     DtU8 PatchAdj()  { return((bvp&0x0f)); };
00514 
00515     DtU8 Soil0()  { return(soil0); };
00516     DtU8 Soil1()  { return(soil1); };
00517     DtU8 AdjSides()  { return(adj_sides); };
00518 
00519   private:
00520 
00521     DtNetU8 bvp;
00522     DtNetU8 soil0;
00523     DtNetU8 soil1;
00524     DtNetU8 adj_sides;
00525 };
00526 
00527 
00528 
00529 static const int TE_VERT_DIMENSION  = 3;
00530 static const int TE_ADJ_TRI_MAP_DIMENSION = 4;
00531 template<class Type>class c4b_terrain_element
00532 {
00533    public:
00534 
00535    void  describe()
00536    {
00537       DtInfo("template c4b_terrain_element::describe\n");
00538       
00539       DtInfo("  "); 
00540       pt.describe();
00541       
00542       double native_z = (double)z;
00543       DtInfo("  ");DtInfo("z=%lf\n", native_z);
00544       
00545       DtInfo("  ");
00546       vert.describe();
00547       
00548       DtInfo("  ");
00549       info.describe();
00550    }
00551 
00552    class c4b_assoc_vertex
00553    {
00554       public:
00555 
00556       void  describe()
00557       {
00558          DtInfo("c4b_assoc_vertex: ");
00559 
00560          for (int i = 0; i < TE_VERT_DIMENSION; i++)
00561          {
00562             DtInfo(" index[%d]=%u,", i, (DtU16) index[i]);
00563          }
00564          DtInfo("\n");
00565       }
00566 
00567       Type  index[TE_VERT_DIMENSION];
00568       Type  padding1;
00569    };
00570 
00571    c4b_xyo_coord2d  pt;
00572    DtNetFloat32     z;
00573    Type adj[TE_ADJ_TRI_MAP_DIMENSION];
00574    c4b_assoc_vertex vert;
00575    c4b_te_info      info;
00576 };    
00577 
00578 typedef c4b_terrain_element<DtNetU8>   c4b_terrain_element_8;
00579 typedef c4b_terrain_element<DtNetU16>  c4b_terrain_element_16;
00580 
00581 
00582 static const int CTDB_PATCHES_PER_GROUP = 4;
00583 static const int CTDB_MAX_POSTS_PER_PATCH = 16;
00584 /*
00585  *
00586  */
00587 class DT_DLL_ctdb c4b_tin_pg_data
00588 {
00589 public:
00590 
00591     DtU16      Patch1Offset();
00592     DtU16      Patch2Offset();
00593     DtU16      Patch3Offset();
00594     void       describe();
00595 
00596 //  private:
00597 
00598    DtNetFloat32   max_elev[CTDB_PATCHES_PER_GROUP];
00599    // In 32-bit words. 
00600    DtNetU16    patch1_offset;
00601    DtNetU16    patch2_offset;
00602    DtNetU16    patch3_offset;
00603    DtNetU16    unused;
00604    DtNetU8        feature_present[CTDB_MAX_POSTS_PER_PATCH * 2];
00605    DtNetU16    num_te[CTDB_PATCHES_PER_GROUP];
00606    DtNetU32    te_offset[CTDB_PATCHES_PER_GROUP];
00607    DtNetU8        te_vgrid_dim[CTDB_PATCHES_PER_GROUP];
00608    DtNetU32    te_vgrid_offset[CTDB_PATCHES_PER_GROUP];
00609 };
00610 
00611 
00612 class DT_DLL_ctdb c4b_grid_pg_data
00613 {
00614 public:
00615 
00616    DtU16    Patch1Offset();
00617    DtU16    Patch2Offset();
00618    DtU16    Patch3Offset();
00619    void     describe();
00620 
00621 private:
00622 
00623    DtNetFloat32   max_elev[CTDB_PATCHES_PER_GROUP];
00624    // In 32-bit words. 
00625    DtNetU16    patch1_offset;
00626    DtNetU16    patch2_offset;
00627    DtNetU16    patch3_offset;
00628    DtNetU16    unused;
00629 };
00630 
00631 
00632 class C4B;
00633 class MyC4BPatchGroup;
00634 
00635 class DT_DLL_ctdb MyC4B
00636 {
00637 public:
00638 
00639    void     parse(C4B &c4b,
00640                   progressCallbackStartFunction *prog_start_fcnp,
00641                   progressCallbackSetValueFunction *prog_set_value_fcnp,
00642                   progressCallbackEndFunction *prog_end_fcnp);
00643    void     parse_soil_types(C4B &c4b);
00644    void     parse_grid_posts(C4B &c4b);
00645    void     xlate(C4B &c4b,
00646                   DtC4bReader* tdb,
00647                   progressCallbackStartFunction *prog_start_fcnp,
00648                   progressCallbackSetValueFunction *prog_set_value_fcnp,
00649                   progressCallbackEndFunction *prog_end_fcnp);
00650    void     xlate_soil_types(c4b_file_header &hdr);
00651 
00652    virtual DtC4bReader* reader() const;
00653    virtual void setReader(DtC4bReader* reader); 
00654 
00655    // increment the feature count of the terrain database as each new feature
00656    // is created, and return the updated count.
00657    int incrementTdbFeatureCount();
00658 
00659    MyC4BPatchGroup*  patch_group;
00660    DtGridPostList*   grid_post_vertex_list;
00661 
00662    DtSurfaceManager* mySurfaces;
00663    DtSurface*        myTree_surface;
00664    DtSurface*        myBuilding_surface;
00665     
00666    int*              tri1_soil_type;
00667    int*              tri2_soil_type;
00668 
00669    DtC4bReader*   myReader;
00670    int            myTdbFeatureCount;   // feature count in terrain database.
00671 };
00672 
00673 
00674 inline DtC4bReader* MyC4B::reader() const
00675 {
00676    return myReader;
00677 }
00678 
00679 
00680 inline void MyC4B::setReader(DtC4bReader* reader)
00681 {
00682    assert(reader != 0);
00683    myReader = reader; 
00684 }
00685 
00686 
00687 inline int MyC4B::incrementTdbFeatureCount()
00688 {
00689    return(++myTdbFeatureCount);
00690 }
00691 
00692 
00693 /*
00694  *
00695  */
00696 class DT_DLL_ctdb C4B
00697 {
00698    public:
00699 
00700    bool  read(FILE* fp,
00701               progressCallbackStartFunction* prog_start_fcnp,
00702               progressCallbackSetValueFunction* prog_set_value_fcnp,
00703               progressCallbackEndFunction* prog_end_fcnp);
00704    void  describe();
00705 
00706    void  xlate(DtC4bReader* tdb,
00707                progressCallbackStartFunction* prog_start_fcnp,
00708                progressCallbackSetValueFunction* prog_set_value_fcnp,
00709                progressCallbackEndFunction* prog_end_fcnp);
00710 
00711    unsigned int patch0_number_from_patch_group_number(unsigned int patch_group_num);
00712 
00713    bool read_patch_group_headers(bool debug = false);
00714    bool read_nodes(bool debug = false);
00715    bool read_edges(bool debug = false); 
00716    bool read_feature_data();
00717    bool read_grid_posts(bool debug = false);
00718    bool read_all_patch_data(bool debug = false);
00719 
00720    // returns a pointer to a memory manager class that handles
00721    // allocations of a group of objects (polygons, groups, grids, 
00722    // features, etc.)
00723    virtual DtC4bReader* reader() const;
00724 
00725    FILE*             fp;
00726 
00727    c4b_file_header  my_ctdb;
00728    c4b_patch_group_headers*  patch_group_headers;
00729    c4b_node*        nodes;
00730    c4b_edge*        edges;
00731 
00732    c4b_grid_post*   grid_posts;
00733 
00734    unsigned int     num_grid_posts;
00735 
00736    DtU8*            patch_data;
00737 
00738    // Derived stuff. 
00739    void  unpack();
00740    unsigned int num_pages;
00741    unsigned int num_patches;
00742    unsigned int num_patch_groups;
00743    unsigned int num_patches_wide;
00744    unsigned int num_patches_high;
00745    unsigned int num_posts_wide;
00746 
00747    MyC4B parsed_c4b;
00748 };
00749 
00750 
00751 inline DtC4bReader* C4B::reader() const
00752 {
00753    return(parsed_c4b.reader());
00754 }
00755 
00756 
00757 
00758 /*
00759  * Compact Terrain Database Format 4
00760  */
00761 class DtMetafileRecord;
00762 
00763 class DT_DLL_ctdb DtC4bReader: public DtTerrainReader
00764 {
00765 public:
00766 
00767     DtC4bReader();
00768 
00769     virtual ~DtC4bReader();
00770 
00771    // Override to set ourselves as the reader in my_ctdb, after calling
00772    // down to base class version.
00773    virtual void init(const DtFilename& filename, 
00774                      DtTerrainDatabase* terrain);
00775 
00776    // Loads terrain database file named filename, returning the data in 
00777    // terrain.  The terrain pointer passed in must be initialized before calling 
00778    // loadTerrain.
00779    virtual bool loadTerrain(const DtFilename& filename, 
00780                             DtTerrainDatabase* terrain);
00781 
00782    // Loads terrain database file named filename, returning the data in 
00783    // terrain.  The initializer object is used to pass in additional information
00784    // about the terrain to be loaded.  The terrain pointer passed in must be 
00785    // initialized before calling loadTerrain.
00786    virtual bool loadTerrain(const DtFilename& filename, 
00787                             DtTerrainDatabase* terrain, 
00788                             const DtTerrainInitializer* initializer);
00789 
00790    // Returns "c4b"
00791    virtual const DtString dataType() const;
00792 
00793    C4B   my_ctdb;
00794 
00795    static DtTerrainReader* create();
00796 
00797    // Returns only the coordinate system that would define this database.  Should not load
00798    // any polygonal or vector information
00799    virtual Coordinate_System* coordinateSystem(const DtFilename& filename);
00800 
00801    virtual int optionalFileFlags(const DtFilename& filename)
00802    {
00803       return 0;
00804    }
00805 
00806 protected:
00807 
00808    bool read(const DtFilename& filename);
00809    bool import();
00810 };
00811 
00812 #endif
00813 

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)