maliput_viz
MaliputViewerPlugin Class Reference

Detailed Description

Loads a road geometry out of a xodr file or a yaml file.

Meshes are created and displayed in the scene provided by Scene3D plugin.

#include <src/maliput_viz/plugins/maliput_viewer_plugin.hh>

Inheritance diagram for MaliputViewerPlugin:
[legend]

Signals

void ListLanesChanged ()
 Signal emitted to update the id of the lanes in the table. More...
 
void RulesListChanged ()
 Signal emitted to update the rules of the selected lane. More...
 
void LaneInfoChanged ()
 Signal emitted to update the info about the clicked lane. More...
 
void LayerCheckboxesChanged ()
 Signal emitted to reset the checkboxes' state for the layers visualization when a new RoadNetwork is loaded. More...
 
void LabelCheckboxesChanged ()
 Signal emitted to reset the checkboxes' state for the label visualization when a new RoadNetwork is loaded. More...
 
void tableLaneIdSelection (int _index)
 Signal emitted to indicate which lane id in the table should be highlighted. More...
 

Public Member Functions

 MaliputViewerPlugin ()
 Default constructor. More...
 
void LoadConfig (const tinyxml2::XMLElement *_pluginElem) override
 Called by Ignition GUI when plugin is instantiated. More...
 
Q_INVOKABLE QStringList ListLanes () const
 Called when a new RoadNetwork is loaded to load the ids of the lanes into the table. More...
 
Q_INVOKABLE QString RulesList () const
 Called when a new lane is selected to load the lane's rules into the UI. More...
 
Q_INVOKABLE QString LaneInfo () const
 Called when a lane is clicked. Update info related to the clicked surface. More...
 
Q_INVOKABLE QList< bool > LayerCheckboxes () const
 Called when a new RoadNetwork is loaded to default the checkboxes' state in the layers selection panel for the meshes. More...
 
Q_INVOKABLE QList< bool > LabelCheckboxes () const
 Called when a new RoadNetwork is loaded to default the checkboxes' state in the label selection panel. More...
 

Protected Slots

void OnNewRoadNetwork ()
 Clears the visualizer and updates the GUI with meshes and labels using the new RoadNetwork. More...
 
void OnNewMeshLayerSelection (const QString &_layer, bool _state)
 Change the visibility of the layers. More...
 
void OnNewTextLabelSelection (const QString &_label, bool _state)
 Change the visibility of the labels. More...
 
void OnTableLaneIdSelection (int _index)
 Manages the selection of lanes id from the table. More...
 
void OnPhaseSelection (const QModelIndex &_index)
 Manages the selection of phase from the phase ring tree view. More...
 

Protected Member Functions

bool eventFilter (QObject *_obj, QEvent *_event) override
 Filters ignition::gui::events::LeftClickToScene to get the clicks events. More...
 
void timerEvent (QTimerEvent *_event) override
 Timer event callback which handles the logic to get the scene. More...
 

Properties

QList< bool > layerCheckboxes
 Property used to load the default state of layers visualization in its correspondant UI's checkboxes. More...
 
QList< bool > labelCheckboxes
 Property used to load the default state of labels visualization in its correspondant UI's checkboxes. More...
 
QStringList listLanes {}
 Property used to load the lanes id in the correspondant UI's table. More...
 
QString rulesList {}
 Property used to load the rules in the correspondant UI's area. More...
 
QString laneInfo {}
 Property used to load the info about the surface clicked in the correspondant UI's area. More...
 

Constructor & Destructor Documentation

◆ MaliputViewerPlugin()

Default constructor.

Member Function Documentation

◆ eventFilter()

bool eventFilter ( QObject _obj,
QEvent *  _event 
)
overrideprotected

Filters ignition::gui::events::LeftClickToScene to get the clicks events.

Filters ignition::gui::events::Render events to update the meshes and labels of the roads and the animation of the arrow mesh.

To make this method be called by Qt Event System, install the event filter in target object.

See also
QObject::installEventFilter() method.

