DART
6.10.1
|
Attach this to a Viewer in order to visualize grid. More...
#include <GridVisual.hpp>
Public Types | |
enum class | PlaneType : unsigned char { XY = 0u , YZ = 1u , ZX = 2u } |
Public Member Functions | |
GridVisual () | |
Default constructor. More... | |
void | setNumCells (std::size_t cells) |
Sets the number of cells along each axis. More... | |
std::size_t | getNumCells () const |
Returns the number of cells along each axis. More... | |
void | setMinorLineStepSize (double size) |
Sets the step size of minor lines in meters. More... | |
double | getMinorLineStepSize () const |
Returns the step size of minor lines in meters. More... | |
void | setNumMinorLinesPerMajorLine (std::size_t size) |
Sets the number of minor lines per major line. More... | |
std::size_t | getNumMinorLinesPerMajorLine () const |
Returns the number of minor lines per major line. More... | |
void | setPlaneType (PlaneType type) |
Set the plane type among XY, YZ, ZX planes. More... | |
PlaneType | getPlaneType () const |
Returns the plane type among XY, YZ, ZX planes. More... | |
void | setOffset (const Eigen::Vector3d &offset) |
Changes the offset at which the grid is displayed. More... | |
const Eigen::Vector3d & | getOffset () const |
Returns the elevation of display for the support polygon. More... | |
void | display (bool display) |
Displays the support polygon. More... | |
bool | isDisplayed () const |
Returns true if the support polygon is being displayed. More... | |
void | setMajorLineColor (const Eigen::Vector4d &color) |
Sets the color of major lines. More... | |
Eigen::Vector4d | getMajorLineColor () const |
Returns the color of major lines. More... | |
void | setMinorLineColor (const Eigen::Vector4d &color) |
Sets the color of minor lines. More... | |
Eigen::Vector4d | getMinorLineColor () const |
Returns the color of minor lines. More... | |
void | setAxisLineWidth (float width) |
Sets line width for axis lines. More... | |
float | getAxisLineWidth () const |
Returns line width for axis lines. More... | |
void | setMajorLineWidth (float width) |
Sets line width for major lines. More... | |
float | getMajorLineWidth () const |
Returns line width for major lines. More... | |
void | setMinorLineWidth (float width) |
Sets line width for minor lines. More... | |
float | getMinorLineWidth () const |
Returns line width for minor lines. More... | |
void | refresh () override final |
Updates the support polygon visual. More... | |
Viewer * | getViewer () |
const Viewer * | getViewer () const |
Protected Member Functions | |
void | initialize () |
Initializes the memory used by this visual. More... | |
virtual void | customAttach (Viewer *newViewer) |
This function will be called by attach(Viewer*) so you can do customized setup when the Viewer changes. More... | |
virtual void | attach (Viewer *newViewer) |
This function will get called when the visual is attached to a new Viewer. More... | |
Protected Attributes | |
PlaneType | mPlaneType |
Plane type among XY, YZ, ZX planes. More... | |
std::size_t | mNumCells |
Number of cells along each axis. More... | |
double | mMinorLineStepSize |
Step size of minor lines in meters. More... | |
std::size_t | mNumMinorLinesPerMajorLine |
Number of minor lines per major line. More... | |
Eigen::Vector3d | mOffset |
Elevation that this visual should use. More... | |
bool | mDisplayGrid |
Whether to display the grid. More... | |
::osg::ref_ptr<::osg::Vec4Array > | mAxisLineColor |
Color for axis lines. More... | |
::osg::ref_ptr<::osg::Vec4Array > | mMajorLineColor |
Color for major lines. More... | |
::osg::ref_ptr<::osg::Vec4Array > | mMinorLineColor |
Color for minor lines. More... | |
::osg::ref_ptr<::osg::Geode > | mGeode |
Geode to hold the grid. More... | |
::osg::ref_ptr<::osg::Geometry > | mAxisLineGeom |
Geometry to describe axis lines. More... | |
::osg::ref_ptr<::osg::Geometry > | mMajorLineGeom |
Geometry to describe minor lines. More... | |
::osg::ref_ptr<::osg::Geometry > | mMinorLineGeom |
Geometry to describe major lines. More... | |
::osg::ref_ptr<::osg::Vec3Array > | mMinorLineVertices |
Vertices of axis lines. More... | |
::osg::ref_ptr<::osg::Vec3Array > | mMajorLineVertices |
Vertices of major lines. More... | |
::osg::ref_ptr<::osg::Vec3Array > | mAxisLineVertices |
Vertices of minor lines. More... | |
::osg::ref_ptr<::osg::DrawElementsUInt > | mAxis1PositiveFaces |
Faces of the first axis positive line. More... | |
::osg::ref_ptr<::osg::DrawElementsUInt > | mAxis1NegativeFaces |
Faces of the first axis negative line. More... | |
::osg::ref_ptr<::osg::DrawElementsUInt > | mAxis2PositiveFaces |
Faces of the second axis positive line. More... | |
::osg::ref_ptr<::osg::DrawElementsUInt > | mAxis2NegativeFaces |
Faces of the second axis negative line. More... | |
::osg::ref_ptr<::osg::DrawElementsUInt > | mMajorLineFaces |
Faces of major lines. More... | |
::osg::ref_ptr<::osg::DrawElementsUInt > | mMinorLineFaces |
Faces of minor lines. More... | |
::osg::ref_ptr<::osg::LineWidth > | mAxisLineWidth |
Line width for axis line. More... | |
::osg::ref_ptr<::osg::LineWidth > | mMajorLineWidth |
Line width for major line. More... | |
::osg::ref_ptr<::osg::LineWidth > | mMinorLineWidth |
Line width for minor line. More... | |
bool | mNeedUpdate |
Dirty flag to notify this grid needs to be updated. More... | |
Private Attributes | |
Viewer * | mViewer |
Attach this to a Viewer in order to visualize grid.
|
strong |
dart::gui::osg::GridVisual::GridVisual | ( | ) |
Default constructor.
|
protectedvirtualinherited |
This function will get called when the visual is attached to a new Viewer.
It adds this node as a child to the root node of the Viewer so the refresh() function will be called at each update cycle. It will also call customAttach(Viewer*) so you can do customized setup.
|
protectedvirtualinherited |
This function will be called by attach(Viewer*) so you can do customized setup when the Viewer changes.
By default this function does nothing, so overriding it is completely safe.
void dart::gui::osg::GridVisual::display | ( | bool | display | ) |
Displays the support polygon.
float dart::gui::osg::GridVisual::getAxisLineWidth | ( | ) | const |
Returns line width for axis lines.
Eigen::Vector4d dart::gui::osg::GridVisual::getMajorLineColor | ( | ) | const |
Returns the color of major lines.
float dart::gui::osg::GridVisual::getMajorLineWidth | ( | ) | const |
Returns line width for major lines.
Eigen::Vector4d dart::gui::osg::GridVisual::getMinorLineColor | ( | ) | const |
Returns the color of minor lines.
double dart::gui::osg::GridVisual::getMinorLineStepSize | ( | ) | const |
Returns the step size of minor lines in meters.
float dart::gui::osg::GridVisual::getMinorLineWidth | ( | ) | const |
Returns line width for minor lines.
std::size_t dart::gui::osg::GridVisual::getNumCells | ( | ) | const |
Returns the number of cells along each axis.
std::size_t dart::gui::osg::GridVisual::getNumMinorLinesPerMajorLine | ( | ) | const |
Returns the number of minor lines per major line.
const Eigen::Vector3d & dart::gui::osg::GridVisual::getOffset | ( | ) | const |
Returns the elevation of display for the support polygon.
GridVisual::PlaneType dart::gui::osg::GridVisual::getPlaneType | ( | ) | const |
Returns the plane type among XY, YZ, ZX planes.
|
inherited |
|
inherited |
|
protected |
Initializes the memory used by this visual.
bool dart::gui::osg::GridVisual::isDisplayed | ( | ) | const |
Returns true if the support polygon is being displayed.
|
finaloverridevirtual |
Updates the support polygon visual.
Implements dart::gui::osg::ViewerAttachment.
void dart::gui::osg::GridVisual::setAxisLineWidth | ( | float | width | ) |
Sets line width for axis lines.
void dart::gui::osg::GridVisual::setMajorLineColor | ( | const Eigen::Vector4d & | color | ) |
Sets the color of major lines.
void dart::gui::osg::GridVisual::setMajorLineWidth | ( | float | width | ) |
Sets line width for major lines.
void dart::gui::osg::GridVisual::setMinorLineColor | ( | const Eigen::Vector4d & | color | ) |
Sets the color of minor lines.
void dart::gui::osg::GridVisual::setMinorLineStepSize | ( | double | size | ) |
Sets the step size of minor lines in meters.
void dart::gui::osg::GridVisual::setMinorLineWidth | ( | float | width | ) |
Sets line width for minor lines.
void dart::gui::osg::GridVisual::setNumCells | ( | std::size_t | cells | ) |
Sets the number of cells along each axis.
void dart::gui::osg::GridVisual::setNumMinorLinesPerMajorLine | ( | std::size_t | size | ) |
Sets the number of minor lines per major line.
void dart::gui::osg::GridVisual::setOffset | ( | const Eigen::Vector3d & | offset | ) |
Changes the offset at which the grid is displayed.
void dart::gui::osg::GridVisual::setPlaneType | ( | GridVisual::PlaneType | type | ) |
Set the plane type among XY, YZ, ZX planes.
|
protected |
Faces of the first axis negative line.
|
protected |
Faces of the first axis positive line.
|
protected |
Faces of the second axis negative line.
|
protected |
Faces of the second axis positive line.
|
protected |
Color for axis lines.
|
protected |
Geometry to describe axis lines.
|
protected |
Vertices of minor lines.
|
protected |
Line width for axis line.
|
protected |
Whether to display the grid.
|
protected |
Geode to hold the grid.
|
protected |
Color for major lines.
|
protected |
Faces of major lines.
|
protected |
Geometry to describe minor lines.
|
protected |
Vertices of major lines.
|
protected |
Line width for major line.
|
protected |
Color for minor lines.
|
protected |
Faces of minor lines.
|
protected |
Geometry to describe major lines.
|
protected |
Step size of minor lines in meters.
|
protected |
Vertices of axis lines.
|
protected |
Line width for minor line.
|
protected |
Dirty flag to notify this grid needs to be updated.
|
protected |
Number of cells along each axis.
|
protected |
Number of minor lines per major line.
|
protected |
Elevation that this visual should use.
|
protected |
Plane type among XY, YZ, ZX planes.
|
privateinherited |