PLaSK library
Loading...
Searching...
No Matches
plask::GeometryObject Struct Referenceabstract

Base class for all geometries. More...

#include <plask/geometry/object.hpp>

Inheritance diagram for plask::GeometryObject:
[legend]
Collaboration diagram for plask::GeometryObject:
[legend]

Classes

struct  Changer
 Base class for geometry changers. More...
 
struct  ChildrenListChangedEvent
 Event class for events types: EVENT_CHILDREN_INSERT and EVENT_CHILDREN_REMOVE. More...
 
struct  CompositeChanger
 Geometry changer which holds vector of changers and try to apply this changers sequentially. More...
 
struct  DeleteChanger
 
class  Event
 Store information about event connected with geometry object. More...
 
struct  PredicateHasRole
 Predicate which check if given object belong to class with given name. More...
 
struct  PredicateIsA
 Predicate which check if given object is another instance of some particular object (given in constructor). More...
 
struct  ReplaceChanger
 Changer which replaces given geometry object from to given geometry object to. More...
 
struct  Subtree
 This structure can refer to part of geometry tree. More...
 
struct  ToBlockChanger
 Changer which replaces given geometry object toChange to block (2d or 3d, depents from toChange) with size equals to toChange bounding box, and with given material. More...
 
class  WriteXMLCallback
 Base class for callbacks used by save() method to get names of objects and paths. More...
 

