PLaSK library
Loading...
Searching...
No Matches
plask::align Namespace Reference

Namespaces

namespace  details
 

Classes

struct  Aligner
 
struct  Aligner< _direction >
 Base class for one direction aligners (in 2D and 3D spaces). More...
 
struct  Aligner< _direction1, _direction2 >
 Two directions aligner in 3D space, compose and use two 1D aligners. More...
 
struct  Aligner< Primitive< 3 >::Direction(0), Primitive< 3 >::Direction(1), Primitive< 3 >::Direction(2)>
 Three directions aligner in 3D space, compose and use three 1D aligners. More...
 
struct  Aligner< Primitive< 3 >::DIRECTION_LONG >
 
struct  Aligner< Primitive< 3 >::DIRECTION_TRAN, Primitive< 3 >::DIRECTION_VERT >
 Two directions aligner in 2D and 3D space, compose and use two 1D aligners. More...
 
struct  AlignerBase
 
struct  AlignerBase2D
 Base class for two directions aligner in 3D space, compose and use two 2D aligners. More...
 
struct  AlignerImpl
 Helper which allow to implement base class for aligners which work in one direction. More...
 
struct  DictionaryFromXML
 Allow to use XMLReader as dictionary which is required by aligners parsing functions. More...
 
struct  DirectionTo2D
 Convert Direction to 2D vector direction. More...
 
struct  DirectionTo2D< Primitive< 3 >::DIRECTION_TRAN >
 
struct  DirectionTo2D< Primitive< 3 >::DIRECTION_VERT >
 

Typedefs

typedef Primitive< 3 >::Direction Direction
 Directions of aligners activity, same as vec<3, T> directions.
 
typedef Aligner< Primitive< 3 >::DIRECTION_TRAN, Primitive< 3 >::DIRECTION_VERT > Aligner2D
 
typedef Aligner< Primitive< 3 >::Direction(0), Primitive< 3 >::Direction(1), Primitive< 3 >::Direction(2)> Aligner3D
 
template<int dim>
using AlignerD = typename chooseType< dim-2, Aligner2D, Aligner3D >::type
 Aligner2D if dim == 2, Aligner3D if dim == 3.
 
template<Primitive< 3 >::Direction dir>
using LowerBoundImpl = details::AlignerCustomImpl< dir, details::lowToCoordinate, typename chooseType< dir, details::BACK, details::LEFT, details::BOTTOM >::type >
 
typedef std::function< plask::optional< double >(const std::string &name)> Dictionary
 

Functions

Aligner< Primitive< 3 >::Direction(0), Primitive< 3 >::Direction(1)> operator& (const Aligner< Primitive< 3 >::Direction(0)> &dir1aligner, const Aligner< Primitive< 3 >::Direction(1)> &dir2aligner)
 
Aligner< Primitive< 3 >::Direction(0), Primitive< 3 >::Direction(1)> operator& (const Aligner< Primitive< 3 >::Direction(1)> &dir1aligner, const Aligner< Primitive< 3 >::Direction(0)> &dir2aligner)
 
Aligner< Primitive< 3 >::Direction(0), Primitive< 3 >::Direction(2)> operator& (const Aligner< Primitive< 3 >::Direction(0)> &dir1aligner, const Aligner< Primitive< 3 >::Direction(2)> &dir2aligner)
 
Aligner< Primitive< 3 >::Direction(0), Primitive< 3 >::Direction(2)> operator& (const Aligner< Primitive< 3 >::Direction(2)> &dir1aligner, const Aligner< Primitive< 3 >::Direction(0)> &dir2aligner)
 
Aligner< Primitive< 3 >::Direction(1), Primitive< 3 >::Direction(2)> operator& (const Aligner< Primitive< 3 >::Direction(1)> &dir1aligner, const Aligner< Primitive< 3 >::Direction(2)> &dir2aligner)
 
Aligner< Primitive< 3 >::Direction(1), Primitive< 3 >::Direction(2)> operator& (const Aligner< Primitive< 3 >::Direction(2)> &dir1aligner, const Aligner< Primitive< 3 >::Direction(1)> &dir2aligner)
 
Aligner3D operator& (const Aligner< Primitive< 3 >::Direction(1), Primitive< 3 >::Direction(2)> &dir12aligner, const Aligner< Primitive< 3 >::Direction(0)> &dir0aligner)
 
