PLaSK library
|
This structure can refer to part of geometry tree. More...
#include <plask/geometry/object.hpp>
Public Member Functions | |
Subtree (shared_ptr< const GeometryObject > object=shared_ptr< const GeometryObject >()) | |
Construct a subtree witch is empty or has only one node. | |
Subtree (shared_ptr< const GeometryObject > object, const std::vector< Subtree > &children) | |
Construct a subtree. | |
Subtree (shared_ptr< const GeometryObject > object, std::vector< Subtree > &&children) | |
Construct subtree. | |
bool | hasBranches () const |
Check if this subtree includes more than one branch (has more than one children or has one child which has more than one branch). | |
Path | toLinearPath () const |
Convert this subtree to linear path: object, child[0].object, child[0].child[0].object, ... | |
Path | getLastPath () const |
Get last (last child is chosen at each level), linear path from subtree. | |
bool | empty () const |
Check if this subtree is empty (its object points to null). | |
Static Public Member Functions | |
static Subtree | extendIfNotEmpty (shared_ptr< const GeometryObject > root, Subtree &&children) |
Construct subtree which consists of given root object and children or empty object if children vector is empty. | |
static Subtree | extendIfNotEmpty (const GeometryObject *root, Subtree &&children) |
Construct subtree which consists of given root object and children or empty object if children vector is empty. | |
Public Attributes | |
shared_ptr< const GeometryObject > | object |
Geometry object. | |
std::vector< Subtree > | children |
Some (but not necessary all) children of object. | |
This structure can refer to part of geometry tree.
Definition at line 233 of file object.hpp.
|
inline |
Construct a subtree witch is empty or has only one node.
object | geometry object, or null pointer to construct an empty Subtree |
Definition at line 244 of file object.hpp.
|
inline |
Construct a subtree.
object | geometry object |
children | some (but not necessary all) children of object |
Definition at line 251 of file object.hpp.
|
inline |
Construct subtree.
object | geometry object |
children | some (but not necessary all) children of object |
Definition at line 259 of file object.hpp.
|
inline |
Check if this subtree is empty (its object points to null).
true
only if this subtree is empty. Definition at line 317 of file object.hpp.
|
inlinestatic |
Construct subtree which consists of given root
object and children
or empty object if children
vector is empty.
This method is used to make set of paths (subtree) longer if this set is not empty.
root | potential root of constructed subtree object |
children | potential children of root in constructed subtree |
root
object and children
or empty object if children
vector is empty Definition at line 286 of file object.hpp.
|
inlinestatic |
Construct subtree which consists of given root
object and children
or empty object if children
vector is empty.
This method is used to make set of paths (subtree) longer if this set is not empty.
root | potential root of constructed subtree object |
children | potential children of root in constructed subtree |
root
object and children
or empty object if children
vector is empty Definition at line 272 of file object.hpp.
Path plask::GeometryObject::Subtree::getLastPath | ( | ) | const |
Get last (last child is chosen at each level), linear path from subtree.
Definition at line 180 of file object.cpp.
bool plask::GeometryObject::Subtree::hasBranches | ( | ) | const |
Check if this subtree includes more than one branch (has more than one children or has one child which has more than one branch).
true
only if this subtree includes branches, false
if it is linear path Definition at line 158 of file object.cpp.
Path plask::GeometryObject::Subtree::toLinearPath | ( | ) | const |
Convert this subtree to linear path: object, child[0].object, child[0].child[0].object, ...
Throw exception if this subtree is not linear path (includes more than one branch).
Definition at line 167 of file object.cpp.
std::vector<Subtree> plask::GeometryObject::Subtree::children |
Some (but not necessary all) children of object.
Definition at line 238 of file object.hpp.
shared_ptr<const GeometryObject> plask::GeometryObject::Subtree::object |
Geometry object.
Definition at line 235 of file object.hpp.