11 #include "vtlib/core/TerrainScene.h"
13 #include "vtdata/Fence.h"
15 #include "vtlib/core/AnimPath.h"
16 #include "vtlib/core/Elastic.h"
17 #include "vtlib/core/NavEngines.h"
18 #include "vtlib/core/Vehicles.h"
19 #include "EnviroEnum.h"
20 #include "PlantingOptions.h"
27 #define INITIAL_SPACE_DIST 3.1f
75 virtual void StartupArgument(
int i,
const char *str);
77 void LoadAllTerrainDescriptions();
78 void LoadGlobalContent();
79 void StartControlEngine();
81 void DoControlOrbit();
82 void DoControlTerrain();
84 vtGroup *GetRoot() {
return m_pRoot; }
85 void StoreTerrainParameters();
86 osgText::Font *GetArial() {
return m_pArial; }
88 void ShowElevationLegend(
bool bShow);
89 bool GetShowElevationLegend();
90 void ShowCompass(
bool bShow);
91 bool GetShowCompass();
92 void ShowMapOverview(
bool bShow);
93 bool GetShowMapOverview();
94 void TextureHasChanged();
97 virtual void SetFlightSpeed(
float speed);
98 float GetFlightSpeed();
99 void SetFlightAccel(
bool bAccel);
100 bool GetFlightAccel();
101 void SetTopDown(
bool bTopDown);
103 void EnableFlyerEngine(
bool bEnable);
104 void SetNavType(NavType nav);
105 NavType GetNavType() {
return m_nav; }
106 void SetMaintain(
bool bOn);
110 void SetMode(MouseMode mode);
111 void DumpCameraInfo();
112 void SetSpeed(
float x);
114 vtString GetStatusString(
int which);
118 bool SwitchToTerrain(
const char *name);
122 vtIcoGlobe *GetGlobe() {
return m_pIcoGlobe; }
123 vtIcoGlobe *GetOverlayGlobe() {
return m_pOverlayGlobe; }
124 void SetEarthShading(
bool bShade);
125 bool GetEarthShading();
126 void SetEarthTilt(
bool bTilt);
128 void SetEarthShape(
bool Flat);
129 bool GetEarthShape() {
return m_bGlobeFlat; }
130 void SetEarthUnfold(
bool Flat);
131 bool GetEarthUnfold() {
return m_bGlobeUnfolded; }
132 void SetSpaceAxes(
bool bShow);
134 int AddGlobeAbstractLayer(
const char *fname);
135 void RemoveGlobeAbstractLayer(
GlobeLayer *glay);
136 void UpdateEarthArc();
138 void SetDisplayedArc(
const DLine2 &path);
139 void SetEarthLines(
double lon,
double lat);
140 void ShowEarthLines(
bool bShow);
143 vtString GetMessage() {
return m_strMessage; }
144 void SetMessage(
const vtString &msg,
float time = 0.0f);
145 void FormatCoordString(
vtString &str,
const DPoint3 &coord, LinearUnits units,
bool seconds =
false);
146 void DescribeCoordinatesEarth(
vtString &str);
147 void DescribeCoordinatesTerrain(
vtString &str);
185 void start_new_fence();
188 void SetFenceOptions(
const vtLinearParams ¶m,
bool bProfileChanged =
false);
191 void start_new_route();
194 void SetRouteOptions(
const vtString &sStructType);
197 void LoadSpeciesList();
210 bool ImportModelFromKML(
const char *kmlfile);
214 int NumSelectedAbstractFeatures();
217 void SetDistanceToolMode(
bool bPath);
218 void SetDistanceTool(
const DLine2 &line);
219 void ResetDistanceTool();
220 void UpdateDistanceTool();
223 void SetWind(
int iDirection,
float fSpeed);
226 void UpdateCompass();
239 bool m_bSelectedStruct;
240 bool m_bSelectedPlant;
241 bool m_bSelectedUtil;
242 bool m_bSelectedVehicle;
244 int m_iDraggingFencePoint;
250 IPoint2 m_MouseDown, m_MouseLast;
251 float m_StartRotation;
252 bool m_bConstrainAngles;
255 std::vector <Camera3kb *> cam3kb;
257 std::vector <models3d *> building_models;
270 virtual void ShowPopupMenu(
const IPoint2 &pos) {}
271 virtual void SetTerrainToGUI(
vtTerrain *pTerrain) {}
272 virtual void ShowLayerView() {}
273 virtual void RefreshLayerView() {}
274 virtual void UpdateLayerView() {}
275 virtual void CameraChanged() {}
276 virtual void EarthPosUpdated() {}
278 double fGround,
double fVertical) {}
279 virtual void ShowDistance(
const DLine2 &path,
280 double fGround,
double fVertical) {}
281 virtual vtTagArray *GetInstanceFromGUI() {
return NULL; }
282 virtual bool OnMouseEvent(
vtMouseEvent &event) {
return false; }
283 virtual void SetTimeEngineToGUI(
vtTimeEngine *pEngine) {}
284 virtual bool IsAcceptable(
vtTerrain *pTerr) {
return true; }
285 virtual void OnCreateTerrain(
vtTerrain *pTerr) {}
286 virtual void ShowMessage(
const vtString &str) {}
287 virtual void SetState(AppState s) { m_state = s; }
289 virtual void ShowProgress(
bool bShow) {}
290 virtual void SetProgressTerrain(
vtTerrain *pTerr) {}
291 virtual void UpdateProgress(
const char *msg,
int amount1,
int amount2) {}
293 virtual void AddVehicle(
CarEngine *eng) {}
294 virtual void RemoveVehicle(
CarEngine *eng) {}
297 void MakeDemoGlobe();
301 void CreateSomeTestVehicles(
vtTerrain *pTerrain);
302 void MakeOverlayGlobe(
vtImage *image,
bool progress_callback(
int) = NULL);
308 void LoadTerrainDescriptions(
const vtString &path);
311 virtual void SetupScene3() {}
313 void DoCursorOnEarth();
314 void DoCursorOnTerrain();
317 void LookUpTerrainLocations();
319 void CreateInstance();
324 void SetTerrainMeasure(
const DLine2 &path);
325 void CreateElevationLegend();
326 void CreateCompass();
327 void CreateMapOverview();
336 bool m_bPlantsLoaded;
343 bool m_bActiveFence, m_bFenceClosed;
358 float m_fDistToolHeight;
363 vtCameraPtr m_pNormalCamera;
364 vtCameraPtr m_pTopDownCamera;
377 float m_fFlattening, m_fFlattenDir;
378 bool m_bGlobeUnfolded;
379 float m_fFolding, m_fFoldDir;
389 float m_fMessageStart, m_fMessageTime;
400 FPoint3 m_TrackStart[3], m_TrackPosDiff;
401 FPoint3 m_SpaceTrackballState[3];
404 float m_fTransitionHeight;
407 vtMaterialArrayPtr m_pHUDMaterials;
410 bool m_bCreatedLegend;
414 bool m_bCreatedCompass;