VR-Forces 4.3.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtAttributeLayout.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2012 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 #include <vrvCore/DtWidget.h>
17 
18 #include <boost/signals/connection.hpp>
19 #include <boost/unordered_map.hpp>
20 
21 #include <osg/Texture>
22 #include <osg/ref_ptr>
23 #include <osg/Vec4>
24 
25 #include <vector>
26 
27 namespace makVrv
28 {
29 
30  class DtDe;
31  class DtQuad;
32  class DtAttribute;
33 
38  {
39  public:
40 
42  DtAttributeLayout( DtDe& de );
43 
45  virtual ~DtAttributeLayout();
46 
48  virtual void setDimensions( unsigned int rows, unsigned int cols );
49 
51  virtual void getDimensions( unsigned int& rowsOut, unsigned int& colsOut );
52 
57  virtual void setAttribute(
58  unsigned int row, unsigned int col, DtAttribute* attribute );
59 
61  virtual DtAttribute* findAttribute( unsigned int row, unsigned int col );
62 
64  virtual void setBottomLeftCorner( double x, double y );
65 
67  virtual void setWorldPosition( float x, float y, float z, float w );
68 
70  virtual void setBackgroundColor( float r, float g, float b, float a );
71 
73  virtual void setBackgroundImage( const std::string& filename );
74 
76  virtual void setCellPadding( double colPadding, double rowPadding );
77 
79  virtual void updateCellSizes();
80 
82  virtual void setVisible( bool visible );
83 
85  virtual void setColor( float r, float g, float b, float a );
86 
89  virtual void setHorizontalCenter( bool center );
90 
93  virtual void setVerticalCenter( bool center );
94 
96  virtual void setOverlay( unsigned int overlayId );
97 
99  virtual void setOrderGroup( unsigned int group );
100 
102  virtual void setBackgroundOrderGroup( unsigned int groupId );
103 
105  virtual void setWidth( float width );
106 
108  virtual void setBackgroundEnabled( bool enabled );
109 
111  virtual void setOutlineEnabled( bool enabled );
112 
114  virtual void setShadowText( bool enabled );
115 
116  protected:
117 
119 
120  typedef std::vector<DtAttribute*> Attributes;
121  typedef std::vector<Attributes> AttributeGrid;
122 
125 
128 
129  float myWorldX;
130  float myWorldY;
131  float myWorldZ;
132  float myWorldW;
133 
134  double myOffsetX;
135  double myOffsetY;
136 
138  double myXDim;
139 
141  double myYDim;
142 
143  double myRowPadding;
145 
148 
149  bool myVisible;
151 
152  unsigned int myOverlay;
153  unsigned int myOverlayGroup;
154  unsigned int myOverlayTextGroup;
155 
156  osg::ref_ptr<osg::Texture> myBackgroundTexture;
157  osg::Vec4 myBackgroundColor;
159 
161 
164  {
165  unsigned int row;
166  unsigned int col;
167  boost::signalslib::connection resizeConnection;
168  };
169 
171  typedef boost::unordered_map<DtAttribute*, AttributeInfo> AttributeInfoMap;
173 
175  virtual void slot_attributeSizeChanged(
176  DtAttribute* attribute, double xSize, double ySize);
177 
180  virtual void resizeLayout();
181 
184  virtual void redimensionLayout();
185 
187  virtual void resizeRowsAndColumns();
188 
189  std::vector<double> myColSizes;
190  std::vector<double> myRowSizes;
191 
192  private:
193 
196  void createBackground();
197 
202  void eraseAttribute(DtAttribute* attribute);
203 
204  };
205 
206 }

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)