PLaSK library

Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Attributes | List of all members
plask::GeometryObjectD< dim > Struct Template Referenceabstract
Geometry Objects

Template of base roles for geometry objects in space with given number of dimensions (2 or 3). More...

`#include <plask/geometry/object.hpp>`

Inheritance diagram for plask::GeometryObjectD< dim >:
[legend]
Collaboration diagram for plask::GeometryObjectD< dim >:
[legend]

## Classes
struct | LineSegment
| Line segment represented by two unordered points. More...

## Public Types
typedef Primitive< dim >::Box | Box
typedef Primitive< dim >::DVec | DVec
Public Types inherited from plask::GeometryObject
enum | Type { TYPE_LEAF = 0 , TYPE_TRANSFORM = 1 , TYPE_SPACE_CHANGER = 2 , TYPE_CONTAINER = 3 , TYPE_GEOMETRY = 4 , TYPE_SEPARATOR = 5 }
| Type of geometry object. More...
typedef std::function< bool(const GeometryObject &)> | Predicate
| Predicate on GeometryObject.

## Public Member Functions
int | getDimensionsCount () const override
| Get number of dimensions.
virtual Subtree | getPathsAt (const DVec &point, bool all=false) const =0
| Find all paths to objects which lies at given `point`.
virtual bool | contains (const DVec &point) const =0
| Check if this geometry object contains point.
virtual Box | getBoundingBox () const =0
| Calculate minimal rectangle which contains all points of geometry object.
virtual DVec | getBoundingBoxSize () const
virtual Box | getRealBoundingBox () const
| Calculate minimal rectangle which contains all points of real geometry object.
virtual shared_ptr< Material > | getMaterial (const DVec &p) const =0
| Return material in a given point inside the geometry object.
shared_ptr< Material > | getMaterialOrAir (const DVec &p) const
| Return material in a given point inside the geometry object.
virtual void | getBoundingBoxesToVec (const GeometryObject::Predicate &predicate, std::vector< Box > &dest, const PathHints *path=0) const =0
| Calculate and append to vector bounding boxes of all nodes which fulfill given `predicate`, optionally marked by path.
void | getBoundingBoxesToVec (const GeometryObject::Predicate &predicate, std::vector< Box > &dest, const PathHints &path) const
| Calculate and append to vector bounding boxes of all nodes which fulfill given `predicate`, marked by path.
std::vector< Box > | getBoundingBoxes (const GeometryObject::Predicate &predicate, const PathHints *path=0) const
| Calculate the vector of bounding boxes of all nodes which fulfill given `predicate`, optionally marked by path.
std::vector< Box > | getBoundingBoxes (const GeometryObject::Predicate &predicate, const PathHints &path)
| Calculate the vector of bounding boxes of all nodes which fulfill given `predicate`, marked by path.
void | getLeafsBoundingBoxesToVec (std::vector< Box > &dest, const PathHints *path=0) const
| Calculate and append to vector bounding boxes of all leafs, optionally marked by path.
void | getLeafsBoundingBoxesToVec (std::vector< Box > &dest, const PathHints &path) const
| Calculate and append to vector bounding boxes of all leafs, marked by path.
std::vector< Box > | getLeafsBoundingBoxes (const PathHints *path=0) const
| Calculate bounding boxes of all leafs, optionally marked by path.
std::vector< Box > | getLeafsBoundingBoxes (const PathHints &path) const
| Calculate bounding boxes of all leafs, marked by path.
void | getObjectBoundingBoxesToVec (std::vector< Box > &dest, const GeometryObject &object, const PathHints *path=0) const
| Calculate and append to vector bounding boxes of all instances of given `object`, optionally marked by path.
void | getObjectBoundingBoxesToVec (std::vector< Box > &dest, const GeometryObject &object, const PathHints &path) const
| Calculate and append to vector bounding boxes of all instances of given `object`, marked by path.
std::vector< Box > | getObjectBoundingBoxes (const GeometryObject &object, const PathHints *path=0) const
| Calculate bounding boxes of all instances of given `object`, optionally marked by path.
std::vector< Box > | getObjectBoundingBoxes (const GeometryObject &object, const PathHints &path) const
| Calculate bounding boxes of all instances of given `objects`, marked by `path`.
virtual void | getPositionsToVec (const Predicate &predicate, std::vector< DVec > &dest, const PathHints *path=0) const =0
| Calculate and append to vector positions of all nodes which fulfill given `predicate`, optionally marked by path.
void | getPositionsToVec (const Predicate &predicate, std::vector< DVec > &dest, const PathHints &path) const
| Calculate and append to vector positions of all nodes which fulfill given `predicate`, marked by path.
std::vector< DVec > | getPositions (const Predicate &predicate, const PathHints *path=0) const
| Calculate and append to vector positions of all nodes which fulfill given `predicate`, optionally marked by path.
std::vector< DVec > | getPositions (const Predicate &predicate, const PathHints &path) const
| Calculate and append to vector positions of all nodes which fulfill given `predicate`, marked by path.
void | getLeafsPositionsToVec (std::vector< DVec > &dest, const PathHints *path=0) const
| Calculate and append to vector positions of all leafs, optionally marked by path.
void | getLeafsPositionsToVec (std::vector< DVec > &dest, const PathHints &path) const
| Calculate and append to vector positions of all leafs, marked by path.
std::vector< DVec > | getLeafsPositions (const PathHints *path=0) const
| Calculate and return a vector of positions of all leafs, optionally marked by path.
std::vector< DVec > | getLeafsPositions (const PathHints &path) const
| Calculate and return a vector of positions of all leafs, marked by path.
void | getObjectPositionsToVec (std::vector< DVec > &dest, const GeometryObject &object, const PathHints *path=0) const
| Calculate and append to vector positions of all instances of given `object`, optionally marked by path.
void | getObjectPositionsToVec (std::vector< DVec > &dest, const GeometryObject &object, const PathHints &path) const
| Calculate and append to vector positions of all instances of given `object`, marked by path.
std::vector< DVec > | getObjectPositions (const GeometryObject &object, const PathHints *path=0) const
| Calculate and return a vector of positions of all instances of given `object`, optionally marked by path.
std::vector< DVec > | getObjectPositions (const GeometryObject &object, const PathHints &path) const
| Calculate and return a vector of positions of all instances of given `object`, marked by path.
shared_ptr< const GeometryObject > | getMatchingAt (const DVec &point, const Predicate &predicate, const PathHints *path=0) const
| Get object closest to the root, which contains specific point and fulfills the predicate.
shared_ptr< const GeometryObject > | getMatchingAt (const DVec &point, const Predicate &predicate, const PathHints &path) const
| Get object closest to the root, which contains specific point and fulfills the predicate.
bool | objectIncludes (const GeometryObject &object, const PathHints *path, const DVec &point) const
| Check if specified geometry object contains a point point.
bool | objectIncludes (const GeometryObject &object, const PathHints &path, const DVec &point) const
| Check if specified geometry object contains a point point.
bool | objectIncludes (const GeometryObject &object, const DVec &point) const
| Check if specified geometry object contains a point point.
std::set< std::string > | getRolesAt (const DVec &point, const plask::PathHints *path=0) const
| Get a sum of roles sets of all objects which lies on path from this to leaf at given `point`.
std::set< std::string > | getRolesAt (const DVec &point, const plask::PathHints &path) const
| Get a sum of roles sets of all objects which lies on path from this to leaf at given `point`.
shared_ptr< const GeometryObject > | hasRoleAt (const std::string &role_name, const DVec &point, const plask::PathHints *path=0) const
| Check if any object at given `point`, not hidden by another object, plays role with given name `role_name` (if so, returns non-nullptr).
shared_ptr< const GeometryObject > | hasRoleAt (const std::string &role_name, const DVec &point, const plask::PathHints &path) const
| Check if any object at given `point`, not hidden by another object, plays role with given name `role_name` (if so, returns non-nullptr).
virtual void | addLineSegmentsToSet (std::set< LineSegment > &PLASK_UNUSED(segments), unsigned PLASK_UNUSED(max_steps), double PLASK_UNUSED(min_step_size)) const =0
| Add characteristic points to the set and edges connecting them.
std::set< LineSegment > | getLineSegments (unsigned max_steps=PLASK_GEOMETRY_MAX_STEPS, double min_step_size=PLASK_GEOMETRY_MIN_STEP_SIZE) const
| Add characteristic points to the set and edges connecting them.
virtual Subtree | getPathsTo (const GeometryObject &el, const PathHints *pathHints=0) const=0
| Find paths to el.
Public Member Functions inherited from plask::GeometryObject
void | setMaxSteps (unsigned value)
| Set max_steps.
void | setMinStepSize (double value)
| Set min_step_size.
template<typename ClassT , typename methodT >
boost::signals2::connection | changedConnectMethod (ClassT *obj, methodT method, boost::signals2::connect_position at=boost::signals2::at_back)
| Connect a method to changed signal.
template<typename ClassT , typename methodT >
void | changedDisconnectMethod (ClassT *obj, methodT method)
| Disconnect a method from changed signal.
template<typename EventT = Event, typename... Args>
void | fireChanged (Args &&... event_constructor_params_without_source)
| Call changed with this as event source.
| GeometryObject (const GeometryObject &to_copy)
| Initialize this to be the same as `to_copy` but doesn't have any changes observer.
GeometryObject & | operator= (const GeometryObject &to_copy)
| Set this to be the same as `to_copy` but doesn't change changes observer.
| GeometryObject ()
| GeometryObject (unsigned max_steps, double min_step_size)
virtual | ~GeometryObject ()
| Virtual destructor.
virtual std::string | getTypeName () const =0
| Get name of object type (like: "block2d", "shelf", "stack3d", etc.).
virtual void | writeXML (XMLWriter::Element &parent_xml_object, WriteXMLCallback &write_cb, AxisNames parent_axes) const
| Write geometry tree branch rooted by this to XML.
void | writeXML (XMLWriter::Element &parent_xml_object, WriteXMLCallback &write_cb) const
| Write geometry tree branch rooted by this to XML.
void | writeXML (XMLWriter::Element &parent_xml_object) const
| Write geometry tree branch rooted by this to XML.
template<int DIMS>
shared_ptr< GeometryObjectD< DIMS > > | asD ()
| Cast this to GeometryObjectD<DIMS>.
template<int DIMS>
shared_ptr< const GeometryObjectD< DIMS > > | asD () const
| Cast this to GeometryObjectD<DIMS> (const version).
shared_ptr< Geometry > | asGeometry ()
| Cast this to Geometry.
shared_ptr< const Geometry > | asGeometry () const
| Cast this to Geometry.
virtual Type | getType () const =0
| Check if geometry is: leaf, transform or container type object.
bool | isLeaf () const
bool | isTransform () const
bool | isSpaceChanger () const
bool | isContainer () const
bool | isGeometry () const
virtual void | addPointsAlongToSet (std::set< double > &points, Primitive< 3 >::Direction PLASK_UNUSED(direction), unsigned PLASK_UNUSED(max_steps), double PLASK_UNUSED(min_step_size)) const =0
| Add characteristic points information along specified axis to set.
std::set< double > | getPointsAlong (Primitive< 3 >::Direction direction, unsigned max_steps=PLASK_GEOMETRY_MAX_STEPS, double min_step_size=PLASK_GEOMETRY_MIN_STEP_SIZE) const
| Get characteristic points information along specified axis.
bool | hasRole (std::string role_name) const
| Check if this object belongs to class (has tag) with name `role_name`.
void | addRole (std::string role_name)
| Add this to given class.
void | removeRole (std::string role_name)
| Remove this from given class, do nothing if this is not in given class.
void | clearRoles ()
| Clear set of roles of this.
virtual void | validate () const
| Check if object is ready for calculation.
virtual bool | hasInSubtree (const GeometryObject &el) const
| Check if el is in subtree with `this` in root.
bool | hasInSubtree (const GeometryObject &el, const PathHints *pathHints) const
bool | hasInSubtree (shared_ptr< const GeometryObject > el, const PathHints *pathHints) const
virtual void | getObjectsToVec (const Predicate &predicate, std::vector< shared_ptr< const GeometryObject > > &dest, const PathHints *path=0) const =0
| Append all objects from subtree with this in root, which fulfill predicate to vector `dest`.
void | getObjectsToVec (const Predicate &predicate, std::vector< shared_ptr< const GeometryObject > > &dest, const PathHints &path) const
| Append all objects from subtree with this in root, which fulfill predicate to vector `dest`.
std::vector< shared_ptr< const GeometryObject > > | getObjects (const Predicate &predicate, const PathHints *path=0) const
| Get vector of all objects from subtree with this in root, which fulfill predicate.
std::vector< shared_ptr< const GeometryObject > > | getObjects (const Predicate &predicate, const PathHints &path) const
| Get vector of all objects from subtree with this in root, which fulfill predicate.
void | getLeafsToVec (std::vector< shared_ptr< const GeometryObject > > &dest, const PathHints *path=0) const
| Append all leafs in subtree with this in root to vector `dest`.
void | getLeafsToVec (std::vector< shared_ptr< const GeometryObject > > &dest, const PathHints &path) const
| Append all leafs in subtree with this in root to vector `dest`.
std::vector< shared_ptr< const GeometryObject > > | getLeafs (const PathHints *path=0) const
| Get all leafs in subtree with this object as root.
std::vector< shared_ptr< const GeometryObject > > | getLeafs (const PathHints &path) const
| Get all leafs in subtree with this object as root.
void | getObjectsWithRoleToVec (const std::string &role, std::vector< shared_ptr< const GeometryObject > > &dest) const
| Append all objects with a specified role in subtree with this in root to vector `dest`.
std::vector< shared_ptr< const GeometryObject > > | getObjectsWithRole (const std::string &role) const
| Get all objects with a specified role in subtree with this object as root.
virtual std::size_t | getChildrenCount () const =0
| Get number of all children of this in geometry graph.
virtual shared_ptr< GeometryObject > | getChildNo (std::size_t child_no) const =0
| Get child with given index.
virtual std::size_t | getRealChildrenCount () const
| Get number of real (physically stored) children in geometry graph.
virtual shared_ptr< GeometryObject > | getRealChildNo (std::size_t child_no) const
| Get real (physically stored) child with given index.
virtual void | removeAtUnsafe (std::size_t index)
| Remove child at given `index`.
void | removeAt (std::size_t index)
| Remove child at given `index`.
void | removeRangeUnsafe (std::size_t index_begin, std::size_t index_end)
bool | removeRange (std::size_t index_begin, std::size_t index_end)
| Remove all children in given range [index_begin, index_end).
virtual void | forEachRealObjectInSubtree (std::function< bool(const GeometryObject &)> callback) const
| Call a `callback` for each object in subtree with `this` in root.
FunctorIndexedIterator< ChildGetter > | begin () const
FunctorIndexedIterator< ChildGetter > | end () const
virtual shared_ptr< const GeometryObject > | changedVersion (const Changer &changer, Vec< 3, double > *translation=0) const =0
| Get this or copy of this with some changes in subtree.
virtual shared_ptr< GeometryObject > | shallowCopy () const =0
| Get shallow copy of this.
virtual shared_ptr< GeometryObject > | deepCopy (std::map< const GeometryObject *, shared_ptr< GeometryObject > > &copied) const =0
| Get deep copy of this.
shared_ptr< GeometryObject > | deepCopy ()
| Get deep copy of this.
bool | canHasAsChild (const GeometryObject &potential_child) const
bool | canHasAsParent (const GeometryObject &potential_parent) const
void | ensureCanHasAsParent (const GeometryObject &potential_parent) const
| Throw CyclicReferenceException if `potential_parent` is in subtree with this in root.
void | ensureCanHaveAsChild (const GeometryObject &potential_child) const
| Throw CyclicReferenceException if `potential_child` has this in subtree.

