VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
mgWrapperInterface.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2011 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 #include "flt/fltDefines.h"
8 #include "vlutil/vlFilename.h"
9 #include "gdb/gdbNode.h"
10 #include "geometry/color.h"
11 #include <map>
12 #include <string>
13 #include "gdb/terrainDatabase.h"
14 #include "gdb/terrainInitializer.h"
17 #include "dted/dfadData.h"
18 #include "vlutil/vlDynamic.h"
19 
20 
21 // The OpenFlight API 4.1 build is built against the VC8 C runtime,
22 // and as a result requires two symbols, _ftol2_sse and _stat64i32,
23 // which don't exist on VC7. These two functions have essentially
24 // equivalent implementations in the VC7 C runtime, with slightly
25 // different names.
26 // See msdn.microsoft.com/en-us/library/14h5k7ff(VS.80).aspx
27 // connect.microsoft.com/VisualStudio/feedback/details/107716
28 //
29 // Our solution below is to define the VC8 symbols using the VC7
30 // names for VC7 only
31 #ifdef _WIN32
32 #if _MSC_VER < 1400
33 extern "C" {
34  long _ftol( double f );
35  long _ftol2_sse( double dblSource ) { return _ftol( dblSource ); }
36  int _stat( const char *path, struct _stat *buffer );
37  int _stat64i32 (const char *path, struct _stat *buffer ) { return _stat (path, buffer); }
38 }
39 #endif
40 #endif
41 
43 
44 typedef std::map<std::string, DtFltPathNode*> DtFltPathMap;
45 
47 {
48 public:
49  virtual ~DtFltPathNode()
50  {
51  DtFltPathMap::iterator iter = myNodes.begin();
52  DtFltPathMap::iterator end = myNodes.end();
53 
54  while (iter != end)
55  {
56  delete iter->second;
57  ++iter;
58  }
59  };
60 
61  DtFltPathMap myNodes;
62 };
63 
65 {
66 public:
67 
68  FlightTranslatedDatabaseListItem(const DtFilename& fname, DtGdbNode* n,
69  double lod);
71 
72  DtFilename myFilename;
74  double myLodDistance;
76 };
77 
78 
80 {
81 public:
82 
83  FlightTextureNameToColorListItem(const DtFilename& textureReferenceName,
84  const DtColor& averagedColor);
86 
90 };
91 
92 
94 {
95 public:
97  virtual ~DtMgWrapperInterface();
98  virtual bool readDfdFile(DtFilename filename, DtDfadData &data) const = 0;
99  virtual DtGdbNode* xlateOpenFlightFile(const DtFilename& filename) = 0;
100  virtual void setTerrainDatabase(DtTerrainDatabase* terrainDB);
101 
102  inline DtSurfaceCharacteristicMap& surfaceCharacteristicMap() { return mySurfaceCharacteristicMap; }
103  inline const DtSurfaceCharacteristicMap& surfaceCharacteristicMap() const { return mySurfaceCharacteristicMap; }
104 
106  {
107  mySurfaceCharacteristicMap = sMap;
108  }
109  inline void setTerrainInitializer(const DtTerrainInitializer* initializer)
110  {
111  myTerrainInitializer = initializer;
112  }
113 
114  void setFlightInitializer(DtFlightTerrainInitializer initializer);
115 protected:
119  // Holds possible spheroid information (copy of object in DtFltReader)
121 
125 
127 };
128 
131 
133 {
134 public:
135  static void initializeMgWrapper();
136  static void unInitializeMgWrapper();
137  static DtMgWrapperInterface* newMgWrapperInterfaceObject();
138  static void deleteMgWrapperInterfaceObject(DtMgWrapperInterface* object);
139 
140 protected:
141  static DtDynamicLibrary* theMgWrapperDllHandle;
142 };
DtFlightTerrainInitializer myFlightInitializer
Definition: mgWrapperInterface.h:120
bool myOriginHasBeenRead
Definition: mgWrapperInterface.h:124
Definition: mgWrapperInterface.h:46
#define DT_DLL_flt
Definition: fltDefines.h:23
std::map< std::string, DtFltPathNode * > DtFltPathMap
Definition: mgWrapperInterface.h:42
Definition: gdbNode.h:44
DtFilename myFilename
Definition: mgWrapperInterface.h:72
double myLodDistance
Definition: mgWrapperInterface.h:74
void setTerrainInitializer(const DtTerrainInitializer *initializer)
Definition: mgWrapperInterface.h:109
FlightTextureNameToColorListItem * myAlreadyAveragedTextures
Definition: mgWrapperInterface.h:126
Definition: mgWrapperInterface.h:79
FlightTextureNameToColorListItem * myNext
Definition: mgWrapperInterface.h:89
Definition: color.h:25
const DtTerrainInitializer * myTerrainInitializer
Definition: mgWrapperInterface.h:117
DtSurfaceCharacteristicMap & surfaceCharacteristicMap()
Definition: mgWrapperInterface.h:102
Definition: surfaceCharacteristicMap.h:27
DtFilename myTextureReferenceName
Definition: mgWrapperInterface.h:87
DtTerrainDatabase * myTerrainDatabase
Definition: mgWrapperInterface.h:116
static DtDynamicLibrary * theMgWrapperDllHandle
Definition: mgWrapperInterface.h:141
DtGdbNode * myNode
Definition: mgWrapperInterface.h:73
FlightTranslatedDatabaseListItem * myNext
Definition: mgWrapperInterface.h:75
DtSurfaceCharacteristicMap mySurfaceCharacteristicMap
Definition: mgWrapperInterface.h:118
virtual ~DtFltPathNode()
Definition: mgWrapperInterface.h:49
double myOriginLatitudeDegrees
Definition: mgWrapperInterface.h:122
void DtMgWrapperObjectDestroyer(DtMgWrapperInterface *)
Definition: mgWrapperInterface.h:130
Definition: mgWrapperInterface.h:132
const DtSurfaceCharacteristicMap & surfaceCharacteristicMap() const
Definition: mgWrapperInterface.h:103
Definition: mgWrapperInterface.h:64
DtColor myAveragedColor
Definition: mgWrapperInterface.h:88
Definition: terrainInitializer.h:16
Definition: terrainDatabase.h:148
Definition: mgWrapperInterface.h:93
double myOriginLongitudeDegrees
Definition: mgWrapperInterface.h:123
DtMgWrapperInterface * DtMgWrapperObjectCreator()
Definition: mgWrapperInterface.h:129
void setSurfaceCharacteristicMap(DtSurfaceCharacteristicMap sMap)
Definition: mgWrapperInterface.h:105
Definition: flightTerrainInitializer.h:21
Definition: dfadData.h:77

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)