2D polyline. More...
#include <PolylineItem.hh>
Public Member Functions | |
PolylineItem (const QPointF &_start, const QPointF &_end) | |
Constructor param[in] _start Start position of the polyline item in pixel coordinates. More... | |
~PolylineItem () | |
Destructor. More... | |
void | AddPoint (const QPointF &_point) |
Add a point to the polyline item. More... | |
void | ClosePath () |
Call the function to indicate that the start and end vertices are connected. More... | |
LineSegmentItem * | GetSegment (unsigned int _index) const |
Get a line segment of the polyline item. More... | |
unsigned int | GetSegmentCount () const |
Get the number of line segments the polyline item has. More... | |
unsigned int | GetVertexCount () const |
Get the number of vertices the polyline item has. More... | |
bool | IsClosed () const |
Get whether of not the polyline item is closed. More... | |
void | PopEndPoint () |
Pop the end point off the polyline item. More... | |
void | SetPosition (const QPointF &_pos) |
Set the position of the polyline item. More... | |
void | SetThickness (double _thickness) |
Set the thickness of the polyline item. More... | |
void | SetVertexPosition (unsigned int _index, const QPointF &_pos) |
Set the position of a vertex of the polyline item. More... | |
void | ShowHandles (bool _show) |
Show the grabber handles of the polyline item. More... | |
void | TranslateVertex (unsigned int _index, const QPointF &_trans) |
Translate a vertex of the polyline item. More... | |
void | Update () |
Update by calling all line segments' Update function which emits Qt signals. More... | |
Public Member Functions inherited from gazebo::gui::EditorItem | |
EditorItem () | |
Constructor. More... | |
~EditorItem () | |
Destructor. More... | |
virtual std::string | GetName () const |
Get the name of the editor item. More... | |
virtual QVector3D | GetScenePosition () const |
Get the scene position of editor item. More... | |
virtual double | GetSceneRotation () const |
Get the scene rotation of the editor item. More... | |
virtual QVector3D | GetSize () const |
Get the size of the item in pixels. More... | |
virtual std::string | GetType () const |
Get the type of the editor item. More... | |
virtual void | SetName (const std::string &_name) |
Set the name of this editor item. More... | |
Protected Member Functions | |
void | DrawBoundingBox (QPainter *_painter) |
Draw bounding box. More... | |
Protected Attributes | |
bool | closed |
True to indicate that the polyline is closed. More... | |
std::vector< GrabberHandle * > | grabbers |
A list of grabber handles for this item, one on each vertex. More... | |
QPointF | segmentMouseMove |
Keep track of mouse press position for translating segments. More... | |
std::vector< LineSegmentItem * > | segments |
A list of line segments of the polyline. More... | |
Protected Attributes inherited from gazebo::gui::EditorItem | |
std::string | editorType |
Type of editor item. More... | |
std::string | name |
Name of editor item. More... | |
Additional Inherited Members | |
Signals inherited from gazebo::gui::EditorItem | |
void | DepthChanged (double _depth) |
Qt signal emitted when the editor item depth has changed. More... | |
void | HeightChanged (double _height) |
Qt signal emitted when the editor item height has changed. More... | |
void | ItemDeleted () |
Qt signal emitted when the editor item is being deleted. More... | |
void | PoseChanged (double _x, double _y, double _z, double _roll, double _pitch, double _yaw) |
Qt signal emitted when the editor item pose has changed. More... | |
void | PoseOriginTransformed (double _x, double _y, double _z, double _roll, double _pitch, double _yaw) |
Qt signal emitted when the editor item pose origin has changed. More... | |
void | PositionChanged (double _x, double _y, double _z) |
Qt signal emitted when the editor item position has changed. More... | |
void | PosXChanged (double _posX) |
Qt signal emitted when the editor item's X position has changed. More... | |
void | PosYChanged (double _posY) |
Qt signal emitted when the editor item's Y position has changed. More... | |
void | PosZChanged (double _posZ) |
Qt signal emitted when the editor item's Z position has changed. More... | |
void | RotationChanged (double _roll, double _pitch, double _yaw) |
Qt signal emitted when the editor item rotation has changed. More... | |
void | SizeChanged (double _width, double _depth, double _height) |
Qt signal emitted when the editor item size has changed. More... | |
void | WidthChanged (double _width) |
Qt signal emitted when the editor item width has changed. More... | |
void | YawChanged (double _yaw) |
Qt signal emitted when the editor item yaw rotation has changed. More... | |
2D polyline.
gazebo::gui::PolylineItem::PolylineItem | ( | const QPointF & | _start, |
const QPointF & | _end | ||
) |
Constructor param[in] _start Start position of the polyline item in pixel coordinates.
param[in] _start End position of the polyline item in pixel coordinates.
gazebo::gui::PolylineItem::~PolylineItem | ( | ) |
Destructor.
void gazebo::gui::PolylineItem::AddPoint | ( | const QPointF & | _point | ) |
Add a point to the polyline item.
[in] | _point | Point to add |
void gazebo::gui::PolylineItem::ClosePath | ( | ) |
Call the function to indicate that the start and end vertices are connected.
|
protected |
Draw bounding box.
[in] | _painter | Qt painter object. |
LineSegmentItem* gazebo::gui::PolylineItem::GetSegment | ( | unsigned int | _index | ) | const |
Get a line segment of the polyline item.
[in] | _index | Index of the line segment. |
unsigned int gazebo::gui::PolylineItem::GetSegmentCount | ( | ) | const |
Get the number of line segments the polyline item has.
unsigned int gazebo::gui::PolylineItem::GetVertexCount | ( | ) | const |
Get the number of vertices the polyline item has.
bool gazebo::gui::PolylineItem::IsClosed | ( | ) | const |
Get whether of not the polyline item is closed.
void gazebo::gui::PolylineItem::PopEndPoint | ( | ) |
Pop the end point off the polyline item.
void gazebo::gui::PolylineItem::SetPosition | ( | const QPointF & | _pos | ) |
Set the position of the polyline item.
[in] | _pos | Position in pixel coordinates. |
void gazebo::gui::PolylineItem::SetThickness | ( | double | _thickness | ) |
Set the thickness of the polyline item.
[in] | _thickness | Thickness in pixels. |
void gazebo::gui::PolylineItem::SetVertexPosition | ( | unsigned int | _index, |
const QPointF & | _pos | ||
) |
Set the position of a vertex of the polyline item.
[in] | _index | Index of the vertex. |
[in] | _pos | Position in pixel coordinates. |
void gazebo::gui::PolylineItem::ShowHandles | ( | bool | _show | ) |
Show the grabber handles of the polyline item.
[in] | _show | True to show the grabber handles, false to hide them. |
void gazebo::gui::PolylineItem::TranslateVertex | ( | unsigned int | _index, |
const QPointF & | _trans | ||
) |
Translate a vertex of the polyline item.
[in] | _index | Index of the vertex. |
[in] | _pos | Translation vector in pixels. |
void gazebo::gui::PolylineItem::Update | ( | ) |
Update by calling all line segments' Update function which emits Qt signals.
|
protected |
True to indicate that the polyline is closed.
|
protected |
A list of grabber handles for this item, one on each vertex.
|
protected |
Keep track of mouse press position for translating segments.
|
protected |
A list of line segments of the polyline.