VR-Forces 4.1 Class Documentation
DtSilverliningGroup.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2008 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: DtSilverliningGroup.h,v $ $Revision: 1.25 $ $State: Exp $
7 ******************************************************************************/
8 
12 
13 #ifndef DtSilverliningGroup_H_
14 #define DtSilverliningGroup_H_
15 
16 #include <vrvOsg/vrvOsg.h>
17 
18 #include <osg/Group>
19 #include <osg/Geode>
20 #include <osg/LightSource>
21 
22 #include <list>
23 #include <matrix/vlVector.h>
24 #include <matrix/refEllipsoid.h>
25 #include <matrix/geodCoord.h>
26 #include <OpenThreads/Mutex>
27 
28 namespace SilverLining
29 {
30  class Atmosphere;
31  class CloudLayer;
32  class LocalTime;
33  class Location;
34 }
35 
36 namespace makVrv
37 {
38  class DtChannel;
39 
40  class DtDe;
41 
45  class DT_DLL_VRVOSG DtSilverliningGroup : public osg::Group
46  {
47  public:
48 
51 
53  virtual ~DtSilverliningGroup();
54 
55  //GLuint getCubeMap();
56 
57  void installIntoChannel(DtChannel*);
58 
60  void deleteGeods();
61 
63  void setGeocentricMode(bool mode);
64 
66  bool geocentricMode() const;
67 
69  void setDateAndTime( unsigned short year, unsigned char month,
70  unsigned char day, unsigned char hour, unsigned char minutes,
71  double seconds, bool observeDaylightSavings );
72 
74  void updateTime();
75 
78  void setLocation(const DtVector& location);
79 
81  void update(const osg::Matrix& m);
82 
84  void update2D();
85 
87  int cloudLayerCount() const;
88 
90  void removeCloudLayer(int index);
91 
94  void setFogBlend(osg::Vec4f rgbA,float density);
95 
97  void addCirroCumulus(const DtVector& position, const DtVector& bounds);
98  void addCirrusFibratus(const DtVector& position, const DtVector& bounds);
99  void addNimbostratus(const DtVector& position, const DtVector& bounds,double density);
100  void addCumulusMediocris(const DtVector& position, const DtVector& bounds,double density);
101  void addCumulusCongestus(const DtVector& position, const DtVector& bounds,double density);
102  void addCumulonumbusCappilatus(const DtVector& position, const DtVector& bounds,double density);
103  void setCloudLayerEnabled(int index, bool enabled);
104  void setCloudLayerPosition(int index, double xCoord, double yCoord);
105 
106  void setWind(double directionDEN,double minAltitude, double maxAltitude,double velocity);
107  void setAirTurbidity( float turbidity );
108  void setVisibleDistance( float distance );
109 
110  void createAtmosphere();
111  void destroyAtmosphere();
112 
113  void realizeLayers();
114 
115  SilverLining::Atmosphere* findAtmosphere();
116 
117  protected:
118 
119  struct CloudLayer
120  {
121  unsigned int type;
122  unsigned int handle;
125  double density;
126  bool enabled;
127  bool realized;
128  };
129 
131  void addLayer( const CloudLayer& layer );
132 
134  void realizeLayer( CloudLayer& layer );
135  void destroyLayer( DtSilverliningGroup::CloudLayer& layer );
136 
137  int CalculateZoneByLongitude(double longitude);
138  void SetTimeAndLocation();
139 
141  virtual void traverse(osg::NodeVisitor& nv);
142  void resetLayers();
143  void forceResetLayers();
144 
145  protected:
146 
147  typedef std::vector<CloudLayer> CloudLayerList;
148 
150  mutable OpenThreads::Mutex myMutex;
151 
152  DtReferenceEllipsoid myRefEllip;
153  DtGeodeticCoord myGeod;
154 
156  SilverLining::Atmosphere* myAtmosphere;
157  SilverLining::LocalTime* myLocalTime;
158  SilverLining::Location* myLocation;
159 
160 
163 
164  osg::ref_ptr<osg::Geode> mySkyGeod;
165  osg::ref_ptr<osg::LightSource> mySkyLight;
166  osg::ref_ptr<osg::Geode> myCloudGeod;
167 
168  osg::Vec4f myFogColor;
170 
172  float myTurbidity;
175 
176  };
177 }
178 
179 #endif
180 

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)