HerdSoftware  0.1.1
Classes | Enumerations | Functions | Variables
Herd::RefFrame Namespace Reference

Classes

struct  Ortog
 Base struct to get the two axes orthogonal to a direction. More...
 
struct  Ortog< RefFrame::Axis::X >
 
struct  Ortog< RefFrame::Axis::Y >
 
struct  Ortog< RefFrame::Axis::Z >
 
struct  ViewAxes
 Base struct to get the two axes of a given view. More...
 
struct  ViewAxes< RefFrame::View::XY >
 
struct  ViewAxes< RefFrame::View::XZ >
 
struct  ViewAxes< RefFrame::View::YZ >
 

Enumerations

enum  Coo : int { Coo::NONE = -1, Coo::X = 0, Coo::Y = 1, Coo::Z = 2 }
 Aliases for the three space coordinates. RefFrame.h common/RefFrame.h. More...
 
enum  Axis : int { Axis::NONE = -1, Axis::X = 0, Axis::Y = 1, Axis::Z = 2 }
 Aliases for the axes. RefFrame.h common/RefFrame.h. More...
 
enum  Direction : int {
  Direction::NONE = -1, Direction::Xpos = 0, Direction::Xneg = 1, Direction::Ypos = 2,
  Direction::Yneg = 3, Direction::Zpos = 4, Direction::Zneg = 5, Direction::XnegYneg = 6,
  Direction::XposYneg = 7, Direction::XnegYpos = 8, Direction::XposYpos = 9
}
 Aliases for the six axis directions. RefFrame.h common/RefFrame.h. More...
 
enum  View : int { View::NONE = -1, View::XY = 0, View::XZ = 1, View::YZ = 2 }
 Aliases for the three 2D projection planes. RefFrame.h common/RefFrame.h. More...
 
enum  Side : int {
  Side::NONE = -1, Side::Xpos = 0, Side::Xneg = 1, Side::Ypos = 2,
  Side::Yneg = 3, Side::TOP = 4
}
 Aliases for the five sides. RefFrame.h common/RefFrame.h. More...
 

Functions

std::ostream & operator<< (std::ostream &out, const Axis &axis)
 
std::string operator+ (const std::string &str, const Axis &axis)
 
std::ostream & operator<< (std::ostream &out, const Direction &direction)
 
std::string operator+ (const std::string &str, const Direction &direction)
 
std::ostream & operator<< (std::ostream &out, const Side &side)
 
std::string operator+ (const std::string &str, const Side &side)
 
Coo ToCoo (Axis axis)
 Associates a coordinate to an axis. More...
 
Axis ToAxis (Coo coo)
 Associates an axis to a coordinate . More...
 
Axis ToAxis (Direction dir)
 
Coo ToCoo (Direction direction)
 Associates a coordinate to a direction. More...
 
Axis NormalAxis (Side side)
 
Axis NormalAxis (View view)
 
Direction NormalDirection (Side side)
 
Axis NormalAxis (Axis ax1, Axis ax2)
 Given two axes get the third one ;) More...
 
bool IsPositive (Direction dir)
 Tells if a direction is positive or not. More...
 

Variables

constexpr std::array< Coo, 3 > Coos {Coo::X, Coo::Y, Coo::Z}
 
constexpr int NAxes = 3
 The number of axes (i.e. (number of elements of Axis) - 1). More...
 
constexpr std::array< Axis, NAxesAxes {Axis::X, Axis::Y, Axis::Z}
 Array of all the axes. More...
 
const std::array< std::string, NAxesAxisName {"X", "Y", "Z"}
 
constexpr int NDirections = 10
 The number of directions (i.e. (number of elements of Direction) - 1). More...
 
constexpr std::array< RefFrame::Direction, RefFrame::NDirectionsDirections
 
const std::array< std::string, RefFrame::NDirectionsDirectionName
 
constexpr int NViews = 3
 The number of views (i.e. (number of elements of View) - 1). More...
 
constexpr std::array< View, NViewsViews {View::XY, View::XZ, View::YZ}
 Array of all the views. More...
 
const std::array< std::string, NViewsViewName {"XY", "XZ", "YZ"}
 
constexpr int NSides = 5
 The number of sides (i.e. (number of elements of Side) - 1). More...
 
