PLaSK library
Loading...
Searching...
No Matches
plask::GeometryD< dim > Class Template Referenceabstract

Base class for all geometry trunks in given space. More...

#include <plask/geometry/space.hpp>

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

Public Types

enum  { DIM = dim }
 
typedef Vec< dim, doubleCoordsType
 
- Public Types inherited from plask::Geometry
enum  Direction { DIRECTION_LONG = Primitive<3>::DIRECTION_LONG , DIRECTION_TRAN = Primitive<3>::DIRECTION_TRAN , DIRECTION_VERT = Primitive<3>::DIRECTION_VERT }
 
- 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 shared_ptr< MaterialgetMaterial (const Vec< dim, double > &p) const
 Get material in point p of child space.
 
virtual shared_ptr< GeometryObjectD< dim > > getChild () const =0
 Get child geometry.
 
virtual shared_ptr< GeometryObjectD< dim > > getChildUnsafe () const =0
 Get child geometry.
 
const Primitive< dim >::Box & getChildBoundingBox () const
 Get bounding box of child geometry.
 
bool hasInSubtree (const GeometryObject &el) const override
 Check if el is in subtree with child (see getChild) of this in root.
 
bool hasInSubtree (shared_ptr< const GeometryObject > el, const PathHints *pathHints) const
 
Subtree getPathsTo (const GeometryObject &el, const PathHints *pathHints=0) const override
 Find paths to el.
 
void getObjectsToVec (const Predicate &predicate, std::vector< shared_ptr< const GeometryObject > > &dest, const PathHints *path=0) const override
 Append all objects from subtree with child (see getChild) of this in root, which fulfill predicate to vector dest.
 
std::size_t getChildrenCount () const override
 Get number of children of this.
 
shared_ptr< GeometryObjectgetChildNo (std::size_t child_no) const override
 Get child_no-th child of this.
 
std::vector< shared_ptr< const GeometryObject > > getLeafs (const PathHints *path=nullptr) const
 Get all leafs in subtree with child (see getChild) of this object as root.
 
std::vector< shared_ptr< const GeometryObject > > getLeafs (const PathHints &path) const
 Get all leafs in subtree with child (see getChild) of this object as root.
 
std::vector< CoordsTypegetLeafsPositions (const PathHints *path=nullptr) const
 Calculate and return a vector of positions of all leafs, optionally marked by path.
 
std::vector< CoordsTypegetLeafsPositions (const PathHints &path) const
 Calculate and return a vector of positions of all leafs, optionally marked by path.
 
std::vector< CoordsTypegetObjectPositions (const GeometryObject &object, const PathHints *path=nullptr) const
 Calculate and return a vector of positions of all instances of given object, optionally marked by path.
 
std::vector< CoordsTypegetObjectPositions (const GeometryObject &object, const PathHints &path) const
 Calculate and return a vector of positions of all instances of given object, optionally marked by path.
 
std::vector< CoordsTypegetObjectPositions (const shared_ptr< const GeometryObject > &object, const PathHints *path=nullptr) const
 Calculate and return a vector of positions of all instances of given object, optionally marked by path.
 
std::vector< CoordsTypegetObjectPositions (const shared_ptr< const GeometryObject > &object, const PathHints &path) const
 Calculate and return a vector of positions of all instances of given object, optionally marked by path.
 
std::vector< typename Primitive< DIM >::Box > getLeafsBoundingBoxes (const PathHints *path=nullptr) const
 Calculate bounding boxes of all leafs, optionally marked by path.
 
std::vector< typename Primitive< DIM >::Box > getLeafsBoundingBoxes (const PathHints &path) const
 Calculate bounding boxes of all leafs, optionally marked by path.
 
std::vector< typename Primitive< DIM >::Box > getObjectBoundingBoxes (const GeometryObject &object, const PathHints *path=nullptr) const
 Calculate bounding boxes (relative to child of this) of all instances of given object, optionally marked by path.
 
