OpenWalnut
1.4.0
|
This node is able to represent a grid in certain ways. More...
#include <WGEGridNode.h>
Public Types | |
typedef osg::ref_ptr< WGEGridNode > | SPtr |
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... | |
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.
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.
|
explicit |
Creates a node representing the specified grid.
grid | the 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.
|
virtual |
Destructor.
Definition at line 122 of file WGEGridNode.cpp.
|
private |
The actual callback handling changes in the grid.
node | the 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.
Definition at line 172 of file WGEGridNode.cpp.
References m_bbColor.
bool WGEGridNode::getEnableBBox | ( | ) | const |
Returns whether bbox mode is enabled or not.
Definition at line 150 of file WGEGridNode.cpp.
References m_showBBox.
bool WGEGridNode::getEnableGrid | ( | ) | const |
Returns whether grid mode is enabled or not.
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.
Definition at line 139 of file WGEGridNode.cpp.
References m_showLabels.
WGridRegular3D::ConstSPtr WGEGridNode::getGrid | ( | ) | const |
Returns the currently set 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.
Definition at line 183 of file WGEGridNode.cpp.
References m_gridColor.
void WGEGridNode::setBBoxColor | ( | const WColor & | color | ) |
Sets the color of the rendered bbox.
color | the 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.
enable | true 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.
enable | true 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.
enable | true 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.
grid | the 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.
color | the color |
Definition at line 188 of file WGEGridNode.cpp.
References m_gridColor, and m_gridUpdate.
|
private |
The color of bbox/grid.
Definition at line 211 of file WGEGridNode.h.
Referenced by callback(), getBBoxColor(), setBBoxColor(), and WGEGridNode().
|
private |
The labels at the corner.
Definition at line 169 of file WGEGridNode.h.
Referenced by callback(), and WGEGridNode().
|
private |
The geometry for the boundary.
Definition at line 159 of file WGEGridNode.h.
Referenced by callback(), and WGEGridNode().
|
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().
|
private |
The color of the grid.
Definition at line 216 of file WGEGridNode.h.
Referenced by callback(), getGridColor(), and setGridColor().
|
private |
If true, the inner grid geometry gets recreated.
Definition at line 191 of file WGEGridNode.h.
Referenced by callback(), and setGrid().
|
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().
|
private |
The geometry for the whole grid.
Definition at line 164 of file WGEGridNode.h.
Referenced by callback(), and WGEGridNode().
|
private |
The geode keeping the labels.
Definition at line 174 of file WGEGridNode.h.
Referenced by callback(), and WGEGridNode().
|
private |
True if the bbox should be rendered.
Definition at line 201 of file WGEGridNode.h.
Referenced by callback(), getEnableBBox(), and setEnableBBox().
|
private |
True if the grid should be rendered.
Definition at line 206 of file WGEGridNode.h.
Referenced by callback(), getEnableGrid(), and setEnableGrid().
|
private |
If true, labels get used.
Definition at line 196 of file WGEGridNode.h.
Referenced by callback(), getEnableLabels(), and setEnableLabels().