VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtCameraNode.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2013 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 <boost/signals.hpp>
16 
17 #include <queue>
18 
19 namespace osg
20 {
21  class RenderInfo;
22  class State;
23 }
24 
25 namespace makVrv
26 {
29  class DT_DLL_VRVOSG DtCameraNode : public osg::Camera
30  {
31  public:
32 
35  {
36  PriorityHighest = 0,
37  PriorityNormal = 5,
38  PriorityLowest = 10
39  };
40 
42  DtCameraNode();
43 
45  META_Node(vrvOsg, DtCameraNode);
46 
48  DtCameraNode(const DtCameraNode& camera,
49  const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
50 
52  DtCameraNode(const osg::Camera& camera,
53  const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
54 
59  virtual void addPostDrawCallback(osg::Camera::DrawCallback* callback,
60  unsigned int priority = PriorityNormal);
61 
63  virtual void removePostDrawCallback(osg::Camera::DrawCallback* callback);
64 
66  void setPostDrawCallback(osg::Camera::DrawCallback* cb);
67 
70  virtual void releaseGLObjects(osg::State* state = 0);
71 
72  protected:
74  ~DtCameraNode();
75 
76  protected:
80  class VrvPostDrawCallback : public osg::Camera::DrawCallback
81  {
82  public:
84 
85  VrvPostDrawCallback(const VrvPostDrawCallback&, const osg::CopyOp&);
86 
87  META_Object(vrvOsg, VrvPostDrawCallback);
88 
90  virtual void operator() (osg::RenderInfo& renderInfo) const;
91  };
92 
93  friend class VrvPostDrawCallback;
94  public:
97  {
98  osg::ref_ptr<osg::Camera::DrawCallback> callback;
99  unsigned int priority;
100  };
101 
102  typedef std::list<PriorityDrawCallback> CallbackQueue;
103 
105  CallbackQueue getCallbackQueue();
106 
108  void setCallbackQueue(CallbackQueue cbq);
109 
110  protected:
113  friend struct PriorityDrawCallbackComparator;
114 
116  {
117  public:
118  bool operator()(const PriorityDrawCallback& lhs, const PriorityDrawCallback& rhs);
119  };
120 
123  friend struct CallbackMatch;
124 
126  {
127  osg::Camera::DrawCallback* callback;
128  bool operator()(PriorityDrawCallback& rhs);
129  };
130 
131  //typedef std::vector<PriorityDrawCallback> CallbackQueue;
133 
134 
135  };
136 }

Document ID: Generated on Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)