VR-Forces 4.0.4 Class Documentation
Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions
makVrv::DtAttributeLayout Class Reference

The attribute layout tells DtAttributes where to draw using a grid type layout. More...

List of all members.

Classes

struct  AttributeInfo
 Data associated with an attribute in the layout. More...

Public Member Functions

 DtAttributeLayout (DtDe &de)
 CTOR.
virtual ~DtAttributeLayout ()
 DTOR.
virtual void setDimensions (unsigned int rows, unsigned int cols)
 Set the number of rows and columns in the layout.
virtual void getDimensions (unsigned int &rowsOut, unsigned int &colsOut)
 Get the dimensions of the layout.
virtual void setAttribute (unsigned int row, unsigned int col, DtAttribute *attribute)
 Set the attribute at the specified grid cell.
virtual DtAttributefindAttribute (unsigned int row, unsigned int col)
 Find the attribute at row, col. Returns 0 if none was found.
virtual void setBottomLeftCorner (double x, double y)
 Set the bottom left corner of the layout.
virtual void setWorldPosition (float x, float y, float z, float w)
 Set the origin of the layout in world coordinates.
virtual void setBackgroundColor (float r, float g, float b, float a)
 Set the background color for the layout.
virtual void setBackgroundImage (const std::string &filename)
 Set the image to use for the background.
virtual void setCellPadding (double colPadding, double rowPadding)
 Set the padding around the contents of each cell.
virtual void updateCellSizes ()
 Update the sizes of all cells.
virtual void setVisible (bool visible)
 Set the layout visible or hidden.
virtual void setColor (float r, float g, float b, float a)
 Set the color of the layout (does not set the color of its attributes)
virtual void setHorizontalCenter (bool center)
 Set whether or not to center the attribute group horizontally around its origin.
virtual void setVerticalCenter (bool center)
 Set whether or not to center the attribute group vertically around its origin.
virtual void setOverlay (unsigned int overlayId)
 Set the overlay id for the attributes to draw on.
virtual void setOrderGroup (unsigned int group)
 Set the group the attribute and background are on.
virtual void setWidth (float width)
 Set the width of the layout.
virtual void setBackgroundEnabled (bool enabled)
 Enable or disable the background quad.
virtual void setOutlineEnabled (bool enabled)
 Enable or disable the layout's outline.

Protected Types

typedef std::vector
< DtAttribute * > 
Attributes
typedef std::vector< AttributesAttributeGrid
typedef boost::unordered_map
< DtAttribute *, AttributeInfo
AttributeInfoMap
 A map from attribute to its location in the layout.

Protected Member Functions

virtual void slot_attributeSizeChanged (DtAttribute *attribute, double xSize, double ySize)
 Called when an attribute's size changes.
virtual void resizeLayout ()
 Resize the attributes in the layout to match the current row and column dimensions.
virtual void redimensionLayout ()
 Recompute the layout's dimensions according to its row and columns sizes.
virtual void resizeRowsAndColumns ()
 Recompute the sizes of the layout's rows and columns.

Protected Attributes

DtDemyDe
AttributeGrid myAttributeGrid
 The 2d grid of attributes to manage.
bool myHorizontalCenter
bool myVerticalCenter
float myWorldX
float myWorldY
float myWorldZ
float myWorldW
double myOffsetX
double myOffsetY
double myXDim
 Layout dimension on X axis.
double myYDim
 Layout dimension on Y axis.
double myRowPadding
double myColumnPadding
DtQuadmyBackground
DtBaseOutlineAttribute myOutline
bool myVisible
bool myOutlineEnabled
unsigned int myOverlay
unsigned int myOverlayGroup
osg::ref_ptr< osg::Texture > myBackgroundTexture
osg::Vec4 myBackgroundColor
DtBoundingBox myBoundingBox
AttributeInfoMap myAttributeInfoMap
std::vector< double > myColSizes
std::vector< double > myRowSizes

Private Member Functions

void createBackground ()
 Create the background quad for the attribute layout.
void eraseAttribute (DtAttribute *attribute)
 Remove and delete an attribute from the layout.

Detailed Description

The attribute layout tells DtAttributes where to draw using a grid type layout.


Member Typedef Documentation

typedef std::vector<DtAttribute*> makVrv::DtAttributeLayout::Attributes [protected]
typedef std::vector<Attributes> makVrv::DtAttributeLayout::AttributeGrid [protected]
typedef boost::unordered_map<DtAttribute*, AttributeInfo> makVrv::DtAttributeLayout::AttributeInfoMap [protected]

A map from attribute to its location in the layout.


Constructor & Destructor Documentation

