VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtTritonCameraManager.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2019 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvTriton/vrvTriton.h>
13 
15 
16 #include <osg/Camera>
17 
18 #include <matrix/vlVector.h>
19 
20 #include <tbb/atomic.h>
21 
22 #include <map>
23 
24 
25 namespace Triton
26 {
27  class Camera;
28 }
29 
30 namespace osg
31 {
32  class RenderInfo;
33 }
34 
35 namespace makVrv
36 {
37  class DtDe;
38  class DtTritonDrawable;
39 
43  {
44 
45  protected:
46  typedef std::map< osg::observer_ptr<const osg::Camera>, Triton::Camera* > MapOsgCamerasToTritonCameras;
47 
48  public:
50  virtual ~DtTritonCameraManager();
51 
52  protected:
53 
56 
58  DtTritonCameraManager(DtTritonDrawable* tritonDrawable, DtDe& de, unsigned int id);
59 
60  private:
61 
64 
67 
69  DtTritonCameraManager &operator=(const DtTritonCameraManager &);
70 
71  public:
72 
74  virtual Triton::Camera* getOrCreateTritonCamera(const osg::RenderInfo& renderInfo);
75 
77  virtual Triton::Camera* getOrCreateTritonCamera(const osg::Camera* osgCamera);
78 
80  virtual void flushInvalidTritonCameras(void);
81 
83  virtual const Triton::Camera* closetCameraTo(const DtVector& position) const;
84 
85  protected:
86 
88 
91 
92  //only used to create unique names for the cameras
93  const unsigned int myManagerId;
94  unsigned int myNextCameraId;
95  };
96 
100  {
101  protected:
104 
106  virtual ~DtTritonCameraManagerCreator();
107 
108  private:
113 
114  public:
116  static DtTritonCameraManagerCreator& instance(DtDe& de);
117 
119  static void registerInstance(DtDe& de,
120  DtTritonCameraManagerCreator* instance);
121 
122  public:
124  virtual DtTritonCameraManager* create(DtTritonDrawable* drawable, DtDe& de);
125 
126  protected:
127  //only used to create unique names for the cameras
128  unsigned int myNextManagerId;
129 
130  };
131 
132 }
Virtual base class.
Definition: DtVirtualBaseClass.h:22
const unsigned int myManagerId
Definition: DtTritonCameraManager.h:93
DtTritonCameraManager creator.
Definition: DtTritonCameraManager.h:99
std::map< osg::observer_ptr< const osg::Camera >, Triton::Camera * > MapOsgCamerasToTritonCameras
Definition: DtTritonCameraManager.h:46
Contains DLL export macros.
Contains makVrv::DtVirtualBaseClass class.
DtTritonDrawable * myTritonDrawable
Definition: DtTritonCameraManager.h:89
DtDe & myDe
Definition: DtTritonCameraManager.h:90
#define DT_DLL_VRVTRITON
Definition: vrvTriton.h:19
unsigned int myNextManagerId
Definition: DtTritonCameraManager.h:128
unsigned int myNextCameraId
Definition: DtTritonCameraManager.h:94
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
An OSG Drawable representing Triton&#39;s infinite ocean.
Definition: DtTritonDrawable.h:61
MapOsgCamerasToTritonCameras myMapOsgCamerasToTritonCameras
Definition: DtTritonCameraManager.h:87
class for managing the link between the triton camera&#39;s and the osg cameras
Definition: DtTritonCameraManager.h:42

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)