OpenWalnut 1.3.1
Public Types | Public Member Functions | Private Member Functions | Private Attributes
WGEGridNode Class Reference

This node is able to represent a grid in certain ways. More...

#include <WGEGridNode.h>

Inheritance diagram for WGEGridNode:

List of all members.

Public Types

typedef osg::ref_ptr< WGEGridNodeSPtr
 Convenience typedef for a osg::ref_ptr< WGEGridNode >.
typedef osg::ref_ptr< const
WGEGridNode
ConstSPtr
 Convenience typedef for a osg::ref_ptr< const WGEGridNode >.

Public Member Functions

 WGEGridNode (WGridRegular3D::ConstSPtr grid)
 Creates a node representing the specified grid.
virtual ~WGEGridNode ()
 Destructor.
void setGrid (WGridRegular3D::ConstSPtr grid)
 Updates the node to use the new specified grid.
WGridRegular3D::ConstSPtr getGrid () const
 Returns the currently set grid.
bool getEnableLabels () const
 Returns whether labels on the corners are enabled or not.
void setEnableLabels (bool enable=true)
 En- or disable labels on the boundary corners.
bool getEnableBBox () const
 Returns whether bbox mode is enabled or not.
void setEnableBBox (bool enable=true)
 En- or disable bbox mode.
bool getEnableGrid () const
 Returns whether grid mode is enabled or not.
void setEnableGrid (bool enable=true)
 En- or disable grid mode.
const WColor & getBBoxColor () const
 The currently set color used for rendering the bbox.
void setBBoxColor (const WColor &color)
 Sets the color of the rendered bbox.
const WColor & getGridColor () const
 The currently set color used for rendering the grid.
void setGridColor (const WColor &color)
 Sets the color of the rendered grid.

Private Member Functions

void callback (osg::Node *node)
 The actual callback handling changes in the grid.

Private Attributes

WSharedObject
< WGridRegular3D::ConstSPtr
m_grid
 The actual grid which should be represented by this node.
osg::ref_ptr< osg::Geode > m_boundaryGeode
 The geometry for the boundary.
osg::ref_ptr< osg::Geode > m_innerGridGeode
 The geometry for the whole grid.
WGELabel::SPtr m_borderLabels [8]
 The labels at the corner.
osg::ref_ptr< osg::Geode > m_labelGeode
 The geode keeping the labels.
bool m_gridUpdate
 If true, the labels and geometry gets adapted properly.
bool m_gridGeometryUpdate
 If true, the inner grid geometry gets recreated.
bool m_showLabels
 If true, labels get used.
bool m_showBBox
 True if the bbox should be rendered.
bool m_showGrid
 True if the grid should be rendered.
WColor m_bbColor
 The color of bbox/grid.
WColor m_gridColor
 The color of the grid.

Detailed Description

This node is able to represent a grid in certain ways.

It can show its boundary or the whole grid if desired.

Definition at line 42 of file WGEGridNode.h.


Member Typedef Documentation

typedef osg::ref_ptr< const WGEGridNode > WGEGridNode::ConstSPtr

Convenience typedef for a osg::ref_ptr< const WGEGridNode >.

Definition at line 53 of file WGEGridNode.h.

typedef osg::ref_ptr< WGEGridNode > WGEGridNode::SPtr

Convenience typedef for a osg::ref_ptr< WGEGridNode >.

Definition at line 48 of file WGEGridNode.h.


Constructor & Destructor Documentation

WGEGridNode::WGEGridNode ( WGridRegular3D::ConstSPtr  grid) [explicit]

Creates a node representing the specified grid.

Parameters:
gridthe grid to represent.

Definition at line 35 of file WGEGridNode.cpp.

References callback(), wge::createUnitCubeAsLines(), WSharedObject< T >::getWriteTicket(), m_bbColor, m_borderLabels, m_boundaryGeode, m_grid, m_innerGridGeode, and m_labelGeode.

WGEGridNode::~WGEGridNode ( ) [virtual]

Destructor.

Definition at line 123 of file WGEGridNode.cpp.


Member Function Documentation

void WGEGridNode::callback ( osg::Node *  node) [private]

The actual callback handling changes in the grid.

Parameters:
nodethe node. This will be the this pointer.

Definition at line 210 of file WGEGridNode.cpp.

References WSharedObject< T >::getReadTicket(), m_bbColor, m_borderLabels, m_boundaryGeode, m_grid, m_gridColor, m_gridGeometryUpdate, m_gridUpdate, m_innerGridGeode, m_labelGeode, m_showBBox, m_showGrid, and m_showLabels.

Referenced by WGEGridNode().

const WColor & WGEGridNode::getBBoxColor ( ) const

The currently set color used for rendering the bbox.

Returns:
the current color.

Definition at line 173 of file WGEGridNode.cpp.

References m_bbColor.

bool WGEGridNode::getEnableBBox ( ) const

Returns whether bbox mode is enabled or not.

Returns:
true if bbox rendering are enabled

