OpenWalnut  1.4.0
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
WGEGridNode Class Reference

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

#include <WGEGridNode.h>

+ Inheritance diagram for WGEGridNode:

Public Types

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

Public Member Functions

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

Private Member Functions

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

Private Attributes

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

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 40 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 51 of file WGEGridNode.h.

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

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

Definition at line 46 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 34 of file WGEGridNode.cpp.

References callback(), wge::createUnitCubeAsLines(), m_bbColor, m_borderLabels, m_boundaryGeode, m_grid, m_innerGridGeode, and m_labelGeode.

WGEGridNode::~WGEGridNode ( )
virtual

Destructor.

Definition at line 122 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 209 of file WGEGridNode.cpp.

References 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 172 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 150 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 161 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 139 of file WGEGridNode.cpp.

References m_showLabels.

WGridRegular3D::ConstSPtr WGEGridNode::getGrid ( ) const

Returns the currently set grid.

Returns
the current grid.

Definition at line 134 of file WGEGridNode.cpp.

References m_grid.

const WColor & WGEGridNode::getGridColor ( ) const

The currently set color used for rendering the grid.

Returns
the current color.

Definition at line 183 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 177 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 155 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 166 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 144 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 127 of file WGEGridNode.cpp.

References 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 188 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 211 of file WGEGridNode.h.

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

WGELabel::SPtr WGEGridNode::m_borderLabels[8]
private

The labels at the corner.

Definition at line 169 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 159 of file WGEGridNode.h.

Referenced by callback(), and WGEGridNode().

WSharedObject< WGridRegular3D::ConstSPtr > WGEGridNode::m_grid
private

The actual grid which should be represented by this node.

Definition at line 154 of file WGEGridNode.h.

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

WColor WGEGridNode::m_gridColor
private

The color of the grid.

Definition at line 216 of file WGEGridNode.h.

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

bool WGEGridNode::m_gridGeometryUpdate
private

If true, the inner grid geometry gets recreated.

Definition at line 191 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 186 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 164 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 174 of file WGEGridNode.h.

Referenced by callback(), and WGEGridNode().

bool WGEGridNode::m_showBBox
private

True if the bbox should be rendered.

Definition at line 201 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 206 of file WGEGridNode.h.

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

bool WGEGridNode::m_showLabels
private

If true, labels get used.

Definition at line 196 of file WGEGridNode.h.

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


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