VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtEntityHATLineFacade.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 
14 #include <vrvCore/DtUniqueID.h>
15 #include <vrvCore/DtWidgetLabel.h>
16 
17 #include <string>
18 
19 namespace makVrv
20 {
21 
22  class Dt3DSegmentedLineModelAgent;
23  class DtWidgetLabelAgent;
24  class DtSceneObjectAgent;
25  class DtAttachableHatUpdaterAgent;
26  class DtProjectedWidgetModelAgent;
27  class DtAttachableHatTextUpdaterAgent;
28  class DtAgentManagerInterface;
29  enum class DtModelSetId;
30 
35  {
36  public:
37 
40  DtModelSetId modelSet, DtUniqueID entityId );
41 
43  virtual ~DtEntityHATLineFacade();
44 
46  virtual void setHatLineVisible( bool );
47  virtual bool hatLineVisible() const;
48 
50  // Set / Get the text color. Can use 0.0-1.0 or 0-255
51  virtual void setTextColor(float r, float g, float b, float a);
52  virtual void getTextColor(float& r, float& g, float& b, float& a) const;
54 
56  // Set / Get the size of the box the text is positioned in, in pixels.
57  virtual void setTextBoxSize( unsigned int textWidth, unsigned int textHeight );
58  virtual void getTextBoxSize( unsigned int& textWidth, unsigned int& textHeight ) const;
60 
62  // Set / Get a pixel offset from the top of the line for the text box.
63  virtual void setOriginOffset( int offsetX, int offsetY );
64  virtual void getOriginOffset( int& offsetX, int& offsetY ) const;
66 
67 
69  // Set / Get the horizontal alignment of the text within the text box.
70  // Values come from DtWidgetLabel
71  virtual void setHorizontalAlignment (DtWidgetLabel::TextHorizontalAlignmentPolicy horizontalAlignment );
72  virtual DtWidgetLabel::TextHorizontalAlignmentPolicy horizontalAlignment() const;
74 
76  // Set / Get the name of the font to use for the height text.
77  virtual void setTextFont( const std::string& textFont) ;
78  virtual std::string textFont() const;
80 
82  // Set / Get the point size of the font used for height text
83  virtual void setTextFontSize( unsigned int textFontSize );
84  virtual unsigned int textFontSize() const;
86 
88  virtual void setModelDefinition( const std::string& modelDefinition );
89  virtual const std::string& modelDefinition() const;
91 
93  virtual void setUseHighestTerrainLod( bool useHighest );
94  virtual bool useHighestTerrainLod() const;
96 
98  virtual void setElementID(DtElementID elementID);
99  virtual DtElementID elementID() const;
101 
102  protected:
103 
105  void createModelAgents();
106 
108  virtual void destroyModelAgents();
109 
110  protected:
111 
116 
117  Dt3DSegmentedLineModelAgent* myHatLineAgent;
118  DtSceneObjectAgent* myHatLineObjectAgent;
119  DtAttachableHatUpdaterAgent* myHatLineUpdaterAgent;
120 
121  DtSceneObjectAgent* myHatTextObjectAgent;
122  DtProjectedWidgetModelAgent* myHatTextModelAgent;
123  DtWidgetLabelAgent* myHatTextWidgetAgent;
124  DtAttachableHatTextUpdaterAgent* myHatTextUpdaterAgent;
125 
126  bool myHatLineVisible; // default is true
127  bool myUseHighestTerrainLod; // default is true; applies only to osgEarth terrains
128  double myTextPosition; // proportion, 0. to 1., 0. at top
129  unsigned int myTextBoxSize[2]; // default is 150 x 25 pixels
131  std::string myTextFont; // default is "FreeMono.otf"
132  unsigned int myTextFontSize; // default is 14
133  float myTextColor[4]; // default is 1., 1., 0., 1.
134  int myOriginOffset[2]; // default is 0, -30
135  std::string myModelDefinition; // default is "HeightAboveTerrainLine"
136 
137  };
138 
139 }
bool myUseHighestTerrainLod
Definition: DtEntityHATLineFacade.h:127
unsigned int myTextFontSize
Definition: DtEntityHATLineFacade.h:132
DtAttachableHatTextUpdaterAgent * myHatTextUpdaterAgent
Definition: DtEntityHATLineFacade.h:124
Dt3DSegmentedLineModelAgent * myHatLineAgent
Definition: DtEntityHATLineFacade.h:117
DtUniqueID DtElementID
The ElementID is a specific type of unique ID used to represent VR-Vantage uniquely defined elements...
Definition: DtUniqueID.h:23
Class for height above terrain line to show height above terrain line and label.
Definition: DtEntityHATLineFacade.h:34
DtSceneObjectAgent * myHatLineObjectAgent
Definition: DtEntityHATLineFacade.h:118
double myTextPosition
Definition: DtEntityHATLineFacade.h:128
DtAgentManagerInterface & myAgentManagerIf
Definition: DtEntityHATLineFacade.h:114
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
Contains the makVrv::DtWidgetLabel class declaration.
DtSceneObjectAgent * myHatTextObjectAgent
Definition: DtEntityHATLineFacade.h:121
DtElementID myElementId
Definition: DtEntityHATLineFacade.h:112
bool myHatLineVisible
Definition: DtEntityHATLineFacade.h:126
DtAttachableHatUpdaterAgent * myHatLineUpdaterAgent
Definition: DtEntityHATLineFacade.h:119
DtWidgetLabel::TextHorizontalAlignmentPolicy myTextHorizontalAlignment
Definition: DtEntityHATLineFacade.h:130
TextHorizontalAlignmentPolicy
Policy that determines how label is aligned within its bounds - only used when the Size Constraint Po...
Definition: DtWidgetLabel.h:31
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
std::string myModelDefinition
Definition: DtEntityHATLineFacade.h:135
DtWidgetLabelAgent * myHatTextWidgetAgent
Definition: DtEntityHATLineFacade.h:123
std::string myTextFont
Definition: DtEntityHATLineFacade.h:131
Contains makVrv::DtUniqueID type.
DtUniqueID myEntityId
Definition: DtEntityHATLineFacade.h:113
DtModelSetId myModelSet
Definition: DtEntityHATLineFacade.h:115
The abstract interface necessary for agents.
Definition: DtAgentManagerInterface.h:33
DtModelSetId
Definition: DtModelSetEnums.h:19
DtProjectedWidgetModelAgent * myHatTextModelAgent
Definition: DtEntityHATLineFacade.h:122
Contains DLL export macros.

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)