VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtTacticalGraphicModelUpdaterManager.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2022 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
10 
11 #pragma once
12 
13 #include <vrvOsg/vrvOsg.h>
16 
17 #include <matrix/vlTaitBryan.h>
18 
19 #include <boost/function.hpp>
20 #include <map>
21 namespace makVrv
22 {
23  class DtChannelManager;
24  class DtChannel;
25  class DtDe;
26  class DtTerrainPatch;
27  class DtCoordinateSystem;
28 
33  {
34  public:
38  {
40  double viewResolution;
41  DtTaitBryan orientation;
43 
44  bool operator==(const ChannelUpdateData& rhs)const
45  {
46  return ((channel == rhs.channel) &&
47  (viewResolution == rhs.viewResolution) &&
48  (orientation == rhs.orientation));
49  }
50 
51  bool operator!=(const ChannelUpdateData& rhs) const
52  {
53  return !(*this == rhs);
54  }
55  };
56 
58  typedef boost::function<void (ChannelUpdateData)> ChannelUpdateCallback;
59 
60  public:
63 
66 
69  static DtTacticalGraphicModelUpdaterManager& instance(DtDe& de);
70 
72  static void registerInstance(DtDe& de, DtTacticalGraphicModelUpdaterManager* anInstance);
73 
76  virtual void add(intptr_t identifier, ChannelUpdateCallback);
77 
79  virtual void remove(intptr_t);
80 
82  virtual bool isRegistered(intptr_t) const;
83 
85  virtual double viewResolution(DtChannel*);
86 
89  virtual ChannelUpdateData channelUpdateData(DtChannel*);
90 
91  protected:
94  virtual void slot_channelUpdated( DtChannelManager*, DtChannel* channel );
95 
98  virtual void slot_channelToBeDestroyed( DtChannelManager*, DtChannel* channel );
99 
102  void initializeTerrainInformation();
103 
106  virtual void terrainChanged(const DtTerrainPatch&);
107 
111  virtual double computeHighestTerrainPoint(DtChannel*) const;
112 
114  virtual void slot_coordinateSystemChanged();
115 
116  protected:
118 
119  typedef std::map<intptr_t, ChannelUpdateCallback> CallbacksList;
121 
124  typedef std::map<DtChannel*, ChannelUpdateData> ChannelUpdateDataMap;
126 
130 
134 
135 
137 
140  DtCoordinateSystem* myCoordinateSystem = nullptr;
141  };
142 }
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
bool operator==(const ChannelUpdateData &rhs) const
Camera orientation.
Definition: DtTacticalGraphicModelUpdaterManager.h:44
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
boost::function< void(ChannelUpdateData)> ChannelUpdateCallback
Function prototype for adding callback method to the model update manager.
Definition: DtTacticalGraphicModelUpdaterManager.h:58
DtDe & myDe
Definition: DtTacticalGraphicModelUpdaterManager.h:117
The DtTacticalGraphicModelUpdaterManager class manages tactical graphics that want to be updated by c...
Definition: DtTacticalGraphicModelUpdaterManager.h:32
ChannelUpdateDataMap myChannelUpdateData
Definition: DtTacticalGraphicModelUpdaterManager.h:125
DtTaitBryan orientation
How much the channel camera is zoomed in/out on the terrain.
Definition: DtTacticalGraphicModelUpdaterManager.h:42
A container for a single piece of terrain, containing settings needed to recreate it...
Definition: DtTerrainPatch.h:40
bool operator!=(const ChannelUpdateData &rhs) const
Definition: DtTacticalGraphicModelUpdaterManager.h:51
The abstract Channel Class.
Definition: DtChannel.h:35
Structure used to supply data to callback. Provided as structure as contents could change over time...
Definition: DtTacticalGraphicModelUpdaterManager.h:37
Contains makVrv::DtVirtualBaseClass class.
double viewResolution
Definition: DtTacticalGraphicModelUpdaterManager.h:40
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
bool myComputeHighestTerrainPoint
Set to true if bounding volume of terrain needs to be recalculated on next access.
Definition: DtTacticalGraphicModelUpdaterManager.h:133
DtChannel * channel
Definition: DtTacticalGraphicModelUpdaterManager.h:39
The DtCoordinateSystem is used to manage the current coordinate system of the scene.
Definition: DtCoordinateSystem.h:41
std::map< intptr_t, ChannelUpdateCallback > CallbacksList
Definition: DtTacticalGraphicModelUpdaterManager.h:119
Base class for handling DtChannels. Derived classes should override the tick() method and advance the...
Definition: DtChannelManager.h:32
Base class to provide boost signal/slot management.
CallbacksList myCallbacks
Definition: DtTacticalGraphicModelUpdaterManager.h:120
Contains DLL export macros.
std::map< DtChannel *, ChannelUpdateData > ChannelUpdateDataMap
Current channel update data such that can check if channel updates need to be called.
Definition: DtTacticalGraphicModelUpdaterManager.h:124
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
double myHighestTerrainPoint
Calculated height above terrain of the highest point of the terrain based on its bounding sphere...
Definition: DtTacticalGraphicModelUpdaterManager.h:129
DtSignalConnectionManager myConnections
Definition: DtTacticalGraphicModelUpdaterManager.h:136

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)