VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtEnvironmentalIconCenteringUpdater.h
Go to the documentation of this file.
1 /*****************************************************************************
2 * Copyright (c) 2022 MAK Technologies, Inc.
3 * All rights reserved.
4 *****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvCore/vrvCore.h>
13 #include <vrvCore/DtTickable.h>
14 #include <vrvCore/DtUniqueID.h>
15 
17 
18 #include <matrix/vlVector.h>
19 
20 #include <vector>
21 
22 namespace makVrv
23 {
24 
25  class DtDe;
26  class DtSceneObject;
27  class DtModel;
28  class DtSceneObjectUpdater;
29  class DtPolygonModel;
30  class DtLineModel;
31  class DtCoordinateSystem;
32 
39  {
40  public:
41 
44 
47 
49  virtual bool needsUpdate( DtTime tNow );
50 
52  virtual void update( DtTime tNow );
53 
56  virtual void setSceneObject( DtSceneObject* sceneObject );
57 
60  virtual void setEnvironmentalSceneObject( DtSceneObject* sceneObject );
61 
63  virtual void setOrderGroup(int);
64 
65  protected:
68  virtual void centerIcon();
69 
71  virtual DtVector calculateGeometricCenter() const;
72 
74  virtual DtVector calculateLineCenter() const;
75 
77  virtual DtVector centerOnLine(int startIndex, int endIndex, double lengthOnLine) const;
78 
79  protected:
80 
84  virtual void slot_sceneObjectToBeDeleted( const DtUniqueID& id );
85 
87  virtual void slot_modelAdded(DtModel*);
88 
90  virtual void slot_modelRemoved(DtModel*);
91 
93  virtual void slot_coordinateSystemChanged();
95 
96  protected:
99 
102 
105 
110 
113 
115  std::vector<DtVector> myPoints;
116 
118  bool myUpdate;
119 
120  // When the class is destructed, the scene object may or may not
121  // exist. Using a separate connection variable makes it possible to
122  // 'disconnect' even if the scene object has been deleted.
123  boost::signalslib::connection mySceneObjectConnection;
124  boost::signalslib::connection myEnvironmentalSceneObjectConnection;
125 
126  boost::signalslib::connection myModelAddedConnection;
127  boost::signalslib::connection myModelRemovedConnection;
128 
130 
131  // local clone of the system wide coordinate system.
132  // for thread safety.
133  DtCoordinateSystem* myCoordinateSystem = nullptr;
134  };
135 }
Distributed model for drawing polygons with attached vertices.
Definition: DtPolygonModel.h:20
An abstract base class for objects that require updates. This object automatically adds itself to a D...
Definition: DtTickable.h:26
DtUniqueID myUniqueId
This distributed object&#39;s unique identifier.
Definition: DtEnvironmentalIconCenteringUpdater.h:101
DtSignalConnectionManager myConnections
Definition: DtEnvironmentalIconCenteringUpdater.h:129
boost::signalslib::connection myModelRemovedConnection
Definition: DtEnvironmentalIconCenteringUpdater.h:127
DtDe & myDe
The display engine.
Definition: DtEnvironmentalIconCenteringUpdater.h:98
DtLineModel * myEnvironmentalLineModel
Definition: DtEnvironmentalIconCenteringUpdater.h:109
A DtEnvironmentalIconCenteringUpdater updates the attached scene object to be centered in the center ...
Definition: DtEnvironmentalIconCenteringUpdater.h:38
DtSceneObject * myEnvironmentalSceneObject
A pointer tothe current environmental scene object agent.
Definition: DtEnvironmentalIconCenteringUpdater.h:112
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
boost::signalslib::connection myModelAddedConnection
Definition: DtEnvironmentalIconCenteringUpdater.h:126
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
The DtCoordinateSystem is used to manage the current coordinate system of the scene.
Definition: DtCoordinateSystem.h:40
DtLineModel is the model interface for remote graphic lines.
Definition: DtLineModel.h:18
Base class to provide boost signal/slot management.
Contains the declaration for makVrv::DtTickable.
DtSceneObject * mySceneObject
A pointer to the current scene object being updated.
Definition: DtEnvironmentalIconCenteringUpdater.h:104
DT_DLL_vrfutil bool calculateGeometricCenter(const DtVertexList &vertices, DtVector &geometricCenter)
Calculates the geometric center of the given vertex list. Returns true. Will use strictly geocentric ...
bool myUpdate
Definition: DtEnvironmentalIconCenteringUpdater.h:118
A DtSceneObject represents an object that can be positioned in the scene by (possibly) attaching it t...
Definition: DtSceneObject.h:42
boost::signalslib::connection myEnvironmentalSceneObjectConnection
Definition: DtEnvironmentalIconCenteringUpdater.h:124
A model which owns a single model instance. A DtModel is a managing container for a single DtModelIns...
Definition: DtModel.h:55
Contains makVrv::DtUniqueID type.
DtPolygonModel * myEnvironmentalPolygonModel
A pointer to the current environmental model object. Only one may be valid, however, both pointers are around for convenience.
Definition: DtEnvironmentalIconCenteringUpdater.h:108
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
std::vector< DtVector > myPoints
Points that were last used for calculation.
Definition: DtEnvironmentalIconCenteringUpdater.h:115
int myOrderGroup
Definition: DtEnvironmentalIconCenteringUpdater.h:117
boost::signalslib::connection mySceneObjectConnection
Definition: DtEnvironmentalIconCenteringUpdater.h:123
Contains DLL export macros.

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)