## Static Public Attributes
static const int | DIM = dim

## Additional Inherited Members
Static Public Member Functions inherited from plask::GeometryObject
static bool | PredicateIsLeaf (const GeometryObject &el)
| Predicate which check if given object is leaf.
Public Attributes inherited from plask::GeometryObject
unsigned | max_steps
| Maximum number of points to split a single leaf.
double | min_step_size
| Minimum distance between divisions for a single leaf.
std::set< std::string > | roles
| Roles/tags.
boost::signals2::signal< void(Event &)> | changed
| Changed signal, fired when object was changed.
Protected Member Functions inherited from plask::GeometryObject
virtual void | writeXMLAttr (XMLWriter::Element &dest_xml_object, const AxisNames &axes) const
| Append XML attributes of this to `dest_xml_object`.
virtual void | writeXMLChildren (XMLWriter::Element &dest_xml_object, WriteXMLCallback &write_cb, const AxisNames &axes) const
| Append all children of this to XML `dest_xml_object`.
void | ensureIsValidChildNr (std::size_t child_no, const char *method_name="getChildNo", const char *arg_name="child_no") const
| Check if given `index` is valid child index and throw exception of it is not.
void | ensureIsValidInsertPosition (std::size_t child_no, const char *method_name="insert", const char *arg_name="pos") const
| Check if given `index` is valid insert index and throw exception of it is not.
void | fireChildrenChanged ()
| Inform observers that children list was changed (also that this is resized)
void | fireChildrenRemoved (std::size_t beginIndex, std::size_t endIndex)
void | fireChildrenInserted (std::size_t beginIndex, std::size_t endIndex)

