PLaSK library

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
plask::GeometryObject::ReplaceChanger Struct Reference

Changer which replaces given geometry object from to given geometry object to. More...

`#include <plask/geometry/object.hpp>`

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

## 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.

## Detailed Description

Changer which replaces given geometry object from to given geometry object to.

Definition at line 385 of file object.hpp.

## Constructor & Destructor Documentation

## ◆ ReplaceChanger() [1/3]

plask::GeometryObject::ReplaceChanger::ReplaceChanger | ( |  | ) |
| inline

Construct uninitialized changer.

Definition at line 393 of file object.hpp.

## ◆ ReplaceChanger() [2/3]

plask::GeometryObject::ReplaceChanger::ReplaceChanger | ( | shared_ptr< const GeometryObject > | from,
|  | shared_ptr< GeometryObject > | to,
|  | Vec< 3, double > | translation
| ) |  |
| inline

Construct changer which change `from` to `to` and return given `translation`.

Parameters

  from,to,translation | changer parameters

Definition at line 399 of file object.hpp.

## ◆ ReplaceChanger() [3/3]

template<typename F >

plask::GeometryObject::ReplaceChanger::ReplaceChanger | ( | const shared_ptr< const GeometryObject > & | from,
|  | F | calc_replace
| ) |  |
| inline

Construct changer which change `from` to calc_replace(to) and return zeroed translation.

Parameters

  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.

## Member Function Documentation

## ◆ apply()

bool plask::GeometryObject::ReplaceChanger::apply | ( | shared_ptr< GeometryObject > & | to_change,
|  | Vec< 3, double > * | translation = `0`
| ) |  | const
| override virtual

Try to apply changes.

Parameters

  [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)

Returns
  `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.

## Member Data Documentation

## ◆ from

shared_ptr<const GeometryObject> plask::GeometryObject::ReplaceChanger::from

Definition at line 386 of file object.hpp.

## ◆ to

shared_ptr<GeometryObject> plask::GeometryObject::ReplaceChanger::to

Definition at line 387 of file object.hpp.

## ◆ translation

Vec<3, double> plask::GeometryObject::ReplaceChanger::translation

Translation to return by apply.

Definition at line 390 of file object.hpp.

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

- plask/geometry/object.hpp
- plask/geometry/object.cpp