VR-Forces 5.0.3 Developer's Guide
 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 namespace Triton
25 {
26  class Camera;
27 }
28 
29 namespace osg
30 {
31  class RenderInfo;
32 }
33 
34 namespace makVrv
35 {
36  class DtDe;
37  class DtTritonDrawable;
38 
41 
44 
46  template <>
47  inline const char* creatorTypeName<DtTritonCameraManager>(void) { return "DtTritonCameraManagerCreator"; }
48 
52  {
53 
54  protected:
55  typedef std::map< osg::observer_ptr<const osg::Camera>, Triton::Camera* > MapOsgCamerasToTritonCameras;
56 
57  public:
59  virtual ~DtTritonCameraManager();
60 
61  protected:
62 
65 
67  DtTritonCameraManager(DtDe& de, DtTritonDrawable* tritonDrawable);
68 
69  private:
70 
73 
76 
78  DtTritonCameraManager &operator=(const DtTritonCameraManager &);
79 
80  public:
81 
83  virtual Triton::Camera* getOrCreateTritonCamera(const osg::RenderInfo& renderInfo);
84 
86  virtual Triton::Camera* getOrCreateTritonCamera(const osg::Camera* osgCamera);
87 
89  virtual void flushInvalidTritonCameras(void);
90 
92  virtual const Triton::Camera* closetCameraTo(const DtVector& position) const;
93 
94  protected:
95 
97 
100 
101  //only used to create unique names for the cameras
102  unsigned int myNextCameraId;
103  };
104 }
friend DtTritonCameraManagerCreator
friend creator so it can be the only thing to create this class
Definition: DtTritonCameraManager.h:64
std::map< osg::observer_ptr< const osg::Camera >, Triton::Camera * > MapOsgCamerasToTritonCameras
Definition: DtTritonCameraManager.h:55
const char * creatorTypeName< DtTritonCameraManager >(void)
template specialization for the creator (pass the class being created to the creatorTypeName template...
Definition: DtTritonCameraManager.h:47
Contains DLL export macros.
Variadic templated creator class for defining a DtVirtualBaseClass creator that is automatically regi...
Definition: DtVirtualBaseClassCreator.h:22
DtTritonDrawable * myTritonDrawable
Definition: DtTritonCameraManager.h:98
DtVirtualBaseClassCreator< DtTritonCameraManager, DtTritonDrawable * > DtTritonCameraManagerCreator
creator
Definition: DtTritonCameraManager.h:40
DtDe & myDe
Definition: DtTritonCameraManager.h:99
#define DT_DLL_VRVTRITON
Definition: vrvTriton.h:19
unsigned int myNextCameraId
Definition: DtTritonCameraManager.h:102
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
An OSG Drawable representing Triton&#39;s infinite ocean. /ingroup vrvTriton.
Definition: DtTritonDrawable.h:62
MapOsgCamerasToTritonCameras myMapOsgCamerasToTritonCameras
Definition: DtTritonCameraManager.h:96
class for managing the link between the triton camera&#39;s and the osg cameras
Definition: DtTritonCameraManager.h:51

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)