std::vector< typename Primitive< DIM >::Box > getObjectBoundingBoxes (const GeometryObject &object, const PathHints &path) const
 Calculate bounding boxes (relative to child of this) of all instances of given object, optionally marked by path.
 
std::vector< typename Primitive< DIM >::Box > getObjectBoundingBoxes (const shared_ptr< const GeometryObject > &object, const PathHints *path=nullptr) const
 Calculate bounding boxes (relative to child of this) of all instances of given object, optionally marked by path.
 
std::vector< typename Primitive< DIM >::Box > getObjectBoundingBoxes (const shared_ptr< const GeometryObject > &object, const PathHints &path) const
 Calculate bounding boxes (relative to child of this) of all instances of given object, optionally marked by path.
 
std::vector< shared_ptr< const GeometryObject > > getObjectsWithRole (const std::string &role) const
 Get all objects with a specified role with this object as root.
 
GeometryObject::Subtree getPathsAt (const CoordsType &point, bool all=false) const
 Find all paths to objects which lies at given point.
 
shared_ptr< const GeometryObjectgetMatchingAt (const CoordsType &point, const Predicate &predicate, const PathHints *path=0)
 Get object closest to the root (child of this), which contains specific point and fulfills the predicate.
 
shared_ptr< const GeometryObjectgetMatchingAt (const CoordsType &point, const Predicate &predicate, const PathHints &path)
 Get object closest to the root (child of this), which contains specific point and fulfills the predicate.
 
bool objectIncludes (const GeometryObject &object, const PathHints *path, const CoordsType &point) const
 Check if specified geometry object contains a point point.
 
bool objectIncludes (const GeometryObject &object, const PathHints &path, const CoordsType &point) const
 Check if specified geometry object contains a point point.
 
bool objectIncludes (const GeometryObject &object, const CoordsType &point) const
 Check if specified geometry object contains a point point.
 