## Detailed Description

template<int dim>
struct plask::GeometryObjectD< dim >

Template of base roles for geometry objects in space with given number of dimensions (2 or 3).

Template Parameters

  dimensions | number of dimensions, 2 or 3

Definition at line 1147 of file object.hpp.

## Member Typedef Documentation

## ◆ Box

template<int dim>

typedef Primitive<dim>::Box plask::GeometryObjectD< dim >::Box

Definition at line 1149 of file object.hpp.

## ◆ DVec

template<int dim>

typedef Primitive<dim>::DVec plask::GeometryObjectD< dim >::DVec

Definition at line 1150 of file object.hpp.

## Member Function Documentation

## ◆ addLineSegmentsToSet()

template<int dim>

virtual void plask::GeometryObjectD< dim >::addLineSegmentsToSet | ( | std::set< LineSegment > & | PLASK_UNUSEDsegments,
|  | unsigned | PLASK_UNUSEDmax_steps,
|  | double | PLASK_UNUSEDmin_step_size
| ) |  | const
| pure virtual

Add characteristic points to the set and edges connecting them.

Parameters

  | max_steps | maximum number of points to split single leaf
  | min_step_size | minimum distance between divisions for a single leaf
  [in,out] | segments | set to extend

## ◆ contains()

template<int dim>