constexpr std::array< Side, NSidesSides {Side::Xpos, Side::Xneg, Side::Ypos, Side::Yneg, Side::TOP}
 Array of all the sides. More...
 
const std::array< std::string, NSidesSideName {"Xpos", "Xneg", "Ypos", "Yneg", "TOP"}
 

Enumeration Type Documentation

◆ Axis

enum Herd::RefFrame::Axis : int
strong

Aliases for the axes. RefFrame.h common/RefFrame.h.

Enumerator
NONE 

◆ Coo

enum Herd::RefFrame::Coo : int
strong

Aliases for the three space coordinates. RefFrame.h common/RefFrame.h.

Enumerator
NONE 

◆ Direction

enum Herd::RefFrame::Direction : int
strong

Aliases for the six axis directions. RefFrame.h common/RefFrame.h.

Enumerator
NONE 
Xpos 
Xneg 
Ypos 
Yneg 
Zpos 
Zneg 
XnegYneg 
XposYneg 
XnegYpos 
XposYpos 

◆ Side

enum Herd::RefFrame::Side : int
strong

Aliases for the five sides. RefFrame.h common/RefFrame.h.

Enumerator
NONE 
Xpos 
Xneg 
Ypos 
Yneg 
TOP 

◆ View

enum Herd::RefFrame::View : int
strong

Aliases for the three 2D projection planes. RefFrame.h common/RefFrame.h.

Enumerator
NONE 
XY 
XZ 
YZ 

Function Documentation

◆ IsPositive()

bool Herd::RefFrame::IsPositive ( Direction  dir)
inline

Tells if a direction is positive or not.

Parameters
dirThe direction.
Returns
true if dir is equal to Xpos or Ypos or Zpos, false if dir is equal to Xneg or Yneg or Zneg
Exceptions
std::runtime_errorif the direction is not along X, Y or Z.

◆ NormalAxis() [1/3]

Axis Herd::RefFrame::NormalAxis ( Side  side)
inline

Returns the normal axis to a given side.

Parameters
sideThe desired side.
Returns
The normal axis to the desired side.
Exceptions
std::runtime_errorif the given side is not valid.

◆ NormalAxis() [2/3]

Axis Herd::RefFrame::NormalAxis ( View  view)
inline

Returns the normal axis to a given view.

Parameters
viewThe desired view.
Returns
The normal axis to the desired view.
Exceptions
std::runtime_errorif the given view is not valid.

◆ NormalAxis() [3/3]

Axis Herd::RefFrame::NormalAxis ( Axis  ax1,
Axis  ax2 
)
inline

Given two axes get the third one ;)

Parameters
ax1Axis no. 1
ax2Axis no. 2
Returns
The third orthogonal axis
Exceptions
std::runtime_errorif ax1 == ax2.

◆ NormalDirection()

Direction Herd::RefFrame::NormalDirection ( Side  side)
inline

Returns the normal direction to a given side.

Parameters
sideThe desired side.
Returns
The normal direction to the desired side.
Exceptions
std::runtime_errorif the given side is not valid.

◆ operator+() [1/3]

std::string Herd::RefFrame::operator+ ( const std::string &  str,
const Axis axis 
)
inline

◆ operator+() [2/3]

std::string Herd::RefFrame::operator+ ( const std::string &  str,
const Direction direction 
)
inline

◆ operator+() [3/3]

std::string Herd::RefFrame::operator+ ( const std::string &  str,
const Side side 
)
inline

◆ operator<<() [1/3]

std::ostream& Herd::RefFrame::operator<< ( std::ostream &  out,
const Axis axis 
)
inline

◆ operator<<() [2/3]

std::ostream& Herd::RefFrame::operator<< ( std::ostream &  out,
const Direction direction 
)
inline

◆ operator<<() [3/3]

std::ostream& Herd::RefFrame::operator<< ( std::ostream &  out,
const Side side 
)
inline

◆ ToAxis() [1/2]

Axis Herd::RefFrame::ToAxis ( Coo  coo)
inline

Associates an axis to a coordinate .

Converts a coordinate to an axis. The Axis::NONE axis is associated to the Coo::NONE coordinate.

Parameters
cooThe given coordinate.
Returns
The axis associated to the given coordinate.

◆ ToAxis() [2/2]

