Ignition Gui

API Reference

5.0.0
ignition::gui Namespace Reference

Namespaces

 events
 Namespace for all events.
 
 plugins
 

Classes

class  Application
 An Ignition GUI application loads a QML engine and provides an API to load plugins and configuration files. The application supports either running a single main window or several plugins as standalone dialogs. More...
 
class  Dialog
 Gui plugin. More...
 
class  DragDropModel
 Customized item model so that we can pass along an URI query as MIME information during a drag-drop. More...
 
class  KeyPublisher
 Publish keyboard stokes to "keyboard/keypress" topic. More...
 
class  MainWindow
 The main window class creates a QQuickWindow and acts as an interface which provides properties and functions which can be called from MainWindow.qml. More...
 
class  PlotData
 Plot Data containter to hold value and registered charts Can be a Field or a PlotComponent Used by PlottingInterface and Gazebo Plotting. More...
 
class  PlottingInterface
 Plotting Interface Responsible for plotting transport msgs-fields Used by TransportPlotting Plugin & GazeboPlotting Plugin Accepts dragged items from TopicViewer Plugin & ComponentInspector Plugin. More...
 
class  Plugin
 Base class for Ignition GUI plugins. More...
 
class  SearchModel
 Customize the proxy model to display search results. More...
 
class  Topic
 Plotting Topic to handle published topics & their registered fields. More...
 
class  Transport
 Handle transport topics subscribing for one object (Chart) More...
 
struct  WindowConfig
 Holds configurations related to a MainWindow. More...
 

Enumerations

enum  DataRole { DISPLAY_NAME = Qt::UserRole + 100, URI_QUERY, TYPE, TO_EXPAND }
 Data roles. More...
 
enum  FileType { CSVFile, PDFFile }
 File types. More...
 
enum  NumberType { NONE, DOUBLE, INT, UINT }
 Number types. More...
 
enum  StringType { NONE, LINE, PLAIN_TEXT }
 String types. More...
 
enum  WindowType : int { kMainWindow = 0, kDialog = 1 }
 Type of window which the application will display. More...
 

Functions

ApplicationApp ()
 Get current running application, this is a cast of qGuiApp. More...
 
QColor convert (const math::Color &_color)
 Return the equivalent qt color. More...
 
math::Color convert (const QColor &_color)
 Return the equivalent ignition color. More...
 
QPointF convert (const math::Vector2d &_pt)
 Return the equivalent QPointF. More...
 
math::Vector2d convert (const QPointF &_pt)
 Return the equivalent ignition vector. More...
 
QVector3D convert (const math::Vector3d &_vec)
 Return the equivalent qt vector 3d. More...
 
math::Vector3d convert (const QVector3D &_vec)
 Return the equivalent ignition vector 3d. More...
 
common::MouseEvent convert (const QMouseEvent &_e)
 Return the equivalent ignition mouse event. More...
 
common::Time convert (const msgs::Time &_t)
 Convert an ignition::msgs::Time to an ignition::common::Time. More...
 
msgs::Time convert (const common::Time &_t)
 Convert an ignition::common::Time to an ignition::msgs::Time. More...
 
template<class T >
findFirstByProperty (const QList< T > _list, const char *_key, QVariant _value)
 Returns the first element on a QList which matches the given property. More...
 
std::string humanReadable (const std::string &_key)
 Create a human readable key, capitalizing the first letter and removing characters like "_". More...
 
void rangeFromKey (const std::string &_key, double &_min, double &_max)
 Returns the range for a given key. For example, the key "transparency" returns min == 0, max == 1. More...
 
StringType stringTypeFromKey (const std::string &_key)
 Returns the string type for a given key. For example, the key "innerxml" has a PLAIN_TEXT type while "name" is a LINE. More...
 
std::string uniqueFilePath (const std::string &_pathAndName, const std::string &_extension)
 Generates a path for a file which doesn't collide with existing files, by appending numbers to it (i.e. (0), (1), ...) More...
 
std::string unitFromKey (const std::string &_key, const std::string &_type="")
 Returns the unit for a given key. For example, the key "mass" returns "kg". More...
 
QStringList worldNames ()
 The main window's "worldNames" property may be filled with a list of the names of all worlds currently loaded. This information can be used by plugins to choose which world to work with. This helper function provides a handy access to the world names list. More...
 

Enumeration Type Documentation

◆ DataRole

enum DataRole

Data roles.

Enumerator
DISPLAY_NAME 

Text which is displayed for the user.

URI_QUERY 

URI including detailed query. This is the information carried during a drag-drop operation.

TYPE 

Data type name, such as "Double" or "Bool", or "model", "link". Used to specialize display according to type.

TO_EXPAND 

Flag indicating whether an item should be expanded or not.

◆ FileType

enum FileType

File types.

Enumerator
CSVFile 

Comma separated value (CSV)

PDFFile 

Portable document format (PDF)

◆ NumberType

enum NumberType
strong

Number types.

Enumerator
NONE 

Undefined type.

DOUBLE 

Double.

INT 

Integer.

UINT 

Unsigned integer.

◆ StringType

enum StringType
strong

String types.

Enumerator
NONE 

Undefined type.

LINE 