Aligner3D operator& (const Aligner< Primitive< 3 >::Direction(0)> &dir0aligner, const Aligner< Primitive< 3 >::Direction(1), Primitive< 3 >::Direction(2)> &dir12aligner)
 
Aligner3D operator& (const Aligner< Primitive< 3 >::Direction(0), Primitive< 3 >::Direction(2)> &dir02aligner, const Aligner< Primitive< 3 >::Direction(1)> &dir1aligner)
 
Aligner3D operator& (const Aligner< Primitive< 3 >::Direction(1)> &dir1aligner, const Aligner< Primitive< 3 >::Direction(0), Primitive< 3 >::Direction(2)> &dir02aligner)
 
Aligner3D operator& (const Aligner< Primitive< 3 >::Direction(0), Primitive< 3 >::Direction(1)> &dir01aligner, const Aligner< Primitive< 3 >::Direction(2)> &dir2aligner)
 
Aligner3D operator& (const Aligner< Primitive< 3 >::Direction(2)> &dir2aligner, const Aligner< Primitive< 3 >::Direction(0), Primitive< 3 >::Direction(1)> &dir01aligner)
 
Aligner< Primitive< 3 >::DIRECTION_TRAN > left (double coordinate)
 
Aligner< Primitive< 3 >::DIRECTION_TRAN > right (double coordinate)
 
Aligner< Primitive< 3 >::DIRECTION_TRAN > tranCenter (double coordinate)
 
Aligner< Primitive< 3 >::DIRECTION_TRAN > center (double coordinate)
 
Aligner< Primitive< 3 >::DIRECTION_TRAN > tran (double coordinate)
 
Aligner< Primitive< 3 >::DIRECTION_LONG > front (double coordinate)
 
Aligner< Primitive< 3 >::DIRECTION_LONG > back (double coordinate)
 
Aligner< Primitive< 3 >::DIRECTION_LONG > lonCenter (double coordinate)
 
Aligner< Primitive< 3 >::DIRECTION_LONG > lon (double coordinate)
 
Aligner< Primitive< 3 >::DIRECTION_VERT > bottom (double coordinate)
 
Aligner< Primitive< 3 >::DIRECTION_VERT > top (double coordinate)
 
Aligner< Primitive< 3 >::DIRECTION_VERT > vertCenter (double coordinate)
 
Aligner< Primitive< 3 >::DIRECTION_VERT > vert (double coordinate)
 
Aligner2D fromVector (const Vec< 2, double > &v)
 
Aligner3D fromVector (const Vec< 3, double > &v)
 
template<Primitive< 3 >::Direction dir>
Aligner< dirlowerBoundZero ()
 Get aligner with align in one direction to lower bound.
 
template<Primitive< 3 >::Direction dir1, Primitive< 3 >::Direction dir2>
Aligner< dir1, dir2lowerBoundZero ()
 
template<Direction direction>
Aligner< direction > fromDictionary (Dictionary dictionary, const std::string &axis_name)
 Construct aligner in given direction from dictionary.
 
template<Direction direction>
Aligner< direction > fromDictionary (Dictionary dic, const AxisNames &axis_names)
 Construct aligner in given direction from dictionary.
 
template<Direction direction>
Aligner< direction > fromDictionary (Dictionary dictionary, const AxisNames &axis_names, Aligner< direction > default_aligner)
 Construct aligner in given direction from dictionary.
 
template<Direction direction>
Aligner< direction > fromXML (const XMLReader &reader, const std::string &axis_name)
 
template<Direction direction>
Aligner< direction > fromXML (const XMLReader &reader, const AxisNames &axis_names)
 
template<Direction direction>
Aligner< direction > fromXML (const XMLReader &reader, const AxisNames &axis_names, Aligner< direction > default_aligner)
 
template<Direction direction1, Direction direction2>
Aligner< direction1, direction2 > fromDictionary (Dictionary dic, const AxisNames &axes)
 Construct 2 directions aligner from dictionary.
 
template<Direction direction1, Direction direction2>
Aligner< direction1, direction2 > fromXML (const XMLReader &reader, const AxisNames &axes)
 Construct 2 directions aligner from XML.
 
