OpenWalnut  1.5.0dev
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:
+ Collaboration diagram for WGEGridNode:

Public Types

typedef osg::ref_ptr< WGEGridNodeSPtr
 Convenience typedef for a osg::ref_ptr< WGEGridNode >. More...
 
typedef osg::ref_ptr< const WGEGridNodeConstSPtr
 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...
 
void setGridLineWidth (int linewidth=1)
 Set the line width of the gird. More...
 
void setBoxLineWidth (int linewidth=4)
 Set the line width of the bounding box. More...
 
int getGridLineWidth () const
 Get the line width of the gird. More...
 
int getBoxLineWidth () const
 get the line width of the bounding box. More...
 

Private Member Functions

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

Private Attributes

WSharedObject< WGridRegular3D::ConstSPtrm_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...
 
int m_gridLineWidth
 Line width used for the grid. More...
 
int m_boxLineWidth
 The line width of the box. 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

◆ ConstSPtr

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.

◆ SPtr

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::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(), WSharedObject< T >::getWriteTicket(), m_bbColor, m_borderLabels, m_boundaryGeode, m_boxLineWidth, m_grid, m_gridLineWidth, m_innerGridGeode, and m_labelGeode.

+ Here is the call graph for this function:

◆ ~WGEGridNode()

WGEGridNode::~WGEGridNode ( )
virtual

Destructor.

Definition at line 125 of file WGEGridNode.cpp.

Member Function Documentation

◆ callback()

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 234 of file WGEGridNode.cpp.

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

Referenced by WGEGridNode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getBBoxColor()

const WColor & WGEGridNode::getBBoxColor ( ) const

The currently set color used for rendering the bbox.

Returns
the current color.

Definition at line 175 of file WGEGridNode.cpp.

References m_bbColor.

◆ getBoxLineWidth()

int WGEGridNode::getBoxLineWidth ( ) const

get the line width of the bounding box.

Returns
the linewidth.

Definition at line 214 of file WGEGridNode.cpp.

References m_boxLineWidth.

◆ getEnableBBox()

bool WGEGridNode::getEnableBBox ( ) const

Returns whether bbox mode is enabled or not.

Returns
true if bbox rendering are enabled

Definition at line 153 of file WGEGridNode.cpp.

References m_showBBox.

◆ getEnableGrid()

bool WGEGridNode::getEnableGrid ( ) const

Returns whether grid mode is enabled or not.

Returns
true if grid rendering are enabled

Definition at line 164 of file WGEGridNode.cpp.

References m_showGrid.

◆ getEnableLabels()

bool WGEGridNode::getEnableLabels ( ) const

Returns whether labels on the corners are enabled or not.

Returns
true if labels are enabled

Definition at line 142 of file WGEGridNode.cpp.

References m_showLabels.

◆ getGrid()

WGridRegular3D::ConstSPtr WGEGridNode::getGrid ( ) const

Returns the currently set grid.

Returns
the current grid.

Definition at line 137 of file WGEGridNode.cpp.

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

+ Here is the call graph for this function:

◆ getGridColor()

const WColor & WGEGridNode::getGridColor ( ) const

The currently set color used for rendering the grid.

Returns
the current color.

Definition at line 186 of file WGEGridNode.cpp.

References m_gridColor.

◆ getGridLineWidth()

int WGEGridNode::getGridLineWidth ( ) const

Get the line width of the gird.

Returns
the linewidth.

Definition at line 209 of file WGEGridNode.cpp.

References m_gridLineWidth.

◆ setBBoxColor()

void WGEGridNode::setBBoxColor ( const WColor &  color)

Sets the color of the rendered bbox.

Parameters
colorthe color

Definition at line 180 of file WGEGridNode.cpp.

References m_bbColor, and m_gridUpdate.

◆ setBoxLineWidth()

void WGEGridNode::setBoxLineWidth ( int  linewidth = 4)

Set the line width of the bounding box.

Parameters
linewidththe linewidth. Default is 4.

Definition at line 203 of file WGEGridNode.cpp.

References m_boxLineWidth, and m_gridUpdate.

◆ setEnableBBox()

