PLaSK library
Loading...
Searching...
No Matches
plask::Lattice Struct Reference

Lattice container that arranges its children in two-dimensional lattice. More...

#include <plask/geometry/lattice.hpp>

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

Public Types

typedef GeometryObjectTransform< 3 >::DVec DVec
 Vector of doubles type in space on this, vector in space with dim number of dimensions.
 
typedef GeometryObjectTransform< 3 >::Box Box
 Rectangle type in space on this, rectangle in space with dim number of dimensions.
 
typedef GeometryObjectTransform< 3 >::ChildType ChildType
 Type of this child.
 
- Public Types inherited from plask::GeometryObjectTransform< 3 >
typedef GeometryObjectD< dim >::DVec DVec
 
typedef GeometryObjectD< dim >::Box Box
 
typedef GeometryObjectD< dim > ChildType
 
- Public Types inherited from plask::GeometryObjectD< dim >
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

std::string getTypeName () const override
 Get name of object type (like: "block2d", "shelf", "stack3d", etc.).
 
 Lattice (const shared_ptr< ChildType > &child=shared_ptr< ChildType >(), const DVec &vec0=Primitive< 3 >::ZERO_VEC, const DVec &vec1=Primitive< 3 >::ZERO_VEC)
 Create a lattice object.
 
shared_ptr< MaterialgetMaterial (const DVec &p) const override
 
bool contains (const DVec &p) const override
 
void onChildChanged (const GeometryObject::Event &evt) override
 Called by child.change signal, call this change.
 
void writeXMLAttr (XMLWriter::Element &dest_xml_object, const AxisNames &axes) const override
 Append XML attributes of this to dest_xml_object.
 
void writeXMLChildren (XMLWriter::Element &dest_xml_object, WriteXMLCallback &write_cb, const AxisNames &axes) const override
 Append all children of this to XML dest_xml_object.
 
Box getBoundingBox () const override
 Calculate minimal rectangle which contains all points of geometry object.
 
Box getRealBoundingBox () const override
 Calculate minimal rectangle which contains all points of real geometry object.
 
void getBoundingBoxesToVec (const GeometryObject::Predicate &predicate, std::vector< Box > &dest, const PathHints *path=0) const override
 
void getObjectsToVec (const GeometryObject::Predicate &predicate, std::vector< shared_ptr< const GeometryObject > > &dest, const PathHints *path=0) const override
 Append all objects from subtree with this in root, which fulfill predicate to vector dest.
 
void getPositionsToVec (const GeometryObject::Predicate &predicate, std::vector< DVec > &dest, const PathHints *path=0) const override
 
GeometryObject::Subtree getPathsTo (const GeometryObject &el, const PathHints *path=0) const override
 Find paths to el.
 
GeometryObject::Subtree getPathsAt (const DVec &point, bool all=false) const override
 
std::size_t getChildrenCount () const override
 Get number of all children of this in geometry graph.
 
shared_ptr< GeometryObjectgetChildNo (std::size_t child_no) const override
 Get child with given index.
 
std::size_t getRealChildrenCount () const override
 Get number of real (physically stored) children in geometry graph.
 
shared_ptr< GeometryObjectgetRealChildNo (std::size_t child_no) const override
 Get real (physically stored) child with given index.
 
shared_ptr< LatticecopyShallow () const
 
shared_ptr< GeometryObjectshallowCopy () const override
 Get shallow copy of this.
 
void addPointsAlongToSet (std::set< double > &points, Primitive< 3 >::Direction direction, unsigned max_steps, double min_step_size) const override
 
void addLineSegmentsToSet (std::set< typename GeometryObjectD< 3 >::LineSegment > &segments, unsigned max_steps, double min_step_size) const override
 
Box fromChildCoords (const typename ChildType::Box &child_bbox) const override
 
void setSegments (std::vector< std::vector< Vec< 2, int > > > new_segments)
 
void refillContainer ()
 Use segments, vec0, vec1 to refill container.
 
