VR-Vantage 2.8 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ciEnvironment.h
Go to the documentation of this file.
1 
2 // Copyright JRM Enterprises, Inc. 2004
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/ciEnvironment.h,v 1.30 2010-10-25 17:20:32 cvsuser Exp $
13 //
14 // $Log: not supported by cvs2svn $
15 // Revision 1.30 2010/10/25 17:20:32 cvsuser
16 // CF101025 : Added Relative Humidity to XML spec.
17 //
18 // Revision 1.29 2010/08/18 13:07:19 cvsuser
19 // (Tom G) Changed parse functions to pass clXML by reference in order to remove calls to a copy constructor that was causing major delays.
20 //
21 // Revision 1.28 2009/11/09 21:45:54 cvsuser
22 // (ken) Set time from environment not scenario for OSV ***** could break Asgard
23 //
24 // Revision 1.27 2009/11/05 11:02:17 cvsuser
25 // (ken) changed to a dll to hopefully allow it to be used with different versions of vc
26 //
27 // Revision 1.26 2009/02/27 18:18:20 cvsuser
28 // (ken) changes for use with VS 2008
29 // eliminate warnings for stdio routines
30 //
31 // Revision 1.25 2008/07/21 18:10:59 cvsuser
32 // Jon G: Reformated Files to be uniform in respect to tabs and braces. replaceds tabs with spaces.
33 //
34 // Revision 1.24 2008/05/14 13:54:54 cvsuser
35 // Added doxygen tags back into header files for ci module. PS
36 //
37 // Revision 1.23 2008/05/02 15:09:46 cvsuser
38 // Modified ci library to use clXML instead of libxml. Adjusted project and solution properties and added unit test to ci. PS
39 //
40 // Revision 1.22 2007/03/05 18:17:37 cvsuser
41 // (Tim) added Doxy comments to CI
42 //
43 // Revision 1.21 2007/02/13 23:50:10 cvsuser
44 // Fix for Linux
45 // TR
46 //
47 // Revision 1.20 2007/01/05 08:09:17 cvsuser
48 // (Tim) added xml loading to the ci project
49 //
50 // Revision 1.19 2006/10/24 12:37:58 cvsuser
51 // (Tim) added rain rate and rain temp
52 //
53 // Revision 1.18 2006/09/05 18:20:45 cvsuser
54 // (Ken) Changes to remove the atm layer offset in favor of terrain altitude.
55 //
56 // Revision 1.17 2006/03/30 23:27:29 cvsuser
57 // (Tim) Cleaned up the data handers code and added missing doxeygen style comments
58 //
59 // Revision 1.16 2006/01/30 22:31:04 cvsuser
60 // (Tim) Integrated the SenSim panel into the sensor panel
61 // Creates a SenSim, Detector, Electronics, and Detector Panel for each sensor
62 // The SenSim is used from the active sensor
63 // All sensim panels get saved and loaded independantly
64 //
65 // Revision 1.15 2006/01/09 23:36:46 cvsuser
66 // (Tim) Added the Atmosphere Offset and Atmosphere Extinction Scale to the Environment panel
67 //
68 // Revision 1.14 2005/12/06 00:21:57 cvsuser
69 // (Tim)Added a star threshold to set the amount of stars that appear
70 //
71 // Revision 1.13 2005/10/31 16:03:02 cvsuser
72 // (Tim)added the round earth checkbox to the envirnment panel and coded it to enable round earth when checked
73 //
74 // Revision 1.12 2005/10/26 19:49:07 cvsuser
75 // (Tim)Added the Scenario data class to store the data for the scenario Panel
76 // removed time of day from the envirnment panel and environment data class
77 // relocated mousevelocity and logscale within interface to be in a scenario data member
78 //
79 // Revision 1.11 2005/10/21 22:23:04 cvsuser
80 // (Tim) Added the button for multiple scattering and added a cimovieplayer object class that gets used to store the movieplayer information.
81 //
82 // Revision 1.10 2005/10/13 21:30:33 cvsuser
83 // (Tim) made mouse velocity and log scale get saved
84 //
85 // Revision 1.9 2005/09/19 12:45:53 cvsuser
86 // Com Library additions
87 // Tom
88 //
89 // Revision 1.8 2005/05/16 18:52:17 cvsuser
90 // (Ken) Added the emission and scattering enable flags.
91 //
92 // Revision 1.7 2005/04/29 21:43:29 cvsuser
93 // Eric: Changed precision to double from floats but since it wrecks the config files, will have to finish upgrade till later
94 //
95 // Revision 1.6 2005/04/22 20:09:48 cvsuser
96 // Tom
97 // Added sky dome radius to environment panel GUI. Moved image display mode to combo box on menu bar. Also added fnumber and focal length to optics panel
98 //
99 // Revision 1.5 2005/03/26 02:29:12 cvsuser
100 // Tom
101 // Ta max/min in interface...
102 //
103 // Revision 1.4 2005/02/08 16:10:24 cvsuser
104 // Tom
105 // Added user defined atmospheric modcard and atm state file loading support
106 //
107 // Revision 1.3 2004/11/08 19:01:36 cvsuser
108 // Added environment changes
109 // Updated doxycution
110 //
111 // Nik
112 //
113 // Revision 1.2 2004/11/02 23:03:51 cvsuser
114 // added "upwards" messaging
115 // added initialization
116 //
117 // Nik
118 //
119 // Revision 1.1 2004/10/27 18:40:50 cvsuser
120 // added ciEnvironment class
121 //
122 // Nik
123 //
124 //
126 
127 #pragma once
128 
129 #if !defined _ciEnvironment_h_
130 #define _ciEnvironment_h_
131 
132 #include "ciApi.h"
133 #include "clXML.h"
134 #include <stdio.h>
135 #include <string.h>
136 #include <fstream>
137 #include <iostream>
138 #include <assert.h>
139 #include "clXMLNode.h"
140 
142 {
143 public: // enumerations
144 
146  // enumAtmModel
152  {
159  USER_SPEC
160  };
161 
163  // enumHazeModel
169  {
170  noAerosolAttenuation = -1,
171  noCloudOrAerosolAtten = 0,
172  ruralVis_23km = 1,
173  ruralVis_5km = 2,
174  navyMaritime = 3,
175  maritime = 4,
176  urban = 5,
177  tropospheric = 6,
178  userDef_cards2Dx = 7,
179  fog1_200m = 8,
180  fog2_500m = 9,
181  desert = 10,
182  };
183 
184 public: // methods
185 
187  // setDate
197  void setDate(int month, int day, int year)
198  {
199  m_dateMonth = month;
200  m_dateDay = day;
201  m_dateYear = year;
202  }
204  // getDate
214  void getDate(int &month, int &day, int &year)
215  {
216  month = m_dateMonth;
217  day = m_dateDay;
218  year = m_dateYear;
219  }
220 
222  // setNightSkyTableFilepath
230  void setNightSkyTableFilepath(char *nightSkyTableFilepath){strncpy(m_nightSkyTableFilepath, nightSkyTableFilepath, sizeof(m_nightSkyTableFilepath));}
231 
233  // getNightSkyTableFilepath
241  char *getNightSkyTableFilepath(){return m_nightSkyTableFilepath;}
242 
244  //setStarThreshold
249  void setStarThreshold(double threshold){m_starThreshold = threshold; }
250 
252  //getStarThreshold
257  double getStarThreshold(){
258  if (m_starThreshold > 100)
259  m_starThreshold = 100;
260  else if (m_starThreshold < 0)
261  m_starThreshold = 0;
262  return m_starThreshold; }
263 
265  // setAtmModel
274  void setAtmModel(int atmModel){m_atmModel = atmModel;}
276  // getAtmModel
284  int getAtmModel(){return m_atmModel;}
285 
287  // setHazeModel
296  void setHazeModel(int hazeModel){m_hazeModel = hazeModel;}
297 
299  // getHazeModel
307  int getHazeModel(){return m_hazeModel;}
308 
309 
311  // setWindVelocity
319  void setWindVelocity(double windVelocity){m_windVelocity = windVelocity;}
320 
322  // getWindVelocity
329  double getWindVelocity(){return m_windVelocity;}
330 
332  // setVisibility
340  void setVisibility(double visibility){m_visibility = visibility;}
341 
343  // getVisibility
350  double getVisibility(){return m_visibility;}
351 
353  // archive
362  bool archive(std::ofstream &outf);
363 
365  // serialize
373  bool serialize(char *filepath);
374 
375  //
376  // loadXML
377  //
378  // \par Description:
379  // Loads attributes from an XML node
380  //
381  // \param clXMLNode* environmentNode
382  // \return bool
383  //
384  bool loadXML(clXMLNode* environmentNode);
385 
386  //
387  // parseXML
388  //
389  // \par Description:
390  // Parses an XML document for specific tags
391  //
392  // \param clXML xmlDocument
393  // \return bool
394  //
395  bool parseXML(clXML& xmlDocument);
396 
398  //loadXMLNode
405  bool loadXMLNode(std::string tag, char *nodeString);
407  //loadXMLNode
414  bool loadXMLNode(std::string tag, bool *nodeBool);
416  //loadXMLNode
423  bool loadXMLNode(std::string tag, int *nodeBool);
425  //loadXMLNode
432  bool loadXMLNode(std::string tag, double *nodeBool);
433 
434  //
435  // saveXML
436  //
437  // \par Description:
438  // Saves XML nodes to an XML document
439  //
440  // \param clXML* xmlDocument
441  //
442  void saveXML(clXML* xmlDocument, bool saveTod);
443 
445  // ciEnvironment
451  ciEnvironment(void);
452 
454  // ~ciEnvironment
460  ~ciEnvironment(void);
461 
463  // ciEnvironment
471 
473  // operator =
480  ciEnvironment operator = (ciEnvironment &obj);
481 
483  // setUseAtmosphericAttenuation
491  void setUseAtmosphericAttenuation(bool useAtmosphericAttenuation) {m_useAtmosphericAttenuation = useAtmosphericAttenuation;}
492 
494  // getUseAtmosphericAttenuation
501  bool getUseAtmosphericAttenuation() {return m_useAtmosphericAttenuation;}
502 
504  // setUseAtmosphericScattering
512  void setUseAtmosphericScattering(bool useAtmosphericScattering) {m_useAtmosphericScattering = useAtmosphericScattering;}
513 
515  // getUseAtmosphericScattering
522  bool getUseAtmosphericScattering() {return m_useAtmosphericScattering;}
524  // setUseRoundEarth
532  void setUseRoundEarth(bool useRoundEarth) {m_useRoundEarth = useRoundEarth;}
533 
535  // getUseRoundEarth
542  bool getUseRoundEarth() {return m_useRoundEarth;}
543 
545  // setUseAtmosphericMultiScattering
553  void setUseAtmosphericMultiScattering(bool useAtmosphericMultiScattering) {m_useAtmosphericMultiScattering = useAtmosphericMultiScattering;}
554 
556  // getUseAtmosphericMultiScattering
563  bool getUseAtmosphericMultiScattering() {return m_useAtmosphericMultiScattering;}
564 
566  // setUseThermalEmission
574  void setUseThermalEmission(bool useThermalEmission) {m_useThermalEmission = useThermalEmission;}
575 
577  // getUseThermalEmission
584  bool getUseThermalEmission() {return m_useThermalEmission;}
585 
587  // setEnableLighting
595  void setEnableLighting(bool enableLighting) {m_enableLighting = enableLighting;}
596 
598  // getEnableLighting
605  bool getEnableLighting() {return m_enableLighting;}
606 
608  // setUserSpecifiedAtmFilepath
616  void setUserSpecifiedAtmFilepath(char *userSpecifiedAtmFilepath){strcpy(m_userSpecifiedAtmFilepath, userSpecifiedAtmFilepath);}
617 
619  // getUserSpecifiedAtmFilepath
627  char *getUserSpecifiedAtmFilepath(){return m_userSpecifiedAtmFilepath;}
628 
630  // setUserSpecifiedTaMin
638  void setUserSpecifiedTaMin(double tempMin){m_tempMin = (float) tempMin;}
639 
641  // setUserSpecifiedTaMax
649  void setUserSpecifiedTaMax(double tempMax){m_tempMax = (float) tempMax;}
650 
652  // getUserSpecifiedTaMin
659  double getUserSpecifiedTaMin(){return m_tempMin;}
660 
662  // setUserSpecifiedTaMax
669  double getUserSpecifiedTaMax(){return m_tempMax;}
670 
672  // setSkyDomeRadius
680  void setSkyDomeRadius(double radius){m_skydomeRadius = radius;}
681 
683  // getSkyDomeRadius
690  double getSkyDomeRadius(){ return m_skydomeRadius;}
691 
693  //setAtmExtinction
698  void setAtmExtinction(double extinction){m_atmExtinction = extinction;}
700  //getAtmExtinction
705  double getAtmExtinction(){return m_atmExtinction;}
707  //getRainRate
712  double getRainRate(){return m_rainRate;}
714  //setRainRate
719  void setRainRate(double rate){m_rainRate = rate;}
721  //getRainTemp
726  double getRainTemp(){return m_rainTemp;}
728  //setRainTemp
733  void setRainTemp(double temp){m_rainTemp = temp;}
735  //getRelativeHumidityRatio
740  double getRelativeHumidityRatio(){return m_humidityRatio;}
742  //setRelativeHumidityRatio
747  void setRelativeHumidityRatio(double ratio){m_humidityRatio = ratio;}
748 
749 
750  void setLogScale(bool flag){m_logScale = flag;}
751  bool getLogScale(){return m_logScale;}
752  void setMouseVel(double vel){m_mouseVel = vel;}
753  double getMouseVel(){return m_mouseVel;}
754  void setTime(float time){m_timeOfDay = time;}
755  float getTime(){return m_timeOfDay;}
756 
757 private: // parts, variables, and other neat stuff...
758 
759  int m_dateMonth,
760  m_dateDay,
761  m_dateYear;
762  float m_timeOfDay;
763  char m_nightSkyTableFilepath[512];
766  double m_windVelocity;
767  double m_visibility;
772  char m_userSpecifiedAtmFilepath[512];
773  float m_tempMin;
774  float m_tempMax;
777  double m_mouseVel;
781  double m_atmOffset; // unused now.
783  double m_rainRate;
784  double m_rainTemp;
787 };
788 
789 #endif // _ciEnvironment_h_


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