template<Direction direction1, Direction direction2>
Aligner< direction1, direction2 > fromDictionary (Dictionary dictionary, const AxisNames &axes, Aligner< direction1, direction2 > default2D)
 Construct 2 direction aligner from dictionary.
 
template<Direction direction1, Direction direction2>
Aligner< direction1, direction2 > fromXML (const XMLReader &reader, const AxisNames &axes, Aligner< direction1, direction2 > default2D)
 Construct 2 direction aligner from XML.
 
template<Direction direction1, Direction direction2, Direction direction3>
Aligner3D fromDictionary (Dictionary dictionary, const AxisNames &axis_names)
 Construct 3 direction aligner from dictionary.
 
template<Direction direction1, Direction direction2, Direction direction3>
Aligner3D fromXML (const XMLReader &reader, const AxisNames &axes)
 Construct 3 direction aligner from XML.
 
template<Direction direction1, Direction direction2, Direction direction3>
Aligner3D fromDictionary (Dictionary dic, const AxisNames &axes, Aligner< direction1, direction2, direction3 > default3D)
 Construct 3 direction aligner from dictionary.
 
template<Direction direction1, Direction direction2, Direction direction3>
Aligner3D fromXML (const XMLReader &reader, const AxisNames &axes, Aligner< direction1, direction2, direction3 > default3D)
 Construct 3 direction aligner from XML.
 
template<typename TranslationT , typename Aligner1T , typename Aligner2T >
void align (TranslationT &toAlign, const Aligner1T &aligner1, const Aligner2T &aligner2)
 Align toAlign by aligner1 and aligner2.
 

Typedef Documentation

◆ Aligner2D

typedef Aligner<Primitive<3>::DIRECTION_TRAN, Primitive<3>::DIRECTION_VERT> plask::align::Aligner2D

Definition at line 477 of file align.hpp.

◆ Aligner3D

◆ AlignerD

Aligner2D if dim == 2, Aligner3D if dim == 3.

Definition at line 578 of file align.hpp.

◆ Dictionary

typedef std::function<plask::optional<double>(const std::string& name)> plask::align::Dictionary

Definition at line 706 of file align.hpp.

◆ Direction

Directions of aligners activity, same as vec<3, T> directions.

Definition at line 34 of file align.hpp.

◆ LowerBoundImpl

Function Documentation

◆ align()

template<typename TranslationT , typename Aligner1T , typename Aligner2T >
void plask::align::align ( TranslationT &  toAlign,
const Aligner1T aligner1,
const Aligner2T aligner2 
)

Align toAlign by aligner1 and aligner2.

It is equal to, but possibly faster than:

It calculates bounding box of toAlign only once and only if it is required by any aligner.

Parameters
toAlignobject to align, translation in 2D or 3D
aligner1,aligner2aligners

Definition at line 932 of file align.hpp.

◆ back()

Aligner< Primitive< 3 >::DIRECTION_LONG > plask::align::back ( double  coordinate)
inline

Definition at line 677 of file align.hpp.

◆ bottom()

Aligner< Primitive< 3 >::DIRECTION_VERT > plask::align::bottom ( double  coordinate)
inline

Definition at line 682 of file align.hpp.

◆ center()

Aligner< Primitive< 3 >::DIRECTION_TRAN > plask::align::center ( double  coordinate)
inline

Definition at line 672 of file align.hpp.

◆ fromDictionary() [1/7]

template<Direction direction1, Direction direction2>
Aligner< direction1, direction2 > plask::align::fromDictionary ( Dictionary  dic,
const AxisNames axes 
)
inline

Construct 2 directions aligner from dictionary.

Throw exception if there is no information about one of this direction in dic, or when some direction is described multiple times.

Parameters
dicdictionary which describes required aligner in 2 directions
axesnames of axes
Returns
constructed aligner

Definition at line 806 of file align.hpp.

◆ fromDictionary() [2/7]

template<Direction direction1, Direction direction2, Direction direction3>
Aligner3D plask::align::fromDictionary ( Dictionary  dic,
const AxisNames axes,
Aligner< direction1, direction2, direction3 default3D 
)
inline

Construct 3 direction aligner from dictionary.

Throw exception if some direction is described multiple times.