- Public Member Functions inherited from plask::GeometryObjectTransform< 3 >
 GeometryObjectTransform (shared_ptr< ChildType > child=nullptr)
 
 GeometryObjectTransform (ChildType &child)
 
virtual ~GeometryObjectTransform ()
 
GeometryObject::Type getType () const override
 Check if geometry is: leaf, transform or container type object.
 
void connectOnChildChanged ()
 Connect onChildChanged to current child change signal.
 
void disconnectOnChildChanged ()
 Disconnect onChildChanged from current child change signal.
 
shared_ptr< ChildTypegetChild () const
 Get child.
 
void setChildUnsafe (const shared_ptr< ChildType > &child)
 Set new child.
 
void setChild (const shared_ptr< ChildType > &child)
 Set new child.
 
bool hasChild () const
 
void validate () const override
 Throws NoChildException if child is not set.
 
bool hasInSubtree (const GeometryObject &el) const override
 Check if el is in subtree with this in root.
 
shared_ptr< GeometryObjectTransform< dim, GeometryObjectD< dim > > > shallowCopyWithChild (const shared_ptr< ChildType > &child) const
 Get copy of this, and change child in the copy,.
 
shared_ptr< GeometryObjectdeepCopy (std::map< const GeometryObject *, shared_ptr< GeometryObject > > &copied) const override
 Get deep copy of this.
 
shared_ptr< const GeometryObjectchangedVersion (const GeometryObject::Changer &changer, Vec< 3, double > *translation=0) const override
 Get this or copy of this with some changes in subtree.
 
void removeAtUnsafe (std::size_t) override
 Remove child at given index.
 
virtual Box fromChildCoords (const typename ChildType::Box &child_bbox) const=0
 Convert bounding box from child's to this's coordinates.
 
void getBoundingBoxesToVec (const GeometryObject::Predicate &predicate, std::vector< Box > &dest, const PathHints *path) const override
 Calculate and append to vector bounding boxes of all nodes which fulfill given predicate, optionally marked by path.
 
bool childHasType (GeometryObject::Type type) const
 Check if child of this has given type.
 
- Public Member Functions inherited from plask::GeometryObjectD< dim >
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 DVec getBoundingBoxSize () const
 
virtual shared_ptr< MaterialgetMaterial (const DVec &p) const =0
 Return material in a given point inside the geometry object.
 
