VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOsgCullVisitor.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>
14 #include <vrvUtil/signalslib.h>
16 
17 namespace makVrv
18 {
19  class DtOsgOcclusionQueryNode;
20  class DtCoordinateSystem;
21 
27  class DT_DLL_VRVOSG DtOsgCullVisitor : public osgUtil::CullVisitor
28  {
29  public:
32 
35 
36  protected:
37 
39  virtual ~DtOsgCullVisitor();
40 
41  public:
43  void initializeViewDependentSettings();
44 
46  bool orthoCulling() const;
47 
50  bool coordinateSystemChanged() const;
51 
54  virtual float getDistanceToScreenEdge(const osg::Vec3& vec) const;
55 
57  virtual float altitude2D() const;
58 
60  const DtOsgCullVisitorParameters* visitorParameters() const;
61 
63  void setInReflectionPass(bool bReflecting) { myIsInReflectionPass = bReflecting; }
65  bool inReflectionPass(void) const { return myIsInReflectionPass; }
66 
70  const DtDe& de(void) const;
71 
75  DtDe& de(void);
76 
78  virtual void apply(osg::Transform& node);
79 
81  virtual void apply(osg::Node& node);
82 
84  virtual void apply(osg::Group& group);
85 
87  virtual void apply(osg::LightSource& lightSource);
88 
90  virtual void apply(osg::Geode& geode);
91 
93  virtual void apply(osg::Camera& node);
94 
96  virtual void apply(osg::Billboard& node);
97 
100  virtual void apply(osg::PagedLOD& node);
101 
103  virtual void apply(osg::OcclusionQueryNode& node);
104 
107  virtual bool isCulled(osg::Node& node, double scaleFactor);
108 
109  protected:
110 
113  virtual float getDistanceToViewPoint(const osg::Vec3& vec, bool useLOD) const;
114 
116  virtual float calculateFocusPointDistance(const osg::Vec3& vec, bool useLOD, float magVal) const;
117 
118 
120  DtOsgCullVisitorParameters* getVisitorParameters() const;
121 
123  virtual osgUtil::CullVisitor* clone() const;
124 
126  virtual void reset();
127 
129  virtual bool isOcean(const osg::Node* node) const;
130 
132  void slot_StateSetChanged(const osg::StateSet* pStateSet);
133 
135  virtual void slot_coordinateSystemChanged();
136 
137 
138  protected:
140  double myAltitude2D;
141  double myAltitude3D;
144 
145  boost::signalslib::connection m_signalConnection;
146 
149 
151 
154  DtCoordinateSystem* myCoordinateSystem = nullptr;
155 
156  };
157 }
158 
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
bool myIsInTerrain
Definition: DtOsgCullVisitor.h:148
boost::signalslib::connection m_signalConnection
Definition: DtOsgCullVisitor.h:145
DtOsgCullVisitor will inspect the camera to see which visual mode is active. If the visual mode is a ...
Definition: DtOsgCullVisitor.h:27
void setInReflectionPass(bool bReflecting)
Indicate whether we are now in a reflection pass.
Definition: DtOsgCullVisitor.h:63
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
The osg cull vistor parameters class provides additional culling and intersector parameters for choos...
Definition: DtOsgCullVisitorParameters.h:42
DtOsgCullVisitorParameters * myInfoCopy
Definition: DtOsgCullVisitor.h:139
double myAltitude3D
Definition: DtOsgCullVisitor.h:141
bool inReflectionPass(void) const
Query whether this visitor is in a reflection pass.
Definition: DtOsgCullVisitor.h:65
The DtCoordinateSystem is used to manage the current coordinate system of the scene.
Definition: DtCoordinateSystem.h:41
DtSignalConnectionManager myConnections
Definition: DtOsgCullVisitor.h:150
Base class to provide boost signal/slot management.
double myAltitude2D
Definition: DtOsgCullVisitor.h:140
Contains DLL export macros.
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
DtDe & myDe
Definition: DtOsgCullVisitor.h:143
Contains the makVrv::DtOsgCullVisitorParameters class. Visual mode information is set into the camera...
osg::Matrix myWorldToWindowMatrix
Definition: DtOsgCullVisitor.h:142
bool myIsInReflectionPass
Definition: DtOsgCullVisitor.h:147

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)