VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtHATLineVisualizer.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 
13 
15 
16 namespace makVrv
17 {
18 
19  class Dt3DSegmentedLineModelAgent;
20  class DtWidgetLabelAgent;
21  class DtSceneObjectAgent;
22  class DtAttachableHatUpdaterAgent;
23  class DtProjectedWidgetModelAgent;
24  class DtAttachableHatTextUpdaterAgent;
25  class DtObjectTypeStateListener;
26 
31  {
32  public:
33 
36  DtStateListener& listener, int modelSet );
37 
39  DtHATLineVisualizer( DtBaseConnection& simulation, DtStateListener& listener,
40  DtSceneObjectAgent* sceneObject, int modelSet );
41 
43  virtual ~DtHATLineVisualizer();
44 
46  DtHATLineVisualizer() = delete;
47 
50 
52  DtHATLineVisualizer& operator=(const DtHATLineVisualizer&) = delete;
53 
54  public:
55 
57  virtual void initialize() override;
58 
59  virtual void setVisualDefinitionEnabled( bool );
60 
63  virtual void setSceneObjectID( DtUniqueID ) override;
64 
66  // Set / Get the text color. Can use 0.0-1.0 or 0-255
67  virtual void setTextColor(float r, float g, float b, float a);
68  virtual void getTextColor(float& r, float& g, float& b, float& a) const;
70 
72  // Set / Get the size of the box the text is positioned in, in pixels.
73  virtual void setTextBoxSize( unsigned int textWidth, unsigned int textHeight );
74  virtual void getTextBoxSize( unsigned int& textWidth, unsigned int& textHeight ) const;
76 
78  // Set / Get a pixel offset from the top of the line for the text box.
79  virtual void setOriginOffset( int offsetX, int offsetY );
80  virtual void getOriginOffset( int& offsetX, int& offsetY ) const;
82 
83 
85  // Set / Get the horizontal alignment of the text within the text box.
86  // Values come from DtWidgetLabel
87  virtual void setHorizontalAlignment (unsigned int horizontalAlignment );
88  virtual unsigned int horizontalAlignment() const;
90 
92  // Set / Get the name of the font to use for the height text.
93  virtual void setTextFont( const std::string& textFont) ;
94  virtual std::string textFont() const;
96 
98  // Set / Get the point size of the font used for height text
99  virtual void setTextFontSize( unsigned int textFontSize );
100  virtual unsigned int textFontSize() const;
102 
104  // Set / Get the scale to apply to the font point size for height text.
105  // This is only used if setIsAltitudeBasedScalingEnabled(false).
106  virtual void setTextFontScale( float textFontScale );
107  virtual float textFontScale() const;
109 
111  virtual void setHatLinePeriod( unsigned int frames );
113  virtual unsigned int hatLinePeriod() const;
115 
117  virtual void setUseHighestTerrainLod( bool trueOrFalse );
120  virtual bool useHighestTerrainLod() const;
122 
124  virtual void setLodOutAltitude(double lodOutAltitude);
131  virtual double lodOutAltitude() const;
133 
138  virtual void setIsPinned(bool myPinned);
139 
147  virtual void setIsAltitudeBasedScalingEnabled(bool isAltitudeBasedScalingEnabled);
148 
152  // This is only used if setIsAltitudeBasedScalingEnabled(true).
153  virtual void setAltitudeBasedConfigurations(
155 
157  virtual void setHasMouseCursor(bool);
159  virtual bool hasMouseCursor() const;
161 
164  virtual void slot_setSelected(bool b) override;
165 
166  protected:
167 
168  virtual DtObjectTypeStateListener& objectTypeStateListener();
169 
171  virtual void createModelAgents() override;
172 
174  virtual void destroyModelAgents() override;
175 
178  virtual void updateAltitudeBasedScalingProperties();
179 
182  virtual void updateForcedAltitudeBasedConfigurationEnabledState();
183 
185  virtual void updateLodOutAltitudeProperties();
186 
188  virtual void updateIsLodOutAltitudeEnabledState();
189 
192  virtual void setModelDefinitionForAgents() override;
193 
196  virtual void connectToListenerSignals() override;
197 
200  virtual void setInitialValuesFromVisualizerDefinition() override;
201 
202  protected:
204  Dt3DSegmentedLineModelAgent* myHatLineAgent;
205  DtSceneObjectAgent* myHatLineObjectAgent;
206  DtAttachableHatUpdaterAgent* myHatLineUpdaterAgent;
207 
208  DtSceneObjectAgent* myHatTextObjectAgent;
209  DtProjectedWidgetModelAgent* myHatTextModelAgent;
210  DtWidgetLabelAgent* myHatTextWidgetAgent;
211  DtAttachableHatTextUpdaterAgent* myHatTextUpdaterAgent;
212 
214 
217 
220 
225 
230 
233 
235 
237 
238  // bool myHatLineEnabled;
241  double myTextPosition; // proportion, 0. to 1., 0. at top
242  unsigned int myTextBoxSize[2]; // default is 150 x 25 pixels
243  unsigned int myTextHorizontalAlignment; // default is center
244  std::string myTextFont; // default is "FreeMono.otf"
246  unsigned int myTextFontSize; // default is 14
247  float myTextColor[4]; // default is 1., 1., 0., 1.
248  int myOriginOffset[2]; // default is 0, -30
249  unsigned int myHatLinePeriod;
250 
251  };
252 
253 }
bool myVisualDefinitionEnabled
Definition: DtHATLineVisualizer.h:239
bool myUseHighestTerrainLod
Definition: DtHATLineVisualizer.h:240
DtAttachableHatTextUpdaterAgent * myHatTextUpdaterAgent
Definition: DtHATLineVisualizer.h:211
DtObjectTypeStateListener * myObjectTypeStateListener
Definition: DtHATLineVisualizer.h:203
bool myHasMouseCursor
Definition: DtHATLineVisualizer.h:213
std::string myTextFont
Definition: DtHATLineVisualizer.h:244
unsigned int myTextFontSize
Definition: DtHATLineVisualizer.h:246
Base class for height above terrain line visualizers to show height above terrain line and label...
Definition: DtHATLineVisualizer.h:30
The DtBaseConnection is an abstract class.
Definition: DtBaseConnection.h:38
float myTextFontScale
Definition: DtHATLineVisualizer.h:234
DtSceneObjectAgent * myHatLineObjectAgent
Definition: DtHATLineVisualizer.h:205
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
bool myIsAltitudeBasedScalingEnabled
Whether or not to use altitude-based scaling is used.
Definition: DtHATLineVisualizer.h:232
Contains makVrv:DtStateVisualizer class.
double myLodOutAltitude
The altitude at which all HAT information will no longer appear The default value is 100000 meters...
Definition: DtHATLineVisualizer.h:224
std::vector< DtDynamicScaleConfiguration > DtDynamicScaleConfigurationCollection
Definition: DtEntitySettingsRecord.h:54
DtProjectedWidgetModelAgent * myHatTextModelAgent
Definition: DtHATLineVisualizer.h:209
bool myLODOutAltitudeEnabled
Whether or not this visualizer will lod out based on altitude.
Definition: DtHATLineVisualizer.h:219
std::string myDisplayUnitCollectionName
Definition: DtHATLineVisualizer.h:245
The DtStateVisualizer is an abstract class. Developers derive from this to create logic that &quot;directs...
Definition: DtStateVisualizer.h:32
makArchives::DtDynamicScaleConfigurationCollection myTextFontScalesByMinimumAltitude
Definition: DtHATLineVisualizer.h:236
double myTextPosition
Definition: DtHATLineVisualizer.h:241
bool myPinnedFlag
whether or not the widget this visualizer controls is pinned
Definition: DtHATLineVisualizer.h:216
The DtObjectTypeStateListener is a base class used by elements that have object types ( including ent...
Definition: DtObjectTypeStateListener.h:30
bool myLodOutAltitudeOverridden
Whether or not the lod out altitude is overridden. If overridden, the lod out altitude from the visua...
Definition: DtHATLineVisualizer.h:229
unsigned int myHatLinePeriod
Definition: DtHATLineVisualizer.h:249
The DtStateListener is an abstract class. Subclasses implement functionality that will allow data to ...
Definition: DtStateListener.h:25
Dt3DSegmentedLineModelAgent * myHatLineAgent
Definition: DtHATLineVisualizer.h:204
DtAttachableHatUpdaterAgent * myHatLineUpdaterAgent
Definition: DtHATLineVisualizer.h:206
unsigned int myTextHorizontalAlignment
Definition: DtHATLineVisualizer.h:243
Contains the DtEntitySettingsRecord class declaration.
DtSceneObjectAgent * myHatTextObjectAgent
Definition: DtHATLineVisualizer.h:208
DtWidgetLabelAgent * myHatTextWidgetAgent
Definition: DtHATLineVisualizer.h:210

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)