shared_ptr< MaterialgetMaterialOrAir (const DVec &p) const
 Return material in a given point inside the geometry object.
 
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< BoxgetBoundingBoxes (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< BoxgetBoundingBoxes (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< BoxgetLeafsBoundingBoxes (const PathHints *path=0) const
 Calculate bounding boxes of all leafs, optionally marked by path.
 
std::vector< BoxgetLeafsBoundingBoxes (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< BoxgetObjectBoundingBoxes (const GeometryObject &object, const PathHints *path=0) const
 Calculate bounding boxes of all instances of given object, optionally marked by path.
 
std::vector< BoxgetObjectBoundingBoxes (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< DVecgetPositions (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< DVecgetPositions (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< DVecgetLeafsPositions (const PathHints *path=0) const
 Calculate and return a vector of positions of all leafs, optionally marked by path.
 
std::vector< DVecgetLeafsPositions (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< DVecgetObjectPositions (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< DVecgetObjectPositions (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 GeometryObjectgetMatchingAt (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 GeometryObjectgetMatchingAt (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 GeometryObjecthasRoleAt (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 GeometryObjecthasRoleAt (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< LineSegmentgetLineSegments (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.
 
- 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 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.
 
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.
 
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
 
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.
 

Public Attributes

DVec vec0
 Basis vectors.
 
DVec vec1
 
shared_ptr< TranslationContainer< 3 > > container
 
std::vector< std::vector< Vec< 2, int > > > segments
 Vector of closed polygons, each consist of number of successive verticles, one side is between last and first vertex.
 
- 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 Public Attributes

static const charNAME = PLASK_LATTICE_NAME
 
- Static Public Attributes inherited from plask::GeometryObjectD< dim >
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.
 
- Protected Member Functions inherited from plask::GeometryObject
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)
 
- Static Protected Member Functions inherited from plask::GeometryObjectTransform< 3 >
static void _getNotChangedPositionsToVec (ThisType _this, const GeometryObject::Predicate &predicate, std::vector< DVec > &dest, const PathHints *path)
 Possible implementation for getPositionsToVec, which does not change children position and is used by many subclasses.
 
- Protected Attributes inherited from plask::GeometryObjectTransform< 3 >
shared_ptr< ChildType_child
 

Detailed Description

Lattice container that arranges its children in two-dimensional lattice.

Definition at line 150 of file lattice.hpp.

Member Typedef Documentation

◆ Box

Rectangle type in space on this, rectangle in space with dim number of dimensions.

Definition at line 155 of file lattice.hpp.

◆ ChildType

Type of this child.

Definition at line 158 of file lattice.hpp.

◆ DVec

Vector of doubles type in space on this, vector in space with dim number of dimensions.

Definition at line 152 of file lattice.hpp.

Constructor & Destructor Documentation

◆ Lattice()

plask::Lattice::Lattice ( const shared_ptr< ChildType > &  child = shared_ptr<ChildType>(),
const DVec vec0 = Primitive<3>::ZERO_VEC,
const DVec vec1 = Primitive<3>::ZERO_VEC 
)
inline

Create a lattice object.

Parameters
childObject to repeat.
vec0,vec1basis vectors

Definition at line 182 of file lattice.hpp.

Member Function Documentation

◆ addLineSegmentsToSet()

void plask::Lattice::addLineSegmentsToSet ( std::set< typename GeometryObjectD< 3 >::LineSegment > &  segments,
unsigned  max_steps,
double  min_step_size 
) const
override

Definition at line 454 of file lattice.cpp.

◆ addPointsAlongToSet()

void plask::Lattice::addPointsAlongToSet ( std::set< double > &  points,
Primitive< 3 >::Direction  direction,
unsigned  max_steps,
double  min_step_size 
) const
override

Definition at line 445 of file lattice.cpp.

◆ contains()

bool plask::Lattice::contains ( const DVec p) const
inlineoverride

Definition at line 192 of file lattice.hpp.

◆ copyShallow()

shared_ptr< Lattice > plask::Lattice::copyShallow ( ) const
inline

Definition at line 251 of file lattice.hpp.

◆ fromChildCoords()

Box plask::Lattice::fromChildCoords ( const typename ChildType::Box &  child_bbox) const
inlineoverride

Definition at line 269 of file lattice.hpp.

◆ getBoundingBox()

Box plask::Lattice::getBoundingBox ( ) const
inlineoverridevirtual

Calculate minimal rectangle which contains all points of geometry object.

Returns
calculated rectangle

Reimplemented from plask::GeometryObjectTransform< 3 >.

Definition at line 211 of file lattice.hpp.

◆ getBoundingBoxesToVec()

void plask::Lattice::getBoundingBoxesToVec ( const GeometryObject::Predicate predicate,
std::vector< Box > &  dest,
const PathHints path = 0 
) const
override

Definition at line 338 of file lattice.cpp.

◆ getChildNo()

shared_ptr< GeometryObject > plask::Lattice::getChildNo ( std::size_t  child_no) const
inlineoverridevirtual

Get child with given index.

Parameters
child_noindex of child to get
Returns
child with index child_no

Reimplemented from plask::GeometryObjectTransform< 3 >.

Definition at line 241 of file lattice.hpp.

◆ getChildrenCount()

std::size_t plask::Lattice::getChildrenCount ( ) const
inlineoverridevirtual

Get number of all children of this in geometry graph.

Returns
number of children

Reimplemented from plask::GeometryObjectTransform< 3 >.

Definition at line 239 of file lattice.hpp.

◆ getMaterial()

shared_ptr< Material > plask::Lattice::getMaterial ( const DVec p) const
inlineoverride

Definition at line 190 of file lattice.hpp.

◆ getObjectsToVec()

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

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

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

Reimplemented from plask::GeometryObjectTransform< 3 >.

Definition at line 350 of file lattice.cpp.

◆ getPathsAt()

GeometryObject::Subtree plask::Lattice::getPathsAt ( const DVec point,
bool  all = false 
) const
inlineoverride

Definition at line 235 of file lattice.hpp.

◆ getPathsTo()

GeometryObject::Subtree plask::Lattice::getPathsTo ( const GeometryObject el,
const PathHints pathHints = 0 
) const
overridevirtual

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 this in root

Reimplemented from plask::GeometryObjectTransform< 3 >.

Definition at line 372 of file lattice.cpp.

◆ getPositionsToVec()

void plask::Lattice::getPositionsToVec ( const GeometryObject::Predicate predicate,
std::vector< DVec > &  dest,
const PathHints path = 0 
) const
override

Definition at line 361 of file lattice.cpp.

◆ getRealBoundingBox()

Box plask::Lattice::getRealBoundingBox ( ) const
inlineoverridevirtual

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 from plask::GeometryObjectD< dim >.

Definition at line 213 of file lattice.hpp.

◆ getRealChildNo()

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

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 from plask::GeometryObject.

Definition at line 247 of file lattice.hpp.

◆ getRealChildrenCount()

std::size_t plask::Lattice::getRealChildrenCount ( ) const
inlineoverridevirtual

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 from plask::GeometryObject.

Definition at line 245 of file lattice.hpp.

◆ getTypeName()

std::string plask::Lattice::getTypeName ( ) const
inlineoverridevirtual

Get name of object type (like: "block2d", "shelf", "stack3d", etc.).

This name is used as tag name when object is serialized to XML.

Returns
name of object type

Implements plask::GeometryObject.

Definition at line 175 of file lattice.hpp.

◆ onChildChanged()

void plask::Lattice::onChildChanged ( const GeometryObject::Event evt)
inlineoverridevirtual

Called by child.change signal, call this change.

Reimplemented from plask::GeometryObjectTransform< 3 >.

Definition at line 195 of file lattice.hpp.

◆ refillContainer()

void plask::Lattice::refillContainer ( )

Use segments, vec0, vec1 to refill container.

Definition at line 379 of file lattice.cpp.

◆ setSegments()

void plask::Lattice::setSegments ( std::vector< std::vector< Vec< 2, int > > >  new_segments)

Definition at line 497 of file lattice.cpp.

◆ shallowCopy()

shared_ptr< GeometryObject > plask::Lattice::shallowCopy ( ) const
inlineoverridevirtual

Get shallow copy of this.

In the shallow copy all children are the same

Returns
shallow copy of this

Implements plask::GeometryObject.

Definition at line 257 of file lattice.hpp.

◆ writeXMLAttr()

void plask::Lattice::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.

Definition at line 462 of file lattice.cpp.

◆ writeXMLChildren()

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

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 from plask::GeometryObject.

Definition at line 474 of file lattice.cpp.

Member Data Documentation

◆ container

shared_ptr<TranslationContainer<3> > plask::Lattice::container

Definition at line 167 of file lattice.hpp.

◆ NAME

const char * plask::Lattice::NAME = PLASK_LATTICE_NAME
static

Definition at line 162 of file lattice.hpp.

◆ segments

std::vector<std::vector<Vec<2, int> > > plask::Lattice::segments

Vector of closed polygons, each consist of number of successive verticles, one side is between last and first vertex.

These polygons are xored. Sides must not cross each other.

Definition at line 173 of file lattice.hpp.

◆ vec0

DVec plask::Lattice::vec0

Basis vectors.

Definition at line 165 of file lattice.hpp.

◆ vec1

DVec plask::Lattice::vec1

Definition at line 165 of file lattice.hpp.


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