VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtCameraNode.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 #include <vrvOsg/vrvOsg.h>
12 
13 #include <osg/Camera>
14 
15 #include <queue>
16 
17 namespace osg
18 {
19  class RenderInfo;
20  class State;
21 }
22 
23 namespace makVrv
24 {
25  class DtGlDebugger;
26  class DtDe;
27 
30  class DT_DLL_VRVOSG DtCameraNode : public osg::Camera
31  {
32  public:
33 
36  {
37  PriorityHighest = 0,
38  PriorityNormal = 5,
39  PriorityLowest = 10
40  };
41 
43  DtCameraNode(DtDe& de);
44 
46  DtCameraNode(const DtCameraNode& camera, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
47 
49  DtCameraNode(DtDe& de, const osg::Camera& camera, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
50 
52  DtCameraNode() = delete;
53 
55  DtCameraNode& operator=(const DtCameraNode& rhs) = delete;
56  public:
58  //META_Node(vrvOsg, DtCameraNode);
59  // actually declare/defines this, since we want DtCameraNode to take DtDe
60  virtual osg::Object* cloneType() const override;
61  virtual osg::Object* clone(const osg::CopyOp& copyop) const override;
62  virtual bool isSameKindAs(const osg::Object* obj) const override;
63  virtual const char* className() const override;
64  virtual const char* libraryName() const override;
65  virtual void accept(osg::NodeVisitor& nv) override;
66  public:
71  virtual void addPostDrawCallback(osg::Camera::DrawCallback* callback,
72  unsigned int priority = PriorityNormal);
73 
75  virtual void removePostDrawCallback(osg::Camera::DrawCallback* callback);
76 
78  virtual bool containsPostDrawCallback(osg::Camera::DrawCallback* callback);
79 
81  virtual void setPostDrawCallback(osg::Camera::DrawCallback* cb);
82 
85  virtual void releaseGLObjects(osg::State* state = 0) const;
86 
87  protected:
89  virtual ~DtCameraNode();
90 
91  protected:
96  {
97  public:
99 
100  VrvPostDrawCallback(const VrvPostDrawCallback&, const osg::CopyOp&);
101 
102  META_Object(vrvOsg, VrvPostDrawCallback);
103 
105  virtual void operator() (osg::RenderInfo& renderInfo) const;
106  };
107 
108  friend class VrvPostDrawCallback;
109  public:
112  {
114  unsigned int priority;
115  };
116 
117  typedef std::list<PriorityDrawCallback> CallbackQueue;
118  public:
120  virtual CallbackQueue getCallbackQueue();
121 
123  virtual void setCallbackQueue(const CallbackQueue& cbq);
124  protected:
126  void setupCallbacks();
127 
128  protected:
131  friend struct PriorityDrawCallbackComparator;
132 
134  {
135  public:
136  bool operator()(const PriorityDrawCallback& lhs, const PriorityDrawCallback& rhs);
137  };
138 
141  friend struct CallbackMatch;
142 
144  {
146  bool operator()(PriorityDrawCallback& rhs);
147  };
148 
149  //typedef std::vector<PriorityDrawCallback> CallbackQueue;
151 
155  };
156 }
std::list< PriorityDrawCallback > CallbackQueue
Definition: DtCameraNode.h:117
VR-Vantage&#39;s post draw callback.
Definition: DtCameraNode.h:95
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
unsigned int priority
Definition: DtCameraNode.h:114
DtGlDebugger * myGLDebugger
Definition: DtCameraNode.h:153
CallbackPriority
Post draw callback default priority levels.
Definition: DtCameraNode.h:35
osg::ref_ptr< osg::Camera::DrawCallback > callback
Definition: DtCameraNode.h:113
Definition: DtGlDebugger.h:16
DtDe & myDe
Definition: DtCameraNode.h:154
VR-Vantage specific subclass of OSG camera.
Definition: DtCameraNode.h:30
Wrapper to add a priority value to a draw callback.
Definition: DtCameraNode.h:111
Definition: DtCameraNode.h:143
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:72
osg::Camera::DrawCallback * callback
Definition: DtCameraNode.h:145
bool myEnableDebugging
Definition: DtCameraNode.h:152
CallbackQueue myCallbackQueue
Definition: DtCameraNode.h:150

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)