33 #ifndef DART_GUI_OSG_GRIDVISUAL_HPP_ 34 #define DART_GUI_OSG_GRIDVISUAL_HPP_ 37 #include <osg/LineWidth> 39 #include "dart/dynamics/SmartPointer.hpp" 41 #include "dart/gui/osg/ShapeFrameNode.hpp" 42 #include "dart/gui/osg/Viewer.hpp" 52 enum class PlaneType : unsigned char
87 void setOffset(
const Eigen::Vector3d& offset);
218 #endif // DART_GUI_OSG_GRIDVISUAL_HPP_ ::osg::ref_ptr<::osg::Vec3Array > mMinorLineVertices
Vertices of axis lines.
Definition: GridVisual.hpp:175
::osg::ref_ptr<::osg::Vec4Array > mAxisLineColor
Color for axis lines.
Definition: GridVisual.hpp:154
bool mNeedUpdate
Dirty flag to notify this grid needs to be updated.
Definition: GridVisual.hpp:211
PlaneType mPlaneType
Plane type among XY, YZ, ZX planes.
Definition: GridVisual.hpp:136
void setOffset(const Eigen::Vector3d &offset)
Changes the offset at which the grid is displayed.
Definition: GridVisual.cpp:119
double mMinorLineStepSize
Step size of minor lines in meters.
Definition: GridVisual.hpp:142
void display(bool display)
Displays the support polygon.
Definition: GridVisual.cpp:135
const Eigen::Vector3d & getOffset() const
Returns the elevation of display for the support polygon.
Definition: GridVisual.cpp:129
Eigen::Vector3d mOffset
Elevation that this visual should use.
Definition: GridVisual.hpp:148
Definition: Viewer.hpp:76
void setMajorLineColor(const Eigen::Vector4d &color)
Sets the color of major lines.
Definition: GridVisual.cpp:155
::osg::ref_ptr<::osg::Vec4Array > mMinorLineColor
Color for minor lines.
Definition: GridVisual.hpp:160
::osg::ref_ptr<::osg::DrawElementsUInt > mMinorLineFaces
Faces of minor lines.
Definition: GridVisual.hpp:199
std::size_t mNumMinorLinesPerMajorLine
Number of minor lines per major line.
Definition: GridVisual.hpp:145
Eigen::Vector4d getMinorLineColor() const
Returns the color of minor lines.
Definition: GridVisual.cpp:186
void setNumCells(std::size_t cells)
Sets the number of cells along each axis.
Definition: GridVisual.cpp:52
Attach this to a Viewer in order to visualize grid.
Definition: GridVisual.hpp:49
::osg::ref_ptr<::osg::LineWidth > mAxisLineWidth
Line width for axis line.
Definition: GridVisual.hpp:202
float getMinorLineWidth() const
Returns line width for minor lines.
Definition: GridVisual.cpp:235
void setMinorLineColor(const Eigen::Vector4d &color)
Sets the color of minor lines.
Definition: GridVisual.cpp:174
void setNumMinorLinesPerMajorLine(std::size_t size)
Sets the number of minor lines per major line.
Definition: GridVisual.cpp:87
Definition: Aspect.cpp:40
::osg::ref_ptr<::osg::Geometry > mAxisLineGeom
Geometry to describe axis lines.
Definition: GridVisual.hpp:166
Eigen::Vector4d getMajorLineColor() const
Returns the color of major lines.
Definition: GridVisual.cpp:167
::osg::ref_ptr<::osg::DrawElementsUInt > mAxis2PositiveFaces
Faces of the second axis positive line.
Definition: GridVisual.hpp:190
::osg::ref_ptr<::osg::DrawElementsUInt > mAxis2NegativeFaces
Faces of the second axis negative line.
Definition: GridVisual.hpp:193
void setAxisLineWidth(float width)
Sets line width for axis lines.
Definition: GridVisual.cpp:193
::osg::ref_ptr<::osg::DrawElementsUInt > mAxis1PositiveFaces
Faces of the first axis positive line.
Definition: GridVisual.hpp:184
PlaneType getPlaneType() const
Returns the plane type among XY, YZ, ZX planes.
Definition: GridVisual.cpp:113
::osg::ref_ptr<::osg::DrawElementsUInt > mAxis1NegativeFaces
Faces of the first axis negative line.
Definition: GridVisual.hpp:187
::osg::ref_ptr<::osg::LineWidth > mMajorLineWidth
Line width for major line.
Definition: GridVisual.hpp:205
void initialize()
Initializes the memory used by this visual.
Definition: GridVisual.cpp:488
::osg::ref_ptr<::osg::Geode > mGeode
Geode to hold the grid.
Definition: GridVisual.hpp:163
::osg::ref_ptr<::osg::Vec3Array > mMajorLineVertices
Vertices of major lines.
Definition: GridVisual.hpp:178
std::size_t mNumCells
Number of cells along each axis.
Definition: GridVisual.hpp:139
bool isDisplayed() const
Returns true if the support polygon is being displayed.
Definition: GridVisual.cpp:149
float getMajorLineWidth() const
Returns line width for major lines.
Definition: GridVisual.cpp:219
void setMajorLineWidth(float width)
Sets line width for major lines.
Definition: GridVisual.cpp:209
void refresh() override final
Updates the support polygon visual.
Definition: GridVisual.cpp:418
::osg::ref_ptr<::osg::LineWidth > mMinorLineWidth
Line width for minor line.
Definition: GridVisual.hpp:208
GridVisual()
Default constructor.
Definition: GridVisual.cpp:46
double getMinorLineStepSize() const
Returns the step size of minor lines in meters.
Definition: GridVisual.cpp:81
void setPlaneType(PlaneType type)
Set the plane type among XY, YZ, ZX planes.
Definition: GridVisual.cpp:103
float getAxisLineWidth() const
Returns line width for axis lines.
Definition: GridVisual.cpp:203
::osg::ref_ptr<::osg::Geometry > mMajorLineGeom
Geometry to describe minor lines.
Definition: GridVisual.hpp:169
void setMinorLineStepSize(double size)
Sets the step size of minor lines in meters.
Definition: GridVisual.cpp:68
::osg::ref_ptr<::osg::Vec3Array > mAxisLineVertices
Vertices of minor lines.
Definition: GridVisual.hpp:181
::osg::ref_ptr<::osg::DrawElementsUInt > mMajorLineFaces
Faces of major lines.
Definition: GridVisual.hpp:196
::osg::ref_ptr<::osg::Vec4Array > mMajorLineColor
Color for major lines.
Definition: GridVisual.hpp:157
std::size_t getNumCells() const
Returns the number of cells along each axis.
Definition: GridVisual.cpp:62
void setMinorLineWidth(float width)
Sets line width for minor lines.
Definition: GridVisual.cpp:225
::osg::ref_ptr<::osg::Geometry > mMinorLineGeom
Geometry to describe major lines.
Definition: GridVisual.hpp:172
bool mDisplayGrid
Whether to display the grid.
Definition: GridVisual.hpp:151
std::size_t getNumMinorLinesPerMajorLine() const
Returns the number of minor lines per major line.
Definition: GridVisual.cpp:97