VR-Forces 4.0.4 Class Documentation
include/flt/mgWrapperInterface.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 2011 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 
00006 #pragma once
00007 #include "flt/fltDefines.h"
00008 #include "vlutil/vlFilename.h"
00009 #include "gdb/gdbNode.h"
00010 #include "geometry/gdbColor.h"
00011 #include <map>
00012 #include <string>
00013 #include "gdb/terrainDb.h"
00014 #include "gdb/terrainInitializer.h"
00015 #include "surfCharMap.h"
00016 #include "fltTerrainInit.h"
00017 #include "dted/dfad_data.h"
00018 #include "vlutil/vlDynamic.h"
00019 
00020 
00021 // The OpenFlight API 4.1 build is built against the VC8 C runtime,
00022 // and as a result requires two symbols, _ftol2_sse and _stat64i32,
00023 // which don't exist on VC7. These two functions have essentially
00024 // equivalent implementations in the VC7 C runtime, with slightly
00025 // different names. 
00026 // See msdn.microsoft.com/en-us/library/14h5k7ff(VS.80).aspx
00027 //     connect.microsoft.com/VisualStudio/feedback/details/107716
00028 //
00029 // Our solution below is to define the VC8 symbols using the VC7
00030 // names for VC7 only
00031 #ifdef _WIN32
00032 #if _MSC_VER < 1400
00033 extern "C" {
00034    long _ftol( double f );
00035    long _ftol2_sse( double dblSource ) { return _ftol( dblSource ); }
00036    int _stat( const char *path, struct _stat *buffer );
00037    int _stat64i32 (const char *path, struct _stat *buffer ) { return _stat (path, buffer); }
00038 }
00039 #endif
00040 #endif
00041 
00042 class DtFltPathNode;
00043 
00044 typedef std::map<std::string, DtFltPathNode*> DtFltPathMap;
00045 
00046 class DT_DLL_flt DtFltPathNode
00047 {
00048 public:
00049    virtual ~DtFltPathNode()
00050    {
00051       DtFltPathMap::iterator iter = myNodes.begin();
00052       DtFltPathMap::iterator end = myNodes.end();
00053 
00054       while (iter != end)
00055       {
00056          delete iter->second;
00057          ++iter;
00058       }
00059    };
00060 
00061    DtFltPathMap myNodes;
00062 };
00063 
00064 class DT_DLL_flt FlightTranslatedDatabaseListItem
00065 {
00066 public:
00067 
00068    FlightTranslatedDatabaseListItem(const DtFilename& fname, DtGdbNode* n,
00069       double lod);
00070    virtual ~FlightTranslatedDatabaseListItem();
00071 
00072    DtFilename myFilename;
00073    DtGdbNode* myNode;
00074    double myLodDistance;
00075    FlightTranslatedDatabaseListItem* myNext;
00076 };
00077 
00078 
00079 class DT_DLL_flt FlightTextureNameToColorListItem
00080 {
00081 public:
00082 
00083    FlightTextureNameToColorListItem(const DtFilename& textureReferenceName,
00084       const DtColor& averagedColor);
00085    virtual ~FlightTextureNameToColorListItem();
00086 
00087    DtFilename myTextureReferenceName;
00088    DtColor myAveragedColor;
00089    FlightTextureNameToColorListItem* myNext;
00090 };
00091 
00092 
00093 class DT_DLL_flt DtMgWrapperInterface 
00094 {
00095 public:
00096    DtMgWrapperInterface();
00097    virtual ~DtMgWrapperInterface();
00098    virtual bool readDfdFile(DtFilename filename, DtDfadData &data) const = 0;
00099    virtual DtGdbNode* xlateOpenFlightFile(const DtFilename& filename) = 0;
00100    virtual void setTerrainDatabase(DtTerrainDatabase* terrainDB);
00101    
00102    inline DtSurfaceCharacteristicMap& surfaceCharacteristicMap() { return mySurfaceCharacteristicMap; }
00103    inline const DtSurfaceCharacteristicMap& surfaceCharacteristicMap() const { return mySurfaceCharacteristicMap; }
00104 
00105    inline void setSurfaceCharacteristicMap(DtSurfaceCharacteristicMap sMap)
00106    {
00107       mySurfaceCharacteristicMap = sMap;
00108    }
00109    inline void setTerrainInitializer(const DtTerrainInitializer* initializer)
00110    {
00111       myTerrainInitializer = initializer;
00112    }
00113 
00114    void setFlightInitializer(DtFlightTerrainInitializer initializer);
00115 protected:
00116    DtTerrainDatabase* myTerrainDatabase;
00117    const DtTerrainInitializer* myTerrainInitializer;
00118    DtSurfaceCharacteristicMap mySurfaceCharacteristicMap;
00119    // Holds possible spheroid information (copy of object in DtFltReader)
00120    DtFlightTerrainInitializer myFlightInitializer;
00121 
00122    double myOriginLatitudeDegrees;
00123    double myOriginLongitudeDegrees;
00124    bool myOriginHasBeenRead;
00125 
00126    FlightTextureNameToColorListItem* myAlreadyAveragedTextures;
00127 };
00128 
00129 typedef DtMgWrapperInterface* DtMgWrapperObjectCreator();
00130 typedef void DtMgWrapperObjectDestroyer(DtMgWrapperInterface*);
00131 
00132 class DT_DLL_flt DtMgDllWrapper
00133 {
00134 public:
00135    static void initializeMgWrapper();
00136    static void unInitializeMgWrapper();
00137    static DtMgWrapperInterface* newMgWrapperInterfaceObject();
00138    static void deleteMgWrapperInterfaceObject(DtMgWrapperInterface* object);
00139 
00140 protected:
00141    static DtDynamicLibrary* theMgWrapperDllHandle;
00142 };

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)