All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
gazebo::gui::PolylineItem Class Reference

2D polyline. More...

#include <PolylineItem.hh>

Inheritance diagram for gazebo::gui::PolylineItem:
Inheritance graph
[legend]
Collaboration diagram for gazebo::gui::PolylineItem:
Collaboration graph
[legend]

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...
 
LineSegmentItemGetSegment (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...
 

Detailed Description

2D polyline.

Constructor & Destructor Documentation

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.

Member Function Documentation

void gazebo::gui::PolylineItem::AddPoint ( const QPointF &  _point)

Add a point to the polyline item.

Parameters
[in]_pointPoint to add
void gazebo::gui::PolylineItem::ClosePath ( )

Call the function to indicate that the start and end vertices are connected.

void gazebo::gui::PolylineItem::DrawBoundingBox ( QPainter *  _painter)
protected

Draw bounding box.

Parameters
[in]_painterQt painter object.
LineSegmentItem* gazebo::gui::PolylineItem::GetSegment ( unsigned int  _index) const

Get a line segment of the polyline item.

Parameters
[in]_indexIndex of the line segment.
unsigned int gazebo::gui::PolylineItem::GetSegmentCount ( ) const

Get the number of line segments the polyline item has.

Returns
Number of line segments
unsigned int gazebo::gui::PolylineItem::GetVertexCount ( ) const

Get the number of vertices the polyline item has.

Returns
Number of vertices
bool gazebo::gui::PolylineItem::IsClosed ( ) const

Get whether of not the polyline item is closed.

Returns
True if the polyline item is closed, false otherwise.
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.

Parameters
[in]_posPosition in pixel coordinates.
void gazebo::gui::PolylineItem::SetThickness ( double  _thickness)

Set the thickness of the polyline item.

Parameters
[in]_thicknessThickness in pixels.
void gazebo::gui::PolylineItem::SetVertexPosition ( unsigned int  _index,
const QPointF &  _pos 
)

Set the position of a vertex of the polyline item.

Parameters
[in]_indexIndex of the vertex.
[in]_posPosition in pixel coordinates.
void gazebo::gui::PolylineItem::ShowHandles ( bool  _show)

Show the grabber handles of the polyline item.

Parameters
[in]_showTrue 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.

Parameters
[in]_indexIndex of the vertex.
[in]_posTranslation vector in pixels.
void gazebo::gui::PolylineItem::Update ( )

Update by calling all line segments' Update function which emits Qt signals.

Member Data Documentation

bool gazebo::gui::PolylineItem::closed
protected

True to indicate that the polyline is closed.

std::vector<GrabberHandle *> gazebo::gui::PolylineItem::grabbers
protected

A list of grabber handles for this item, one on each vertex.

QPointF gazebo::gui::PolylineItem::segmentMouseMove
protected

Keep track of mouse press position for translating segments.

std::vector<LineSegmentItem*> gazebo::gui::PolylineItem::segments
protected

A list of line segments of the polyline.


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