PLaSK library
|
Base, abstract for all classes which describe what do with points outside geometry in calculation space. More...
#include <plask/geometry/edge.hpp>
Public Types | |
enum | Type { DEFAULT , SIMPLE , EXTEND , PERIODIC , MIRROR } |
Enum holding strategy types. More... | |
Public Member Functions | |
virtual | ~Strategy () |
virtual Type | type () const =0 |
virtual void | applyLo (double bbox_lo, double bbox_hi, double &p, shared_ptr< Material > &result_material, const Strategy *opposite) const =0 |
Apply strategy to given point p . | |
virtual void | applyHi (double bbox_lo, double bbox_hi, double &p, shared_ptr< Material > &result_material, const Strategy *opposite) const =0 |
Apply strategy to given point p . | |
virtual bool | canMoveOutsideBoundingBox () const |
Check if this strategy can move point p to place outside bounding box. | |
virtual Strategy * | clone () const =0 |
Clone this strategy. | |
virtual std::string | str () const =0 |
Get string representation of this strategy. | |
Static Public Member Functions | |
static Strategy * | fromStr (const std::string &str, const MaterialsDB &materialsDB=MaterialsDB::getDefault()) |
Create new strategy (using operator new) described by string str . | |
static std::unique_ptr< Strategy > | fromStrUnique (const std::string &str, const MaterialsDB &materialsDB=MaterialsDB::getDefault()) |
Create new strategy described by string str . | |
Base, abstract for all classes which describe what do with points outside geometry in calculation space.
|
pure virtual |
Apply strategy to given point p
.
[in] | bbox_lo,bbox_hi | coordinates of geometry object bounding box in strategy working direction |
[in,out] | p | coordinate of point in strategy working direction, it's (must be) higher than bbox_hi , this method can move this point |
[out] | result_material | optionally, this method can assign to it material which should be used |
[in] | opposite | strategy at opposite side (if known) |
Implemented in plask::edge::Null, plask::edge::SimpleMaterial, plask::edge::Extend, plask::edge::Periodic, and plask::edge::Mirror.
|
pure virtual |
Apply strategy to given point p
.
[in] | bbox_lo,bbox_hi | coordinates of geometry object bounding box in strategy working direction |
[in,out] | p | coordinate of point in strategy working direction, it's (must be) lower than bbox_lo , this method can move this point |
[out] | result_material | optionally, this method can assign to it material which should be used |
[in] | opposite | strategy at opposite side (if known) |
Implemented in plask::edge::Null, plask::edge::SimpleMaterial, plask::edge::Extend, plask::edge::Periodic, and plask::edge::Mirror.
|
virtual |
Check if this strategy can move point p to place outside bounding box.
Default implementation return false
.
true
if this strategy can move point p to place outside bounding box, false
if this strategy always move point p to bounding box or doesn't move p at all Reimplemented in plask::edge::Mirror.
Clone this strategy.
Implemented in plask::edge::Null, plask::edge::SimpleMaterial, plask::edge::Extend, plask::edge::Periodic, plask::edge::Mirror, and plask::edge::UniversalStrategy.
|
static |
Create new strategy (using operator new) described by string str
.
Throw exception if str
not describe strategy.
str | string which represent strategy, one of: "null", "periodic", "extend", "mirror", or material. |
materialsDB | source of materials, typically material database, used to get material |
|
inlinestatic |
Create new strategy described by string str
.
Throw exception if str
not describe strategy.
str | string which represent strategy, one of: "null", "periodic", "extend", "mirror", or material. |
materialsDB | source of materials, typically material database, used to get material |
std::unique_ptr<Strategy>(fromStr(str, materialsDB))
|
pure virtual |
Get string representation of this strategy.
Implemented in plask::edge::Null, plask::edge::SimpleMaterial, plask::edge::Extend, plask::edge::Periodic, and plask::edge::Mirror.
Implemented in plask::edge::Null, plask::edge::SimpleMaterial, plask::edge::Extend, plask::edge::Periodic, and plask::edge::Mirror.