Use line for short strings which usually fit in a single line.

PLAIN_TEXT 

Use text for longer strings which span multiple lines.

◆ WindowType

enum WindowType : int
strong

Type of window which the application will display.

Enumerator
kMainWindow 

A main window, which may contain top-level menus and multiple plugins.

kDialog 

One independent dialog per plugin.

Function Documentation

◆ App()

Application* ignition::gui::App ( )

Get current running application, this is a cast of qGuiApp.

Returns
Pointer to running application, or nullptr if none is running.

◆ convert() [1/9]

QColor ignition::gui::convert ( const math::Color &  _color)

Return the equivalent qt color.

Parameters
[in]_colorIgnition color to convert
Returns
Qt color value

◆ convert() [2/9]

math::Color ignition::gui::convert ( const QColor _color)

Return the equivalent ignition color.

Parameters
[in]_colorQt color to convert
Returns
Ignition color value

◆ convert() [3/9]

QPointF ignition::gui::convert ( const math::Vector2d &  _pt)

Return the equivalent QPointF.

Parameters
[in]_ptIgnition vector to convert.
Returns
QPointF.

◆ convert() [4/9]

math::Vector2d ignition::gui::convert ( const QPointF _pt)

Return the equivalent ignition vector.

Parameters
[in]_ptQPointF to convert
Returns
Ignition Vector2d.

◆ convert() [5/9]

QVector3D ignition::gui::convert ( const math::Vector3d &  _vec)

Return the equivalent qt vector 3d.

Parameters
[in]_vecIgnition vector 3d to convert.
Returns
Qt vector 3d value.

◆ convert() [6/9]

math::Vector3d ignition::gui::convert ( const QVector3D _vec)

Return the equivalent ignition vector 3d.

Parameters
[in]_vecQt vector 3d to convert.
Returns
Ignition vector 3d value

◆ convert() [7/9]

common::MouseEvent ignition::gui::convert ( const QMouseEvent _e)

Return the equivalent ignition mouse event.

Note that there isn't a 1-1 mapping between these types, so fields such as common::MouseEvent::PressPos need to be set afterwards.

Parameters
[in]_eQt mouse event
Returns
Ignition mouse event

◆ convert() [8/9]

common::Time ignition::gui::convert ( const msgs::Time &  _t)

Convert an ignition::msgs::Time to an ignition::common::Time.

Parameters
[in]_tThe time to convert
Returns
An ignition::common::Time object
Deprecated:
Use ignition::msgs:Convert to std::chrono::steady_clock::time_point

◆ convert() [9/9]

msgs::Time ignition::gui::convert ( const common::Time &  _t)

Convert an ignition::common::Time to an ignition::msgs::Time.

Parameters
[in]_tThe time to convert
Returns
An ignition::msgs::Time object
Deprecated:
Use ignition::msgs:Convert to std::chrono::steady_clock::time_point

◆ findFirstByProperty()

T ignition::gui::findFirstByProperty ( const QList< T >  _list,
const char *  _key,
QVariant  _value 
)

Returns the first element on a QList which matches the given property.

Parameters
[in]_listThe list to search through.
[in]_keyThe property key value.
[in]_valueThe property value.
Returns
The first matching element.

◆ humanReadable()

std::string ignition::gui::humanReadable ( const std::string _key)

Create a human readable key, capitalizing the first letter and removing characters like "_".

Parameters
[in]_keyNon-human-readable key.
Returns
Human-readable key.

◆ rangeFromKey()

void ignition::gui::rangeFromKey ( const std::string _key,
double &  _min,
double &  _max 
)

Returns the range for a given key. For example, the key "transparency" returns min == 0, max == 1.

Parameters
[in]_keyThe key.
[out]_minThe minimum value.
[out]_maxThe maximum value.

◆ stringTypeFromKey()

StringType ignition::gui::stringTypeFromKey ( const std::string _key)

Returns the string type for a given key. For example, the key "innerxml" has a PLAIN_TEXT type while "name" is a LINE.

Parameters
[in]_keyThe key.
Returns
The string type.

◆ uniqueFilePath()

std::string ignition::gui::uniqueFilePath ( const std::string _pathAndName,
const std::string _extension 
)

Generates a path for a file which doesn't collide with existing files, by appending numbers to it (i.e. (0), (1), ...)

Parameters
[in]_pathAndNameFull absolute path and file name up to the file extension.
[in]_extensionFile extension, such as "pdf".
Returns
Full path, with name and extension, which doesn't collide with existing files

◆ unitFromKey()

std::string ignition::gui::unitFromKey ( const std::string _key,
const std::string _type = "" 
)

Returns the unit for a given key. For example, the key "mass" returns "kg".

Parameters
[in]_keyThe key.
[in]_typeIn case the key may have more than one type, the type must be given too. For example, a prismatic joint will have different units from a revolute joint.
Returns
The unit.

◆ worldNames()

QStringList ignition::gui::worldNames ( )

The main window's "worldNames" property may be filled with a list of the names of all worlds currently loaded. This information can be used by plugins to choose which world to work with. This helper function provides a handy access to the world names list.

Returns
List of world names, as stored in the MainWindow's "worldNames" property.