PLaSK library
|
Changer which replaces given geometry object from to given geometry object to. More...
#include <plask/geometry/object.hpp>
Public Member Functions | |
ReplaceChanger () | |
Construct uninitialized changer. | |
ReplaceChanger (shared_ptr< const GeometryObject > from, shared_ptr< GeometryObject > to, Vec< 3, double > translation) | |
Construct changer which change from to to and return given translation . | |
template<typename F > | |
ReplaceChanger (const shared_ptr< const GeometryObject > &from, F calc_replace) | |
Construct changer which change from to calc_replace(to) and return zeroed translation. | |
bool | apply (shared_ptr< GeometryObject > &to_change, Vec< 3, double > *translation=0) const override |
Try to apply changes. | |
Public Member Functions inherited from plask::GeometryObject::Changer | |
virtual | ~Changer () |
Virtual destructor. Do nothing. | |
Public Attributes | |
shared_ptr< const GeometryObject > | from |
shared_ptr< GeometryObject > | to |
Vec< 3, double > | translation |
Translation to return by apply. | |
Changer which replaces given geometry object from to given geometry object to.
Definition at line 385 of file object.hpp.
|
inline |
Construct uninitialized changer.
Definition at line 393 of file object.hpp.
|
inline |
Construct changer which change from
to to
and return given translation
.
from,to,translation | changer parameters |
Definition at line 399 of file object.hpp.
|
inline |
Construct changer which change from
to calc_replace(to) and return zeroed translation.
from | object which should be changed |
calc_replace | functor which is used to calculate change destination object |
Definition at line 408 of file object.hpp.
|
overridevirtual |
Try to apply changes.
[in,out] | to_change | pointer to object which eventually will be changed (in such case pointer after call can point to another geometry object) |
[out] | translation | optional, extra translation for object after change (in case of 2d object caller reads only tran and up components of this vector) |
true
only if something was changed, false
if nothing was changed (in such case changer doesn't change arguments) Implements plask::GeometryObject::Changer.
Definition at line 43 of file object.cpp.
shared_ptr<const GeometryObject> plask::GeometryObject::ReplaceChanger::from |
Definition at line 386 of file object.hpp.
shared_ptr<GeometryObject> plask::GeometryObject::ReplaceChanger::to |
Definition at line 387 of file object.hpp.
Translation to return by apply.
Definition at line 390 of file object.hpp.