VR-Forces 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) 2023 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 namespace makVrv
24 {
25  // Forward declarations.
26  class DtJobSplitter;
27  class DtOsgWeatherEffectsObject;
28 
29 
46  class DT_DLL_VRVOSG DtWeatherLayerGroup : public osg::Group
47  {
48  public:
49 
52 
54  DtWeatherLayerGroup(const DtWeatherLayerGroup& orig, const osg::CopyOp& opr);
55 
57  virtual ~DtWeatherLayerGroup();
58 
59  private:
60 
62  DtWeatherLayerGroup() = delete;
63 
65  DtWeatherLayerGroup(const DtWeatherLayerGroup &other) = delete;
66 
68  DtWeatherLayerGroup &operator=(const DtWeatherLayerGroup &other) = delete;
69 
70  public:
71 
73  virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new DtWeatherLayerGroup(*this, copyop); }
74  virtual osg::Object* cloneType() const { return NULL; }
75 
77  virtual void releaseGLObjects(osg::State* state = 0) const override;
78 
80  virtual void deleteGeode();
81 
82  // !\brief Gets the sensor node suitable for use with sensorFX.
83  virtual osg::Node* getOrCreateSensorNode();
84 
91  virtual void registerLayer(DtWeatherLayer* layer, bool global = false);
92 
96  virtual void unregisterLayer(DtWeatherLayer* layer);
97 
101  virtual void setGlobalWind(float windDirectionRad, float windSpeedMps);
102 
104  virtual void drawWeatherEffects(DtWeatherEffect::DrawData& drawData);
105 
107  virtual float timeStep() const;
108 
110  virtual void registerWeatherEffectsObject(DtOsgWeatherEffectsObject* weatherEffectsObject);
111 
112  protected:
113 
115  void connectSignals();
116 
118  virtual void slot_groundSnowAccumulationChanged(float value);
119 
121  virtual void slot_simulationUpdate();
122 
124  virtual void traverse(osg::NodeVisitor& nv);
125 
129  virtual bool cullUpdate(osg::Camera* cam);
130 
134  virtual void computeBasis(const osg::Vec3d& inGeocentricPos, osg::Matrixd& rotOut);
135 
136  protected:
137 
139 
142 
143  std::vector<DtWeatherArea*> myDrawWeatherAreas;
144 
145  double myLastTime;
146  float myTimeStep;
149 
151 
154 
155  private:
156 
158  mutable std::vector<DtWeatherLayer*> myWeatherLayers;
159  mutable std::vector<DtWeatherLayer*> myGlobalWeatherLayers;
160  };
161 
162 
163 
166  {
167 
168  public:
169 
171  static DtWeatherLayerGroupCreator& instance(DtDe& theIG);
172 
174  static void registerInstance(DtDe& theIG, DtWeatherLayerGroupCreator* anInstance);
175 
177  virtual DtWeatherLayerGroup* create(DtDe&);
178  };
179 }
180 
181 
osg::ref_ptr< makVrv::DtWeatherEffectDrawable > myEffectDrawable
Definition: DtWeatherLayerGroup.h:141
float myWindDirectionRad
Definition: DtWeatherLayerGroup.h:147
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:138
A group node which serves as a root for weather layers.
Definition: DtWeatherLayerGroup.h:46
DtSignalConnectionManager myMainConnections
Definition: DtWeatherLayerGroup.h:152
Creator that is used to create the weather layer group.
Definition: DtWeatherLayerGroup.h:165
#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:73
DtJobSplitter * myJobSplitter
Definition: DtWeatherLayerGroup.h:150
float myWindSpeedMps
Definition: DtWeatherLayerGroup.h:148
this class is used to split work up between threads.
Definition: DtJobSplitter.h:64
double myLastTime
Definition: DtWeatherLayerGroup.h:145
DtSignalConnectionManager myWeatherEffectsConnections
Definition: DtWeatherLayerGroup.h:153
float myTimeStep
Definition: DtWeatherLayerGroup.h:146
std::vector< DtWeatherLayer * > myGlobalWeatherLayers
Definition: DtWeatherLayerGroup.h:159
A structure used to hold data for drawing.
Definition: DtWeatherEffect.h:72
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:143
osg::ref_ptr< osg::Geode > myEffectGeode
Definition: DtWeatherLayerGroup.h:140
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:74
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:158
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:76
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 Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)