Parameters
dicdictionary which describes required aligner in 3 directions
axesnames of axes
default3Ddefault aligner in all directions, used when there is no information about aligner in some direction in dictionary
Returns
constructed aligner

Definition at line 900 of file align.hpp.

◆ fromDictionary() [3/7]

template<Direction direction>
Aligner< direction > plask::align::fromDictionary ( Dictionary  dic,
const AxisNames axis_names 
)

Construct aligner in given direction from dictionary.

Throw exception if dic contains information about multiple aligners in given direction.

Parameters
dictionarydictionary which can describe aligner
axis_namesnames of axes
Returns
parsed aligner or nullptr if no information about aligner was found in dictionary
Template Parameters
directiondirection

Definition at line 751 of file align.hpp.

◆ fromDictionary() [4/7]

template<Direction direction1, Direction direction2>
Aligner< direction1, direction2 > plask::align::fromDictionary ( Dictionary  dictionary,
const AxisNames axes,
Aligner< direction1, direction2 >  default2D 
)
inline

Construct 2 direction aligner from dictionary.

Throw exception if some direction is described multiple times.

Parameters
dictionarydictionary which describes required aligner in 2 directions
axesnames of axes
default2Ddefault aligners, used when there is no information about aligner in some direction in dictionary
Returns
constructed aligner

Definition at line 838 of file align.hpp.

◆ fromDictionary() [5/7]

template<Direction direction1, Direction direction2, Direction direction3>
Aligner3D plask::align::fromDictionary ( Dictionary  dictionary,
const AxisNames axis_names 
)
inline

Construct 3 direction aligner from dictionary.

Throw exception if there is no information about one of this direction in dic, or when some direction is described multiple times.

Parameters
dictionarydictionary which describes required aligner in 3 directions
axis_namesnames of axes
Returns
constructed aligner

Definition at line 866 of file align.hpp.

◆ fromDictionary() [6/7]

template<Direction direction>
Aligner< direction > plask::align::fromDictionary ( Dictionary  dictionary,
const AxisNames axis_names,
Aligner< direction >  default_aligner 
)

Construct aligner in given direction from dictionary.

Throw exception if dic contains information about multiple aligners in given direction.

Parameters
dictionarydictionary which can describes 2D aligner
axis_namesnames of axes
default_alignerdefault aligners, returned when there is no information about aligner in dictionary
Returns
parsed aligner or default_aligner if no information about aligner was found in dictionary
Template Parameters
directiondirection

Definition at line 766 of file align.hpp.

◆ fromDictionary() [7/7]

template<Direction direction>
Aligner< direction > plask::align::fromDictionary ( Dictionary  dictionary,
const std::string &  axis_name 
)

Construct aligner in given direction from dictionary.

Throw exception if dic contains information about multiple aligners in given direction.

Parameters
dictionarydictionary which can describe aligner
axis_namename of axis in given direction
Returns
parsed aligner or nullptr if no information about aligner was found in dictionary
Template Parameters
directiondirection

◆ fromVector() [1/2]

Aligner2D plask::align::fromVector ( const Vec< 2, double > &  v)
inline

Definition at line 687 of file align.hpp.

◆ fromVector() [2/2]

Aligner3D plask::align::fromVector ( const Vec< 3, double > &  v)
inline

Definition at line 691 of file align.hpp.

◆ fromXML() [1/7]

template<Direction direction1, Direction direction2>
Aligner< direction1, direction2 > plask::align::fromXML ( const XMLReader reader,
const AxisNames axes 
)
inline

Construct 2 directions aligner from XML.

Throw exception if there is no information about one of this direction in reader, or when some direction is described multiple times.

Parameters
readerXML reader which point to tag which attributes describe required aligner in 2 directions
axesnames of axes
Returns
constructed aligner

Definition at line 824 of file align.hpp.

◆ fromXML() [2/7]

template<Direction direction1, Direction direction2, Direction direction3>
Aligner3D plask::align::fromXML ( const XMLReader reader,
const AxisNames axes 
)
inline

Construct 3 direction aligner from XML.

Throw exception if there is no information about one of this direction in reader, or when some direction is described multiple times.

Parameters
readerXML reader which point to tag which attributes describe required aligner in 3 directions
axesnames of axes
Returns
constructed aligner

Definition at line 886 of file align.hpp.

◆ fromXML() [3/7]

