VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtWeatherLayerGroup.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 
14 #include <osg/Group>
15 
17 #include <vrvOsg/DtWeatherEffect.h>
18 #include <vrvOsg/DtWeatherLayer.h>
19 
22 
23 
24 
25 namespace makVrv
26 {
27  // Forward declarations.
28  class DtJobSplitter;
29  class DtOsgWeatherEffectsObject;
30 
31 
48  class DT_DLL_VRVOSG DtWeatherLayerGroup : public osg::Group
49  {
50  public:
51 
54 
56  DtWeatherLayerGroup(const DtWeatherLayerGroup& orig, const osg::CopyOp& opr);
57 
59  virtual ~DtWeatherLayerGroup();
60 
61  private:
62 
64  DtWeatherLayerGroup() = delete;
65 
67  DtWeatherLayerGroup(const DtWeatherLayerGroup &other) = delete;
68 
70  DtWeatherLayerGroup &operator=(const DtWeatherLayerGroup &other) = delete;
71 
72  public:
73 
75  virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new DtWeatherLayerGroup(*this, copyop); }
76  virtual osg::Object* cloneType() const { return NULL; }
77 
79  virtual void releaseGLObjects(osg::State* state = 0) const override;
80 
82  virtual void deleteGeode();
83 
84  // !\brief Gets the sensor node suitable for use with sensorFX.
85  virtual osg::Node* getOrCreateSensorNode();
86 
89  virtual void removeLayer(DtUniqueID layerId);
90 
92  virtual void removeAllLayers();
93 
97  virtual void addLayer(DtWeatherLayer* layer);
98 
101  virtual DtWeatherLayer* getLayer(DtUniqueID layerId);
102 
106  virtual void setWind(float windDirectionRad, float windSpeedMps);
107 
111  virtual void setLayerIntensity(DtUniqueID layerId, float level);
112 
114  virtual void drawWeatherEffects(DtWeatherEffect::DrawData& drawData);
115 
117  virtual float timeStep() const;
118 
120  virtual void registerWeatherEffectsObject(DtOsgWeatherEffectsObject* weatherEffectsObject);
121 
122  protected:
123 
125  void connectSignals();
126 
128  void disconnectSignals();
129 
131  virtual void slot_groundSnowAccumulationChanged(float value);
132 
134  virtual void slot_simulationUpdate();
135 
137  virtual void traverse(osg::NodeVisitor& nv);
138 
141  virtual void cullUpdate(osg::Camera* cam);
142 
146  virtual void computeBasis(const osg::Vec3d& inGeocentricPos, osg::Matrixd& rotOut);
147 
148  protected:
149 
151 
154 
155  std::vector<osg::Vec4d> myCullingPlanes;
156 
157  double myLastTime;
158  float myTimeStep;
161 
163 
165 
166  private:
167 
169 
171  typedef std::map<DtUniqueID, DtWeatherLayer*> WeatherLayerMap;
172 
174  };
175 
176 
177 
180  {
181 
182  public:
183 
185  static DtWeatherLayerGroupCreator& instance(DtDe& theIG);
186 
188  static void registerInstance(DtDe& theIG, DtWeatherLayerGroupCreator* anInstance);
189 
191  virtual DtWeatherLayerGroup* create(DtDe&);
192  };
193 }
194 
195 
osg::ref_ptr< makVrv::DtWeatherEffectDrawable > myEffectDrawable
Definition: DtWeatherLayerGroup.h:153
std::vector< osg::Vec4d > myCullingPlanes
Definition: DtWeatherLayerGroup.h:155
float myWindDirectionRad
Definition: DtWeatherLayerGroup.h:159
Contains makVrv::DtWeatherLayer class.
Virtual base class.
Definition: DtVirtualBaseClass.h:19
DtDe & myDe
Definition: DtWeatherLayerGroup.h:150
WeatherLayerMap myMutableWeatherLayerMap
Definition: DtWeatherLayerGroup.h:173
A group node which serves as a root for weather layers.
Definition: DtWeatherLayerGroup.h:48
Creator that is used to create the weather layer group.
Definition: DtWeatherLayerGroup.h:179
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
virtual osg::Object * clone(const osg::CopyOp &copyop) const
required functions for derriving from osg::Group
Definition: DtWeatherLayerGroup.h:75
DT_DLL_VRVCORE DtTaitBryan level(const DtCoordinateSystem &cs, const DtVector &localOrigin, double topoHeading)
Returns a level orientation with the topographic heading.
DtJobSplitter * myJobSplitter
Definition: DtWeatherLayerGroup.h:162
float myWindSpeedMps
Definition: DtWeatherLayerGroup.h:160
this class is used to split work up between threads.
Definition: DtJobSplitter.h:64
double myLastTime
Definition: DtWeatherLayerGroup.h:157
DtSignalConnectionManager myWeatherEffectsConnections
Definition: DtWeatherLayerGroup.h:164
float myTimeStep
Definition: DtWeatherLayerGroup.h:158
A structure used to hold data for drawing.
Definition: DtWeatherEffect.h:48
Contains makVrv::DtVirtualBaseClass class.
Contains makVrv::DtWeatherEffect class.
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
osg::ref_ptr< osg::Geode > myEffectGeode
Definition: DtWeatherLayerGroup.h:152
Base class to provide boost signal/slot management.
A weather layer uses one or more weather effects to create a top level visual.
Definition: DtWeatherLayer.h:43
virtual osg::Object * cloneType() const
Definition: DtWeatherLayerGroup.h:76
std::map< DtUniqueID, DtWeatherLayer * > WeatherLayerMap
These are mutable because it&#39;s used as part of the const drawImplementation.
Definition: DtWeatherLayerGroup.h:171
Contains DLL export macros.
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
Contains the makVrv::DtOsgCullVisitorParameters class.
An OSG implementation of the weather effects object.
Definition: DtOsgWeatherEffectsObject.h:22

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)