VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOsgLightPointManager.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2018 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
13 
14 #include <vrvOsg/vrvOsg.h>
16 
20 
21 #include <osgSim/LightPointNode>
22 
23 #include <boost/thread.hpp>
24 
25 #include <string>
26 
27 namespace osgEarth
28 {
29  class GeoPoint;
30  class MapNode;
31 }
32 
33 namespace makVrv
34 {
35  class DtDe;
36 
37  class DtGlBuffer;
38 
39  class DtLightPointNode;
41 
44  typedef osg::observer_ptr<osg::Node> LightPointNodeObs;
45  typedef osg::ref_ptr<osg::Node> LightPointNodeRef;
46  typedef std::set<LightPointNodeObs> LightPointNodeObsSet;
47 
49  {
50  float color[4];
51  float intensity[4];
52  float sectors[4];
53  float pixelSize[4];
55  };
56 
69  {
70  public:
71 
74 
76  static DtOsgLightPointManager& instanceAsDtOsgLightPointManager(DtDe& de);
77 
78 
81  virtual void registerInstancedLightPoints(DtInstanceManager::LightPointVec &lightPoints, bool daylightControlled);
82 
85  virtual LightPointNodeObsSet registerLightPoints(LightPointNodeObsSet lightPoints, const std::string& groupName = "", bool daylightControlled = false);
86 
91  virtual DtLightPointNode *createLightPointNode(osg::Node *nodeRef, bool daylightControlled);
92 
96  virtual DtGlBuffer *lightPointTypeBuffer();
97 
100  virtual DtGlBuffer *lightPointGroupBuffer();
101 
105  virtual DtGlBuffer *lightPointNodeBuffer(osg::Camera* camera);
106 
108  virtual int nodeId(DtLightPointNode *lpNode, int instanceId);
109 
111  virtual void slot_preTick();
112 
114  virtual void clearNodeBuffer(const osg::Camera* camera);
115 
119  virtual void setNodeBufferData(int nodeId, osg::Matrixf &modelView, osg::Vec4f &eyeLocal, int groupId, const osg::Camera *camera, float posScale, float radiusScale, bool isInstancedReflection);
120 
122  virtual void processImGui();
123 
125  virtual DtLightPointDrawable *masterLightPointDrawable();
126 
128  virtual bool debugLabelsEnabled();
129 
131  virtual bool debugDirectionEnabled();
132 
134  virtual bool softerLightPointsEnabled();
135 
137  virtual float softenIntensity();
138 
141  virtual void setShouldReplaceOsgSimLightPoints(bool enable);
142 
145  virtual bool shouldReplaceOsgSimLightPoints();
146 
148  virtual void freeNodeIds(std::vector<int> &nodeIds);
149 
150  virtual void releaseGLObjects(osg::State * state) const;
151 
153  virtual void setInstanceReflectionMatrix(const osg::Camera *camera, const osg::Matrixf &reflectMat);
154 
156  virtual const osg::Matrixf &instanceReflectionMatrix(const osg::Camera *camera);
157 
159  boost::signal<void(LightPointNodeObsSet&)> signal_lightPointsRegistered;
160 
161  protected:
162 
164  virtual ~DtOsgLightPointManager();
165 
167  virtual void slot_reloadShaders();
168 
170  virtual void setupShaders();
171 
174  int parseNodeGroupId(osg::Node *lightPointNode);
175 
177  std::string parseNodeGroupName(osg::Node *node);
178 
179  protected:
180 
183 
184  typedef std::map<const osg::Camera*, std::vector<float> > CameraVectorMap;
187 
188 
189  typedef std::pair<DtLightPointNode*, int> nodeIntPair;
190  typedef std::map<nodeIntPair, int> NodeIdMap;
192  std::set<int> myFreeNodeIds;
193 
194  boost::mutex myMutex;
195 
196  osg::ref_ptr<DtLightPointDrawable> myMasterLightPointDrawable;
197 
203 
205 
206  typedef std::map<std::string, GroupIdMap> ParentGroupIdMap;
208 
209  std::map<const osg::Camera*, osg::Matrixf> myInstanceReflectionMatrix;
210 
211  };
212 }

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)