virtual bool plask::GeometryObjectD< dim >::contains | ( | const DVec & | point | ) | const
| pure virtual

Check if this geometry object contains point.

Parameters

  point | point in local coordinates

Returns
  true only if this geometry contains point p

Implemented in plask::Circle< dim >, plask::Clip< dim >, plask::Cylinder, plask::HollowCylinder, plask::Intersection< dim >, plask::ArrangeContainer< dim >, plask::Block< dim >, plask::Block< 3 >, plask::Flip< dim >, plask::Mirror< dim >, plask::Polygon, plask::TriangularPrism, plask::Prism, plask::GeometryObjectSeparator< dim >, plask::Translation< dim >, plask::Translation< DIMS >, plask::Extrusion, plask::Revolution, and plask::Triangle.

## ◆ getBoundingBox()

template<int dim>

virtual Box plask::GeometryObjectD< dim >::getBoundingBox | ( |  | ) | const
| pure virtual

Calculate minimal rectangle which contains all points of geometry object.

Returns
  calculated rectangle

Implemented in plask::Circle< dim >, plask::Circle< dim >, plask::Circle< dim >, plask::Circle< dim >, plask::Circle< dim >, plask::GeometryObjectContainer< dim >, plask::RotatedCuboid, plask::Cylinder, plask::HollowCylinder, plask::Ellipse, plask::EllipticCylinder, plask::ArrangeContainer< dim >, plask::Lattice, plask::Block< dim >, plask::Block< 3 >, plask::Mirror< dim >, plask::Polygon, plask::TriangularPrism, plask::Prism, plask::Gap1D< dim, direction >, plask::GeometryObjectTransform< dim, Child_Type >, plask::GeometryObjectTransform< 3 >, plask::GeometryObjectTransform< this_dim, GeometryObjectD< 5 - this_dim > >, plask::GeometryObjectTransform< this_dim, GeometryObjectD< child_dim > >, and plask::Triangle.

## ◆ getBoundingBoxes() [1/2]

template<int dim>

std::vector< Box > plask::GeometryObjectD< dim >::getBoundingBoxes | ( | const GeometryObject::Predicate & | predicate,
|  | const PathHints & | path
| ) |  |
| inline

Calculate the vector of bounding boxes of all nodes which fulfill given `predicate`, marked by path.

Parameters

  predicate |
  path | path hints which limits search space

Returns
  vector of bounding boxes of all nodes which fulfill given `predicate`, optionally marked by path

Definition at line 1280 of file object.hpp.

## ◆ getBoundingBoxes() [2/2]

template<int dim>

std::vector< Box > plask::GeometryObjectD< dim >::getBoundingBoxes | ( | const GeometryObject::Predicate & | predicate,
|  | const PathHints * | path = `0`
| ) |  | const
| inline

Calculate the vector of bounding boxes of all nodes which fulfill given `predicate`, optionally marked by path.

Parameters

  predicate |
  path | (optional) path hints which limits search space

Returns
  vector of bounding boxes of all nodes which fulfill given `predicate`, optionally marked by path

Definition at line 1268 of file object.hpp.

## ◆ getBoundingBoxesToVec() [1/2]

template<int dim>

void plask::GeometryObjectD< dim >::getBoundingBoxesToVec | ( | const GeometryObject::Predicate & | predicate,
|  | std::vector< Box > & | dest,
|  | const PathHints & | path
| ) |  | const
| inline

Calculate and append to vector bounding boxes of all nodes which fulfill given `predicate`, marked by path.

Parameters

  predicate |
  dest | place to add result, bounding boxes will be added in the same order which is generated by GeometryObject::getObjects
  path | path hints which limits search space

Definition at line 1256 of file object.hpp.

## ◆ getBoundingBoxesToVec() [2/2]

template<int dim>

virtual void plask::GeometryObjectD< dim >::getBoundingBoxesToVec | ( | const GeometryObject::Predicate & | predicate,
|  | std::vector< Box > & | dest,
|  | const PathHints * | path = `0`
| ) |  | const
| pure virtual