template<Direction direction1, Direction direction2>
Aligner< direction1, direction2 > plask::align::fromXML ( const XMLReader reader,
const AxisNames axes,
Aligner< direction1, direction2 >  default2D 
)
inline

Construct 2 direction aligner from XML.

Throw exception if some direction is described multiple times.

Parameters
readerXML reader which point to tag which attributes describe required aligner in 2 directions
axesnames of axes
default2Ddefault aligners, used when there is no information about aligner in some direction in reader
Returns
constructed aligner

Definition at line 852 of file align.hpp.

◆ fromXML() [4/7]

template<Direction direction1, Direction direction2, Direction direction3>
Aligner3D plask::align::fromXML ( const XMLReader reader,
const AxisNames axes,
Aligner< direction1, direction2, direction3 default3D 
)
inline

Construct 3 direction aligner from XML.

Throw exception if some direction is described multiple times.

Parameters
readerXML reader which point to tag which attributes describe required aligner in 3 directions
axesnames of axes
default3Ddefault aligner in all directions, used when there is no information about aligner in some direction in reader
Returns
constructed aligner

Definition at line 914 of file align.hpp.

◆ fromXML() [5/7]

template<Direction direction>
Aligner< direction > plask::align::fromXML ( const XMLReader reader,
const AxisNames axis_names 
)
inline

Definition at line 787 of file align.hpp.

◆ fromXML() [6/7]

template<Direction direction>
Aligner< direction > plask::align::fromXML ( const XMLReader reader,
const AxisNames axis_names,
Aligner< direction >  default_aligner 
)
inline

Definition at line 792 of file align.hpp.

◆ fromXML() [7/7]

template<Direction direction>
Aligner< direction > plask::align::fromXML ( const XMLReader reader,
const std::string &  axis_name 
)
inline

Definition at line 782 of file align.hpp.

◆ front()

Aligner< Primitive< 3 >::DIRECTION_LONG > plask::align::front ( double  coordinate)
inline

Definition at line 676 of file align.hpp.

◆ left()

Aligner< Primitive< 3 >::DIRECTION_TRAN > plask::align::left ( double  coordinate)
inline

Definition at line 669 of file align.hpp.

◆ lon()

Aligner< Primitive< 3 >::DIRECTION_LONG > plask::align::lon ( double  coordinate)
inline

Definition at line 679 of file align.hpp.

◆ lonCenter()

Aligner< Primitive< 3 >::DIRECTION_LONG > plask::align::lonCenter ( double  coordinate)
inline

Definition at line 678 of file align.hpp.

◆ lowerBoundZero() [1/2]

template<Primitive< 3 >::Direction dir>
Aligner< dir > plask::align::lowerBoundZero ( )
inline

Get aligner with align in one direction to lower bound.

Returns
aligner with align to lower bound in given direction, equal to left, back, or bottom.
Template Parameters
dirdirection

Definition at line 703 of file align.hpp.

◆ lowerBoundZero() [2/2]

template<Primitive< 3 >::Direction dir1, Primitive< 3 >::Direction dir2>
Aligner< dir1, dir2 > plask::align::lowerBoundZero ( )
inline

Definition at line 704 of file align.hpp.

◆ operator&() [1/12]

Aligner3D plask::align::operator& ( const Aligner< Primitive< 3 >::Direction(0), Primitive< 3 >::Direction(1)> &  dir01aligner,
const Aligner< Primitive< 3 >::Direction(2)> &  dir2aligner 
)
inline

Definition at line 622 of file align.hpp.

◆ operator&() [2/12]

Aligner3D plask::align::operator& ( const Aligner< Primitive< 3 >::Direction(0), Primitive< 3 >::Direction(2)> &  dir02aligner,
const Aligner< Primitive< 3 >::Direction(1)> &  dir1aligner 
)
inline

Definition at line 614 of file align.hpp.

◆ operator&() [3/12]

Aligner3D plask::align::operator& ( const Aligner< Primitive< 3 >::Direction(0)> &  dir0aligner,
const Aligner< Primitive< 3 >::Direction(1), Primitive< 3 >::Direction(2)> &  dir12aligner 
)
inline

Definition at line 610 of file align.hpp.

◆ operator&() [4/12]

