DHART
Loading...
Searching...
No Matches
HF::GraphGenerator::GeometryFlagMap Struct Reference

Manages rules and ids for different types of geometry in the graph generator. More...

#include <graph_generator.h>

+ Collaboration diagram for HF::GraphGenerator::GeometryFlagMap:

Public Member Functions

void SetGeometryIds (const std::vector< int > &obstacle_geometry, const std::vector< int > &walkable_geometry)
 Set geometry ids as being walkable or obstacles. More...
 
bool HasKey (int id) const
 Check if this id exists in the dictionary. More...
 
HIT_FLAG operator[] (int id) const
 Get the flag of the geometry in this hit dictionary. More...
 
void Set (int id, HIT_FLAG flag)
 Set the value of a key in the internal dictionary. More...
 

Public Attributes

GeometryFilterMode Mode = GeometryFilterMode::ALL_INTERSECTIONS
 Filter mode of this GeometryFlagMap. More...
 

Private Member Functions

void DetermineFilterMode (const std::vector< int > &walkable, const std::vector< int > &obstacle)
 Set the filter mode of this GeometryFlagMap based on the input types. More...
 

Private Attributes

hashmap internal_dictionary
 

Detailed Description

Manages rules and ids for different types of geometry in the graph generator.

See also
GeometryFilterMode for more info about each mode of this struct
HIT_FLAG for info about the different geometry flags
CheckGeometryID for using this struct to check the results of an intersection

Definition at line 157 of file graph_generator.h.

Member Function Documentation

◆ DetermineFilterMode()

void HF::GraphGenerator::GeometryFlagMap::DetermineFilterMode ( const std::vector< int > &  walkable,
const std::vector< int > &  obstacle 
)
inlineprivate

Set the filter mode of this GeometryFlagMap based on the input types.

Parameters
walkableArray of walkable geometry IDs
obstacleArray of obstacle geometry IDs

If the walkable array is empty, then set the mode to obstacles only. If the obstacle and the walkable arrays are empty set the mode to none If both obstacle and walkable arrays are specified, set this mode to obstacles and floors.

Postcondition
Sets the filter type for this hit_dict to the appropriate value for the number of elements in walkable and obstacle

Definition at line 176 of file graph_generator.h.

References HF::GraphGenerator::ALL_INTERSECTIONS, Mode, HF::GraphGenerator::OBSTACLES_AND_FLOORS, and HF::GraphGenerator::OBSTACLES_ONLY.

Referenced by SetGeometryIds().

+ Here is the caller graph for this function:

◆ HasKey()

bool HF::GraphGenerator::GeometryFlagMap::HasKey ( int  id) const
inline

Check if this id exists in the dictionary.

Parameters
idID to check for
Returns
True if the ID exists, false otherwise.

Definition at line 219 of file graph_generator.h.

References internal_dictionary.

Referenced by operator[]().

+ Here is the caller graph for this function:

◆ operator[]()

HIT_FLAG HF::GraphGenerator::GeometryFlagMap::operator[] ( int  id) const
inline

Get the flag of the geometry in this hit dictionary.

Parameters
idID of geometry to get the hitflag of
Returns
The flag assigned to id in SetGeometryIDs or HIT_FLAG::NO_FLAG if no flag was ever assigned to id
Remarks
Unlike the standard square brackets operator of std::unordered_map, this gaurantees no memory is allocated. Note that this can't be used to assign keys.

Definition at line 236 of file graph_generator.h.

References HasKey(), internal_dictionary, and HF::GraphGenerator::NO_FLAG.

+ Here is the call graph for this function:

◆ Set()

void HF::GraphGenerator::GeometryFlagMap::Set ( int  id,
HIT_FLAG  flag 
)
inline

Set the value of a key in the internal dictionary.

Parameters
idID to set as
Postcondition
Next call to [] for this object with id will return flag. If id already has been assigned a flag, the value will be updated to flag.

Definition at line 249 of file graph_generator.h.

References internal_dictionary.

Referenced by SetGeometryIds().

+ Here is the caller graph for this function:

◆ SetGeometryIds()

void HF::GraphGenerator::GeometryFlagMap::SetGeometryIds ( const std::vector< int > &  obstacle_geometry,
const std::vector< int > &  walkable_geometry 
)
inline

Set geometry ids as being walkable or obstacles.

Parameters
obstacle_geometryIDs of meshes to set as obstacles
walkable_geometryIDs of meshes to set as walkable
Postcondition
1) The filter mode for this hit_dict will be set to the appropriate value for the inputs
2) All geometry in obstacle_geometry will return HIT_FLAG::OBSTACLES when calling operator [] and all geometry in walkable_geometry will return HIT_FLAG::FLOORS when calling operator[]

Definition at line 200 of file graph_generator.h.

References DetermineFilterMode(), HF::GraphGenerator::FLOORS, HF::GraphGenerator::OBSTACLES, and Set().

Referenced by HF::GraphGenerator::GraphGenerator::GraphGenerator(), and HF::GraphGenerator::setupRT().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ internal_dictionary

hashmap HF::GraphGenerator::GeometryFlagMap::internal_dictionary
private

Definition at line 160 of file graph_generator.h.

Referenced by HasKey(), operator[](), and Set().

◆ Mode

GeometryFilterMode HF::GraphGenerator::GeometryFlagMap::Mode = GeometryFilterMode::ALL_INTERSECTIONS

Filter mode of this GeometryFlagMap.

Definition at line 189 of file graph_generator.h.

Referenced by HF::GraphGenerator::CheckGeometryID(), and DetermineFilterMode().


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