Calculate and append to vector bounding boxes of all nodes which fulfill given `predicate`, optionally marked by path.

Parameters

  predicate |
  dest | place to add result, bounding boxes will be added in the same order which is generated by GeometryObject::getObjects
  path | path (optional) path hints which limits search space

Implemented in plask::GeometryObjectTransform< dim, Child_Type >, plask::GeometryObjectTransform< 3 >, plask::GeometryObjectTransform< this_dim, GeometryObjectD< 5 - this_dim > >, plask::GeometryObjectTransform< this_dim, GeometryObjectD< child_dim > >, plask::Intersection< dim >, plask::ArrangeContainer< dim >, plask::GeometryObjectLeaf< dim >, plask::GeometryObjectLeaf< 2 >, plask::GeometryObjectLeaf< 3 >, plask::Mirror< dim >, and plask::GeometryObjectSeparator< dim >.

## ◆ getBoundingBoxSize()

template<int dim>

virtual DVec plask::GeometryObjectD< dim >::getBoundingBoxSize | ( |  | ) | const
| inline virtual

Definition at line 1207 of file object.hpp.

## ◆ getDimensionsCount()

template<int dim>

int plask::GeometryObjectD< dim >::getDimensionsCount | ( |  | ) | const
| inline override virtual

Get number of dimensions.

Returns
  number of dimensions

Implements plask::GeometryObject.

Definition at line 1174 of file object.hpp.

## ◆ getLeafsBoundingBoxes() [1/2]

template<int dim>

std::vector< Box > plask::GeometryObjectD< dim >::getLeafsBoundingBoxes | ( | const PathHints & | path | ) | const
| inline

Calculate bounding boxes of all leafs, marked by path.

Parameters

  path | path hints which limits search space

Returns
  bounding boxes of all leafs, in the same order which is generated by GeometryObject::getLeafs(const PathHints&)

Definition at line 1322 of file object.hpp.

## ◆ getLeafsBoundingBoxes() [2/2]

template<int dim>

std::vector< Box > plask::GeometryObjectD< dim >::getLeafsBoundingBoxes | ( | const PathHints * | path = `0` | ) | const
| inline

Calculate bounding boxes of all leafs, optionally marked by path.

Parameters

  path | (optional) path hints which limits search space

Returns
  bounding boxes of all leafs, in the same order which is generated by GeometryObject::getLeafs(const PathHints*)

Definition at line 1310 of file object.hpp.

## ◆ getLeafsBoundingBoxesToVec() [1/2]

template<int dim>

void plask::GeometryObjectD< dim >::getLeafsBoundingBoxesToVec | ( | std::vector< Box > & | dest,
|  | const PathHints & | path
| ) |  | const
| inline

Calculate and append to vector bounding boxes of all leafs, marked by path.

Parameters

  dest | place to add result, bounding boxes will be added in the same order which is generated by GeometryObject::getLeafsToVec
  path | path hints which limits search space

Definition at line 1300 of file object.hpp.

## ◆ getLeafsBoundingBoxesToVec() [2/2]

template<int dim>

void plask::GeometryObjectD< dim >::getLeafsBoundingBoxesToVec | ( | std::vector< Box > & | dest,
|  | const PathHints * | path = `0`
| ) |  | const
| inline

Calculate and append to vector bounding boxes of all leafs, optionally marked by path.

Parameters

  dest | place to add result, bounding boxes will be added in the same order which is generated by GeometryObject::getLeafsToVec
  path | (optional) path hints which limits search space

Definition at line 1290 of file object.hpp.

## ◆ getLeafsPositions() [1/2]

template<int dim>

std::vector< DVec > plask::GeometryObjectD< dim >::getLeafsPositions | ( | const PathHints & | path | ) | const
| inline

Calculate and return a vector of positions of all leafs, marked by path.

Parameters

  path | path hints which limits search space

Returns
  positions of leafs in the sub-tree with this object in the root, in the same order which is generated by GeometryObject::getLeafs

Some leafs can have vector of NaNs as translations. This mean that translation is not well defined (some space changer on path).

Definition at line 1481 of file object.hpp.

## ◆ getLeafsPositions() [2/2]

template<int dim>

std::vector< DVec > plask::GeometryObjectD< dim >::getLeafsPositions | ( | const PathHints * | path = `0` | ) | const
| inline

Calculate and return a vector of positions of all leafs, optionally marked by path.

Parameters

  path | (optional) path hints which limits search space

Returns
  positions of leafs in the sub-tree with this object in the root, in the same order which is generated by GeometryObject::getLeafs

Some leafs can have vector of NaNs as translations. This mean that translation is not well defined (some space changer on path).

Definition at line 1466 of file object.hpp.

## ◆ getLeafsPositionsToVec() [1/2]

template<int dim>

void plask::GeometryObjectD< dim >::getLeafsPositionsToVec | ( | std::vector< DVec > & | dest,
|  | const PathHints & | path
| ) |  | const
| inline

Calculate and append to vector positions of all leafs, marked by path.

Some leafs can have vector of NaNs as translations. This mean that translation is not well defined (some space changer on path).

Parameters

  dest | place to add result, positions will be added in the same order which is generated by GeometryObject::getLeafsToVec
  path | path hints which limits search space

Definition at line 1453 of file object.hpp.

## ◆ getLeafsPositionsToVec() [2/2]

template<int dim>

void plask::GeometryObjectD< dim >::getLeafsPositionsToVec | ( | std::vector< DVec > & | dest,
|  | const PathHints * | path = `0`
| ) |  | const
| inline

Calculate and append to vector positions of all leafs, optionally marked by path.

Some leafs can have vector of NaNs as translations. This mean that translation is not well defined (some space changer on path).