Aligner< Primitive< 3 >::Direction(0), Primitive< 3 >::Direction(1)> plask::align::operator& ( const Aligner< Primitive< 3 >::Direction(0)> &  dir1aligner,
const Aligner< Primitive< 3 >::Direction(1)> &  dir2aligner 
)
inline

Definition at line 581 of file align.hpp.

◆ operator&() [5/12]

Aligner< Primitive< 3 >::Direction(0), Primitive< 3 >::Direction(2)> plask::align::operator& ( const Aligner< Primitive< 3 >::Direction(0)> &  dir1aligner,
const Aligner< Primitive< 3 >::Direction(2)> &  dir2aligner 
)
inline

Definition at line 589 of file align.hpp.

◆ operator&() [6/12]

Aligner3D plask::align::operator& ( const Aligner< Primitive< 3 >::Direction(1), Primitive< 3 >::Direction(2)> &  dir12aligner,
const Aligner< Primitive< 3 >::Direction(0)> &  dir0aligner 
)
inline

Definition at line 606 of file align.hpp.

◆ operator&() [7/12]

Aligner3D plask::align::operator& ( const Aligner< Primitive< 3 >::Direction(1)> &  dir1aligner,
const Aligner< Primitive< 3 >::Direction(0), Primitive< 3 >::Direction(2)> &  dir02aligner 
)
inline

Definition at line 618 of file align.hpp.

◆ operator&() [8/12]

Aligner< Primitive< 3 >::Direction(0), Primitive< 3 >::Direction(1)> plask::align::operator& ( const Aligner< Primitive< 3 >::Direction(1)> &  dir1aligner,
const Aligner< Primitive< 3 >::Direction(0)> &  dir2aligner 
)
inline

Definition at line 585 of file align.hpp.

◆ operator&() [9/12]

Aligner< Primitive< 3 >::Direction(1), Primitive< 3 >::Direction(2)> plask::align::operator& ( const Aligner< Primitive< 3 >::Direction(1)> &  dir1aligner,
const Aligner< Primitive< 3 >::Direction(2)> &  dir2aligner 
)
inline

Definition at line 597 of file align.hpp.

◆ operator&() [10/12]

Aligner< Primitive< 3 >::Direction(0), Primitive< 3 >::Direction(2)> plask::align::operator& ( const Aligner< Primitive< 3 >::Direction(2)> &  dir1aligner,
const Aligner< Primitive< 3 >::Direction(0)> &  dir2aligner 
)
inline

Definition at line 593 of file align.hpp.

◆ operator&() [11/12]

Aligner< Primitive< 3 >::Direction(1), Primitive< 3 >::Direction(2)> plask::align::operator& ( const Aligner< Primitive< 3 >::Direction(2)> &  dir1aligner,
const Aligner< Primitive< 3 >::Direction(1)> &  dir2aligner 
)
inline

Definition at line 601 of file align.hpp.

◆ operator&() [12/12]

Aligner3D plask::align::operator& ( const Aligner< Primitive< 3 >::Direction(2)> &  dir2aligner,
const Aligner< Primitive< 3 >::Direction(0), Primitive< 3 >::Direction(1)> &  dir01aligner 
)
inline

Definition at line 626 of file align.hpp.

◆ right()

Aligner< Primitive< 3 >::DIRECTION_TRAN > plask::align::right ( double  coordinate)
inline

Definition at line 670 of file align.hpp.

◆ top()

Aligner< Primitive< 3 >::DIRECTION_VERT > plask::align::top ( double  coordinate)
inline

Definition at line 683 of file align.hpp.

◆ tran()

Aligner< Primitive< 3 >::DIRECTION_TRAN > plask::align::tran ( double  coordinate)
inline

Definition at line 673 of file align.hpp.

◆ tranCenter()

Aligner< Primitive< 3 >::DIRECTION_TRAN > plask::align::tranCenter ( double  coordinate)
inline

Definition at line 671 of file align.hpp.

◆ vert()

Aligner< Primitive< 3 >::DIRECTION_VERT > plask::align::vert ( double  coordinate)
inline

Definition at line 685 of file align.hpp.

◆ vertCenter()

Aligner< Primitive< 3 >::DIRECTION_VERT > plask::align::vertCenter ( double  coordinate)
inline

Definition at line 684 of file align.hpp.