Public Types

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

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.
 
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< 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 int getDimensionsCount () const =0
 Get number of dimensions.
 
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 Subtree getPathsTo (const GeometryObject &el, const PathHints *pathHints=0) const =0
 Find paths to el.
 
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< GeometryObjectgetChildNo (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< 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.
 

Static Public Member Functions

static bool PredicateIsLeaf (const GeometryObject &el)
 Predicate which check if given object is leaf.
 

Public Attributes

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

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

Base class for all geometries.

Definition at line 80 of file object.hpp.

Member Typedef Documentation

◆ Predicate

Predicate on GeometryObject.

Definition at line 433 of file object.hpp.

Member Enumeration Documentation

◆ Type

Type of geometry object.

Enumerator
TYPE_LEAF 

leaf object (has no child)

TYPE_TRANSFORM 

transform object (has one child)

TYPE_SPACE_CHANGER 

transform object which changes its space (has one child)

TYPE_CONTAINER 

container (can have more than one child)

TYPE_GEOMETRY 

geometry / space

TYPE_SEPARATOR 

objects of this type are used internally, mainly as separators

Definition at line 82 of file object.hpp.

Constructor & Destructor Documentation

◆ GeometryObject() [1/3]

plask::GeometryObject::GeometryObject ( const GeometryObject to_copy)
inline

Initialize this to be the same as to_copy but doesn't have any changes observer.

Parameters
to_copyobject to copy

Definition at line 614 of file object.hpp.

◆ GeometryObject() [2/3]

plask::GeometryObject::GeometryObject ( )
inline

Definition at line 630 of file object.hpp.

◆ GeometryObject() [3/3]

plask::GeometryObject::GeometryObject ( unsigned  max_steps,
double  min_step_size 
)
inline

Definition at line 632 of file object.hpp.

◆ ~GeometryObject()

plask::GeometryObject::~GeometryObject ( )
virtual

Virtual destructor.

Inform all change listeners.

Definition at line 113 of file object.cpp.

Member Function Documentation

◆ addPointsAlongToSet()

virtual void plask::GeometryObject::addPointsAlongToSet ( std::set< double > &  points,
Primitive< 3 >::Direction   PLASK_UNUSEDdirection,
unsigned   PLASK_UNUSEDmax_steps,
double   PLASK_UNUSEDmin_step_size 
) const
pure virtual

Add characteristic points information along specified axis to set.

Parameters
[in,out]pointsordered set of division points along specified axis
directionaxis direction
max_stepsmaximum number of points to split single leaf
min_step_sizeminimum distance between divisions for a single leaf

◆ addRole()

void plask::GeometryObject::addRole ( std::string  role_name)
inline

Add this to given class.

Parameters
role_namename of class where this should be added

Definition at line 767 of file object.hpp.

◆ asD() [1/2]

template<int DIMS>
template shared_ptr< GeometryObjectD< 3 > > plask::GeometryObject::asD< 3 > ( )

Cast this to GeometryObjectD<DIMS>.

Returns
this casted to GeometryObjectD<DIMS> or nullptr if casting is not possible.

Definition at line 125 of file object.cpp.

◆ asD() [2/2]

template<int DIMS>
template shared_ptr< const GeometryObjectD< 3 > > plask::GeometryObject::asD< 3 > ( ) const

Cast this to GeometryObjectD<DIMS> (const version).

Returns
this casted to GeometryObjectD<DIMS> or nullptr if casting is not possible.

Definition at line 131 of file object.cpp.

◆ asGeometry() [1/2]

shared_ptr< Geometry > plask::GeometryObject::asGeometry ( )

Cast this to Geometry.

Returns
this casted to Geometry or nullptr if casting is not possible.

Definition at line 141 of file object.cpp.

◆ asGeometry() [2/2]

shared_ptr< const Geometry > plask::GeometryObject::asGeometry ( ) const

Cast this to Geometry.

Returns
this casted to Geometry or nullptr if casting is not possible.

Definition at line 145 of file object.cpp.

◆ begin()

FunctorIndexedIterator< ChildGetter > plask::GeometryObject::begin ( ) const
inline
Returns
begin begin iterator over children

Definition at line 1013 of file object.hpp.

◆ canHasAsChild()

bool plask::GeometryObject::canHasAsChild ( const GeometryObject potential_child) const
inline

Definition at line 1056 of file object.hpp.

◆ canHasAsParent()

bool plask::GeometryObject::canHasAsParent ( const GeometryObject potential_parent) const
inline

Definition at line 1058 of file object.hpp.

◆ changedConnectMethod()

boost::signals2::connection plask::GeometryObject::changedConnectMethod ( ClassT obj,
methodT  method,
boost::signals2::connect_position  at = boost::signals2::at_back 
)
inline

Connect a method to changed signal.

Parameters
obj,methodslot to connect, object and it's method
atspecifies where the slot should be connected:
  • boost::signals2::at_front indicates that the slot will be connected at the front of the list or group of slots
  • boost::signals2::at_back (default) indicates that the slot will be connected at the back of the list or group of slots

Definition at line 580 of file object.hpp.

◆ changedDisconnectMethod()

void plask::GeometryObject::changedDisconnectMethod ( ClassT obj,
methodT  method 
)
inline

Disconnect a method from changed signal.

Definition at line 587 of file object.hpp.

◆ changedVersion()

virtual shared_ptr< const GeometryObject > plask::GeometryObject::changedVersion ( const Changer changer,
Vec< 3, double > *  translation = 0 
) const
pure virtual

Get this or copy of this with some changes in subtree.

Parameters
[in]changerchanger which will be applied to subtree with this in root
[out]translationoptional, if non-null, recommended translation of this after change will be stored
Returns
pointer to this (if nothing was changed) or copy of this with some changes in subtree

Implemented in plask::Geometry2DCartesian, plask::Geometry2DCylindrical, plask::Geometry3D, plask::GeometryObjectContainer< dim >, plask::GeometryObjectLeaf< dim >, plask::GeometryObjectLeaf< 2 >, plask::GeometryObjectLeaf< 3 >, plask::GeometryObjectSeparator< dim >, plask::GeometryObjectTransform< dim, Child_Type >, plask::GeometryObjectTransform< 3 >, plask::GeometryObjectTransform< this_dim, GeometryObjectD< 5 - this_dim > >, plask::GeometryObjectTransform< this_dim, GeometryObjectD< child_dim > >, plask::Translation< dim >, and plask::Translation< DIMS >.

◆ clearRoles()

void plask::GeometryObject::clearRoles ( )
inline

Clear set of roles of this.

Definition at line 784 of file object.hpp.

◆ deepCopy() [1/2]

shared_ptr< GeometryObject > plask::GeometryObject::deepCopy ( )
inline

Get deep copy of this.

In the deep copy all children are copied.

Returns
deep copy of this

Definition at line 1051 of file object.hpp.

◆ deepCopy() [2/2]

◆ end()

FunctorIndexedIterator< ChildGetter > plask::GeometryObject::end ( ) const
inline
Returns
end end iterator over children

Definition at line 1018 of file object.hpp.

◆ ensureCanHasAsParent()

void plask::GeometryObject::ensureCanHasAsParent ( const GeometryObject potential_parent) const

Throw CyclicReferenceException if potential_parent is in subtree with this in root.

Parameters
[in]potential_parentpotential, new parent of this

Definition at line 192 of file object.cpp.

◆ ensureCanHaveAsChild()

void plask::GeometryObject::ensureCanHaveAsChild ( const GeometryObject potential_child) const
inline

Throw CyclicReferenceException if potential_child has this in subtree.

Parameters
[in]potential_childpotential, new child of this

Definition at line 1070 of file object.hpp.

◆ ensureIsValidChildNr()

void plask::GeometryObject::ensureIsValidChildNr ( std::size_t  child_no,
const char method_name = "getChildNo",
const char arg_name = "child_no" 
) const
inlineprotected

Check if given index is valid child index and throw exception of it is not.

Parameters
child_noindex to check
method_namecaller method name which is used to format exception message
arg_namename of index argument in caller method, used to format exception message
Exceptions
OutOfBoundsExceptionif index is not valid

Definition at line 1101 of file object.hpp.

◆ ensureIsValidInsertPosition()

void plask::GeometryObject::ensureIsValidInsertPosition ( std::size_t  child_no,
const char method_name = "insert",
const char arg_name = "pos" 
) const
inlineprotected

Check if given index is valid insert index and throw exception of it is not.

Parameters
child_noindex to check
method_namecaller method name which is used to format exception message
arg_namename of index argument in caller method, used to format exception message
Exceptions
OutOfBoundsExceptionif index is not valid

Definition at line 1116 of file object.hpp.

◆ fireChanged()

template<typename EventT = Event, typename... Args>
void plask::GeometryObject::fireChanged ( Args &&...  event_constructor_params_without_source)
inline

Call changed with this as event source.

Parameters
event_constructor_params_without_sourceparameters for event constructor (without first - source)

Definition at line 605 of file object.hpp.

◆ fireChildrenChanged()

void plask::GeometryObject::fireChildrenChanged ( )
inlineprotected

Inform observers that children list was changed (also that this is resized)

Definition at line 1125 of file object.hpp.

◆ fireChildrenInserted()

void plask::GeometryObject::fireChildrenInserted ( std::size_t  beginIndex,
std::size_t  endIndex 
)
inlineprotected

Definition at line 1134 of file object.hpp.

◆ fireChildrenRemoved()

void plask::GeometryObject::fireChildrenRemoved ( std::size_t  beginIndex,
std::size_t  endIndex 
)
inlineprotected

Definition at line 1129 of file object.hpp.

◆ forEachRealObjectInSubtree()

void plask::GeometryObject::forEachRealObjectInSubtree ( std::function< bool(const GeometryObject &)>  callback) const
virtual

Call a callback for each object in subtree with this in root.

Visit tree in pre-order.

Parameters
callbackcall-back to call, should return true only if descendants of object given as parameter should be visited

Definition at line 219 of file object.cpp.

◆ getChildNo()

◆ getChildrenCount()

◆ getDimensionsCount()

virtual int plask::GeometryObject::getDimensionsCount ( ) const
pure virtual

◆ getLeafs() [1/2]

std::vector< shared_ptr< const GeometryObject > > plask::GeometryObject::getLeafs ( const PathHints path) const
inline

Get all leafs in subtree with this object as root.

Parameters
pathpath hints which limits search space
Returns
all leafs in subtree with this object as root

Definition at line 905 of file object.hpp.

◆ getLeafs() [2/2]

std::vector< shared_ptr< const GeometryObject > > plask::GeometryObject::getLeafs ( const PathHints path = 0) const
inline

Get all leafs in subtree with this object as root.

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

Definition at line 894 of file object.hpp.

◆ getLeafsToVec() [1/2]

void plask::GeometryObject::getLeafsToVec ( std::vector< shared_ptr< const GeometryObject > > &  dest,
const PathHints path 
) const
inline

Append all leafs in subtree with this in root to vector dest.

Parameters
destleafs destination vector
pathpath hints which limits search space

Definition at line 885 of file object.hpp.

◆ getLeafsToVec() [2/2]

void plask::GeometryObject::getLeafsToVec ( std::vector< shared_ptr< const GeometryObject > > &  dest,
const PathHints path = 0 
) const
inline

Append all leafs in subtree with this in root to vector dest.

Parameters
destleafs destination vector
path(optional) path hints which limits search space

Definition at line 876 of file object.hpp.

◆ getObjects() [1/2]

std::vector< shared_ptr< const GeometryObject > > plask::GeometryObject::getObjects ( const Predicate predicate,
const PathHints path 
) const
inline

Get vector of all objects from subtree with this in root, which fulfill predicate.

Parameters
predicatepredicate required to match
pathpath hints which limits search space
Returns
vector of all objects from subtree with this in root, which fulfill predicate

Definition at line 867 of file object.hpp.

◆ getObjects() [2/2]

std::vector< shared_ptr< const GeometryObject > > plask::GeometryObject::getObjects ( const Predicate predicate,
const PathHints path = 0 
) const
inline

Get vector of all objects from subtree with this in root, which fulfill predicate.

Parameters
predicatepredicate required to match
path(optional) path hints which limits search space
Returns
vector of all objects from subtree with this in root, which fulfill predicate

Definition at line 854 of file object.hpp.

◆ getObjectsToVec() [1/2]

void plask::GeometryObject::getObjectsToVec ( const Predicate predicate,
std::vector< shared_ptr< const GeometryObject > > &  dest,
const PathHints path 
) const
inline

Append all objects from subtree with this in root, which fulfill predicate to vector dest.

Parameters
predicatepredicate required to match
destdestination vector
pathpath hints which limits search space

Definition at line 842 of file object.hpp.

◆ getObjectsToVec() [2/2]

virtual void plask::GeometryObject::getObjectsToVec ( const Predicate predicate,
std::vector< shared_ptr< const GeometryObject > > &  dest,
const PathHints path = 0 
) const
pure virtual

◆ getObjectsWithRole()

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

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

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

Definition at line 921 of file object.hpp.

◆ getObjectsWithRoleToVec()

void plask::GeometryObject::getObjectsWithRoleToVec ( const std::string &  role,
std::vector< shared_ptr< const GeometryObject > > &  dest 
) const
inline

Append all objects with a specified role in subtree with this in root to vector dest.

Parameters
destobjects destination vector
rolerole to search objects with

Definition at line 912 of file object.hpp.

◆ getPathsTo()

◆ getPointsAlong()

std::set< double > plask::GeometryObject::getPointsAlong ( Primitive< 3 >::Direction  direction,
unsigned  max_steps = PLASK_GEOMETRY_MAX_STEPS,
double  min_step_size = PLASK_GEOMETRY_MIN_STEP_SIZE 
) const
inline

Get characteristic points information along specified axis.

Parameters
directionaxis direction
max_stepsmaximum number of points to split single leaf
min_step_sizeminimum distance between divisions for a single leaf
Returns
ordered set of division points along specified axis

Definition at line 745 of file object.hpp.

◆ getRealChildNo()

shared_ptr< GeometryObject > plask::GeometryObject::getRealChildNo ( std::size_t  child_no) const
virtual

Get real (physically stored) child with given index.

By default call getChildNo(child_no), but objects of some types (like multi-stack) redefine this.

Parameters
child_noindex of real child to get
Returns
child with index child_no

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

Definition at line 211 of file object.cpp.

◆ getRealChildrenCount()

std::size_t plask::GeometryObject::getRealChildrenCount ( ) const
virtual

Get number of real (physically stored) children in geometry graph.

By default call getChildrenCount(), but objects of some types (like multi-stack) redefine this.

Returns
number of real children

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

Definition at line 207 of file object.cpp.

◆ getType()

◆ getTypeName()

◆ hasInSubtree() [1/3]

◆ hasInSubtree() [2/3]

bool plask::GeometryObject::hasInSubtree ( const GeometryObject el,
const PathHints pathHints 
) const
inline

Definition at line 808 of file object.hpp.

◆ hasInSubtree() [3/3]

bool plask::GeometryObject::hasInSubtree ( shared_ptr< const GeometryObject el,
const PathHints pathHints 
) const
inline

Definition at line 812 of file object.hpp.

◆ hasRole()

bool plask::GeometryObject::hasRole ( std::string  role_name) const
inline

Check if this object belongs to class (has tag) with name role_name.

Parameters
role_namename of class/tag to check
Returns
true only if this belongs to class role_name

Definition at line 758 of file object.hpp.

◆ isContainer()

bool plask::GeometryObject::isContainer ( ) const
inline

Definition at line 715 of file object.hpp.

◆ isGeometry()

bool plask::GeometryObject::isGeometry ( ) const
inline

Definition at line 716 of file object.hpp.

◆ isLeaf()

bool plask::GeometryObject::isLeaf ( ) const
inline

Definition at line 712 of file object.hpp.

◆ isSpaceChanger()

bool plask::GeometryObject::isSpaceChanger ( ) const
inline

Definition at line 714 of file object.hpp.

◆ isTransform()

bool plask::GeometryObject::isTransform ( ) const
inline

Definition at line 713 of file object.hpp.

◆ operator=()

GeometryObject & plask::GeometryObject::operator= ( const GeometryObject to_copy)
inline

Set this to be the same as to_copy but doesn't change changes observer.

Parameters
to_copyobject to copy

Definition at line 623 of file object.hpp.

◆ PredicateIsLeaf()

static bool plask::GeometryObject::PredicateIsLeaf ( const GeometryObject el)
inlinestatic

Predicate which check if given object is leaf.

Definition at line 436 of file object.hpp.

◆ removeAt()

void plask::GeometryObject::removeAt ( std::size_t  index)
inline

Remove child at given index.

Throw exception if given index is not valid, real child index.

Parameters
indexindex of real child to remove

Definition at line 972 of file object.hpp.

◆ removeAtUnsafe()

◆ removeRange()

bool plask::GeometryObject::removeRange ( std::size_t  index_begin,
std::size_t  index_end 
)
inline

Remove all children in given range [index_begin, index_end).

Parameters
index_begin,index_endrange of real children's indexes
Returns
true if something was delete

Definition at line 987 of file object.hpp.

◆ removeRangeUnsafe()

void plask::GeometryObject::removeRangeUnsafe ( std::size_t  index_begin,
std::size_t  index_end 
)
inline

Definition at line 978 of file object.hpp.

◆ removeRole()

void plask::GeometryObject::removeRole ( std::string  role_name)
inline

Remove this from given class, do nothing if this is not in given class.

Parameters
role_namename of class from where this should be removed

Definition at line 776 of file object.hpp.

◆ setMaxSteps()

void plask::GeometryObject::setMaxSteps ( unsigned  value)
inline

Set max_steps.

Definition at line 554 of file object.hpp.

◆ setMinStepSize()

void plask::GeometryObject::setMinStepSize ( double  value)
inline

Set min_step_size.

Definition at line 560 of file object.hpp.

◆ shallowCopy()

◆ validate()

virtual void plask::GeometryObject::validate ( ) const
inlinevirtual

Check if object is ready for calculation.

Throw exception if object is in bad state and can't be used in calculations, for example has not required children, etc. Default implementation do nothing, but inherited class can change this behavior.

Exceptions
Exceptionif object is not ready for calculation

Reimplemented in plask::Polygon, plask::Prism, plask::GeometryObjectTransform< dim, Child_Type >, plask::GeometryObjectTransform< 3 >, plask::GeometryObjectTransform< this_dim, GeometryObjectD< 5 - this_dim > >, and plask::GeometryObjectTransform< this_dim, GeometryObjectD< child_dim > >.

Definition at line 798 of file object.hpp.

◆ writeXML() [1/3]

void plask::GeometryObject::writeXML ( XMLWriter::Element parent_xml_object) const
inline

Write geometry tree branch rooted by this to XML.

Provides good default parameters.

Parameters
parent_xml_objectdestination, parent XML object

Definition at line 677 of file object.hpp.

◆ writeXML() [2/3]

void plask::GeometryObject::writeXML ( XMLWriter::Element parent_xml_object,
WriteXMLCallback write_cb 
) const
inline

Write geometry tree branch rooted by this to XML.

Provides good default parameters.

Parameters
parent_xml_objectdestination, parent XML object
write_cbwrite callback, used to get names for objects and paths

Definition at line 667 of file object.hpp.

◆ writeXML() [3/3]

void plask::GeometryObject::writeXML ( XMLWriter::Element parent_xml_object,
WriteXMLCallback write_cb,
AxisNames  parent_axes 
) const
virtual

Write geometry tree branch rooted by this to XML.

Default implementation write XML tag for this (with eventual name and axes attributes) call writeXMLAttr to append extra atribiutes, and write all real children. Typically you should overwrite only writeXMLAttr method.

Parameters
parent_xml_objectdestination, parent XML object
write_cbwrite callback, used to get names for objects and paths
parent_axesnames of axes (typically used by parent of this)

Reimplemented in plask::GeometryObjectContainer< dim >, plask::StackContainer< dim >, plask::Geometry2DCartesian, and plask::Geometry2DCylindrical.

Definition at line 117 of file object.cpp.

◆ writeXMLAttr()

void plask::GeometryObject::writeXMLAttr ( XMLWriter::Element dest_xml_object,
const AxisNames axes 
) const
protectedvirtual

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 in plask::ShelfContainer2D, plask::Clip< dim >, plask::Clip< dim >, plask::Clip< dim >, plask::Clip< dim >, plask::ArrangeContainer< dim >, plask::ArrangeContainer< dim >, plask::ArrangeContainer< dim >, plask::ArrangeContainer< dim >, plask::Block< dim >, plask::Block< 3 >, plask::Block< dim >, plask::Block< 3 >, plask::Block< dim >, plask::Block< 3 >, plask::Block< dim >, plask::Block< 3 >, plask::GeometryD< dim >, plask::GeometryD< 2 >, plask::GeometryD< 3 >, plask::GeometryD< dim >, plask::GeometryD< 2 >, plask::GeometryD< 3 >, plask::GeometryD< dim >, plask::GeometryD< 2 >, plask::GeometryD< 3 >, plask::GeometryD< dim >, plask::GeometryD< 2 >, plask::GeometryD< 3 >, plask::Translation< dim >, plask::Translation< DIMS >, plask::Translation< dim >, plask::Translation< DIMS >, plask::Translation< dim >, plask::Translation< DIMS >, plask::Translation< dim >, plask::Translation< DIMS >, plask::Circle< dim >, plask::Clip< dim >, plask::RotatedCuboid, plask::Cylinder, plask::HollowCylinder, plask::ArrangeContainer< dim >, plask::Lattice, plask::Block< dim >, plask::Block< 3 >, plask::Flip< dim >, plask::Mirror< dim >, plask::Polygon, plask::TriangularPrism, plask::Prism, plask::Gap1D< dim, direction >, plask::GeometryD< dim >, plask::GeometryD< 2 >, plask::GeometryD< 3 >, plask::StackContainerBaseImpl< dim, growingDirection >, plask::StackContainerBaseImpl< 2, Primitive< 2 >::DIRECTION_TRAN >, plask::Translation< dim >, plask::Translation< DIMS >, plask::Extrusion, and plask::Triangle.

Definition at line 197 of file object.cpp.

◆ writeXMLChildren()

void plask::GeometryObject::writeXMLChildren ( XMLWriter::Element dest_xml_object,
GeometryObject::WriteXMLCallback write_cb,
const AxisNames axes 
) const
protectedvirtual

Append all children of this to XML dest_xml_object.

Parameters
dest_xml_objectXML tag where attributes should be append
write_cbwrite callback, used to get names for objects and paths
axeschosen name of axes

Reimplemented in plask::Intersection< dim >, and plask::Lattice.

Definition at line 201 of file object.cpp.

Member Data Documentation

◆ changed

boost::signals2::signal<void(Event&)> plask::GeometryObject::changed

Changed signal, fired when object was changed.

Definition at line 569 of file object.hpp.

◆ max_steps

unsigned plask::GeometryObject::max_steps

Maximum number of points to split a single leaf.

Definition at line 548 of file object.hpp.

◆ min_step_size

double plask::GeometryObject::min_step_size

Minimum distance between divisions for a single leaf.

Definition at line 551 of file object.hpp.

◆ roles

std::set<std::string> plask::GeometryObject::roles

Roles/tags.

Definition at line 566 of file object.hpp.


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