Definition at line 151 of file WGEGridNode.cpp.

References m_showBBox.

bool WGEGridNode::getEnableGrid ( ) const

Returns whether grid mode is enabled or not.

Returns:
true if grid rendering are enabled

Definition at line 162 of file WGEGridNode.cpp.

References m_showGrid.

bool WGEGridNode::getEnableLabels ( ) const

Returns whether labels on the corners are enabled or not.

Returns:
true if labels are enabled

Definition at line 140 of file WGEGridNode.cpp.

References m_showLabels.

WGridRegular3D::ConstSPtr WGEGridNode::getGrid ( ) const

Returns the currently set grid.

Returns:
the current grid.

Definition at line 135 of file WGEGridNode.cpp.

References WSharedObject< T >::getReadTicket(), and m_grid.

const WColor & WGEGridNode::getGridColor ( ) const

The currently set color used for rendering the grid.

Returns:
the current color.

Definition at line 184 of file WGEGridNode.cpp.

References m_gridColor.

void WGEGridNode::setBBoxColor ( const WColor &  color)

Sets the color of the rendered bbox.

Parameters:
colorthe color

Definition at line 178 of file WGEGridNode.cpp.

References m_bbColor, and m_gridUpdate.

void WGEGridNode::setEnableBBox ( bool  enable = true)

En- or disable bbox mode.

Parameters:
enabletrue to enbable

Definition at line 156 of file WGEGridNode.cpp.

References m_gridUpdate, and m_showBBox.

void WGEGridNode::setEnableGrid ( bool  enable = true)

En- or disable grid mode.

Parameters:
enabletrue to enbable

Definition at line 167 of file WGEGridNode.cpp.

References m_gridUpdate, and m_showGrid.

void WGEGridNode::setEnableLabels ( bool  enable = true)

En- or disable labels on the boundary corners.

Parameters:
enabletrue to enbable

Definition at line 145 of file WGEGridNode.cpp.

References m_gridUpdate, and m_showLabels.

void WGEGridNode::setGrid ( WGridRegular3D::ConstSPtr  grid)

Updates the node to use the new specified grid.

Parameters:
gridthe new grid to use

Definition at line 128 of file WGEGridNode.cpp.

References WSharedObject< T >::getWriteTicket(), m_grid, m_gridGeometryUpdate, and m_gridUpdate.

void WGEGridNode::setGridColor ( const WColor &  color)

Sets the color of the rendered grid.

Parameters:
colorthe color

Definition at line 189 of file WGEGridNode.cpp.

References m_gridColor, and m_gridUpdate.


Member Data Documentation

WColor WGEGridNode::m_bbColor [private]

The color of bbox/grid.

Definition at line 213 of file WGEGridNode.h.

Referenced by callback(), getBBoxColor(), setBBoxColor(), and WGEGridNode().

The labels at the corner.

Definition at line 171 of file WGEGridNode.h.

Referenced by callback(), and WGEGridNode().

osg::ref_ptr< osg::Geode > WGEGridNode::m_boundaryGeode [private]

The geometry for the boundary.

Definition at line 161 of file WGEGridNode.h.

Referenced by callback(), and WGEGridNode().

The actual grid which should be represented by this node.

Definition at line 156 of file WGEGridNode.h.

Referenced by callback(), getGrid(), setGrid(), and WGEGridNode().

WColor WGEGridNode::m_gridColor [private]

The color of the grid.

Definition at line 218 of file WGEGridNode.h.

Referenced by callback(), getGridColor(), and setGridColor().

If true, the inner grid geometry gets recreated.

Definition at line 193 of file WGEGridNode.h.

Referenced by callback(), and setGrid().

bool WGEGridNode::m_gridUpdate [private]

If true, the labels and geometry gets adapted properly.

Definition at line 188 of file WGEGridNode.h.

Referenced by callback(), setBBoxColor(), setEnableBBox(), setEnableGrid(), setEnableLabels(), setGrid(), and setGridColor().

osg::ref_ptr< osg::Geode > WGEGridNode::m_innerGridGeode [private]

The geometry for the whole grid.

Definition at line 166 of file WGEGridNode.h.

Referenced by callback(), and WGEGridNode().

osg::ref_ptr< osg::Geode > WGEGridNode::m_labelGeode [private]

The geode keeping the labels.

Definition at line 176 of file WGEGridNode.h.

Referenced by callback(), and WGEGridNode().

bool WGEGridNode::m_showBBox [private]

True if the bbox should be rendered.

Definition at line 203 of file WGEGridNode.h.

Referenced by callback(), getEnableBBox(), and setEnableBBox().

bool WGEGridNode::m_showGrid [private]

True if the grid should be rendered.

Definition at line 208 of file WGEGridNode.h.

Referenced by callback(), getEnableGrid(), and setEnableGrid().

bool WGEGridNode::m_showLabels [private]

If true, labels get used.

Definition at line 198 of file WGEGridNode.h.

Referenced by callback(), getEnableLabels(), and setEnableLabels().


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