Parameters

  dest | place to add result, positions will be added in the same order which is generated by GeometryObject::getLeafsToVec
  path | (optional) path hints which limits search space

Definition at line 1440 of file object.hpp.

## ◆ getLineSegments()

template<int dim>

std::set< LineSegment > plask::GeometryObjectD< dim >::getLineSegments | ( | unsigned | max_steps = `PLASK_GEOMETRY_MAX_STEPS`,
|  | double | min_step_size = `PLASK_GEOMETRY_MIN_STEP_SIZE`
| ) |  | const
| inline

Add characteristic points to the set and edges connecting them.

Parameters

  max_steps | maximum number of points to split single leaf
  min_step_size | minimum distance between divisions for a single leaf

Returns
  segments set

Definition at line 1759 of file object.hpp.

## ◆ getMatchingAt() [1/2]

template<int dim>

shared_ptr< const GeometryObject > plask::GeometryObjectD< dim >::getMatchingAt | ( | const DVec & | point,
|  | const Predicate & | predicate,
|  | const PathHints & | path
| ) |  | const
| inline

Get object closest to the root, which contains specific point and fulfills the predicate.

Parameters

  point | point to test
  predicate | predicate required to match, called for each object on path to point, in order from root to leaf
  path | path hints filtering out some objects

Returns
  resulted object or empty pointer

Definition at line 1657 of file object.hpp.

## ◆ getMatchingAt() [2/2]

template<int dims>

shared_ptr< const GeometryObject > plask::GeometryObjectD< dims >::getMatchingAt | ( | const DVec & | point,
|  | const Predicate & | predicate,
|  | const PathHints * | path = `0`
| ) |  | const

Get object closest to the root, which contains specific point and fulfills the predicate.

Parameters

  point | point to test
  predicate | predicate required to match, called for each object on path to point, in order from root to leaf
  path | optional path hints filtering out some objects

Returns
  resulted object or empty pointer

Definition at line 228 of file object.cpp.

## ◆ getMaterial()

template<int dim>

virtual shared_ptr< Material > plask::GeometryObjectD< dim >::getMaterial | ( | const DVec & | p | ) | const
| pure virtual

Return material in a given point inside the geometry object.

Parameters

  p | point

Returns
  material in given point, or `nullptr` if this GeometryObject not contains point p

Implemented in plask::Clip< dim >, plask::Intersection< dim >, plask::ArrangeContainer< dim >, plask::GeometryObjectLeaf< dim >, plask::GeometryObjectLeaf< 2 >, plask::GeometryObjectLeaf< 3 >, plask::Flip< dim >, plask::Mirror< dim >, plask::GeometryObjectSeparator< dim >, plask::Translation< dim >, plask::Translation< DIMS >, plask::Extrusion, and plask::Revolution.

## ◆ getMaterialOrAir()

template<int dim>

shared_ptr< Material > plask::GeometryObjectD< dim >::getMaterialOrAir | ( | const DVec & | p | ) | const
| inline

Return material in a given point inside the geometry object.

Parameters

  p | point

Returns
  material in given point, or Air if this GeometryObject not contains point p

Definition at line 1232 of file object.hpp.

## ◆ getObjectBoundingBoxes() [1/2]

template<int dim>

std::vector< Box > plask::GeometryObjectD< dim >::getObjectBoundingBoxes | ( | const GeometryObject & | object,
|  | const PathHints & | path
| ) |  | const
| inline

Calculate bounding boxes of all instances of given `objects`, marked by `path`.

Parameters

  object | object
  path | path hints which limits search space

Returns
  bounding boxes of all objects, in the same order which is generated by GeometryObject::getObjects(const PathHints&)

Definition at line 1367 of file object.hpp.

## ◆ getObjectBoundingBoxes() [2/2]

template<int dim>

std::vector< Box > plask::GeometryObjectD< dim >::getObjectBoundingBoxes | ( | const GeometryObject & | object,
|  | const PathHints * | path = `0`
| ) |  | const
| inline

Calculate bounding boxes of all instances of given `object`, optionally marked by path.

Parameters

  object | object
  path | (optional) path hints which limits search space

Returns
  bounding boxes of all instances of given `object`

Definition at line 1354 of file object.hpp.

## ◆ getObjectBoundingBoxesToVec() [1/2]

template<int dim>

void plask::GeometryObjectD< dim >::getObjectBoundingBoxesToVec | ( | std::vector< Box > & | dest,
|  | const GeometryObject & | object,
|  | const PathHints & | path
| ) |  | const
| inline

Calculate and append to vector bounding boxes of all instances of given `object`, marked by path.

Parameters

  object | object
  dest | place to add result
  path | path hints which limits search space

Definition at line 1342 of file object.hpp.

## ◆ getObjectBoundingBoxesToVec() [2/2]

template<int dim>

void plask::GeometryObjectD< dim >::getObjectBoundingBoxesToVec | ( | std::vector< Box > & | dest,
|  | const GeometryObject & | object,
|  | const PathHints * | path = `0`
| ) |  | const
| inline

Calculate and append to vector bounding boxes of all instances of given `object`, optionally marked by path.

Parameters

  object | object
  dest | place to add result
  path | (optional) path hints which limits search space

Definition at line 1330 of file object.hpp.

## ◆ getObjectPositions() [1/2]

template<int dim>

std::vector< DVec > plask::GeometryObjectD< dim >::getObjectPositions | ( | const GeometryObject & | object,
|  | const PathHints & | path
| ) |  | const
| inline

Calculate and return a vector of positions of all instances of given `object`, marked by path.

Parameters

  object | object to which instances translations should be found
  path | path hints which limits search space

Returns
  vector of positions

Some objects can have vector of NaNs as translations. This mean that translation is not well defined (some space changer on path).

