PLaSK library

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
plask::align::AlignerImpl< _direction > Struct Template Referenceabstract

Helper which allow to implement base class for aligners which work in one direction. More...

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

Inheritance diagram for plask::align::AlignerImpl< _direction >:
[legend]
Collaboration diagram for plask::align::AlignerImpl< _direction >:
[legend]

## Public Member Functions
| AlignerImpl (double coordinate)
| Construct new aligner.
virtual | ~AlignerImpl ()
virtual double | getAlign (double low, double hi) const =0
| Get translation for aligned obiect.
virtual bool | useBounds () const
| Check if this aligner getAlign use bounds (low and hi parameters) in calculation.
double | align (Translation< 3 > &toAlign, const Box3D &childBoundingBox) const
| Set object coordinate in direction of aligner activity.
virtual double | align (Translation< 3 > &toAlign) const
| Set object translation in direction of aligner activity.
virtual std::string | key (const AxisNames &axis_names) const =0
| Get aligner name.
std::map< std::string, double > | asDict (const AxisNames &axis_names) const
| Get aligner as dictionary.
void | writeToXML (XMLElement &dest, const AxisNames &axis_names) const
| Write this aligner to XML.
Public Member Functions inherited from plask::Printable
virtual void | print (std::ostream &out) const =0
| Print this to stream `out`.
virtual | ~Printable ()
std::string | str () const
| Get string representation of this using print method.

## Public Attributes
double | coordinate
| Coordinate to which this aligner aligns.

## Static Public Attributes
static const Direction | direction = _direction
| Direction of activity.

## Detailed Description

template<Direction _direction>
struct plask::align::AlignerImpl< _direction >

Helper which allow to implement base class for aligners which work in one direction.

Don't use it directly, use Aligner instead.

Template Parameters

  _direction | direction of activity

See also
  Aligner

Definition at line 60 of file align.hpp.

## Constructor & Destructor Documentation

## ◆ AlignerImpl()

template<Direction _direction>

plask::align::AlignerImpl< _direction >::AlignerImpl | ( | double | coordinate | ) |
| inline

Construct new aligner.

Parameters

  coordinate | coordinate to which this aligner aligns.

Definition at line 72 of file align.hpp.

## ◆ ~AlignerImpl()

template<Direction _direction>

virtual plask::align::AlignerImpl< _direction >::~AlignerImpl | ( |  | ) |
| inline virtual

Definition at line 74 of file align.hpp.

## Member Function Documentation

## ◆ align() [1/2]

template<Direction _direction>

virtual double plask::align::AlignerImpl< _direction >::align | ( | Translation< 3 > & | toAlign | ) | const
| inline virtual

Set object translation in direction of aligner activity.

This version is called if caller doesn't know child bounding box.

Parameters

  toAlign | translation to set, should have child, which is an object to align

Definition at line 106 of file align.hpp.

## ◆ align() [2/2]

template<Direction _direction>

double plask::align::AlignerImpl< _direction >::align | ( | Translation< 3 > & | toAlign,
|  | const Box3D & | childBoundingBox
| ) |  | const
| inline

Set object coordinate in direction of aligner activity.

This version is called if caller knows child bounding box.

Parameters

  toAlign | translation to set, should have child, which is an object to align
  childBoundingBox | bounding box of object to align

Definition at line 96 of file align.hpp.

## ◆ asDict()

template<Direction _direction>

std::map< std::string, double > plask::align::AlignerImpl< _direction >::asDict | ( | const AxisNames & | axis_names | ) | const
| inline

Get aligner as dictionary.

Parameters

  axis_names | name of axes

Returns
  string:double map representing the aligner

Definition at line 125 of file align.hpp.

## ◆ getAlign()

template<Direction _direction>

virtual double plask::align::AlignerImpl< _direction >::getAlign | ( | double | low,
|  | double | hi
| ) |  | const
| pure virtual

Get translation for aligned obiect.

Parameters

  low,hi | aligned object bounds in direction of activity of this aligner

Returns
  aligned obiect translation in direction of activity

Implemented in plask::align::details::AlignerCustomImpl< direction, strategy, name_tag >.

## ◆ key()

template<Direction _direction>

virtual std::string plask::align::AlignerImpl< _direction >::key | ( | const AxisNames & | axis_names | ) | const
| pure virtual

Get aligner name.

Parameters

  axis_names | name of axes

Returns
  name of the aligner

Implemented in plask::align::details::AlignerCustomImpl< direction, strategy, name_tag >, and plask::align::details::PositionAlignerImpl< direction >.

## ◆ useBounds()

template<Direction _direction>

virtual bool plask::align::AlignerImpl< _direction >::useBounds | ( |  | ) | const
| inline virtual

Check if this aligner getAlign use bounds (low and hi parameters) in calculation.

Returns
  `true` only if this aligner use bounds, `false` if bounds are ignored

Reimplemented in plask::align::details::PositionAlignerImpl< direction >.

Definition at line 87 of file align.hpp.

## ◆ writeToXML()

template<Direction _direction>

void plask::align::AlignerImpl< _direction >::writeToXML | ( | XMLElement & | dest,
|  | const AxisNames & | axis_names
| ) |  | const
| inline

Write this aligner to XML.

Parameters

  dest | tag where attributes describing this should be appended
  axis_names | name of axes

Definition at line 136 of file align.hpp.

## Member Data Documentation

## ◆ coordinate

template<Direction _direction>

double plask::align::AlignerImpl< _direction >::coordinate

Coordinate to which this aligner aligns.

Definition at line 66 of file align.hpp.

## ◆ direction

template<Direction _direction>

const Direction plask::align::AlignerImpl< _direction >::direction = _direction
| static

Direction of activity.

Definition at line 63 of file align.hpp.

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

- plask/geometry/align.hpp