VR-Vantage 3.0 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ciTerrain.h
Go to the documentation of this file.
1 
2 // Copyright JRM Enterprises, Inc. 2004 - 2012
3 // All rights reserved.
4 //
5 // This code is the intellectual property of JRM Enterprises, Inc.
6 // It may not be used or released as source or compiled binary form
7 // without the prior written consent of JRM Enterprises, Inc.
8 //
9 // Original Author: Nikolai Fedoroff
10 // Date: Oct 2004
11 //
12 // $Header: /cvsroot/CommonInterface/CILib/include/ciTerrain.h,v 1.32 2012-02-22 17:50:43 cvsuser Exp $
13 //
14 // $Log: not supported by cvs2svn $
15 // Revision 1.32 2012/02/22 17:50:43 cvsuser
16 // Add terrain side of brdf
17 // tr
18 //
19 // Revision 1.31 2011-05-02 22:33:20 cvsuser
20 // (TomG) Added the option into ciTerrain and the config file to use osv's terrain centering with 0,0 in the center of the terrain or just use the classic OSG setup for the terrain.
21 //
22 // Revision 1.30 2010/12/04 01:19:31 cvsuser
23 // Linux build.
24 // TR
25 //
26 // Revision 1.29 2010-08-18 13:07:19 cvsuser
27 // (Tom G) Changed parse functions to pass clXML by reference in order to remove calls to a copy constructor that was causing major delays.
28 //
29 // Revision 1.28 2010/04/22 19:12:08 cvsuser
30 // CF100422 : SFX & MMLS tweaks & adding lens diffraction and rotation-based scanmask generation
31 //
32 // Revision 1.27 2010/03/31 20:11:54 cvsuser
33 // CF100331 : Added support for reading SFX PIP files.
34 //
35 // Revision 1.26 2009/11/09 10:49:30 cvsuser
36 // (ken) added missing root node
37 // changed root node to JRM_configuration_file
38 //
39 // Revision 1.25 2009/11/05 11:02:17 cvsuser
40 // (ken) changed to a dll to hopefully allow it to be used with different versions of vc
41 //
42 // Revision 1.24 2009/02/27 18:18:20 cvsuser
43 // (ken) changes for use with VS 2008
44 // eliminate warnings for stdio routines
45 //
46 // Revision 1.23 2008/07/21 18:10:59 cvsuser
47 // Jon G: Reformated Files to be uniform in respect to tabs and braces. replaceds tabs with spaces.
48 //
49 // Revision 1.22 2008/05/14 13:54:54 cvsuser
50 // Added doxygen tags back into header files for ci module. PS
51 //
52 // Revision 1.21 2008/05/02 15:09:46 cvsuser
53 // Modified ci library to use clXML instead of libxml. Adjusted project and solution properties and added unit test to ci. PS
54 //
55 // Revision 1.20 2007/11/20 16:47:07 cvsuser
56 // (ken) Emat initial integration with SigSimC generated emat fractions
57 //
58 // Revision 1.19 2007/11/09 12:46:01 cvsuser
59 // (ken) Emat texture support
60 // Osg 1.2 updates
61 // Radar filtering.
62 //
63 // Revision 1.18 2007/07/26 01:08:50 cvsuser
64 // Lod Scale added to the Terrain Panel
65 //
66 // Revision 1.17 2007/03/05 18:17:37 cvsuser
67 // (Tim) added Doxy comments to CI
68 //
69 // Revision 1.16 2007/01/05 08:09:17 cvsuser
70 // (Tim) added xml loading to the ci project
71 //
72 // Revision 1.15 2006/12/27 21:09:08 cvsuser
73 // (Tim) Added set/get for forcing tree billboards.
74 //
75 // Revision 1.14 2006/12/06 21:35:50 cvsuser
76 // CF061206 : Missing #includes, according to my last build. Shouldn't hurt anything if they're already included in some other way.
77 //
78 // Revision 1.13 2006/09/04 17:10:22 cvsuser
79 // (Tim) added a combobox for targeting an entity for movie merge
80 // changed the atm offeset to altitude in terrain panel
81 //
82 // Revision 1.12 2006/05/25 23:48:17 cvsuser
83 // (Tim)Updated CI for use with wxWidgets-2.6.3
84 //
85 // Revision 1.11 2006/05/22 19:50:44 cvsuser
86 // (Tim)added noise percents along with better noise generation
87 // added a checkbox for link to TOD
88 //
89 // Revision 1.10 2006/01/30 22:31:04 cvsuser
90 // (Tim) Integrated the SenSim panel into the sensor panel
91 // Creates a SenSim, Detector, Electronics, and Detector Panel for each sensor
92 // The SenSim is used from the active sensor
93 // All sensim panels get saved and loaded independantly
94 //
95 // Revision 1.9 2004/11/30 18:16:59 cvsuser
96 // Tom
97 //
98 // Fixed the Movie player file load routine so it works with spaces in the directory name
99 //
100 // Added a “Current Working Directory” patch to all panels that specify file inputs via a dialog box. The file dialog box potentially changed the CWD which could cause problems. This fix restores the CWD to its state prior to the file operation, there by always keeping the CWD pointing to the start up location of the Asgard executable.
101 //
102 // Revision 1.8 2004/11/05 21:59:41 cvsuser
103 // sgSensor - addeld trackfile checkbox, added position and orientaion data
104 // sgTerrain - added visibility checkbox
105 //
106 // Nik
107 //
108 // Revision 1.7 2004/11/03 17:17:15 cvsuser
109 // Added cicfg load
110 // fixed some panel bugs
111 // added panel grid assignement enumerations
112 //
113 // Nik
114 //
115 // Revision 1.6 2004/11/02 23:03:51 cvsuser
116 // added "upwards" messaging
117 // added initialization
118 //
119 // Nik
120 //
121 // Revision 1.5 2004/10/28 16:16:39 cvsuser
122 // (Eric) Fixed some capitalization problems
123 //
124 // Revision 1.4 2004/10/27 13:40:25 cvsuser
125 // (Eric) Changed a few syntax issues
126 //
127 // Revision 1.3 2004/10/22 14:55:22 cvsuser
128 // Renamed all ci methods to spec
129 //
130 // Nik
131 //
132 // Revision 1.2 2004/10/08 21:52:24 cvsuser
133 // implemented and tested ciTerrain interface class
134 //
135 // Nik
136 //
137 // Revision 1.1 2004/10/07 21:29:20 cvsuser
138 // renaming panel files...
139 //
140 // Nik
141 //
142 //
144 
145 #if !defined(_ciTerrain_h_)
146 #define _ciTerrain_h_
147 
148 #if _MSC_VER > 1000
149 #pragma once
150 #endif // _MSC_VER > 1000
151 
152 #include "clXML.h"
153 #include <stdio.h>
157 #include "ciApi.h"
158 #include <iostream>
159 #include <fstream>
160 #include <string.h>
161 #include "clXMLNode.h"
162 
164 {
165 public: // enumerations
166 
168  // enumProjectionType
174  {
175  UTM,
176  LVCS
177  };
178 
180  // enumTextureType
186  {
187  MCM,
188  EMAT
189  };
190 
191 public: // methods
192 
194  // getName
201  char *getName() {return m_name;}
202 
204  // setName
212  void setName(const char *name) {strncpy(m_name, name, sizeof(m_name));}
213 
215  // getTerrainFilepath
222  char *getTerrainFilepath() {return m_terrainFilepath;}
223 
225  // setTerrainFilepath
233  void setTerrainFilepath(char *terrainFilepath)
234  {strncpy(m_terrainFilepath, terrainFilepath, sizeof(m_terrainFilepath));}
235 
237  // getProjectionType
244  int getProjectionType() {return m_projectionType;}
245 
247  // setProjectionType
255  void setProjectionType(int projectionType) {
256  if ((projectionType >= 0) && (projectionType < (int) sizeof(enumProjectionType)))
257  m_projectionType = projectionType;
258  }
259 
261  // getTextureType
269  if ((m_textureType >= 0) && (m_textureType < (int) sizeof(enumTextureType)))
270  return m_textureType;
271  else
272  return 0;
273  }
274 
276  // setTextureType
284  void setTextureType(int textureType) {
285  if ((textureType >= 0) && (textureType < (int) sizeof(enumTextureType)))
286  m_textureType = textureType;
287  }
288 
290  // getSWOrigin
299  void getSWOrigin(double &latitude, double &longitude);
300 
302  // setSWOrigin
311  void setSWOrigin(double latitude, double longitude);
312 
314  // getPositionOffset
323  void getPositionOffset(double &x, double &y);
324 
326  // setPositionOffset
335  void setPositionOffset(double x, double y);
336 
338  // getMtlsysFilepath
345  char *getMtlsysFilepath() {return m_mtlsysFilepath;}
346 
348  // setMtlsysFilepath
356  void setMtlsysFilepath(char *mtlsysFilepath)
357  {strncpy(m_mtlsysFilepath, mtlsysFilepath, sizeof(m_mtlsysFilepath));}
358 
360  // getThermalSpinup
367  double getThermalSpinup() {return m_thermalSpinup;}
368 
370  // setThermalSpinup
378  void setThermalSpinup(double thermalSpinup) {m_thermalSpinup = thermalSpinup;}
379 
381  // setVisbility
389  void setVisbility(bool visibility) {m_visibility = visibility;}
390 
392  // getVisbility
399  bool getVisbility() {return m_visibility;}
400 
402  //getEnableTrees
407  bool getEnableTrees() {return m_trees;}
409  //setEnableTrees
414  void setEnableTrees(bool flag) {m_trees = flag;}
416  //getEnableTreeWind
421  bool getEnableTreeWind() {return m_treeWind;}
423  //setEnableTreeWind
428  void setEnableTreeWind(bool flag) {m_treeWind = flag;}
430  //getForceTreeBillboards
435  bool getForceTreeBillboards() {return m_forceTreeBillboards;}
437  //setForceTreeBillboards
442  void setForceTreeBillboards(bool flag) {m_forceTreeBillboards = flag;}
444  //getEnableTerrainObjects
449  bool getEnableTerrainObjects() {return m_terrainObjects;}
451  //setEnableTerrainObjects
456  void setEnableTerrainObjects(bool flag) {m_terrainObjects = flag;}
458  //setAltitude
463  void setAltitude(double altitude){m_altitude = altitude;}
465  //getAltitude
470  double getAltitude(){return m_altitude;}
472  //setLodScale
477  void setLodScale(double scale){m_lodScale = scale;}
479  //getLodScale
484  double getLodScale(){return m_lodScale;}
485 
487  //getTerrainCenterEnabled
492  bool getTerrainCenterEnabled() { return m_terrainCenterEnabled; }
493 
495  //setTerrainCenterEnabled
500  void setTerrainCenterEnabled(bool enabled) { m_terrainCenterEnabled = enabled; }
501 
502 
503  int getBrdf();
504  void setBrdf(int brdf);
505  double getRoughness();
506  void setRoughness(double roughness);
507 
509  // archive
518  bool archive(std::ofstream &outf);
519 
521  // serialize
529  bool serialize(char *filepath);
530 
531  //
532  // loadXML
533  //
534  // \par Description:
535  // Loads attributes from an XML node
536  //
537  // \param clXMLNode* terrainNode
538  // \return
539  //
540  bool loadXML(clXMLNode* terrainNode);
541 
542  //
543  // parseXML
544  //
545  // \par Description:
546  // Parses an XML document for specific tags
547  //
548  // \param clXML xmlDocument
549  // \return bool
550  //
551  bool parseXML(clXML& xmlDocument);
552 
554  //loadXMLNode
561  bool loadXMLNode(std::string tag, char *nodeString);
563  //loadXMLNode
570  bool loadXMLNode(std::string tag, bool *nodeBool);
572  //loadXMLNode
579  bool loadXMLNode(std::string tag, int *nodeBool);
581  //loadXMLNode
588  bool loadXMLNode(std::string tag, double *nodeBool);
589 
590  //
591  // saveXML
592  //
593  // \par Description:
594  // Saves XML nodes to an XML document
595  //
596  // \param clXML* xmlDocument
597  //
598  void saveXML(clXML* xmlDocument);
599 
601  // operator =
609  ciTerrain operator = (ciTerrain &obj);
610 
611 protected: // methods
612 
613 public: // construction/destruction
614 
616  // ciTerrain
621  ciTerrain();
622 
624  // ciTerrain
632 
633  virtual ~ciTerrain();
634 
635 protected: // variables
636 
637  char m_name[128];
638  char m_terrainFilepath[512];
643  double m_offsetX;
644  double m_offsetY;
645  char m_mtlsysFilepath[512];
648  bool m_trees;
651  double m_altitude;
653  double m_lodScale;
655  int m_brdf;
656  double m_roughness;
658 private: // variables
659 
660 };
661 
662 #endif // _ciTerrain_h_


Copyright © 2005-2022 MAK Technologies. All Rights Reserved (www.mak.com)