Definition at line 1535 of file object.hpp.

## ◆ getObjectPositions() [2/2]

template<int dim>

std::vector< DVec > plask::GeometryObjectD< dim >::getObjectPositions | ( | const GeometryObject & | object,
|  | const PathHints * | path = `0`
| ) |  | const
| inline

Calculate and return a vector of positions of all instances of given `object`, optionally marked by path.

Parameters

  object | object to which instances translations should be found
  path | (optional) path hints which limits search space

Returns
  vector of positions

Some objects can have vector of NaNs as translations. This mean that translation is not well defined (some space changer on path).

Definition at line 1522 of file object.hpp.

## ◆ getObjectPositionsToVec() [1/2]

template<int dim>

void plask::GeometryObjectD< dim >::getObjectPositionsToVec | ( | std::vector< DVec > & | dest,
|  | const GeometryObject & | object,
|  | const PathHints & | path
| ) |  | const
| inline

Calculate and append to vector positions of all instances of given `object`, marked by path.

Some objects can have vector of NaNs as translations. This mean that translation is not well defined (some space changer on path).

Parameters

  dest | place to add result, positions will be added in the same order which is generated by GeometryObject::getObjectsToVec
  object | object to which instances translations should be found
  path | path hints which limits search space

Definition at line 1509 of file object.hpp.

## ◆ getObjectPositionsToVec() [2/2]

template<int dim>

void plask::GeometryObjectD< dim >::getObjectPositionsToVec | ( | std::vector< DVec > & | dest,
|  | const GeometryObject & | object,
|  | const PathHints * | path = `0`
| ) |  | const
| inline

Calculate and append to vector positions of all instances of given `object`, optionally marked by path.

Some objects can have vector of NaNs as translations. This mean that translation is not well defined (some space changer on path).

Parameters

  dest | place to add result, positions will be added in the same order which is generated by GeometryObject::getObjectsToVec
  object | object to which instances translations should be found
  path | (optional) path hints which limits search space

Definition at line 1493 of file object.hpp.

## ◆ getPathsAt()

template<int dim>

virtual Subtree plask::GeometryObjectD< dim >::getPathsAt | ( | const DVec & | point,
|  | bool | all = `false`
| ) |  | const
| pure virtual

Find all paths to objects which lies at given `point`.

Parameters

  point | a point in local coordinates
  all | if true then return all paths if branches overlap the point

Returns
  all paths, last one is on top and overlies the rest

Implemented in plask::Clip< dim >, plask::Intersection< dim >, plask::ArrangeContainer< dim >, plask::Flip< dim >, plask::Mirror< dim >, plask::Translation< dim >, plask::Translation< DIMS >, plask::Extrusion, plask::Revolution, plask::GeometryObjectLeaf< dim >, plask::GeometryObjectLeaf< 2 >, plask::GeometryObjectLeaf< 3 >, and plask::GeometryObjectSeparator< dim >.

## ◆ getPathsTo()

template<int dim>

virtual Subtree plask::GeometryObject::getPathsTo | ( | const GeometryObject & | el,
|  | const PathHints * | pathHints = `0`
| ) |  | const
| virtual

Find paths to el.

Parameters

  el | object to search for
  pathHints | (optional) path hints which limits search space

Returns
  sub-tree with paths to given object (`el` is in all leafs), empty sub-tree if `el` is not in subtree with `this` in root

Implements plask::GeometryObject.

Reimplemented in plask::Lattice, plask::GeometryObjectLeaf< dim >, plask::GeometryObjectLeaf< 2 >, plask::GeometryObjectLeaf< 3 >, plask::Mirror< dim >, plask::GeometryObjectSeparator< dim >, plask::GeometryObjectTransform< dim, Child_Type >, plask::GeometryObjectTransform< 3 >, plask::GeometryObjectTransform< this_dim, GeometryObjectD< 5 - this_dim > >, and plask::GeometryObjectTransform< this_dim, GeometryObjectD< child_dim > >.

## ◆ getPositions() [1/2]

template<int dim>

std::vector< DVec > plask::GeometryObjectD< dim >::getPositions | ( | const Predicate & | predicate,
|  | const PathHints & | path
| ) |  | const
| inline

Calculate and append to vector positions of all nodes which fulfill given `predicate`, marked by path.

Parameters

  predicate | predicate required to match
  path | path hints which limits search space

Returns
  positions of the pointed objects in the sub-tree with this object in the root, in the same order which is generated by GeometryObject::getObjects

Some objects can have all vector of NaNs as translations. This mean that translation is not well defined (some space changer on path).

Definition at line 1427 of file object.hpp.

## ◆ getPositions() [2/2]

template<int dim>

std::vector< DVec > plask::GeometryObjectD< dim >::getPositions | ( | const Predicate & | predicate,
|  | const PathHints * | path = `0`
| ) |  | const
| inline

Calculate and append to vector positions of all nodes which fulfill given `predicate`, optionally marked by path.

Parameters

  predicate | predicate required to match
  path | (optional) path hints which limits search space

Returns
  positions of the pointed objects in the sub-tree with this object in the root, in the same order which is generated by GeometryObject::getObjects

Some objects can have all vector of NaNs as translations. This mean that translation is not well defined (some space changer on path).

Definition at line 1411 of file object.hpp.

## ◆ getPositionsToVec() [1/2]

template<int dim>

void plask::GeometryObjectD< dim >::getPositionsToVec | ( | const Predicate & | predicate,
|  | std::vector< DVec > & | dest,
|  | const PathHints & | path
| ) |  | const
| inline

Calculate and append to vector positions of all nodes which fulfill given `predicate`, marked by path.

Some objects can have all vector of NaNs as translations. This mean that translation is not well defined (some space changer on path).