void WGEGridNode::setEnableBBox ( bool  enable = true)

En- or disable bbox mode.

Parameters
enabletrue to enbable

Definition at line 158 of file WGEGridNode.cpp.

References m_gridUpdate, and m_showBBox.

◆ setEnableGrid()

void WGEGridNode::setEnableGrid ( bool  enable = true)

En- or disable grid mode.

Parameters
enabletrue to enbable

Definition at line 169 of file WGEGridNode.cpp.

References m_gridUpdate, and m_showGrid.

◆ setEnableLabels()

void WGEGridNode::setEnableLabels ( bool  enable = true)

En- or disable labels on the boundary corners.

Parameters
enabletrue to enbable

Definition at line 147 of file WGEGridNode.cpp.

References m_gridUpdate, and m_showLabels.

◆ setGrid()

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

Updates the node to use the new specified grid.

Parameters
gridthe new grid to use

Definition at line 130 of file WGEGridNode.cpp.

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

+ Here is the call graph for this function:

◆ setGridColor()

void WGEGridNode::setGridColor ( const WColor &  color)

Sets the color of the rendered grid.

Parameters
colorthe color

Definition at line 191 of file WGEGridNode.cpp.

References m_gridColor, and m_gridUpdate.

◆ setGridLineWidth()

void WGEGridNode::setGridLineWidth ( int  linewidth = 1)

Set the line width of the gird.

Parameters
linewidththe linewidth. Default is 1.

Definition at line 197 of file WGEGridNode.cpp.

References m_gridLineWidth, and m_gridUpdate.

Member Data Documentation

◆ m_bbColor

WColor WGEGridNode::m_bbColor
private

The color of bbox/grid.

Definition at line 239 of file WGEGridNode.h.

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

◆ m_borderLabels

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

The labels at the corner.

Definition at line 197 of file WGEGridNode.h.

Referenced by callback(), and WGEGridNode().

◆ m_boundaryGeode

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

The geometry for the boundary.

Definition at line 187 of file WGEGridNode.h.

Referenced by callback(), and WGEGridNode().

◆ m_boxLineWidth

int WGEGridNode::m_boxLineWidth
private

The line width of the box.

Definition at line 254 of file WGEGridNode.h.

Referenced by callback(), getBoxLineWidth(), setBoxLineWidth(), and WGEGridNode().

◆ m_grid

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

The actual grid which should be represented by this node.

Definition at line 182 of file WGEGridNode.h.

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

◆ m_gridColor

WColor WGEGridNode::m_gridColor
private

The color of the grid.

Definition at line 244 of file WGEGridNode.h.

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

◆ m_gridGeometryUpdate

bool WGEGridNode::m_gridGeometryUpdate
private

If true, the inner grid geometry gets recreated.

Definition at line 219 of file WGEGridNode.h.

Referenced by callback(), and setGrid().

◆ m_gridLineWidth

int WGEGridNode::m_gridLineWidth
private

Line width used for the grid.

Definition at line 249 of file WGEGridNode.h.

Referenced by callback(), getGridLineWidth(), setGridLineWidth(), and WGEGridNode().

◆ m_gridUpdate

bool WGEGridNode::m_gridUpdate
private

If true, the labels and geometry gets adapted properly.

Definition at line 214 of file WGEGridNode.h.

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

◆ m_innerGridGeode

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

The geometry for the whole grid.

Definition at line 192 of file WGEGridNode.h.

Referenced by callback(), and WGEGridNode().

◆ m_labelGeode

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

The geode keeping the labels.

Definition at line 202 of file WGEGridNode.h.

Referenced by callback(), and WGEGridNode().

◆ m_showBBox

bool WGEGridNode::m_showBBox
private

True if the bbox should be rendered.

Definition at line 229 of file WGEGridNode.h.

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

◆ m_showGrid

bool WGEGridNode::m_showGrid
private

True if the grid should be rendered.

Definition at line 234 of file WGEGridNode.h.

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

◆ m_showLabels

bool WGEGridNode::m_showLabels
private

If true, labels get used.

Definition at line 224 of file WGEGridNode.h.

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


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