Axis Herd::RefFrame::ToAxis ( Direction  dir)
inline

Returns the axis corresponding to the given direction.

Parameters
dirThe desired direction.
Returns
The axis corresponding to the given direction.
Exceptions
std::runtime_errorif the given direction is not valid.

◆ ToCoo() [1/2]

Coo Herd::RefFrame::ToCoo ( Axis  axis)
inline

Associates a coordinate to an axis.

Converts an axis to a coordinate. The conversion is meaningful only for X, Y and Z axis, since coordinates are defined only along these axes. The Coo::NONE coordinate is associated to the Axis::NONE axis. An exception is thrown if an axis different from NONE, X, Y or Z is given as argument.

Parameters
axisThe given axis.
Returns
The coordinate associated to the given axis.

◆ ToCoo() [2/2]

Coo Herd::RefFrame::ToCoo ( Direction  direction)
inline

Associates a coordinate to a direction.

Converts a direction to a coordinate. The conversion is meaningful only for Xpos/Xneg, Ypos/Yneg and Zpos/Zneg directions, since coordinates are defined only along these directions. The Coo::NONE coordinate is associated to the Axis::NONE axis. An exception is thrown if a direction different from NONE, Xpos/Xneg, Ypos/Yneg or Zpos/Zneg is given as argument.

Parameters
directionThe given direction.
Returns
The coordinate associated to the given direction.

Variable Documentation

◆ Axes

constexpr std::array<Axis, NAxes> Herd::RefFrame::Axes {Axis::X, Axis::Y, Axis::Z}

Array of all the axes.

This array can be used to iterate over all the axes using array iterators in a range-for loop, e.g.:

for (auto axis : Axes){ ...

◆ AxisName

const std::array<std::string, NAxes> Herd::RefFrame::AxisName {"X", "Y", "Z"}

◆ Coos

constexpr std::array<Coo, 3> Herd::RefFrame::Coos {Coo::X, Coo::Y, Coo::Z}

◆ DirectionName

const std::array<std::string, RefFrame::NDirections> Herd::RefFrame::DirectionName
Initial value:
{
"Xpos", "Xneg", "Ypos", "Yneg", "Zpos", "Zneg", "XnegYneg", "XposYneg", "XnegYpos", "XposYpos"}

◆ Directions

constexpr std::array<RefFrame::Direction, RefFrame::NDirections> Herd::RefFrame::Directions
Initial value:
{
RefFrame::Direction::Xpos, RefFrame::Direction::Xneg, RefFrame::Direction::Ypos,
RefFrame::Direction::Yneg, RefFrame::Direction::Zpos, RefFrame::Direction::Zneg,
RefFrame::Direction::XnegYneg, RefFrame::Direction::XposYneg, RefFrame::Direction::XnegYpos,
RefFrame::Direction::XposYpos}

◆ NAxes

constexpr int Herd::RefFrame::NAxes = 3

The number of axes (i.e. (number of elements of Axis) - 1).

◆ NDirections

constexpr int Herd::RefFrame::NDirections = 10

The number of directions (i.e. (number of elements of Direction) - 1).

◆ NSides

constexpr int Herd::RefFrame::NSides = 5

The number of sides (i.e. (number of elements of Side) - 1).

◆ NViews

constexpr int Herd::RefFrame::NViews = 3

The number of views (i.e. (number of elements of View) - 1).

◆ SideName

const std::array<std::string, NSides> Herd::RefFrame::SideName {"Xpos", "Xneg", "Ypos", "Yneg", "TOP"}

◆ Sides

constexpr std::array<Side, NSides> Herd::RefFrame::Sides {Side::Xpos, Side::Xneg, Side::Ypos, Side::Yneg, Side::TOP}

Array of all the sides.

This array can be used to iterate over all the sides using array iterators in a range-for loop, e.g.:

for (auto side : Sides){ ...

◆ ViewName

const std::array<std::string, NViews> Herd::RefFrame::ViewName {"XY", "XZ", "YZ"}

◆ Views

constexpr std::array<View, NViews> Herd::RefFrame::Views {View::XY, View::XZ, View::YZ}

Array of all the views.

This array can be used to iterate over all the views using array iterators in a range-for loop, e.g.:

for (auto view : Views){ ...