VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtCloudLayerRecord.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2008 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
12 
13 namespace makArchives
14 {
18  {
19  public:
22 
25 
27  DtCloudLayerRecord& operator=(const DtCloudLayerRecord& orig);
28 
31 
32  //Test for equality.
33  bool operator==(const DtCloudLayerRecord& other) const;
34 
35  //Test for inequality.
36  bool operator!=(const DtCloudLayerRecord& other) const;
37 
38  //Is the cloud layer visible.
39  void setEnabledFlag(bool enabled);
40  bool enabledFlag() const;
41 
42  // Does the cloud layer extend forever
43  void setInfiniteFlag(bool infinite);
44  bool infiniteFlag() const;
45 
46  //The type of cloud layer.
47  void setType(const std::string& type );
48  const std::string& type() const;
49 
50  //Location
51  void setPosition(double x, double y, double z);
52  void setPosition(double position[3]);
53 
55  const double* position() const;
56 
57  //Size
58  void setWidth(double w);
59  void setLength(double l);
60  void setThickness(double t);
61 
62  double width() const;
63  double length() const;
64  double thickness() const;
65 
66  //Parameters
67  void setDensity(float density);
68  float density() const;
69 
70  void setSkyCoverage(float skyCoverage);
71  float skyCoverage() const;
72 
73  protected:
74 
75  friend class boost::serialization::access;
76 
80  template<class Archive>
81  void serialize(Archive & ar, const unsigned int version)
82  {
83  if (version < 3)
84  {
85  ar & BOOST_SERIALIZATION_NVP(myEnabledFlag);
86  }
87  ar & BOOST_SERIALIZATION_NVP(myType);
88 
89  if(version < 1)
90  {
91  ar & boost::serialization::make_nvp("myOriginX", myPosition[0]);
92  ar & boost::serialization::make_nvp("myOriginY", myPosition[1]);
93  ar & boost::serialization::make_nvp("myAltitude", myPosition[2]);
94  }
95  else if (version < 3)
96  {
97  ar & BOOST_SERIALIZATION_NVP(myPosition);
98  }
99  ar & BOOST_SERIALIZATION_NVP(myWidth);
100  ar & BOOST_SERIALIZATION_NVP(myLength);
101 
102  if (version < 3)
103  {
104  ar & BOOST_SERIALIZATION_NVP(myThickness);
105  }
106 
107  ar & BOOST_SERIALIZATION_NVP(myDensity);
108  if (version >= 3)
109  {
110  ar & BOOST_SERIALIZATION_NVP(mySkyCoverage);
111  }
112  if (version == 2)
113  {
114  ar & BOOST_SERIALIZATION_NVP(myInfiniteFlag);
115  }
116 
117  if (version >= 3)
118  {
119  // initialize deprecated parameters
120  myPosition[0] = 0.0;
121  myPosition[1] = 0.0;
122  myPosition[2] = 0.0;
123  myEnabledFlag = true;
124  myInfiniteFlag = true;
125  myThickness = 0.0;
126  }
127  }
128 
129  //The name of the type of cloud layer.
130  std::string myType;
131 
132  //The density, in kg/m^3, of the cloud layer. Only used by VRForces.
133  float myDensity;
134 
135  //The sky coverage (in normalized [0-1] Oktas) of the cloud layer.
137 
138  //The length and width of the cloud layer
139  double myWidth;
140  double myLength;
141 
142  //Deprecated Parameters in version >= 3
143  double myPosition[3];
146  double myThickness;
147  };
148 }
149 
151 
152 
double myLength
Definition: DtCloudLayerRecord.h:140
BOOST_CLASS_VERSION(makArchives::DtDiGuySettingsRecord, 3)
double myThickness
Definition: DtCloudLayerRecord.h:146
float myDensity
Definition: DtCloudLayerRecord.h:133
double myWidth
Definition: DtCloudLayerRecord.h:139
DT_DLL_terrainCS bool operator==(const DtDegMinSec &lhs, const DtDegMinSec &rhs)
Contains DLL export macros.
void serialize(Archive &ar, const unsigned int version)
When the class Archive corresponds to an output archive, the &amp; operator is defined similar to &lt;&lt;...
Definition: DtCloudLayerRecord.h:81
Record of a single cloud layer&#39;s settings.
Definition: DtCloudLayerRecord.h:17
std::string myType
Definition: DtCloudLayerRecord.h:130
float mySkyCoverage
Definition: DtCloudLayerRecord.h:136
bool myInfiniteFlag
Definition: DtCloudLayerRecord.h:145
bool myEnabledFlag
Definition: DtCloudLayerRecord.h:144
DT_DLL_terrainCS bool operator!=(const DtDegMinSec &lhs, const DtDegMinSec &rhs)
#define DT_DLL_MAKARCHIVES
Definition: makArchives.h:31

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)