shared_ptr< const GeometryObjecthasRoleAt (const std::string &role_name, const CoordsType &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 GeometryObjecthasRoleAt (const std::string &role_name, const CoordsType &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).
 
std::set< std::string > getRolesAt (const CoordsType &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 CoordsType &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.
 
void setPlanarEdges (const edge::Strategy &border_to_set) override
 Set all planar edges or throw exception if this edges can't be set for this calculation space or direction.
 
virtual CoordsType wrapEdges (CoordsType p) const =0
 Wrap point to canonical position respecting edge settings (mirror, extend and periodic)
 
void writeXMLAttr (XMLWriter::Element &dest_xml_object, const AxisNames &axes) const override
 Append XML attributes of this to dest_xml_object.
 
void writeXMLAttr (XMLWriter::Element &dest_xml_object, const AxisNames &axes) const
 Append XML attributes of this to dest_xml_object.
 
void writeXMLAttr (XMLWriter::Element &dest_xml_object, const AxisNames &axes) const
 Append XML attributes of this to dest_xml_object.
 
void setPlanarEdges (const edge::Strategy &border_to_set)
 Set all planar edges or throw exception if this edges can't be set for this calculation space or direction.
 
void setPlanarEdges (const edge::Strategy &border_to_set)
 Set all planar edges or throw exception if this edges can't be set for this calculation space or direction.
 
void writeXMLAttr (XMLWriter::Element &dest_xml_object, const AxisNames &axes) const
 Append XML attributes of this to dest_xml_object.
 
void writeXMLAttr (XMLWriter::Element &dest_xml_object, const AxisNames &axes) const
 Append XML attributes of this to dest_xml_object.
 
- Public Member Functions inherited from plask::Geometry
 Geometry (shared_ptr< Material > defaultMaterial=make_shared< materials::Air >())
 Calculation space constructor, set default material.
 
 Geometry (const Geometry &to_copy)
 Initialize this to be the same as to_copy but doesn't have any changes observer.
 
Geometryoperator= (const Geometry &to_copy)
 Set this to be the same as to_copy but doesn't changed changes observer.
 
virtual ~Geometry ()
 Inform observators that this is being deleted.
 
virtual void setEdges (Direction direction, const edge::Strategy &border_lo, const edge::Strategy &border_hi)=0
 Set all edges in given direction or throw exception if this edges can't be set for this calculation space or direction.
 
virtual void setEdges (Direction direction, const edge::Strategy &border_to_set)
 Set all edges in given direction or throw exception if this edges can't be set for this calculation space or direction.
 
void setAllEdges (const edge::Strategy &border_to_set)
 Set all edges (planar and up-bottom).
 
virtual void setEdge (Direction direction, bool higher, const edge::Strategy &border_to_set)=0
 Set edge or throw exception if this edge can't be set for this calculation space or direction.
 
void setEdges (const std::function< plask::optional< std::string >(const std::string &s)> &borderValuesGetter, const AxisNames &axesNames, const MaterialsDB &materialsDB=MaterialsDB::getDefault(), bool draft=false)
 Set edges using string value which is gotten from borderValuesGetter.
 
virtual const edge::StrategygetEdge (Direction direction, bool higher) const =0
 Get edge strategy or throw exception if edge can't be get for this calculation space or direction.
 
virtual bool isSymmetric (Direction direction) const
 Check if structure in given direction is symmetric, i.e.
 
bool isPeriodic (Direction direction) const
 Check if structure in given direction is periodic, i.e.
 
bool isExtended (Direction direction, bool higher) const
 Check if structure extends in given direction.
 
Type getType () const override
 Check if geometry is: leaf, transform or container type object.
 
virtual shared_ptr< GeometryObjectD< 3 > > getObject3D () const =0
 Get 3D object held by this geometry (which has type Extrusion or Revolution for 2D geometries).
 
- 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.
 
GeometryObjectoperator= (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< GeometryasGeometry ()
 Cast this to Geometry.
 
shared_ptr< const GeometryasGeometry () const
 Cast this to Geometry.
 
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< doublegetPointsAlong (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.
 
bool hasInSubtree (const GeometryObject &el, const PathHints *pathHints) const
 
bool hasInSubtree (shared_ptr< const GeometryObject > el, const PathHints *pathHints) const
 
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 getRealChildrenCount () const
 Get number of real (physically stored) children in geometry graph.
 
virtual shared_ptr< GeometryObjectgetRealChildNo (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 GeometryObjectchangedVersion (const Changer &changer, Vec< 3, double > *translation=0) const =0
 Get this or copy of this with some changes in subtree.
 
virtual shared_ptr< GeometryObjectshallowCopy () const =0
 Get shallow copy of this.
 
virtual shared_ptr< GeometryObjectdeepCopy (std::map< const GeometryObject *, shared_ptr< GeometryObject > > &copied) const =0
 Get deep copy of this.
 
shared_ptr< GeometryObjectdeepCopy ()
 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.
 

Protected Member Functions

shared_ptr< MaterialgetMaterialOrDefault (const Vec< dim, double > &p) const
 Get material from geometry or return default material if geometry returns nullptr.
 
void onChildChanged (const GeometryObject::Event &evt)
 Refresh bounding box cache.
 
void disconnectOnChildChanged ()
 Disconnect onChildChanged from current child change signal.
 
void initNewChild ()
 Initialize bounding box cache and onChange connection.
 
virtual ~GeometryD ()
 
- Protected Member Functions inherited from plask::Geometry
virtual const charalternativeDirectionName (std::size_t ax, std::size_t orient) const
 
void storeEdgeInXML (XMLWriter::Element &dest_xml_object, Direction direction, bool higher) const
 
- Protected Member Functions inherited from plask::GeometryObject
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)
 

Protected Attributes

Primitive< dim >::Box cachedBoundingBox
 Childs bounding box.
 

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::Geometry
shared_ptr< MaterialdefaultMaterial
 Default material (which will be used for places in which geometry doesn't define any material), typically air.
 
AxisNames axisNames
 Axis names for this geometry.
 
- 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.
 
- Static Protected Member Functions inherited from plask::Geometry
template<typename EdgeType >
static const EdgeTypecastEdge (const edge::Strategy &strategy)
 Dynamic cast edge to given type and throw exception in case of bad cast.
 

Detailed Description

template<int dim>
class plask::GeometryD< dim >

Base class for all geometry trunks in given space.

Template Parameters
dimnumber of space dimensions

Definition at line 202 of file space.hpp.

Member Typedef Documentation

◆ CoordsType

template<int dim>
typedef Vec<dim, double> plask::GeometryD< dim >::CoordsType

Definition at line 209 of file space.hpp.

Member Enumeration Documentation

◆ anonymous enum

template<int dim>
anonymous enum
Enumerator
DIM 

Definition at line 207 of file space.hpp.

Constructor & Destructor Documentation

◆ ~GeometryD()

template<int dim>
virtual plask::GeometryD< dim >::~GeometryD ( )
inlineprotectedvirtual

Definition at line 241 of file space.hpp.

Member Function Documentation

◆ disconnectOnChildChanged()

template<int dim>
void plask::GeometryD< dim >::disconnectOnChildChanged ( )
protected

Disconnect onChildChanged from current child change signal.

Definition at line 113 of file space.cpp.

◆ getChild()

template<int dim>
virtual shared_ptr< GeometryObjectD< dim > > plask::GeometryD< dim >::getChild ( ) const
pure virtual

Get child geometry.

Throws exception if has no child.

Returns
child geometry

Implemented in plask::Geometry2DCartesian, plask::Geometry2DCylindrical, and plask::Geometry3D.

◆ getChildBoundingBox()

template<int dim>
const Primitive< dim >::Box & plask::GeometryD< dim >::getChildBoundingBox ( ) const
inline

Get bounding box of child geometry.

Returns
bounding box of child geometry

Definition at line 277 of file space.hpp.

◆ getChildNo()

template<int dim>
shared_ptr< GeometryObject > plask::GeometryD< dim >::getChildNo ( std::size_t  child_no) const
inlineoverridevirtual

Get child_no-th child of this.

Parameters
child_nomust be 0
Returns
child of this

Implements plask::GeometryObject.

Definition at line 325 of file space.hpp.

◆ getChildrenCount()

template<int dim>
std::size_t plask::GeometryD< dim >::getChildrenCount ( ) const
inlineoverridevirtual

Get number of children of this.

Returns
1 if this has a child or 0 if it hasn't

Implements plask::GeometryObject.

Definition at line 318 of file space.hpp.

◆ getChildUnsafe()

template<int dim>
virtual shared_ptr< GeometryObjectD< dim > > plask::GeometryD< dim >::getChildUnsafe ( ) const
pure virtual

Get child geometry.

Returns
child geometry or nullptr if there is no child

Implemented in plask::Geometry2DCartesian, plask::Geometry2DCylindrical, and plask::Geometry3D.

◆ getDimensionsCount()

template<int dim>
int plask::GeometryD< dim >::getDimensionsCount ( ) const
overridevirtual

Get number of dimensions.

Returns
number of dimensions

Implements plask::GeometryObject.

Definition at line 129 of file space.cpp.

◆ getLeafs() [1/2]

template<int dim>
std::vector< shared_ptr< const GeometryObject > > plask::GeometryD< dim >::getLeafs ( const PathHints path) const
inline

Get all leafs in subtree with child (see getChild) of this object as root.

Parameters
path(optional) path hints which limits search space
Returns
all leafs in subtree with child of this object as root

Definition at line 345 of file space.hpp.

◆ getLeafs() [2/2]

template<int dim>
std::vector< shared_ptr< const GeometryObject > > plask::GeometryD< dim >::getLeafs ( const PathHints path = nullptr) const
inline

Get all leafs in subtree with child (see getChild) of this object as root.

Parameters
path(optional) path hints which limits search space
Returns
all leafs in subtree with child of this object as root

Definition at line 336 of file space.hpp.

◆ getLeafsBoundingBoxes() [1/2]

template<int dim>
std::vector< typename Primitive< DIM >::Box > plask::GeometryD< dim >::getLeafsBoundingBoxes ( const PathHints path) const
inline

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

Parameters
pathpath hints which limits search space
Returns
bounding boxes of all leafs (relative to child of this), in the same order which is generated by GeometryObject::getLeafs(const PathHints*)

Definition at line 438 of file space.hpp.

◆ getLeafsBoundingBoxes() [2/2]

template<int dim>
std::vector< typename Primitive< DIM >::Box > plask::GeometryD< dim >::getLeafsBoundingBoxes ( const PathHints path = nullptr) 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 (relative to child of this), in the same order which is generated by GeometryObject::getLeafs(const PathHints*)

Definition at line 428 of file space.hpp.

◆ getLeafsPositions() [1/2]

template<int dim>
std::vector< CoordsType > plask::GeometryD< dim >::getLeafsPositions ( const PathHints path) const
inline

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

Parameters
pathpath hints which limits search space
Returns
positions of leafs in the sub-tree with child (see getChild) of 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 367 of file space.hpp.

◆ getLeafsPositions() [2/2]

template<int dim>
std::vector< CoordsType > plask::GeometryD< dim >::getLeafsPositions ( const PathHints path = nullptr) 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 child (see getChild) of 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 356 of file space.hpp.

◆ getMatchingAt() [1/2]

template<int dim>
shared_ptr< const GeometryObject > plask::GeometryD< dim >::getMatchingAt ( const CoordsType point,
const Predicate predicate,
const PathHints path 
)
inline

Get object closest to the root (child of this), which contains specific point and fulfills the predicate.

Parameters
pointpoint to test
predicatepredicate required to match, called for each object on path to point, in order from root to leaf
pathpath hints filtering out some objects
Returns
resulted object or empty pointer

Definition at line 548 of file space.hpp.

◆ getMatchingAt() [2/2]

template<int dim>
shared_ptr< const GeometryObject > plask::GeometryD< dim >::getMatchingAt ( const CoordsType point,
const Predicate predicate,
const PathHints path = 0 
)
inline

Get object closest to the root (child of this), which contains specific point and fulfills the predicate.

Parameters
pointpoint to test
predicatepredicate required to match, called for each object on path to point, in order from root to leaf
pathoptional path hints filtering out some objects
Returns
resulted object or empty pointer

Definition at line 535 of file space.hpp.

◆ getMaterial()

template<int dim>
shared_ptr< Material > plask::GeometryD< dim >::getMaterial ( const Vec< dim, double > &  p) const
virtual

Get material in point p of child space.

Material is got from the geometry (if geometry defines material at given point) or the environment (otherwise). Result is defined, and is not nullptr, for each point p.

Default implementation just call getMaterialOrDefault which returns default material in each point for which geometry return nullptr. For other strategies see subclasses of this class.

Parameters
ppoint
Returns
material, which is not nullptr

Definition at line 132 of file space.cpp.

◆ getMaterialOrDefault()

template<int dim>
shared_ptr< Material > plask::GeometryD< dim >::getMaterialOrDefault ( const Vec< dim, double > &  p) const
inlineprotected

Get material from geometry or return default material if geometry returns nullptr.

Returns
default material in each point for which geometry return nullptr or material from geometry

Definition at line 216 of file space.hpp.

◆ getObjectBoundingBoxes() [1/4]

template<int dim>
std::vector< typename Primitive< DIM >::Box > plask::GeometryD< dim >::getObjectBoundingBoxes ( const GeometryObject object,
const PathHints path 
) const
inline

Calculate bounding boxes (relative to child of this) of all instances of given object, optionally marked by path.

Parameters
objectobject
pathpath hints which limits search space
Returns
bounding boxes of all instances of given object

Definition at line 461 of file space.hpp.

◆ getObjectBoundingBoxes() [2/4]

template<int dim>
std::vector< typename Primitive< DIM >::Box > plask::GeometryD< dim >::getObjectBoundingBoxes ( const GeometryObject object,
const PathHints path = nullptr 
) const
inline

Calculate bounding boxes (relative to child of this) of all instances of given object, optionally marked by path.

Parameters
objectobject
path(optional) path hints which limits search space
Returns
bounding boxes of all instances of given object

Definition at line 449 of file space.hpp.

◆ getObjectBoundingBoxes() [3/4]

template<int dim>
std::vector< typename Primitive< DIM >::Box > plask::GeometryD< dim >::getObjectBoundingBoxes ( const shared_ptr< const GeometryObject > &  object,
const PathHints path 
) const
inline

Calculate bounding boxes (relative to child of this) of all instances of given object, optionally marked by path.

Parameters
objectobject
path(optional) path hints which limits search space
Returns
bounding boxes of all instances of given object

Definition at line 484 of file space.hpp.

◆ getObjectBoundingBoxes() [4/4]

template<int dim>
std::vector< typename Primitive< DIM >::Box > plask::GeometryD< dim >::getObjectBoundingBoxes ( const shared_ptr< const GeometryObject > &  object,
const PathHints path = nullptr 
) const
inline

Calculate bounding boxes (relative to child of this) of all instances of given object, optionally marked by path.

Parameters
objectobject
path(optional) path hints which limits search space
Returns
bounding boxes of all instances of given object

Definition at line 472 of file space.hpp.

◆ getObjectPositions() [1/4]

template<int dim>
std::vector< CoordsType > plask::GeometryD< dim >::getObjectPositions ( const GeometryObject object,
const PathHints path 
) const
inline

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

Parameters
objectobject to which instances translations should be found
pathpath hints which limits search space
Returns
vector of positions (relative to child of this)

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 391 of file space.hpp.

◆ getObjectPositions() [2/4]

template<int dim>
std::vector< CoordsType > plask::GeometryD< dim >::getObjectPositions ( const GeometryObject object,
const PathHints path = nullptr 
) const
inline

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

Parameters
objectobject to which instances translations should be found
path(optional) path hints which limits search space
Returns
vector of positions (relative to child of this)

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 378 of file space.hpp.

◆ getObjectPositions() [3/4]

template<int dim>
std::vector< CoordsType > plask::GeometryD< dim >::getObjectPositions ( const shared_ptr< const GeometryObject > &  object,
const PathHints path 
) const
inline

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

Parameters
objectobject to which instances translations should be found
pathpath hints which limits search space
Returns
vector of positions (relative to child of this)

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 418 of file space.hpp.

◆ getObjectPositions() [4/4]

template<int dim>
std::vector< CoordsType > plask::GeometryD< dim >::getObjectPositions ( const shared_ptr< const GeometryObject > &  object,
const PathHints path = nullptr 
) const
inline

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

Parameters
objectobject to which instances translations should be found
path(optional) path hints which limits search space
Returns
vector of positions (relative to child of this)

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 404 of file space.hpp.

◆ getObjectsToVec()

template<int dim>
void plask::GeometryD< dim >::getObjectsToVec ( const Predicate predicate,
std::vector< shared_ptr< const GeometryObject > > &  dest,
const PathHints path = 0 
) const
inlineoverridevirtual

Append all objects from subtree with child (see getChild) of this in root, which fulfill predicate to vector dest.

Parameters
predicatepredicate required to match
destdestination vector
path(optional) path hints which limits search space

Implements plask::GeometryObject.

Definition at line 308 of file space.hpp.

◆ getObjectsWithRole()

template<int dim>
std::vector< shared_ptr< const GeometryObject > > plask::GeometryD< dim >::getObjectsWithRole ( const std::string &  role) const
inline

Get all objects with a specified role with this object as root.

Parameters
rolerole to search objects with
Returns
all objects with this object as root having a specified role

Definition at line 494 of file space.hpp.

◆ getPathsAt()

template<int dim>
GeometryObject::Subtree plask::GeometryD< dim >::getPathsAt ( const CoordsType point,
bool  all = false 
) const
inline

Find all paths to objects which lies at given point.

Parameters
pointpoint in local coordinates
allif true then return all paths if branches overlap the point
Returns
all paths, starting from child of this, last one is on top and overlies rest

Definition at line 504 of file space.hpp.

◆ getPathsTo()

template<int dim>
Subtree plask::GeometryD< dim >::getPathsTo ( const GeometryObject el,
const PathHints pathHints = 0 
) const
inlineoverridevirtual

Find paths to el.

Parameters
elobject 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 child of this in root

Implements plask::GeometryObject.

Definition at line 297 of file space.hpp.

◆ getRolesAt() [1/2]

template<int dim>
std::set< std::string > plask::GeometryD< dim >::getRolesAt ( const CoordsType 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.

Parameters
pointpoint
pathpath hints filtering out some objects
Returns
calculated set

◆ getRolesAt() [2/2]

template<int dim>
std::set< std::string > plask::GeometryD< dim >::getRolesAt ( const CoordsType 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
pointpoint
pathpath hints filtering out some objects
Returns
calculated set

◆ hasInSubtree() [1/2]

template<int dim>
bool plask::GeometryD< dim >::hasInSubtree ( const GeometryObject el) const
inlineoverridevirtual

Check if el is in subtree with child (see getChild) of this in root.

Parameters
elobject to search for
Returns
true only if el is in subtree with child of this in root

Reimplemented from plask::GeometryObject.

Definition at line 284 of file space.hpp.

◆ hasInSubtree() [2/2]

template<int dim>
bool plask::GeometryD< dim >::hasInSubtree ( shared_ptr< const GeometryObject el,
const PathHints pathHints 
) const
inline

Definition at line 286 of file space.hpp.

◆ hasRoleAt() [1/2]

template<int dim>
shared_ptr< const GeometryObject > plask::GeometryD< dim >::hasRoleAt ( const std::string &  role_name,
const CoordsType 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_namename of class
pointpoint
pathoptional 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 610 of file space.hpp.

◆ hasRoleAt() [2/2]

template<int dim>
shared_ptr< const GeometryObject > plask::GeometryD< dim >::hasRoleAt ( const std::string &  role_name,
const CoordsType 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_namename of class
pointpoint
pathoptional 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 595 of file space.hpp.

◆ initNewChild()

template<int dim>
void plask::GeometryD< dim >::initNewChild ( )
protected

Initialize bounding box cache and onChange connection.

Subclasses should call this from it's constructors (can't be moved to constructor because it uses virtual method getChildUnsafe) and after changing child.

Definition at line 118 of file space.cpp.

◆ objectIncludes() [1/3]

template<int dim>
bool plask::GeometryD< dim >::objectIncludes ( const GeometryObject object,
const CoordsType point 
) const
inline

Check if specified geometry object contains a point point.

Parameters
objectobject to test
pointpoint
Returns
true only if this geometry contains the point point

Definition at line 582 of file space.hpp.

◆ objectIncludes() [2/3]

template<int dim>
bool plask::GeometryD< dim >::objectIncludes ( const GeometryObject object,
const PathHints path,
const CoordsType point 
) const
inline

Check if specified geometry object contains a point point.

Parameters
objectobject to test
pathpath hints specifying the object
pointpoint
Returns
true only if this geometry contains the point point

Definition at line 572 of file space.hpp.

◆ objectIncludes() [3/3]

template<int dim>
bool plask::GeometryD< dim >::objectIncludes ( const GeometryObject object,
const PathHints path,
const CoordsType point 
) const
inline

Check if specified geometry object contains a point point.

Parameters
objectobject to test
pathpath hints specifying the object
pointpoint
Returns
true only if this geometry contains the point point

Definition at line 561 of file space.hpp.

◆ onChildChanged()

template<int dim>
void plask::GeometryD< dim >::onChildChanged ( const GeometryObject::Event evt)
protected

Refresh bounding box cache.

Called by childrenChanged signal. Delegate this signal.

Parameters
evt

Definition at line 106 of file space.cpp.

◆ setPlanarEdges() [1/3]

void plask::GeometryD< 2 >::setPlanarEdges ( const edge::Strategy border_to_set)
inlinevirtual

Set all planar edges or throw exception if this edges can't be set for this calculation space or direction.

Planar edges are all edges but up-bottom.

Parameters
border_to_setnew edge strategy for all planar edges

Implements plask::Geometry.

Definition at line 673 of file space.hpp.

◆ setPlanarEdges() [2/3]

void plask::GeometryD< 3 >::setPlanarEdges ( const edge::Strategy border_to_set)
inlinevirtual

Set all planar edges or throw exception if this edges can't be set for this calculation space or direction.

Planar edges are all edges but up-bottom.

Parameters
border_to_setnew edge strategy for all planar edges

Implements plask::Geometry.

Definition at line 677 of file space.hpp.

◆ setPlanarEdges() [3/3]

template<int dim>
void plask::GeometryD< dim >::setPlanarEdges ( const edge::Strategy border_to_set)
overridevirtual

Set all planar edges or throw exception if this edges can't be set for this calculation space or direction.

Planar edges are all edges but up-bottom.

Parameters
border_to_setnew edge strategy for all planar edges

Implements plask::Geometry.

◆ wrapEdges()

template<int dim>
virtual CoordsType plask::GeometryD< dim >::wrapEdges ( CoordsType  p) const
pure virtual

Wrap point to canonical position respecting edge settings (mirror, extend and periodic)

Parameters
ppoint to wrap

◆ writeXMLAttr() [1/5]

void plask::GeometryD< 2 >::writeXMLAttr ( XMLWriter::Element dest_xml_object,
const AxisNames axes 
) const
virtual

Append XML attributes of this to dest_xml_object.

By default do nothing.

Parameters
dest_xml_objectXML tag where attributes should be append
axeschosen name of axes

Reimplemented from plask::GeometryObject.

Definition at line 147 of file space.cpp.

◆ writeXMLAttr() [2/5]

void plask::GeometryD< 3 >::writeXMLAttr ( XMLWriter::Element dest_xml_object,
const AxisNames axes 
) const
virtual

Append XML attributes of this to dest_xml_object.

By default do nothing.

Parameters
dest_xml_objectXML tag where attributes should be append
axeschosen name of axes

Reimplemented from plask::GeometryObject.

Definition at line 157 of file space.cpp.

◆ writeXMLAttr() [3/5]

void plask::GeometryD< 2 >::writeXMLAttr ( XMLWriter::Element dest_xml_object,
const AxisNames axes 
) const
virtual

Append XML attributes of this to dest_xml_object.

By default do nothing.

Parameters
dest_xml_objectXML tag where attributes should be append
axeschosen name of axes

Reimplemented from plask::GeometryObject.

◆ writeXMLAttr() [4/5]

void plask::GeometryD< 3 >::writeXMLAttr ( XMLWriter::Element dest_xml_object,
const AxisNames axes 
) const
virtual

Append XML attributes of this to dest_xml_object.

By default do nothing.

Parameters
dest_xml_objectXML tag where attributes should be append
axeschosen name of axes

Reimplemented from plask::GeometryObject.

◆ writeXMLAttr() [5/5]

template<int dim>
void plask::GeometryD< dim >::writeXMLAttr ( XMLWriter::Element dest_xml_object,
const AxisNames axes 
) const
overridevirtual

Append XML attributes of this to dest_xml_object.

By default do nothing.

Parameters
dest_xml_objectXML tag where attributes should be append
axeschosen name of axes

Reimplemented from plask::GeometryObject.

Member Data Documentation

◆ cachedBoundingBox

template<int dim>
Primitive<dim>::Box plask::GeometryD< dim >::cachedBoundingBox
protected

Childs bounding box.

Definition at line 222 of file space.hpp.


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