maliput_viz
Selector Class Reference

Detailed Description

Selects lanes and outlines them with red cubes along the sides of the lane.

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

Public Member Functions

 Selector (ignition::rendering::ScenePtr &_scene, double _scaleX, double _scaleY, double _scaleZ, int _poolSize, int _numLanes, double _minTolerance)
 Initializes the pool of red cubes to be used for selecting lanes. More...
 
 ~Selector ()=default
 Destructor. Cube's destruction will be in charge of the scene's destructor. More...
 
void SelectLane (const maliput::api::Lane *_lane)
 Selects _lane's mesh when it is not selected, or deselects it when it is selected. More...
 
void SetVisibility (bool _visible)
 Hides every cube used and resets the cache. More...
 
void DeselectAll ()
 Deselects all selected regions by calling ResetPopulationMap(), ClearSelectedBranchPoints() and ClearSelectedLanes() More...
 
std::vector< std::string > GetSelectedLanes ()
 Gets the currently selected lanes as a string vector. More...
 
std::vector< std::string > GetSelectedBranchPoints ()
 Gets the currently selected BranchPoints as a string vector. More...
 
bool IsSelected (const maliput::api::Lane *_lane)
 Finds if the passed in lane is currently selected or not. More...
 
bool IsSelected (const std::string &_id)
 Finds if mesh corresponding to the id is currently selected or not. More...
 

Constructor & Destructor Documentation

◆ Selector()

Selector ( ignition::rendering::ScenePtr &  _scene,
double  _scaleX,
double  _scaleY,
double  _scaleZ,
int  _poolSize,
int  _numLanes,
double  _minTolerance 
)

Initializes the pool of red cubes to be used for selecting lanes.

Parameters
[in]_scenePointer to the scene where cubes will live.
[in]_scaleXScale factor for the X axis. This value multiplied by two will be used if tolerance is lower than the length of the cube in the X axis of each cube.
[in]_scaleYScale factor for the Y axis of each cube.
[in]_scaleZScale fator for the Z axis of each cube.
[in]_poolSizeAmount of cubes to be used for outlining.
[in]_numLanesThe number of lanes to auto-initialize visuals for
[in]_minToleranceDistance between cubes.

◆ ~Selector()

~Selector ( )
default

Destructor. Cube's destruction will be in charge of the scene's destructor.

Member Function Documentation

◆ DeselectAll()

void DeselectAll ( )

Deselects all selected regions by calling ResetPopulationMap(), ClearSelectedBranchPoints() and ClearSelectedLanes()

◆ GetSelectedBranchPoints()

std::vector< std::string > GetSelectedBranchPoints ( )

Gets the currently selected BranchPoints as a string vector.

Returns
A vector of the branch_point_id's which are selected.

◆ GetSelectedLanes()

std::vector< std::string > GetSelectedLanes ( )

Gets the currently selected lanes as a string vector.

Returns
A vector of the lane_id's which are selected.

◆ IsSelected() [1/2]

bool IsSelected ( const maliput::api::Lane *  _lane)

Finds if the passed in lane is currently selected or not.

Parameters
[in]_laneLane to be evaluated.
Returns
Boolean that determines whether the lane is selected or not.

◆ IsSelected() [2/2]

bool IsSelected ( const std::string &  _id)

Finds if mesh corresponding to the id is currently selected or not.

Parameters
[in]_idThe id to be evaluated.
Returns
Boolean that determines whether the mesh is selected or not.

◆ SelectLane()

void SelectLane ( const maliput::api::Lane *  _lane)

Selects _lane's mesh when it is not selected, or deselects it when it is selected.

Parameters
[in]_laneLane to be outlined.

◆ SetVisibility()

void SetVisibility ( bool  _visible)

Hides every cube used and resets the cache.

Parameters
[in]_visibleBoolean that determines the visibility of the outlining.

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