◆ LabelCheckboxes()

QList< bool > LabelCheckboxes ( ) const

Called when a new RoadNetwork is loaded to default the checkboxes' state in the label selection panel.

◆ LabelCheckboxesChanged

void LabelCheckboxesChanged ( )
signal

Signal emitted to reset the checkboxes' state for the label visualization when a new RoadNetwork is loaded.

◆ LaneInfo()

QString LaneInfo ( ) const

Called when a lane is clicked. Update info related to the clicked surface.

◆ LaneInfoChanged

void LaneInfoChanged ( )
signal

Signal emitted to update the info about the clicked lane.

◆ LayerCheckboxes()

QList< bool > LayerCheckboxes ( ) const

Called when a new RoadNetwork is loaded to default the checkboxes' state in the layers selection panel for the meshes.

◆ LayerCheckboxesChanged

void LayerCheckboxesChanged ( )
signal

Signal emitted to reset the checkboxes' state for the layers visualization when a new RoadNetwork is loaded.

◆ ListLanes()

QStringList ListLanes ( ) const

Called when a new RoadNetwork is loaded to load the ids of the lanes into the table.

◆ ListLanesChanged

void ListLanesChanged ( )
signal

Signal emitted to update the id of the lanes in the table.

◆ LoadConfig()

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

Called by Ignition GUI when plugin is instantiated.

Parameters
[in]_pluginElemXML configuration for this plugin.

◆ OnNewMeshLayerSelection

void OnNewMeshLayerSelection ( const QString &  _layer,
bool  _state 
)
protectedslot

Change the visibility of the layers.

Parameters
[in]_layerThe layer to change its visibility.
[in]_stateThe state of the visibility checkbox.

◆ OnNewRoadNetwork

void OnNewRoadNetwork ( )
protectedslot

Clears the visualizer and updates the GUI with meshes and labels using the new RoadNetwork.

◆ OnNewTextLabelSelection

void OnNewTextLabelSelection ( const QString &  _label,
bool  _state 
)
protectedslot

Change the visibility of the labels.

Parameters
[in]_labelName of the label.
[in]_stateThe state of the visibility checkbox.

◆ OnPhaseSelection

void OnPhaseSelection ( const QModelIndex &  _index)
protectedslot

Manages the selection of phase from the phase ring tree view.

Parameters
[in]_indexCorrespondant to the position of the row in the tree view.

◆ OnTableLaneIdSelection

void OnTableLaneIdSelection ( int  _index)
protectedslot

Manages the selection of lanes id from the table.

Parameters
[in]_indexCorrespondant to the position of the row in the table.

◆ RulesList()

QString RulesList ( ) const

Called when a new lane is selected to load the lane's rules into the UI.

◆ RulesListChanged

void RulesListChanged ( )
signal

Signal emitted to update the rules of the selected lane.

◆ tableLaneIdSelection

void tableLaneIdSelection ( int  _index)
signal

Signal emitted to indicate which lane id in the table should be highlighted.

◆ timerEvent()

void timerEvent ( QTimerEvent *  _event)
overrideprotected

Timer event callback which handles the logic to get the scene.

Property Documentation

◆ labelCheckboxes

QList<bool> labelCheckboxes
read

Property used to load the default state of labels visualization in its correspondant UI's checkboxes.

◆ laneInfo

QString laneInfo {}
read

Property used to load the info about the surface clicked in the correspondant UI's area.

Holds the info about the clicked surface that is displayed in the UI.

◆ layerCheckboxes

QList<bool> layerCheckboxes
read

Property used to load the default state of layers visualization in its correspondant UI's checkboxes.

◆ listLanes

QStringList listLanes {}
read

Property used to load the lanes id in the correspondant UI's table.

Holds the lanes id that are shown in the table.

The order in this collection will affect the order that the lanes id are displayed in the table.

◆ rulesList

QString rulesList {}
read

Property used to load the rules in the correspondant UI's area.

Holds the rules of the last selected lane that are displayed in the UI.


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