PLaSK library

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

Geometry changer which holds vector of changers and try to apply this changers sequentially. More...

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

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

## Public Member Functions
| CompositeChanger (const Changer *changer)
| Construct CompositeChanger and append `changer` to its changers list.
CompositeChanger & | operator() (const Changer *changer)
| Append `changer` to changers list.
CompositeChanger & | append (const Changer *changer)
| Append `changer` to changers list.
| CompositeChanger ()
| Construct empty composit changer.
| ~CompositeChanger ()
| Delete all held changers (using delete operator).
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
std::vector< const Changer * > | changers

## Detailed Description

Geometry changer which holds vector of changers and try to apply this changers sequentially.

Its apply method call: changers[0].apply(to_change, translation), changers[1].apply(to_change, translation), ... up to time when one of this call returns `true` (and then it returns `true`) or there are no mora changers in changes vector (and then it returns `false`).

Definition at line 348 of file object.hpp.

## Constructor & Destructor Documentation

## ◆ CompositeChanger() [1/2]

plask::GeometryObject::CompositeChanger::CompositeChanger | ( | const Changer * | changer | ) |

Construct CompositeChanger and append `changer` to its changers list.

Parameters

  changer | changer to append, will be deleted by destructor of `this`

Definition at line 25 of file object.cpp.

## ◆ CompositeChanger() [2/2]

plask::GeometryObject::CompositeChanger::CompositeChanger | ( |  | ) |
| inline

Construct empty composit changer.

Definition at line 374 of file object.hpp.

## ◆ ~CompositeChanger()

plask::GeometryObject::CompositeChanger::~CompositeChanger | ( |  | ) |

Delete all held changers (using delete operator).

Definition at line 34 of file object.cpp.

## Member Function Documentation

## ◆ append()

CompositeChanger & plask::GeometryObject::CompositeChanger::append | ( | const Changer * | changer | ) |
| inline

Append `changer` to changers list.

Parameters

  changer | changer to append

Returns
  `*this`

Definition at line 369 of file object.hpp.

## ◆ apply()

bool plask::GeometryObject::CompositeChanger::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 38 of file object.cpp.

## ◆ operator()()

GeometryObject::CompositeChanger & plask::GeometryObject::CompositeChanger::operator() | ( | const Changer * | changer | ) |

Append `changer` to changers list.

Parameters

  changer | changer to append

Returns
  `*this`

Definition at line 29 of file object.cpp.

## Member Data Documentation

## ◆ changers

std::vector<const Changer*> plask::GeometryObject::CompositeChanger::changers

Definition at line 349 of file object.hpp.

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

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