VR-Vantage API Documentation
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 #include <vrvOsg/vrvOsg.h>
11 
12 #include <osg/Camera>
13 
14 #include <boost/signals.hpp>
15 
16 #include <queue>
17 
18 namespace osg { class RenderInfo; }
19 
20 namespace makVrv
21 {
24  class DT_DLL_VRVOSG DtCameraNode : public osg::Camera
25  {
26  public:
27 
30  {
31  PriorityHighest = 0,
32  PriorityNormal = 5,
33  PriorityLowest = 10
34  };
35 
37  DtCameraNode();
38 
40  META_Node(vrvOsg, DtCameraNode);
41 
43  DtCameraNode(const DtCameraNode& camera,
44  const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
45 
47  DtCameraNode(const osg::Camera& camera,
48  const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
49 
54  virtual void addPostDrawCallback(osg::Camera::DrawCallback* callback,
55  unsigned int priority = PriorityNormal);
56 
58  virtual void removePostDrawCallback(osg::Camera::DrawCallback* callback);
59 
61  void setPostDrawCallback(osg::Camera::DrawCallback* cb);
62 
63  protected:
65  ~DtCameraNode();
66 
67  protected:
71  class VrvPostDrawCallback : public osg::Camera::DrawCallback
72  {
73  public:
75 
76  VrvPostDrawCallback(const VrvPostDrawCallback&, const osg::CopyOp&);
77 
78  META_Object(vrvOsg, VrvPostDrawCallback);
79 
81  virtual void operator() (osg::RenderInfo& renderInfo) const;
82  };
83 
84  friend class VrvPostDrawCallback;
85  public:
88  {
89  osg::ref_ptr<osg::Camera::DrawCallback> callback;
90  unsigned int priority;
91  };
92  protected:
95  friend struct PriorityDrawCallbackComparator;
96 
98  {
99  public:
100  bool operator()(const PriorityDrawCallback& lhs, const PriorityDrawCallback& rhs);
101  };
102 
105  friend struct CallbackMatch;
106 
108  {
109  osg::Camera::DrawCallback* callback;
110  bool operator()(PriorityDrawCallback& rhs);
111  };
112 
113  typedef std::vector<PriorityDrawCallback> CallbackQueue;
115  };
116 }


Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)