PLaSK library
Loading...
Searching...
No Matches
plask::AxisNames Struct Reference

Held names of axises. More...

#include <plask/axes.hpp>

Collaboration diagram for plask::AxisNames:
[legend]

Classes

struct  Register
 Register of axis names. More...
 

Public Member Functions

 AxisNames ()
 Construct uninitialized object, with empty names of axes.
 
 AxisNames (const std::string &c0_name, const std::string &c1_name, const std::string &c2_name)
 
const std::string & operator[] (const std::size_t i) const
 Get axis name by index.
 
std::size_t operator[] (const std::string &name) const
 Get axis index by name.
 
Primitive< 3 >::Direction get3D (const std::string &name) const
 Get axis index by name.
 
Primitive< 2 >::Direction get2D (const std::string &name) const
 Get axis index in 2D by name.
 
template<int DIMS>
Primitive< DIMS >::Direction get (const std::string &name) const
 Get axis index in 2D/3D by name.
 
std::string str () const
 
std::string getNameForLong () const
 
std::string getNameForTran () const
 
std::string getNameForVert () const
 
bool operator== (const AxisNames &to_compare) const
 Check if this and to_compare have equals names of all axes.
 
bool operator!= (const AxisNames &to_compare) const
 Check if this and to_compare have not equals names of all axes.
 
template<>
Primitive< 2 >::Direction get (const std::string &name) const
 
template<>
Primitive< 3 >::Direction get (const std::string &name) const
 

Static Public Member Functions

static const AxisNamesgetAbsoluteNames ()
 Get absolute names.
 

Public Attributes

std::string byIndex [3]
 Name of axes (by index).
 

Static Public Attributes

static Register axisNamesRegister
 Register of standard axis names.
 

Detailed Description

Held names of axises.

Can change: axis number (from 0 to 2) <-> axis name (string)

Definition at line 34 of file axes.hpp.

Constructor & Destructor Documentation

◆ AxisNames() [1/2]

plask::AxisNames::AxisNames ( )
inline

Construct uninitialized object, with empty names of axes.

Definition at line 112 of file axes.hpp.

◆ AxisNames() [2/2]

plask::AxisNames::AxisNames ( const std::string &  c0_name,
const std::string &  c1_name,
const std::string &  c2_name 
)

Definition at line 38 of file axes.cpp.

Member Function Documentation

◆ get() [1/3]

template<int DIMS>
Primitive< DIMS >::Direction plask::AxisNames::get ( const std::string &  name) const

Get axis index in 2D/3D by name.

Throws exception if name is not proper name of axis in 2D/3D.

Parameters
nameaxis name
Returns
index (from 0 to DIMS-1) of axis with given name

◆ get() [2/3]

template<>
Primitive< 2 >::Direction plask::AxisNames::get ( const std::string &  name) const
inline

Definition at line 182 of file axes.hpp.

◆ get() [3/3]

template<>
Primitive< 3 >::Direction plask::AxisNames::get ( const std::string &  name) const
inline

Definition at line 183 of file axes.hpp.

◆ get2D()

Primitive< 2 >::Direction plask::AxisNames::get2D ( const std::string &  name) const

Get axis index in 2D by name.

Throws exception if name is not proper name of axis in 2D.

Parameters
nameaxis name
Returns
index (from 0 to 1) of axis with given name

Definition at line 54 of file axes.cpp.

◆ get3D()

Primitive< 3 >::Direction plask::AxisNames::get3D ( const std::string &  name) const

Get axis index by name.

Throws exception if name is not proper name of axis.

Parameters
nameaxis name
Returns
index (from 0 to 2) of axis with given name

Definition at line 48 of file axes.cpp.

◆ getAbsoluteNames()

const AxisNames & plask::AxisNames::getAbsoluteNames ( )
static

Get absolute names.

Definition at line 66 of file axes.cpp.

◆ getNameForLong()

std::string plask::AxisNames::getNameForLong ( ) const
inline

Definition at line 161 of file axes.hpp.

◆ getNameForTran()

std::string plask::AxisNames::getNameForTran ( ) const
inline

Definition at line 163 of file axes.hpp.

◆ getNameForVert()

std::string plask::AxisNames::getNameForVert ( ) const
inline

Definition at line 165 of file axes.hpp.

◆ operator!=()

bool plask::AxisNames::operator!= ( const AxisNames to_compare) const
inline

Check if this and to_compare have not equals names of all axes.

Parameters
to_compareobject to compare to this
Returns
true only if this and to_compar are not equals

Definition at line 179 of file axes.hpp.

◆ operator==()

bool plask::AxisNames::operator== ( const AxisNames to_compare) const

Check if this and to_compare have equals names of all axes.

Parameters
to_compareobject to compare to this
Returns
true only if this and to_compar are equals

Definition at line 70 of file axes.cpp.

◆ operator[]() [1/2]

const std::string & plask::AxisNames::operator[] ( const std::size_t  i) const
inline

Get axis name by index.

Parameters
iindex of axis name, from 0 to 2
Returns
name of i-th axis

Definition at line 121 of file axes.hpp.

◆ operator[]() [2/2]

std::size_t plask::AxisNames::operator[] ( const std::string &  name) const

Get axis index by name.

Parameters
nameaxis name
Returns
index (from 0 to 2) of axis with given name or 3 if no axis with given name

Definition at line 41 of file axes.cpp.

◆ str()

std::string plask::AxisNames::str ( ) const
Returns
string representation of the axes for the register

Definition at line 60 of file axes.cpp.

Member Data Documentation

◆ axisNamesRegister

AxisNames::Register plask::AxisNames::axisNamesRegister
static
Initial value:
=
AxisNames::Register
("x", "y", "z", "yz", "z_up")
("z", "x", "y", "xy", "y_up")
("y", "z", "x", "zx", "x_up")
("p", "r", "z", "rz", "rad")
("l", "t", "v", "abs")
("long", "tran", "vert", "absolute")

Register of standard axis names.

Definition at line 103 of file axes.hpp.

◆ byIndex

std::string plask::AxisNames::byIndex[3]

Name of axes (by index).

Definition at line 109 of file axes.hpp.


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