VR-Forces 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) 2023 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
11 
13 #include <vrvCore/DtWidgetLabel.h>
14 
16 
17 namespace makVrv
18 {
19 
20  class Dt3DSegmentedLineModelAgent;
21  class DtWidgetLabelAgent;
22  class DtSceneObjectAgent;
23  class DtAttachableHatUpdaterAgent;
24  class DtProjectedWidgetModelAgent;
25  class DtAttachableHatTextUpdaterAgent;
26  class DtObjectTypeStateListener;
27 
32  {
33  public:
35  DtHATLineVisualizer( DtBaseConnection& simulation, DtStateListener& listener,
36  DtSceneObjectAgent* sceneObject, DtModelSetId modelSet );
37 
39  virtual ~DtHATLineVisualizer();
40 
42  DtHATLineVisualizer() = delete;
43 
46 
48  DtHATLineVisualizer& operator=(const DtHATLineVisualizer&) = delete;
49 
50  public:
51 
53  virtual void initialize() override;
54 
55  virtual void setVisualDefinitionEnabled( bool );
56 
58  // Set / Get the text color. Can use 0.0-1.0 or 0-255
59  virtual void setTextColor(float r, float g, float b, float a);
60  virtual void getTextColor(float& r, float& g, float& b, float& a) const;
62 
64  // Set / Get the size of the box the text is positioned in, in pixels.
65  virtual void setTextBoxSize( unsigned int textWidth, unsigned int textHeight );
66  virtual void getTextBoxSize( unsigned int& textWidth, unsigned int& textHeight ) const;
68 
70  // Set / Get a pixel offset from the top of the line for the text box.
71  virtual void setOriginOffset( int offsetX, int offsetY );
72  virtual void getOriginOffset( int& offsetX, int& offsetY ) const;
74 
75 
77  // Set / Get the horizontal alignment of the text within the text box.
78  // Values come from DtWidgetLabel
79  virtual void setHorizontalAlignment (DtWidgetLabel::TextHorizontalAlignmentPolicy horizontalAlignment );
80  virtual DtWidgetLabel::TextHorizontalAlignmentPolicy horizontalAlignment() const;
82 
84  // Set / Get the name of the font to use for the height text.
85  virtual void setTextFont( const std::string& textFont) ;
86  virtual std::string textFont() const;
88 
90  // Set / Get the point size of the font used for height text
91  virtual void setTextFontSize( unsigned int textFontSize );
92  virtual unsigned int textFontSize() const;
94 
96  // Set / Get the scale to apply to the font point size for height text.
97  // This is only used if setIsAltitudeBasedScalingEnabled(false).
98  virtual void setTextFontScale( float textFontScale );
99  virtual float textFontScale() const;
101 
103  virtual void setHatLinePeriod( unsigned int frames );
105  virtual unsigned int hatLinePeriod() const;
107 
109  virtual void setUseHighestTerrainLod( bool trueOrFalse );
112  virtual bool useHighestTerrainLod() const;
114 
116  virtual void setLodOutAltitude(double lodOutAltitude);
123  virtual double lodOutAltitude() const;
125 
130  virtual void setIsPinned(bool myPinned);
131 
139  virtual void setIsAltitudeBasedScalingEnabled(bool isAltitudeBasedScalingEnabled);
140 
144  // This is only used if setIsAltitudeBasedScalingEnabled(true).
145  virtual void setAltitudeBasedConfigurations(
147 
149  virtual void setHasMouseCursor(bool);
151  virtual bool hasMouseCursor() const;
153 
156  virtual void slot_setSelected(bool b) override;
157  protected:
158 
159  virtual DtObjectTypeStateListener& objectTypeStateListener();
160 
162  virtual void createModelAgents() override;
163 
165  virtual void destroyModelAgents() override;
166 
169  virtual void updateAltitudeBasedScalingProperties();
170 
173  virtual void updateForcedAltitudeBasedConfigurationEnabledState();
174 
176  virtual void updateLodOutAltitudeProperties();
177 
179  virtual void updateIsLodOutAltitudeEnabledState();
180 
183  virtual void setModelDefinitionForAgents() override;
184 
187  virtual void connectToListenerSignals() override;
188 
191  virtual void setInitialValuesFromVisualizerDefinition() override;
192 
194  virtual void slot_displayUnitCollectionChanged();
195  protected:
197  Dt3DSegmentedLineModelAgent* myHatLineAgent;
198  DtSceneObjectAgent* myHatLineObjectAgent;
199  DtAttachableHatUpdaterAgent* myHatLineUpdaterAgent;
200 
201  DtSceneObjectAgent* myHatTextObjectAgent;
202  DtProjectedWidgetModelAgent* myHatTextModelAgent;
203  DtWidgetLabelAgent* myHatTextWidgetAgent;
204  DtAttachableHatTextUpdaterAgent* myHatTextUpdaterAgent;
205 
207 
210 
213 
218 
223 
226 
228 
230 
231  // bool myHatLineEnabled;
234  double myTextPosition; // proportion, 0. to 1., 0. at top
235  unsigned int myTextBoxSize[2]; // default is 150 x 25 pixels
237  std::string myTextFont; // default is "FreeMono.otf"
239  unsigned int myTextFontSize; // default is 14
240  float myTextColor[4]; // default is 1., 1., 0., 1.
241  int myOriginOffset[2]; // default is 0, -30
242  unsigned int myHatLinePeriod;
243 
244  };
245 
246 }
bool myVisualDefinitionEnabled
Definition: DtHATLineVisualizer.h:232
Contains the DtAltitudeBasedScaleConfigurationRecord class declaration.
bool myUseHighestTerrainLod
Definition: DtHATLineVisualizer.h:233
DtAttachableHatTextUpdaterAgent * myHatTextUpdaterAgent
Definition: DtHATLineVisualizer.h:204
DtObjectTypeStateListener * myObjectTypeStateListener
Definition: DtHATLineVisualizer.h:196
bool myHasMouseCursor
Definition: DtHATLineVisualizer.h:206
std::string myTextFont
Definition: DtHATLineVisualizer.h:237
unsigned int myTextFontSize
Definition: DtHATLineVisualizer.h:239
Base class for height above terrain line visualizers to show height above terrain line and label...
Definition: DtHATLineVisualizer.h:31
DtWidgetLabel::TextHorizontalAlignmentPolicy myTextHorizontalAlignment
Definition: DtHATLineVisualizer.h:236
The DtBaseConnection is an abstract class.
Definition: DtBaseConnection.h:35
float myTextFontScale
Definition: DtHATLineVisualizer.h:227
DtSceneObjectAgent * myHatLineObjectAgent
Definition: DtHATLineVisualizer.h:198
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
bool myIsAltitudeBasedScalingEnabled
Whether or not to use altitude-based scaling is used.
Definition: DtHATLineVisualizer.h:225
makArchives::DtAltitudeBasedScaleConfigurationRecordCollection myTextFontScalesByMinimumAltitude
Definition: DtHATLineVisualizer.h:229
Contains makVrv:DtStateVisualizer class.
Contains the makVrv::DtWidgetLabel class declaration.
double myLodOutAltitude
The altitude at which all HAT information will no longer appear The default value is 100000 meters...
Definition: DtHATLineVisualizer.h:217
DtProjectedWidgetModelAgent * myHatTextModelAgent
Definition: DtHATLineVisualizer.h:202
bool myLODOutAltitudeEnabled
Whether or not this visualizer will lod out based on altitude.
Definition: DtHATLineVisualizer.h:212
TextHorizontalAlignmentPolicy
Policy that determines how label is aligned within its bounds - only used when the Size Constraint Po...
Definition: DtWidgetLabel.h:31
std::string myDisplayUnitCollectionName
Definition: DtHATLineVisualizer.h:238
The DtStateVisualizer is an abstract class. Developers derive from this to create logic that &quot;directs...
Definition: DtStateVisualizer.h:30
double myTextPosition
Definition: DtHATLineVisualizer.h:234
bool myPinnedFlag
whether or not the widget this visualizer controls is pinned
Definition: DtHATLineVisualizer.h:209
The DtObjectTypeStateListener is a base class used by elements that have object types ( including ent...
Definition: DtObjectTypeStateListener.h:31
bool myLodOutAltitudeOverridden
Whether or not the lod out altitude is overridden. If overridden, the lod out altitude from the visua...
Definition: DtHATLineVisualizer.h:222
unsigned int myHatLinePeriod
Definition: DtHATLineVisualizer.h:242
DtModelSetId
Definition: DtModelSetEnums.h:19
std::vector< DtAltitudeBasedScaleConfigurationRecord > DtAltitudeBasedScaleConfigurationRecordCollection
Definition: DtAltitudeBasedScaleConfigurationRecord.h:45
The DtStateListener is an abstract class. Subclasses implement functionality that will allow data to ...
Definition: DtStateListener.h:26
Dt3DSegmentedLineModelAgent * myHatLineAgent
Definition: DtHATLineVisualizer.h:197
DtAttachableHatUpdaterAgent * myHatLineUpdaterAgent
Definition: DtHATLineVisualizer.h:199
DtSceneObjectAgent * myHatTextObjectAgent
Definition: DtHATLineVisualizer.h:201
DtWidgetLabelAgent * myHatTextWidgetAgent
Definition: DtHATLineVisualizer.h:203

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)