maliput_viz
|
Model of the plugin.
Holds the information, as a map of meshes and materials.
#include <src/maliput_viz/plugins/maliput_viewer_model.hh>
Public Member Functions | |
MaliputViewerModel (std::unique_ptr< maliput::api::RoadNetwork > _roadNetwork) | |
Constructor. More... | |
~MaliputViewerModel ()=default | |
Destructor. More... | |
const std::map< std::string, std::unique_ptr< MaliputMesh > > & | Meshes () const |
Getter of the map of meshes. More... | |
const std::map< std::string, MaliputLabel > & | Labels () const |
Getter of the map of labels. More... | |
void | SetLayerState (const std::string &_key, bool _isVisible) |
Modifies the visualization state of key mesh. More... | |
void | SetTextLabelState (const std::string &_key, bool _isVisible) |
Modifies the visualization state of _type type text labels. More... | |
void | SetTextLabelState (MaliputLabelType _type, bool _isVisible) |
Modifies the visualization state of _type type text labels. More... | |
const maliput::api::Lane * | GetLaneFromWorldPosition (const ignition::math::Vector3d &_position) |
Get the lane associated with a point in world space if exists. More... | |
const maliput::api::RoadPositionResult | GetRoadPositionResult (const ignition::math::Vector3d &_position) |
Get the maliput::api::RoadPositionResult associated with a point in world space if exists. More... | |
const maliput::api::Lane * | GetLaneFromId (const std::string &_id) |
Get the lane associated with an id. More... | |
std::vector< const maliput::api::rules::TrafficLight * > | GetTrafficLights () const |
Get all the traffic lights from the underlying traffic light book that lives in the road network if any. More... | |
template<typename ContainerType > | |
ContainerType | GetNLanes (size_t _n) const |
Get N lanes from the underlying road geometry. More... | |
template<typename ContainerType > | |
ContainerType | GetAllLaneIds () const |
Get all the lanes that the road geometry posses. More... | |
template<typename StringType > | |
StringType | GetRulesOfLane (const std::string &_phaseRingId, const std::string &_phaseId, const std::string &_laneId) const |
Get all the rules for a given lane. More... | |
template<typename StringType > | |
std::unordered_map< std::string, std::vector< StringType > > | GetPhaseRings () const |
maliput::api::rules::BulbStates | GetBulbStates (const std::string &_phaseRingId, const std::string &_phaseId) const |
Get the state of all the bulbs for a given phase ring id and phase id. More... | |
MaliputViewerModel | ( | std::unique_ptr< maliput::api::RoadNetwork > | _roadNetwork | ) |
Constructor.
_roadNetwork | A maliput::api::RoadNetwork. |
|
default |
Destructor.
ContainerType GetAllLaneIds |
Get all the lanes that the road geometry posses.
ContainerType | A container class that must implement size(), push_back() and reserve() methods. See std::vector for further reference on each one of these methods. Its elements' type must be a string class that must be constructible with a single const char* argument and must support concatenation via operator+. |
maliput::api::rules::BulbStates GetBulbStates | ( | const std::string & | _phaseRingId, |
const std::string & | _phaseId | ||
) | const |
Get the state of all the bulbs for a given phase ring id and phase id.
[in] | _phaseRingId | Id of the desired phase ring to get the bulb states from. |
[in] | _phaseId | Id of the desired phase to get the bulb states from. |
const maliput::api::Lane * GetLaneFromId | ( | const std::string & | _id | ) |
Get the lane associated with an id.
[in] | _id | Id of the lane. |
const maliput::api::Lane * GetLaneFromWorldPosition | ( | const ignition::math::Vector3d & | _position | ) |
Get the lane associated with a point in world space if exists.
[in] | _position | World position of point that intersected with a plane |
ContainerType GetNLanes | ( | size_t | _n | ) | const |
Get N lanes from the underlying road geometry.
[in] | _n | Amount of lanes desired to get from the underlying road geometry. |
ContainerType | A container class that must implement size(), push_back() and reserve() methods. See std::vector for further reference on each one of these methods. Its elements' type must be a string class that must be constructible with a single const char* argument and must support concatenation via operator+. |
std::unordered_map< std::string, std::vector< StringType > > GetPhaseRings |
const maliput::api::RoadPositionResult GetRoadPositionResult | ( | const ignition::math::Vector3d & | _position | ) |
Get the maliput::api::RoadPositionResult associated with a point in world space if exists.
[in] | _position | World position of point that intersected with a plane |
StringType GetRulesOfLane | ( | const std::string & | _phaseRingId, |
const std::string & | _phaseId, | ||
const std::string & | _laneId | ||
) | const |
Get all the rules for a given lane.
[in] | _phaseRingId | Id of the desired phase ring to get the rules from. |
[in] | _phaseId | Id of the desired phase to get the rules from. |
[in] | _laneId | Id of the desired lane to get the rules from. |
StringType | A string class that must be constructible with a single const char* argument and must support concatenation via operator+. |
std::vector< const maliput::api::rules::TrafficLight * > GetTrafficLights | ( | ) | const |
Get all the traffic lights from the underlying traffic light book that lives in the road network if any.
const std::map< std::string, MaliputLabel > & Labels | ( | ) | const |
Getter of the map of labels.
const std::map< std::string, std::unique_ptr< MaliputMesh > > & Meshes | ( | ) | const |
Getter of the map of meshes.
void SetLayerState | ( | const std::string & | _key, |
bool | _isVisible | ||
) |
Modifies the visualization state of key
mesh.
[in] | _key | The name of the mesh. |
[in] | _isVisible | The new visualization status of the mesh. |
void SetTextLabelState | ( | const std::string & | _key, |
bool | _isVisible | ||
) |
Modifies the visualization state of _type
type text labels.
[in] | _key | The id of the lane or branch point. |
[in] | _isVisible | The new visualization status of the text label. |
void SetTextLabelState | ( | MaliputLabelType | _type, |
bool | _isVisible | ||
) |
Modifies the visualization state of _type
type text labels.
[in] | _type | The desired label type to target. |
[in] | _isVisible | The new visualization status of the text label. |