dart
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
dart::gui::osg::GridVisual Class Reference

Attach this to a Viewer in order to visualize grid. More...

#include <GridVisual.hpp>

Inheritance diagram for dart::gui::osg::GridVisual:
Inheritance graph
[legend]
Collaboration diagram for dart::gui::osg::GridVisual:
Collaboration graph
[legend]

Public Types

enum  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.
 
- Public Member Functions inherited from dart::gui::osg::ViewerAttachment
 ViewerAttachment ()
 Default constructor.
 
virtual ~ViewerAttachment ()
 Virtual destructor.
 
ViewergetViewer ()
 
const ViewergetViewer () const
 

Protected Member Functions

void initialize ()
 Initializes the memory used by this visual.
 
- Protected Member Functions inherited from dart::gui::osg::ViewerAttachment
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.
 
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.
 

Detailed Description

Attach this to a Viewer in order to visualize grid.


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