![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /****************************************************************************** 00002 ** Copyright (c) 2008 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 ******************************************************************************/ 00005 /****************************************************************************** 00006 ** $RCSfile: DtSilverliningGroup.h,v $ $Revision: 1.25 $ $State: Exp $ 00007 ******************************************************************************/ 00008 00012 00013 #ifndef DtSilverliningGroup_H_ 00014 #define DtSilverliningGroup_H_ 00015 00016 #include <vrvOsg/vrvOsg.h> 00017 00018 #include <osg/Group> 00019 #include <osg/Geode> 00020 #include <osg/LightSource> 00021 00022 #include <list> 00023 #include <matrix/vlVector.h> 00024 #include <matrix/refEllipsoid.h> 00025 #include <matrix/geodCoord.h> 00026 #include <OpenThreads/Mutex> 00027 00028 namespace SilverLining 00029 { 00030 class Atmosphere; 00031 class CloudLayer; 00032 class LocalTime; 00033 class Location; 00034 } 00035 00036 namespace makVrv 00037 { 00038 class DtChannel; 00039 00040 class DtDe; 00041 00045 class DT_DLL_VRVOSG DtSilverliningGroup : public osg::Group 00046 { 00047 public: 00048 00050 DtSilverliningGroup(DtDe& de); 00051 00053 virtual ~DtSilverliningGroup(); 00054 00055 void installIntoChannel(DtChannel*); 00056 00058 void deleteGeods(); 00059 00061 void setGeocentricMode(bool mode); 00062 00064 bool geocentricMode() const; 00065 00067 void setDateAndTime( unsigned short year, unsigned char month, 00068 unsigned char day, unsigned char hour, unsigned char minutes, 00069 double seconds, bool observeDaylightSavings ); 00070 00072 void updateTime(); 00073 00076 void setLocation(const DtVector& location); 00077 00079 void update(const osg::Matrix& m); 00080 00082 void update2D(); 00083 00085 int cloudLayerCount() const; 00086 00088 void removeCloudLayer(int index); 00089 00092 void setFogBlend(osg::Vec4f rgbA,float density); 00093 00095 void addCirroCumulus(const DtVector& position, const DtVector& bounds); 00096 void addCirrusFibratus(const DtVector& position, const DtVector& bounds); 00097 void addNimbostratus(const DtVector& position, const DtVector& bounds,double density); 00098 void addCumulusMediocris(const DtVector& position, const DtVector& bounds,double density); 00099 void addCumulusCongestus(const DtVector& position, const DtVector& bounds,double density); 00100 void addCumulonumbusCappilatus(const DtVector& position, const DtVector& bounds,double density); 00101 void setCloudLayerEnabled(int index, bool enabled); 00102 void setCloudLayerPosition(int index, double xCoord, double yCoord); 00103 00104 void setWind(double directionDEN,double minAltitude, double maxAltitude,double velocity); 00105 void setAirTurbidity( float turbidity ); 00106 void setVisibleDistance( float distance ); 00107 00108 void createAtmosphere(); 00109 void destroyAtmosphere(); 00110 00111 void realizeLayers(); 00112 00113 SilverLining::Atmosphere* findAtmosphere(); 00114 00115 protected: 00116 00117 struct CloudLayer 00118 { 00119 unsigned int type; 00120 unsigned int handle; 00121 DtVector position; 00122 DtVector bounds; 00123 double density; 00124 bool enabled; 00125 bool realized; 00126 }; 00127 00129 void addLayer( const CloudLayer& layer ); 00130 00132 void realizeLayer( CloudLayer& layer ); 00133 void destroyLayer( DtSilverliningGroup::CloudLayer& layer ); 00134 00135 int CalculateZoneByLongitude(double longitude); 00136 void SetTimeAndLocation(); 00137 00139 virtual void traverse(osg::NodeVisitor& nv); 00140 void resetLayers(); 00141 void forceResetLayers(); 00142 00143 protected: 00144 00145 typedef std::vector<CloudLayer> CloudLayerList; 00146 00147 DtDe& myDe; 00148 mutable OpenThreads::Mutex myMutex; 00149 00150 DtReferenceEllipsoid myRefEllip; 00151 DtGeodeticCoord myGeod; 00152 00154 SilverLining::Atmosphere* myAtmosphere; 00155 SilverLining::LocalTime* myLocalTime; 00156 SilverLining::Location* myLocation; 00157 00158 00159 CloudLayerList myLayers; 00160 CloudLayerList myDestroyedLayers; 00161 00162 osg::ref_ptr<osg::Geode> mySkyGeod; 00163 osg::ref_ptr<osg::LightSource> mySkyLight; 00164 osg::ref_ptr<osg::Geode> myCloudGeod; 00165 00166 osg::Vec4f myFogColor; 00167 float myFogDensity; 00168 00169 float myVisibility; 00170 float myTurbidity; 00171 bool myGeocFlag; 00172 bool myNeedsResetFlag; 00173 00174 }; 00175 } 00176 00177 #endif 00178