Gazebo Gui

API Reference

6.8.0

Provides buttons for the tape measure tool. More...

#include <TapeMeasure.hh>

Public Slots

double Distance ()
 Callback in Qt thread to get the distance to display in the gui window. More...
 
void OnMeasure ()
 Callback in Qt thread when the new measurement button is clicked. More...
 
void OnReset ()
 Callback in Qt thread when the reset button is clicked. More...
 

Signals

void newDistance ()
 Signal fired when a new tape measure distance is set. More...
 

Public Member Functions

 TapeMeasure ()
 Constructor. More...
 
 ~TapeMeasure () override
 Destructor. More...
 
void DeleteMarker (int _id)
 Deletes the marker with the provided id within the "tape_measure" namespace. More...
 
void DrawLine (int _id, gz::math::Vector3d &_startPoint, gz::math::Vector3d &_endPoint, gz::math::Color &_color)
 Draws a line marker. Called to display the line between the start and end point of the tape measure. More...
 
void DrawPoint (int _id, gz::math::Vector3d &_point, gz::math::Color &_color)
 Draws a point marker. Called to display the start and end point of the tape measure. More...
 
void LoadConfig (const tinyxml2::XMLElement *_pluginElem) override
 Load the plugin with a configuration file. Override this on custom plugins to handle custom configurations. More...
 
void Measure ()
 Starts a new measurement. Erases any previous measurement in progress or already made. More...
 
void Reset ()
 Resets all of the relevant data for this plugin. Called when the user clicks the reset button and when the user starts a new measurement. More...
 
- Public Member Functions inherited from Plugin
 Plugin ()
 Constructor. More...
 
virtual ~Plugin ()
 Destructor. More...
 
QQuickItem * CardItem () const
 Get the card item which contains this plugin. The item is generated the first time this function is run. More...
 
virtual std::string ConfigStr ()
 Get the configuration XML as a string. More...
 
QQmlContext * Context () const
 Get the QML context where the plugin was created. More...
 
bool DeleteLaterRequested () const
 Get the value of the the delete_later element from the configuration file, which defaults to false. More...
 
void Load (const tinyxml2::XMLElement *_pluginElem)
 Load the plugin with a configuration file. This loads the default parameters and then calls LoadConfig(), which should be overridden to load custom parameters. More...
 
QQuickItem * PluginItem () const
 Get the plugin item. More...
 
void PostParentChanges ()
 Apply changes which should come after the plugin already has a parent. More...
 
virtual std::string Title () const
 Get title. More...
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
virtual ~QObject ()
 
bool blockSignals (bool block)
 
QObjectchild (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArraydynamicPropertyNames () const
 
virtual bool event (QEvent *e)
 
findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObjectparent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThreadthread () const
 

Protected Member Functions

bool eventFilter (QObject *_obj, QEvent *_event) override
 
- Protected Member Functions inherited from Plugin
void DeleteLater ()
 Wait until the plugin has a parent, then close and delete the parent. More...
 
- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObjectsender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Protected Attributes inherited from Plugin
std::string configStr
 XML configuration. More...
 
std::string title = ""
 Title to be displayed on top of plugin. More...
 
- Properties inherited from QObject
 objectName
 

Detailed Description

Provides buttons for the tape measure tool.

Constructor & Destructor Documentation

◆ TapeMeasure()

Constructor.

◆ ~TapeMeasure()

~TapeMeasure ( )
override

Destructor.

Member Function Documentation

◆ DeleteMarker()

void DeleteMarker ( int  _id)

Deletes the marker with the provided id within the "tape_measure" namespace.

Parameters
[in]_idThe id of the marker

◆ Distance

double Distance ( )
slot

Callback in Qt thread to get the distance to display in the gui window.

Returns
The distance between the start and end point of the measurement

◆ DrawLine()

void DrawLine ( int  _id,
gz::math::Vector3d _startPoint,
gz::math::Vector3d _endPoint,
gz::math::Color &  _color 
)

Draws a line marker. Called to display the line between the start and end point of the tape measure.

Parameters
[in]_idThe id of the marker
[in]_startPointThe x, y, z coordinates of the line start point
[in]_endPointThe x, y, z coordinates of the line end point
[in]_colorThe rgba color to set the marker

◆ DrawPoint()

void DrawPoint ( int  _id,
gz::math::Vector3d _point,
gz::math::Color &  _color 
)

Draws a point marker. Called to display the start and end point of the tape measure.

Parameters
[in]_idThe id of the marker
[in]_pointThe x, y, z coordinates of where to place the marker
[in]_colorThe rgba color to set the marker

◆ eventFilter()

bool eventFilter ( QObject _obj,
QEvent _event 
)
overrideprotectedvirtual

Reimplemented from QObject.

◆ LoadConfig()

void LoadConfig ( const tinyxml2::XMLElement *  _pluginElem)
overridevirtual

Load the plugin with a configuration file. Override this on custom plugins to handle custom configurations.

Called when a plugin is first created. This function should not be blocking.

See also
Load
Parameters
[in]_pluginElemElement containing configuration

Reimplemented from Plugin.

◆ Measure()

void Measure ( )

Starts a new measurement. Erases any previous measurement in progress or already made.

◆ newDistance

void newDistance ( )
signal

Signal fired when a new tape measure distance is set.

◆ OnMeasure

void OnMeasure ( )
slot

Callback in Qt thread when the new measurement button is clicked.

◆ OnReset

void OnReset ( )
slot

Callback in Qt thread when the reset button is clicked.

◆ Reset()

void Reset ( )

Resets all of the relevant data for this plugin. Called when the user clicks the reset button and when the user starts a new measurement.


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