VR-Forces 4.1 Class Documentation
List of all members | 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...

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 setBackgroundOrderGroup (unsigned int groupId)
 Set the overlay group used for shadows and the background.
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.
virtual void setShadowText (bool enabled)
 Set whether text shadows should be displayed.

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
unsigned int myOverlayTextGroup
osg::ref_ptr< osg::Texture > myBackgroundTexture
osg::Vec4 myBackgroundColor
DtBoundingBox myBoundingBox
bool myShadowTextFlag
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

makVrv::DtAttributeLayout::DtAttributeLayout ( DtDe de)

CTOR.

virtual makVrv::DtAttributeLayout::~DtAttributeLayout ( )
virtual

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::setBackgroundOrderGroup ( unsigned int  groupId)
virtual

Set the overlay group used for shadows and the background.

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::setShadowText ( bool  enabled)
virtual

Set whether text shadows should be displayed.

virtual void makVrv::DtAttributeLayout::slot_attributeSizeChanged ( DtAttribute attribute,
double  xSize,
double  ySize 
)
protectedvirtual

Called when an attribute's size changes.

virtual void makVrv::DtAttributeLayout::resizeLayout ( )
protectedvirtual

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

virtual void makVrv::DtAttributeLayout::redimensionLayout ( )
protectedvirtual

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

virtual void makVrv::DtAttributeLayout::resizeRowsAndColumns ( )
protectedvirtual

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

void makVrv::DtAttributeLayout::createBackground ( )
private

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

DtDe& makVrv::DtAttributeLayout::myDe
protected
AttributeGrid makVrv::DtAttributeLayout::myAttributeGrid
protected

The 2d grid of attributes to manage.

bool makVrv::DtAttributeLayout::myHorizontalCenter
protected
bool makVrv::DtAttributeLayout::myVerticalCenter
protected
float makVrv::DtAttributeLayout::myWorldX
protected
float makVrv::DtAttributeLayout::myWorldY
protected
float makVrv::DtAttributeLayout::myWorldZ
protected
float makVrv::DtAttributeLayout::myWorldW
protected
double makVrv::DtAttributeLayout::myOffsetX
protected
double makVrv::DtAttributeLayout::myOffsetY
protected
double makVrv::DtAttributeLayout::myXDim
protected

Layout dimension on X axis.

double makVrv::DtAttributeLayout::myYDim
protected

Layout dimension on Y axis.

double makVrv::DtAttributeLayout::myRowPadding
protected
double makVrv::DtAttributeLayout::myColumnPadding
protected
DtQuad* makVrv::DtAttributeLayout::myBackground
protected
DtBaseOutlineAttribute makVrv::DtAttributeLayout::myOutline
protected
bool makVrv::DtAttributeLayout::myVisible
protected
bool makVrv::DtAttributeLayout::myOutlineEnabled
protected
unsigned int makVrv::DtAttributeLayout::myOverlay
protected
unsigned int makVrv::DtAttributeLayout::myOverlayGroup
protected
unsigned int makVrv::DtAttributeLayout::myOverlayTextGroup
protected
osg::ref_ptr<osg::Texture> makVrv::DtAttributeLayout::myBackgroundTexture
protected
osg::Vec4 makVrv::DtAttributeLayout::myBackgroundColor
protected
DtBoundingBox makVrv::DtAttributeLayout::myBoundingBox
protected
bool makVrv::DtAttributeLayout::myShadowTextFlag
protected
AttributeInfoMap makVrv::DtAttributeLayout::myAttributeInfoMap
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 Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)