VR-Forces 5.0.3 Developer's Guide
 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) 2021 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 
93  virtual void registerLayer(DtWeatherLayer* layer, bool global = false);
94 
98  virtual void unregisterLayer(DtWeatherLayer* layer);
99 
103  virtual void setGlobalWind(float windDirectionRad, float windSpeedMps);
104 
106  virtual void drawWeatherEffects(DtWeatherEffect::DrawData& drawData);
107 
109  virtual float timeStep() const;
110 
112  virtual void registerWeatherEffectsObject(DtOsgWeatherEffectsObject* weatherEffectsObject);
113 
114  protected:
115 
117  void connectSignals();
118 
120  void disconnectSignals();
121 
123  virtual void slot_groundSnowAccumulationChanged(float value);
124 
126  virtual void slot_simulationUpdate();
127 
129  virtual void traverse(osg::NodeVisitor& nv);
130 
134  virtual bool cullUpdate(osg::Camera* cam);
135 
139  virtual void computeBasis(const osg::Vec3d& inGeocentricPos, osg::Matrixd& rotOut);
140 
141  protected:
142 
144 
147 
148  std::vector<osg::Vec4d> myCullingPlanes;
149  std::vector<DtWeatherArea*> myDrawWeatherAreas;
150 
151  double myLastTime;
152  float myTimeStep;
155 
157 
159 
160  private:
161 
163  mutable std::vector<DtWeatherLayer*> myWeatherLayers;
164  mutable std::vector<DtWeatherLayer*> myGlobalWeatherLayers;
165  };
166 
167 
168 
171  {
172 
173  public:
174 
176  static DtWeatherLayerGroupCreator& instance(DtDe& theIG);
177 
179  static void registerInstance(DtDe& theIG, DtWeatherLayerGroupCreator* anInstance);
180 
182  virtual DtWeatherLayerGroup* create(DtDe&);
183  };
184 }
185 
186 
osg::ref_ptr< makVrv::DtWeatherEffectDrawable > myEffectDrawable
Definition: DtWeatherLayerGroup.h:146
std::vector< osg::Vec4d > myCullingPlanes
Definition: DtWeatherLayerGroup.h:148
float myWindDirectionRad
Definition: DtWeatherLayerGroup.h:153
Contains makVrv::DtWeatherLayer class.
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
DtDe & myDe
Definition: DtWeatherLayerGroup.h:143
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:170
#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
DtJobSplitter * myJobSplitter
Definition: DtWeatherLayerGroup.h:156
float myWindSpeedMps
Definition: DtWeatherLayerGroup.h:154
this class is used to split work up between threads.
Definition: DtJobSplitter.h:64
double myLastTime
Definition: DtWeatherLayerGroup.h:151
DtSignalConnectionManager myWeatherEffectsConnections
Definition: DtWeatherLayerGroup.h:158
float myTimeStep
Definition: DtWeatherLayerGroup.h:152
std::vector< DtWeatherLayer * > myGlobalWeatherLayers
Definition: DtWeatherLayerGroup.h:164
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
std::vector< DtWeatherArea * > myDrawWeatherAreas
Definition: DtWeatherLayerGroup.h:149
osg::ref_ptr< osg::Geode > myEffectGeode
Definition: DtWeatherLayerGroup.h:145
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:47
virtual osg::Object * cloneType() const
Definition: DtWeatherLayerGroup.h:76
Contains DLL export macros.
std::vector< DtWeatherLayer * > myWeatherLayers
These are mutable because it&#39;s used as part of the const drawImplementation.
Definition: DtWeatherLayerGroup.h:163
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:70
Contains the makVrv::DtOsgCullVisitorParameters class. Visual mode information is set into the camera...
An OSG implementation of the weather effects object.
Definition: DtOsgWeatherEffectsObject.h:22

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)