|
DART 6.12.2
|
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. | |
| void | setNumCells (std::size_t cells) |
| Sets the number of cells along each axis. | |
| std::size_t | getNumCells () const |
| Returns the number of cells along each axis. | |
| void | setMinorLineStepSize (double size) |
| Sets the step size of minor lines in meters. | |
| double | getMinorLineStepSize () const |
| Returns the step size of minor lines in meters. | |
| void | setNumMinorLinesPerMajorLine (std::size_t size) |
| Sets the number of minor lines per major line. | |
| std::size_t | getNumMinorLinesPerMajorLine () const |
| Returns the number of minor lines per major line. | |
| void | setPlaneType (PlaneType type) |
| Set the plane type among XY, YZ, ZX planes. | |
| PlaneType | getPlaneType () const |
| Returns the plane type among XY, YZ, ZX planes. | |
| void | setOffset (const Eigen::Vector3d &offset) |
| Changes the offset at which the grid is displayed. | |
| const Eigen::Vector3d & | getOffset () const |
| Returns the elevation of display for the support polygon. | |
| void | display (bool display) |
| Displays the support polygon. | |
| bool | isDisplayed () const |
| Returns true if the support polygon is being displayed. | |
| void | setMajorLineColor (const Eigen::Vector4d &color) |
| Sets the color of major lines. | |
| Eigen::Vector4d | getMajorLineColor () const |
| Returns the color of major lines. | |
| void | setMinorLineColor (const Eigen::Vector4d &color) |
| Sets the color of minor lines. | |
| Eigen::Vector4d | getMinorLineColor () const |
| Returns the color of minor lines. | |
| void | setAxisLineWidth (float width) |
| Sets line width for axis lines. | |
| float | getAxisLineWidth () const |
| Returns line width for axis lines. | |
| void | setMajorLineWidth (float width) |
| Sets line width for major lines. | |
| float | getMajorLineWidth () const |
| Returns line width for major lines. | |
| void | setMinorLineWidth (float width) |
| Sets line width for minor lines. | |
| float | getMinorLineWidth () const |
| Returns line width for minor lines. | |
| void | refresh () override final |
| Updates the support polygon visual. | |
| Viewer * | getViewer () |
| const Viewer * | getViewer () const |
Protected Member Functions | |
| void | initialize () |
| Initializes the memory used by this visual. | |
| virtual void | customAttach (Viewer *newViewer) |
| This function will be called by attach(Viewer*) so you can do customized setup when the Viewer changes. | |
| virtual void | attach (Viewer *newViewer) |
| This function will get called when the visual is attached to a new Viewer. | |
Protected Attributes | |
| PlaneType | mPlaneType |
| Plane type among XY, YZ, ZX planes. | |
| std::size_t | mNumCells |
| Number of cells along each axis. | |
| double | mMinorLineStepSize |
| Step size of minor lines in meters. | |
| std::size_t | mNumMinorLinesPerMajorLine |
| Number of minor lines per major line. | |
| Eigen::Vector3d | mOffset |
| Elevation that this visual should use. | |
| bool | mDisplayGrid |
| Whether to display the grid. | |
| ::osg::ref_ptr<::osg::Vec4Array > | mAxisLineColor |
| Color for axis lines. | |
| ::osg::ref_ptr<::osg::Vec4Array > | mMajorLineColor |
| Color for major lines. | |
| ::osg::ref_ptr<::osg::Vec4Array > | mMinorLineColor |
| Color for minor lines. | |
| ::osg::ref_ptr<::osg::Geode > | mGeode |
| Geode to hold the grid. | |
| ::osg::ref_ptr<::osg::Geometry > | mAxisLineGeom |
| Geometry to describe axis lines. | |
| ::osg::ref_ptr<::osg::Geometry > | mMajorLineGeom |
| Geometry to describe minor lines. | |
| ::osg::ref_ptr<::osg::Geometry > | mMinorLineGeom |
| Geometry to describe major lines. | |
| ::osg::ref_ptr<::osg::Vec3Array > | mMinorLineVertices |
| Vertices of axis lines. | |
| ::osg::ref_ptr<::osg::Vec3Array > | mMajorLineVertices |
| Vertices of major lines. | |
| ::osg::ref_ptr<::osg::Vec3Array > | mAxisLineVertices |
| Vertices of minor lines. | |
| ::osg::ref_ptr<::osg::DrawElementsUInt > | mAxis1PositiveFaces |
| Faces of the first axis positive line. | |
| ::osg::ref_ptr<::osg::DrawElementsUInt > | mAxis1NegativeFaces |
| Faces of the first axis negative line. | |
| ::osg::ref_ptr<::osg::DrawElementsUInt > | mAxis2PositiveFaces |
| Faces of the second axis positive line. | |
| ::osg::ref_ptr<::osg::DrawElementsUInt > | mAxis2NegativeFaces |
| Faces of the second axis negative line. | |
| ::osg::ref_ptr<::osg::DrawElementsUInt > | mMajorLineFaces |
| Faces of major lines. | |
| ::osg::ref_ptr<::osg::DrawElementsUInt > | mMinorLineFaces |
| Faces of minor lines. | |
| ::osg::ref_ptr<::osg::LineWidth > | mAxisLineWidth |
| Line width for axis line. | |
| ::osg::ref_ptr<::osg::LineWidth > | mMajorLineWidth |
| Line width for major line. | |
| ::osg::ref_ptr<::osg::LineWidth > | mMinorLineWidth |
| Line width for minor line. | |
| bool | mNeedUpdate |
| Dirty flag to notify this grid needs to be updated. | |
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 |