CTOR.

DTOR.


Member Function Documentation

virtual void makVrv::DtAttributeLayout::setDimensions ( unsigned int  rows,
unsigned int  cols 
) [virtual]

Set the number of rows and columns in the layout.

virtual void makVrv::DtAttributeLayout::getDimensions ( unsigned int &  rowsOut,
unsigned int &  colsOut 
) [virtual]

Get the dimensions of the layout.

virtual void makVrv::DtAttributeLayout::setAttribute ( unsigned int  row,
unsigned int  col,
DtAttribute attribute 
) [virtual]

Set the attribute at the specified grid cell.

Transfers ownership.

The cell must be within the bounds specified in the most recent setDimensions call

virtual DtAttribute* makVrv::DtAttributeLayout::findAttribute ( unsigned int  row,
unsigned int  col 
) [virtual]

Find the attribute at row, col. Returns 0 if none was found.

virtual void makVrv::DtAttributeLayout::setBottomLeftCorner ( double  x,
double  y 
) [virtual]

Set the bottom left corner of the layout.

virtual void makVrv::DtAttributeLayout::setWorldPosition ( float  x,
float  y,
float  z,
float  w 
) [virtual]

Set the origin of the layout in world coordinates.

virtual void makVrv::DtAttributeLayout::setBackgroundColor ( float  r,
float  g,
float  b,
float  a 
) [virtual]

Set the background color for the layout.

virtual void makVrv::DtAttributeLayout::setBackgroundImage ( const std::string &  filename) [virtual]

Set the image to use for the background.

virtual void makVrv::DtAttributeLayout::setCellPadding ( double  colPadding,
double  rowPadding 
) [virtual]

Set the padding around the contents of each cell.

virtual void makVrv::DtAttributeLayout::updateCellSizes ( ) [virtual]

Update the sizes of all cells.

virtual void makVrv::DtAttributeLayout::setVisible ( bool  visible) [virtual]

Set the layout visible or hidden.

virtual void makVrv::DtAttributeLayout::setColor ( float  r,
float  g,
float  b,
float  a 
) [virtual]

Set the color of the layout (does not set the color of its attributes)

virtual void makVrv::DtAttributeLayout::setHorizontalCenter ( bool  center) [virtual]

Set whether or not to center the attribute group horizontally around its origin.

virtual void makVrv::DtAttributeLayout::setVerticalCenter ( bool  center) [virtual]

Set whether or not to center the attribute group vertically around its origin.

virtual void makVrv::DtAttributeLayout::setOverlay ( unsigned int  overlayId) [virtual]

Set the overlay id for the attributes to draw on.

virtual void makVrv::DtAttributeLayout::setOrderGroup ( unsigned int  group) [virtual]

Set the group the attribute and background are on.

virtual void makVrv::DtAttributeLayout::setWidth ( float  width) [virtual]

Set the width of the layout.

virtual void makVrv::DtAttributeLayout::setBackgroundEnabled ( bool  enabled) [virtual]

Enable or disable the background quad.

virtual void makVrv::DtAttributeLayout::setOutlineEnabled ( bool  enabled) [virtual]

Enable or disable the layout's outline.

virtual void makVrv::DtAttributeLayout::slot_attributeSizeChanged ( DtAttribute attribute,
double  xSize,
double  ySize 
) [protected, virtual]

Called when an attribute's size changes.

virtual void makVrv::DtAttributeLayout::resizeLayout ( ) [protected, virtual]

Resize the attributes in the layout to match the current row and column dimensions.

virtual void makVrv::DtAttributeLayout::redimensionLayout ( ) [protected, virtual]

Recompute the layout's dimensions according to its row and columns sizes.

virtual void makVrv::DtAttributeLayout::resizeRowsAndColumns ( ) [protected, virtual]

Recompute the sizes of the layout's rows and columns.

Create the background quad for the attribute layout.

Non-virtual (Called from CTOR).

void makVrv::DtAttributeLayout::eraseAttribute ( DtAttribute attribute) [private]

Remove and delete an attribute from the layout.

  • attribute must be in the layout
  • does not redimension the layout

Member Data Documentation

The 2d grid of attributes to manage.

Layout dimension on X axis.

Layout dimension on Y axis.

unsigned int makVrv::DtAttributeLayout::myOverlay [protected]
osg::ref_ptr<osg::Texture> makVrv::DtAttributeLayout::myBackgroundTexture [protected]
std::vector<double> makVrv::DtAttributeLayout::myColSizes [protected]
std::vector<double> makVrv::DtAttributeLayout::myRowSizes [protected]

The documentation for this class was generated from the following file:

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)