VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Protected Member Functions | Static Protected Member Functions
makVrv::DtTerrapageHeaderParser Class Reference

DtTerrapageHeaderParser parses coordinate system info from TerraPage (.txp) terrain database archives.

The parser first looks for a companion projInfo.txt file in the same directory as the .txp file (this is the standard TerraPage convention). That file contains key=value pairs including a selectorId (EPSG code) and origin offsets. Supported coordinate systems are:

Inheritance diagram for makVrv::DtTerrapageHeaderParser:
Inheritance graph
[legend]

Classes

struct  ProjInfoFields
 
struct  TxpHeaderFields
 

Public Member Functions

 DtTerrapageHeaderParser (const std::string &filePath)
 
virtual ~DtTerrapageHeaderParser ()
 
virtual bool isValid ()
 
- Public Member Functions inherited from makVrv::DtHeaderParser
 DtHeaderParser (const std::string &filePath)
 
virtual ~DtHeaderParser ()
 
virtual const std::string & terrainCoordinateSystem ()
 
virtual const std::string & terrainCoordinateSystemParameters ()
 
virtual const std::string & filePath ()
 
const TerrainPatchRecords & terrainPatchRecords () const
 
TerrainPatchRecords & terrainPatchRecords ()
 

Protected Member Functions

virtual bool parseTxpHeader (TxpHeaderFields &fields)
 
virtual bool buildCoordinateSystem (const TxpHeaderFields &fields)
 
virtual std::string projInfoPath () const
 
virtual bool parseProjInfoFile (const std::string &path, ProjInfoFields &fields)
 
virtual bool buildFromProjInfo (const ProjInfoFields &fields)
 

Static Protected Member Functions

static int swapInt32 (int value, bool swap)
 
static double swapFloat64 (double value, bool swap)
 

Additional Inherited Members

- Public Types inherited from makVrv::DtHeaderParser
typedef std::list
< makArchives::DtTerrainPatchRecord > 
TerrainPatchRecords
 
- Protected Attributes inherited from makVrv::DtHeaderParser
std::string myFilePath
 
std::string myTerrainCoordinateSystem
 
std::string myTerrainCoordinateSystemParameters
 
TerrainPatchRecords myTerrainPatchRecords
 

Constructor & Destructor Documentation

makVrv::DtTerrapageHeaderParser::DtTerrapageHeaderParser ( const std::string &  filePath)

CTOR.

virtual makVrv::DtTerrapageHeaderParser::~DtTerrapageHeaderParser ( )
virtual

DTOR.

Member Function Documentation

virtual bool makVrv::DtTerrapageHeaderParser::isValid ( )
virtual

Returns true if the file was loaded and produced acceptable coordinate system information and origin information.

Implements makVrv::DtHeaderParser.

virtual bool makVrv::DtTerrapageHeaderParser::parseTxpHeader ( TxpHeaderFields &  fields)
protectedvirtual

Open the .txp file and parse the binary TRPGHEADER block. Returns true on success and fills fields.

virtual bool makVrv::DtTerrapageHeaderParser::buildCoordinateSystem ( const TxpHeaderFields &  fields)
protectedvirtual

Build a coordinate converter from projInfo.txt if it exists, then fall back to binary header heuristics. Returns true if a supported projection was detected.

virtual std::string makVrv::DtTerrapageHeaderParser::projInfoPath ( ) const
protectedvirtual

Return the path to the projInfo.txt companion file for this archive (same directory as the .txp file).

virtual bool makVrv::DtTerrapageHeaderParser::parseProjInfoFile ( const std::string &  path,
ProjInfoFields &  fields 
)
protectedvirtual

Read and parse the projInfo.txt key=value file. Returns true if the file was found and at least one usable field was read.

virtual bool makVrv::DtTerrapageHeaderParser::buildFromProjInfo ( const ProjInfoFields &  fields)
protectedvirtual

Build the coordinate system from already-parsed ProjInfo fields. Returns true if a supported projection was detected.

static int makVrv::DtTerrapageHeaderParser::swapInt32 ( int  value,
bool  swap 
)
staticprotected

Apply byte-swapping to a 4-byte integer if needed.

static double makVrv::DtTerrapageHeaderParser::swapFloat64 ( double  value,
bool  swap 
)
staticprotected

Apply byte-swapping to an 8-byte double if needed.


The documentation for this class was generated from the following file:

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)