VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtAttributeLayout.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2026 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 
14 #include <vrvCore/DtWidget.h>
15 #include <vrvCore/DtBoundingBox.h>
17 
18 #include <vrvMath/DtVector4.h>
19 
21 
22 #include <boost/signals2/connection.hpp>
23 
24 #include <osg/Texture>
25 #include <osg/ref_ptr>
26 
27 #include <vector>
28 #include <unordered_map>
29 
30 namespace makVrv
31 {
32 
33  class DtDe;
34  class DtQuadProxyInterface;
35  class DtAttribute;
36  class DtBaseOutlineAttribute;
37  class DtOsgTextureWrapper;
38 
43  {
44 
45  public:
46 
48 
49  public:
50 
52  DtAttributeLayout( DtDe& de );
53 
55  virtual ~DtAttributeLayout();
56 
57  public:
58 
60  virtual void setDimensions( unsigned int rows, unsigned int cols );
61 
63  virtual void getDimensions( unsigned int& rowsOut, unsigned int& colsOut );
64 
69  virtual void setAttribute(
70  unsigned int row, unsigned int col, DtAttribute* attribute );
71 
73  virtual DtAttribute* findAttribute( unsigned int row, unsigned int col );
74 
77  virtual void setOriginOffset( double x, double y );
78 
81  virtual void setOriginPlacementPolicy(DtOriginPlacementPolicy originPolicy);
82 
90  virtual void setHorizontalCenter(bool center);
91 
99  virtual void setVerticalCenter(bool center);
100 
102  virtual void setWorldPosition( float x, float y, float z, float w );
103 
105  virtual void setBackgroundColor( float r, float g, float b, float a );
106 
108  virtual void setBackgroundImage( const std::string& filename );
109 
111  virtual void setCellPadding( double colPadding, double rowPadding );
112 
114  virtual void updateCellSizes();
115 
117  virtual void setVisible( bool visible );
118 
120  virtual void setColor( float r, float g, float b, float a );
121 
123  virtual void setOverlay( unsigned int overlayId );
124 
126  virtual void setOrderGroup( unsigned int group );
127  virtual unsigned int orderGroup() const;
128 
130  virtual void setBackgroundOrderGroup( unsigned int groupId );
131 
133  virtual void setWidth( float width );
134 
136  virtual void setBackgroundEnabled( bool enabled );
137 
139  virtual void setOutlineWidth( float width );
140 
142  virtual void setOutlineEnabled( bool enabled );
143 
145  virtual void setShadowText( bool enabled );
146 
149  virtual void setFadingEnabled( bool enabled );
150 
155  virtual void setBackgroundLodOutAltitude(double lodOutAltitude);
156 
160  virtual void setBackgroundIsLodOutAltitudeEnabled(bool isLodOutAltitudeEnabled);
161 
162  protected:
163 
165  virtual void updateOriginPlacementPolicyBasedOnHorizontalAndVerticalCenterProperties();
166 
167  protected:
168 
170 
171  typedef std::vector<DtAttribute*> Attributes;
172  typedef std::vector<Attributes> AttributeGrid;
173 
176 
179 
180  float myWorldX;
181  float myWorldY;
182  float myWorldZ;
183  float myWorldW;
184 
186 
187  double myOffsetX;
188  double myOffsetY;
189 
191  double myXDim;
192 
194  double myYDim;
195 
196  double myRowPadding;
198 
201 
202  bool myVisible;
204 
206 
207  unsigned int myOverlay;
208  unsigned int myOverlayGroup;
209  unsigned int myOverlayTextGroup;
210 
214 
216 
218 
221  {
222  unsigned int row;
223  unsigned int col;
224  boost::signalslib::connection resizeConnection;
225  };
226 
228  typedef std::unordered_map<DtAttribute*, AttributeInfo> AttributeInfoMap;
230 
232  virtual void slot_attributeSizeChanged(
233  DtAttribute* attribute, double xSize, double ySize);
234 
237  virtual void resizeLayout();
238 
241  virtual void redimensionLayout();
242 
244  virtual void resizeRowsAndColumns();
245 
246  std::vector<double> myColSizes;
247  std::vector<double> myRowSizes;
248 
249  private:
250 
253  void createBackground();
254 
259  void eraseAttribute(DtAttribute* attribute);
260 
261  };
262 
263 }
DtBaseOutlineAttribute * myOutline
Definition: DtAttributeLayout.h:200
DtQuadProxyInterface * myBackground
Definition: DtAttributeLayout.h:199
bool myVisible
Definition: DtAttributeLayout.h:202
bool myHorizontalCenter
Definition: DtAttributeLayout.h:177
float myWorldX
Definition: DtAttributeLayout.h:180
unsigned int myOverlayTextGroup
Definition: DtAttributeLayout.h:209
bool myOutlineEnabled
Definition: DtAttributeLayout.h:203
double myOffsetX
Definition: DtAttributeLayout.h:187
Contains the makVrv::DtBoundingBox class declaration.
double myOffsetY
Definition: DtAttributeLayout.h:188
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
double myXDim
Layout dimension on X axis.
Definition: DtAttributeLayout.h:191
boost::signalslib::connection resizeConnection
Definition: DtAttributeLayout.h:224
float myOutlineWidth
Definition: DtAttributeLayout.h:205
4 dimensional vector
std::vector< Attributes > AttributeGrid
Definition: DtAttributeLayout.h:172
bool myShadowTextFlag
Definition: DtAttributeLayout.h:215
The attribute layout tells DtAttributes where to draw.
Definition: DtBaseOutlineAttribute.h:36
The attribute layout tells DtAttributes where to draw.
Definition: DtAttribute.h:21
Contains the DtAttributeGroupWidget class declaration.
Contains makVrv::DtWidget class.
float myWorldY
Definition: DtAttributeLayout.h:181
The attribute layout tells DtAttributes where to draw using a grid type layout.
Definition: DtAttributeLayout.h:42
Data associated with an attribute in the layout.
Definition: DtAttributeLayout.h:220
DtOriginPlacementPolicy
Policy that determines where the origin of the widget is.
Definition: DtAttributeGroupWidget.h:24
bool myFadingEnabled
Definition: DtAttributeLayout.h:217
A single 2D quadrilateral.
Definition: DtQuadProxyInterface.h:21
float myWorldW
Definition: DtAttributeLayout.h:183
unsigned int myOverlay
Definition: DtAttributeLayout.h:207
DtBoundingBox myBoundingBox
Definition: DtAttributeLayout.h:213
DtOriginPlacementPolicy myOriginPlacementPolicy
Definition: DtAttributeLayout.h:185
Interface for a texture. Used to pass in a texture to vrvGraphics.
Definition: DtOsgTextureWrapper.h:27
bool myVerticalCenter
Definition: DtAttributeLayout.h:178
std::vector< double > myRowSizes
Definition: DtAttributeLayout.h:247
std::unordered_map< DtAttribute *, AttributeInfo > AttributeInfoMap
A map from attribute to its location in the layout.
Definition: DtAttributeLayout.h:228
double myRowPadding
Definition: DtAttributeLayout.h:196
Base class to provide boost signal/slot management.
AttributeInfoMap myAttributeInfoMap
Definition: DtAttributeLayout.h:229
unsigned int myOverlayGroup
Definition: DtAttributeLayout.h:208
double myYDim
Layout dimension on Y axis.
Definition: DtAttributeLayout.h:194
unsigned int col
Definition: DtAttributeLayout.h:223
Contains DLL export macros.
DtDe & myDe
Definition: DtAttributeLayout.h:169
double myColumnPadding
Definition: DtAttributeLayout.h:197
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:76
std::vector< double > myColSizes
Definition: DtAttributeLayout.h:246
AttributeGrid myAttributeGrid
The 2d grid of attributes to manage.
Definition: DtAttributeLayout.h:175
DtVector4< float > myBackgroundColor
Definition: DtAttributeLayout.h:212
float myWorldZ
Definition: DtAttributeLayout.h:182
unsigned int row
Definition: DtAttributeLayout.h:222
std::vector< DtAttribute * > Attributes
Definition: DtAttributeLayout.h:171
A simple bounding box.
Definition: DtBoundingBox.h:101
DtOsgTextureWrapper * myBackgroundTexture
Definition: DtAttributeLayout.h:211

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)