Go to the documentation of this file.
   10 #ifndef HERD_REFFRAME_H_ 
   11 #define HERD_REFFRAME_H_ 
   26 const std::array<std::string, 3> 
CooName{
"X", 
"Y", 
"Z"};
 
   27 inline std::ostream &
operator<<(std::ostream &out, 
const Coo &coo) { 
return out << CooName[static_cast<int>(coo)]; }
 
   28 inline std::string 
operator+(
const std::string &str, 
const Coo &coo) { 
return str + 
CooName[
static_cast<int>(coo)]; }
 
   45 const std::array<std::string, NAxes> 
AxisName{
"X", 
"Y", 
"Z"};
 
   46 inline std::ostream &
operator<<(std::ostream &out, 
const Axis &axis) { 
return out << AxisName[static_cast<int>(axis)]; }
 
   47 inline std::string 
operator+(
const std::string &str, 
const Axis &axis) {
 
   48   return str + 
AxisName[
static_cast<int>(axis)];
 
   72 constexpr std::array<RefFrame::Direction, RefFrame::NDirections> 
Directions{
 
   79     "Xpos", 
"Xneg", 
"Ypos", 
"Yneg", 
"Zpos", 
"Zneg", 
"XnegYneg", 
"XposYneg", 
"XnegYpos", 
"XposYpos"};
 
   82   return out << DirectionName[static_cast<int>(direction)];
 
  102 const std::array<std::string, NViews> 
ViewName{
"XY", 
"XZ", 
"YZ"};
 
  103 inline std::ostream &
operator<<(std::ostream &out, 
const View &view) { 
return out << ViewName[static_cast<int>(view)]; }
 
  105   return str + 
ViewName[
static_cast<int>(view)];
 
  122 const std::array<std::string, NSides> 
SideName{
"Xpos", 
"Xneg", 
"Ypos", 
"Yneg", 
"TOP"};
 
  123 inline std::ostream &
operator<<(std::ostream &out, 
const Side &side) { 
return out << SideName[static_cast<int>(side)]; }
 
  125   return str + 
SideName[
static_cast<int>(side)];
 
  129 template <RefFrame::Axis T> 
struct Ortog {};
 
  164     throw Exception(
"RefFrame::AxesOf: Invalid view");
 
  211     throw std::runtime_error(
"RefFrame::ToAxis: unknown direction");
 
  248     throw std::runtime_error(
"RefFrame::NormalAxis: unknown side");
 
  269     throw std::runtime_error(
"RefFrame::NormalAxis: unknown side");
 
  294     throw std::runtime_error(
"RefFrame::NormalAxis: unknown side");
 
  308     throw std::runtime_error(
"RefFrame::NormalAxis: called with ax1 = ax2");
 
  332   std::pair<Axis, Axis> normalAxes;
 
  343     throw Herd::Exception(
"RefFrame::NormalAxes: called with invalid axis");
 
  357     throw std::runtime_error(
 
  358         "RefFrame:::IsPositive called with direction = to XposYpos or XnegYpos or XnegYneg or XposYneg");
 
  
constexpr bool IsPositive(Direction dir)
Tells if a direction is positive or not.
Definition: RefFrame.h:354
 
const std::array< std::string, NSides > SideName
Definition: RefFrame.h:122
 
const std::array< std::string, RefFrame::NDirections > DirectionName
Definition: RefFrame.h:78
 
RefFrame::Axis ordinate
Definition: RefFrame.h:149
 
constexpr std::array< RefFrame::Direction, RefFrame::NDirections > Directions
Definition: RefFrame.h:72
 
const std::array< std::string, 3 > CooName
Definition: RefFrame.h:26
 
const std::array< std::string, NAxes > AxisName
Definition: RefFrame.h:45
 
constexpr std::array< Side, NSides > Sides
Array of all the sides.
Definition: RefFrame.h:121
 
constexpr Direction NormalDirection(Side side)
Definition: RefFrame.h:279
 
constexpr std::array< Axis, NAxes > Axes
Array of all the axes.
Definition: RefFrame.h:44
 
Direction
Aliases for the six axis directions.
Definition: RefFrame.h:55
 
Side
Aliases for the five sides.
Definition: RefFrame.h:111
 
constexpr int NAxes
The number of axes (i.e. (number of elements of Axis) - 1).
Definition: RefFrame.h:36
 
constexpr int NSides
The number of sides (i.e. (number of elements of Side) - 1).
Definition: RefFrame.h:113
 
View
Aliases for the three 2D projection planes.
Definition: RefFrame.h:91
 
std::ostream & operator<<(std::ostream &out, const Coo &coo)
Definition: RefFrame.h:27
 
constexpr Coo ToCoo(Axis axis)
Associates a coordinate to an axis.
Definition: RefFrame.h:180
 
Definition: RefFrame.h:19
 
const std::array< std::string, NViews > ViewName
Definition: RefFrame.h:102
 
std::string operator+(const std::string &str, const Coo &coo)
Definition: RefFrame.h:28
 
constexpr std::array< View, NViews > Views
Array of all the views.
Definition: RefFrame.h:101
 
constexpr Axis NormalAxis(Side side)
Definition: RefFrame.h:235
 
Base struct to get the two axes of a given view.
Definition: RefFrame.h:147
 
Definition: Exception.h:24
 
Base struct to get the two axes orthogonal to a direction.
Definition: RefFrame.h:129
 
Axis
Aliases for the axes.
Definition: RefFrame.h:34
 
constexpr Axis ToAxis(Coo coo)
Associates an axis to a coordinate .
Definition: RefFrame.h:189
 
Coo
Aliases for the three space coordinates.
Definition: RefFrame.h:24
 
RefFrame::Axis abscissa
Definition: RefFrame.h:148
 
constexpr int NDirections
The number of directions (i.e. (number of elements of Direction) - 1).
Definition: RefFrame.h:70
 
constexpr std::pair< Axis, Axis > NormalAxes(Axis ax)
Given one axes get the other two ;)
Definition: RefFrame.h:331
 
constexpr std::array< Coo, 3 > Coos
Definition: RefFrame.h:25
 
constexpr RefFrame::ViewAxes AxesOf(RefFrame::View view)
Definition: RefFrame.h:152
 
constexpr int NViews
The number of views (i.e. (number of elements of View) - 1).
Definition: RefFrame.h:93