PLaSK library
|
Represent hints for path finder. More...
#include <plask/geometry/path.hpp>
Public Types | |
typedef std::map< weak_ptr< GeometryObject >, std::set< weak_ptr< GeometryObject > > > | HintMap |
Type for map: geometry object container -> object in container. | |
typedef Edge | Hint |
Type for arc in graph. | |
Public Member Functions | |
PathHints (const Hint &hint) | |
PathHints (const Path &path) | |
PathHints (const std::vector< shared_ptr< const GeometryObject > > &path) | |
Construct path hints with all hinst included in path . | |
PathHints (const GeometryObject::Subtree &subtree) | |
Construct path hints with all hinst included in subtree . | |
PathHints ()=default | |
Construct empty set of path hints. | |
void | addHint (const Hint &hint) |
Add hint to hints map. | |
bool | includes (shared_ptr< const GeometryObject > container, shared_ptr< const GeometryObject > child_tran) const |
Check if hint is included in this. | |
bool | includes (const Hint &hint) const |
Check if hint is included in this . | |
PathHints & | operator+= (const Hint &hint) |
Add hint to hints map. | |
bool | operator== (const PathHints &comp) const |
Comparison operator. | |
bool | operator< (const PathHints &comp) const |
Comparison operator for using PathHints as map keys. | |
void | addHint (weak_ptr< GeometryObject > container, weak_ptr< GeometryObject > child) |
Add hint to hints map. | |
void | addAllHintsFromPath (const std::vector< shared_ptr< const GeometryObject > > &pathObjects) |
Add all hinst included in path objects. | |
void | addAllHintsFromPath (const Path &path) |
Add all hinst included in path . | |
void | addAllHintsFromSubtree (const GeometryObject::Subtree &subtree) |
Add all hinst included in subtree . | |
std::set< shared_ptr< GeometryObject > > | getChildren (shared_ptr< const GeometryObject > container) |
Get children for given container. | |
std::set< shared_ptr< GeometryObject > > | getChildren (const GeometryObject &container) |
Get children for given container. | |
std::set< shared_ptr< GeometryObject > > | getChildren (shared_ptr< const GeometryObject > container) const |
Get child for given container. | |
std::set< shared_ptr< GeometryObject > > | getChildren (const GeometryObject &container) const |
Get child for given container. | |
template<int dim> | |
std::set< shared_ptr< Translation< dim > > > | getTranslationChildren (shared_ptr< const GeometryObject > container) |
Get child for given container casted to Translation object. | |
template<int dim> | |
std::set< shared_ptr< Translation< dim > > > | getTranslationChildren (const GeometryObject &container) |
Get child for given container casted to Translation object. | |
template<int dim> | |
std::set< shared_ptr< Translation< dim > > > | getTranslationChildren (shared_ptr< const GeometryObject > container) const |
Get child for given container casted to Translation object. | |
template<int dim> | |
std::set< shared_ptr< Translation< dim > > > | getTranslationChildren (const GeometryObject &container) const |
Get child for given container casted to Translation object. | |
void | cleanDeleted () |
Remove all hints which refer to deleted objects. | |
Static Public Member Functions | |
template<int dim> | |
static std::set< shared_ptr< Translation< dim > > > | castToTranslation (std::set< shared_ptr< GeometryObject > > src) |
Public Attributes | |
HintMap | hintFor |
Hints map. | |
Represent hints for path finder.
Hints are used to find unique path for all GeometryObject pairs, even if one of the pair object is inserted to the geometry graph in more than one place.
Each hint allows for chooseing one child for geometry object container and it is a pair: geometry object container -> object in container.
Typically, hints are returned by methods which adds new objects to containers.
typedef std::map<weak_ptr<GeometryObject>, std::set<weak_ptr<GeometryObject> > > plask::PathHints::HintMap |
|
inlineexplicit |
|
inlineexplicit |
|
default |
Construct empty set of path hints.
void plask::PathHints::addAllHintsFromPath | ( | const std::vector< shared_ptr< const GeometryObject > > & | pathObjects | ) |
void plask::PathHints::addAllHintsFromSubtree | ( | const GeometryObject::Subtree & | subtree | ) |
void plask::PathHints::addHint | ( | weak_ptr< GeometryObject > | container, |
weak_ptr< GeometryObject > | child | ||
) |
|
inlinestatic |
void plask::PathHints::cleanDeleted | ( | ) |
|
inline |
|
inline |
std::set< shared_ptr< GeometryObject > > plask::PathHints::getChildren | ( | shared_ptr< const GeometryObject > | container | ) |
std::set< shared_ptr< GeometryObject > > plask::PathHints::getChildren | ( | shared_ptr< const GeometryObject > | container | ) | const |
|
inline |
Get child for given container casted to Translation object.
container | container |
nullptr
if there is no hint or it cannot be casted
|
inline |
Get child for given container casted to Translation object.
container | container |
nullptr
if there is no hint or it cannot be casted
|
inline |
Get child for given container casted to Translation object.
container | container |
nullptr
if there is no hint or it cannot be casted
|
inline |
Get child for given container casted to Translation object.
container | container |
nullptr
if there is no hint or it cannot be casted bool plask::PathHints::includes | ( | shared_ptr< const GeometryObject > | container, |
shared_ptr< const GeometryObject > | child_tran | ||
) | const |