Parameters

  predicate | predicate required to match
  dest | place to add result, positions will be added in the same order which is generated by GeometryObject::getObjectsToVec
  path | path hints which limits search space

Definition at line 1396 of file object.hpp.

## ◆ getPositionsToVec() [2/2]

template<int dim>

virtual void plask::GeometryObjectD< dim >::getPositionsToVec | ( | const Predicate & | predicate,
|  | std::vector< DVec > & | dest,
|  | const PathHints * | path = `0`
| ) |  | const
| pure virtual

Calculate and append to vector positions of all nodes which fulfill given `predicate`, optionally marked by path.

Some objects can have all vector of NaNs as translations. This mean that translation is not well defined (some space changer on path).

Parameters

  predicate | predicate required to match
  dest | place to add result, positions will be added in the same order which is generated by GeometryObject::getObjectsToVec
  path | (optional) path hints which limits search space

Implemented in plask::GeometryObjectLeaf< dim >, plask::GeometryObjectLeaf< 2 >, plask::GeometryObjectLeaf< 3 >, plask::GeometryObjectSeparator< dim >, plask::Clip< dim >, plask::Intersection< dim >, plask::ArrangeContainer< dim >, plask::Flip< dim >, plask::Mirror< dim >, plask::Translation< dim >, plask::Translation< DIMS >, plask::Extrusion, and plask::Revolution.

## ◆ getRealBoundingBox()

template<int dim>

virtual Box plask::GeometryObjectD< dim >::getRealBoundingBox | ( |  | ) | const
| inline virtual

Calculate minimal rectangle which contains all points of real geometry object.

This box can be different from getBoundingBox() only for objects which have virtual children, like multple-stack. Returned box is always included in (in most cases: equal to) box returned by getBoundingBox().

Default implementation returns result of getBoundingBox() call.

Returns
  calculated rectangle

Reimplemented in plask::ArrangeContainer< dim >, plask::Lattice, and plask::Mirror< dim >.

Definition at line 1218 of file object.hpp.

## ◆ getRolesAt() [1/2]

template<int dim>

std::set< std::string > plask::GeometryObjectD< dim >::getRolesAt | ( | const DVec & | point,
|  | const plask::PathHints & | path
| ) |  | const
| inline

Get a sum of roles sets of all objects which lies on path from this to leaf at given `point`.

Parameters

  point | point
  path | path hints filtering out some objects

Returns
  calculated set

Definition at line 1709 of file object.hpp.

## ◆ getRolesAt() [2/2]

template<int dims>

std::set< std::string > plask::GeometryObjectD< dims >::getRolesAt | ( | const DVec & | point,
|  | const plask::PathHints * | path = `0`
| ) |  | const

Get a sum of roles sets of all objects which lies on path from this to leaf at given `point`.

Parameters

  point | point
  path | optional path hints filtering out some objects

Returns
  calculated set

Definition at line 246 of file object.cpp.

## ◆ hasRoleAt() [1/2]

template<int dim>

shared_ptr< const GeometryObject > plask::GeometryObjectD< dim >::hasRoleAt | ( | const std::string & | role_name,
|  | const DVec & | point,
|  | const plask::PathHints & | path
| ) |  | const
| inline

Check if any object at given `point`, not hidden by another object, plays role with given name `role_name` (if so, returns non-nullptr).

Parameters

  role_name | name of class
  point | point
  path | optional path hints filtering out some objects

Returns
  object which is at given `point`, is not hidden by another object and plays role with name `role_name`, nullptr if there is not such object

Definition at line 1737 of file object.hpp.

## ◆ hasRoleAt() [2/2]

template<int dim>

shared_ptr< const GeometryObject > plask::GeometryObjectD< dim >::hasRoleAt | ( | const std::string & | role_name,
|  | const DVec & | point,
|  | const plask::PathHints * | path = `0`
| ) |  | const
| inline

Check if any object at given `point`, not hidden by another object, plays role with given name `role_name` (if so, returns non-nullptr).

Parameters

  role_name | name of class
  point | point
  path | optional path hints filtering out some objects

Returns
  object which is at given `point`, is not hidden by another object and plays role with name `role_name`, `nullptr` if there is not such object

Definition at line 1722 of file object.hpp.

## ◆ objectIncludes() [1/3]

template<int dim>

bool plask::GeometryObjectD< dim >::objectIncludes | ( | const GeometryObject & | object,
|  | const DVec & | point
| ) |  | const
| inline

Check if specified geometry object contains a point point.

Parameters

  object | object to test
  point | point

Returns
  true only if this geometry contains the point point

Definition at line 1691 of file object.hpp.

## ◆ objectIncludes() [2/3]

template<int dim>

bool plask::GeometryObjectD< dim >::objectIncludes | ( | const GeometryObject & | object,
|  | const PathHints & | path,
|  | const DVec & | point
| ) |  | const
| inline

Check if specified geometry object contains a point point.

Parameters

  object | object to test
  path | path hints specifying the object
  point | point

Returns
  true only if this geometry contains the point point

Definition at line 1681 of file object.hpp.

## ◆ objectIncludes() [3/3]

template<int dim>

bool plask::GeometryObjectD< dim >::objectIncludes | ( | const GeometryObject & | object,
|  | const PathHints * | path,
|  | const DVec & | point
| ) |  | const
| inline

Check if specified geometry object contains a point point.

Parameters

  object | object to test
  path | path hints specifying the object
  point | point

Returns
  true only if this geometry contains the point point

Definition at line 1670 of file object.hpp.

## Member Data Documentation

## ◆ DIM

template<int dim>

const int plask::GeometryObjectD< dim >::DIM = dim
| static

Definition at line 1148 of file object.hpp.

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

- plask/geometry/object.hpp
- plask/geometry/object.cpp