VR-Forces 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) 2023 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvCore/vrvCore.h>
15 
16 #include <matrix/vlTaitBryan.h>
17 
18 #include <functional>
19 #include <map>
20 
21 namespace makVrv
22 {
23  class DtChannelManager;
24  class DtChannel;
25  class DtDe;
26  class DtTerrainPatch;
27  class DtCoordinateSystem;
28 
33  {
34  public:
38  {
41  bool is2D;
42  double viewResolution;
43  DtTaitBryan orientation;
45 
46  bool operator==(const ChannelUpdateData& rhs)const
47  {
48  return ((channel == rhs.channel) &&
49  (viewResolution == rhs.viewResolution) &&
50  (orientation == rhs.orientation) &&
51  (windowPixelRatio == rhs.windowPixelRatio) &&
52  (is2D == rhs.is2D));
53  }
54 
55  bool operator!=(const ChannelUpdateData& rhs) const
56  {
57  return !(*this == rhs);
58  }
59  };
60 
62  typedef std::function<void (ChannelUpdateData)> ChannelUpdateCallback;
63 
64  public:
67 
70 
73  static DtTacticalGraphicModelUpdaterManager& instance(DtDe& de);
74 
76  static void registerInstance(DtDe& de, DtTacticalGraphicModelUpdaterManager* anInstance);
77 
80  virtual void add(intptr_t identifier, ChannelUpdateCallback);
81 
83  virtual void remove(intptr_t);
84 
86  virtual bool isRegistered(intptr_t) const;
87 
89  virtual double viewResolution(DtChannel*);
90 
93  virtual ChannelUpdateData channelUpdateData(DtChannel*);
94 
95  protected:
98  virtual void slot_channelUpdated( DtChannelManager*, DtChannel* channel );
99 
102  virtual void slot_channelToBeDestroyed( DtChannelManager*, DtChannel* channel );
103 
106  void initializeTerrainInformation();
107 
110  virtual void terrainChanged(const DtTerrainPatch&);
111 
115  virtual double computeHighestTerrainPoint(DtChannel*) const;
116 
118  virtual void slot_coordinateSystemChanged();
119 
120  protected:
122 
123  typedef std::map<intptr_t, ChannelUpdateCallback> CallbacksList;
125 
128  typedef std::map<DtChannel*, ChannelUpdateData> ChannelUpdateDataMap;
130 
134 
138 
140 
143  DtCoordinateSystem* myCoordinateSystem = nullptr;
144  };
145 }
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:46
DtDe & myDe
Definition: DtTacticalGraphicModelUpdaterManager.h:121
The DtTacticalGraphicModelUpdaterManager class manages tactical graphics that want to be updated by c...
Definition: DtTacticalGraphicModelUpdaterManager.h:32
ChannelUpdateDataMap myChannelUpdateData
Definition: DtTacticalGraphicModelUpdaterManager.h:129
DtTaitBryan orientation
How much the channel camera is zoomed in/out on the terrain.
Definition: DtTacticalGraphicModelUpdaterManager.h:44
float windowPixelRatio
Definition: DtTacticalGraphicModelUpdaterManager.h:40
A container for a single piece of terrain, containing settings needed to recreate it...
Definition: DtTerrainPatch.h:42
bool operator!=(const ChannelUpdateData &rhs) const
Definition: DtTacticalGraphicModelUpdaterManager.h:55
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.
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
double viewResolution
Definition: DtTacticalGraphicModelUpdaterManager.h:42
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:137
std::function< void(ChannelUpdateData)> ChannelUpdateCallback
Function prototype for adding callback method to the model update manager.
Definition: DtTacticalGraphicModelUpdaterManager.h:62
DtChannel * channel
Definition: DtTacticalGraphicModelUpdaterManager.h:39
The DtCoordinateSystem is used to manage the current coordinate system of the scene.
Definition: DtCoordinateSystem.h:40
std::map< intptr_t, ChannelUpdateCallback > CallbacksList
Definition: DtTacticalGraphicModelUpdaterManager.h:123
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:124
std::map< DtChannel *, ChannelUpdateData > ChannelUpdateDataMap
Current channel update data such that can check if channel updates need to be called.
Definition: DtTacticalGraphicModelUpdaterManager.h:128
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:72
double myHighestTerrainPoint
Calculated height above terrain of the highest point of the terrain based on its bounding sphere...
Definition: DtTacticalGraphicModelUpdaterManager.h:133
bool is2D
Definition: DtTacticalGraphicModelUpdaterManager.h:41
DtSignalConnectionManager myConnections
Definition: DtTacticalGraphicModelUpdaterManager.h:139
Contains DLL export macros.

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)