RotationAxes.hpp
1 /*---------------------------------------------------------------------------*\
2  *
3  * mimmo
4  *
5  * Copyright (C) 2015-2021 OPTIMAD engineering Srl
6  *
7  * -------------------------------------------------------------------------
8  * License
9  * This file is part of mimmo.
10  *
11  * mimmo is free software: you can redistribute it and/or modify it
12  * under the terms of the GNU Lesser General Public License v3 (LGPL)
13  * as published by the Free Software Foundation.
14  *
15  * mimmo is distributed in the hope that it will be useful, but WITHOUT
16  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18  * License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * along with mimmo. If not, see <http://www.gnu.org/licenses/>.
22  *
23 \*---------------------------------------------------------------------------*/
24 #ifndef __ROTATIONAXES_HPP__
25 #define __ROTATIONAXES_HPP__
26 
27 #include "BaseManipulation.hpp"
28 
29 namespace mimmo{
30 
83 
84 protected:
85  //members
92  double m_alpha;
94 public:
95  RotationAxes(darray3E origin = { {0, 0, 0} }, darray3E direction = { {0, 0, 0} });
96  RotationAxes(const bitpit::Config::Section & rootXML);
97  ~RotationAxes();
98 
99  RotationAxes(const RotationAxes & other);
101 
102  void buildPorts();
103 
104  void setAxis(darray3E origin, darray3E direction);
105  void setOrigin(darray3E origin);
106  void setDirection(darray3E direction);
107  void setRotation(double alpha);
108  void setAxes(dmatrix33E axes);
109  void setAxesOrigin(darray3E axes_origin);
110 
113 
114  void execute();
115 
116  virtual void absorbSectionXML(const bitpit::Config::Section & slotXML, std::string name = "");
117  virtual void flushSectionXML(bitpit::Config::Section & slotXML, std::string name= "");
118 
119 protected:
120  void swap(RotationAxes & x) noexcept;
121 
122 };
123 
124 REGISTER_PORT(M_POINT, MC_ARRAY3, MD_FLOAT,__ROTATIONAXES_HPP__)
125 REGISTER_PORT(M_AXIS, MC_ARRAY3, MD_FLOAT,__ROTATIONAXES_HPP__)
126 REGISTER_PORT(M_VALUED, MC_SCALAR, MD_FLOAT,__ROTATIONAXES_HPP__)
127 REGISTER_PORT(M_POINT2, MC_ARRAY3, MD_FLOAT,__ROTATIONAXES_HPP__)
128 REGISTER_PORT(M_AXES, MC_ARR3ARR3, MD_FLOAT,__ROTATIONAXES_HPP__)
129 
130 REGISTER(BaseManipulation, RotationAxes, "mimmo.RotationAxes")
131 
132 };
133 
134 #endif /* __ROTATIONAXES_HPP__ */
virtual void flushSectionXML(bitpit::Config::Section &slotXML, std::string name="")
#define M_POINT2
void setOrigin(darray3E origin)
#define MC_ARRAY3
#define MD_FLOAT
void setAxes(dmatrix33E axes)
void setAxesOrigin(darray3E axes_origin)
void setRotation(double alpha)
#define MC_ARR3ARR3
#define M_POINT
RotationAxes is the class that applies a rotation to a given reference system.
BaseManipulation is the base class of any manipulation object of the library.
#define MC_SCALAR
#define REGISTER_PORT(Name, Container, Datatype, ManipBlock)
dmatrix33E getRotatedAxes()
std::array< darray3E, 3 > dmatrix33E
virtual void absorbSectionXML(const bitpit::Config::Section &slotXML, std::string name="")
RotationAxes & operator=(RotationAxes other)
#define M_AXES
void setDirection(darray3E direction)
darray3E getRotatedOrigin()
#define M_VALUED
RotationAxes(darray3E origin={ {0, 0, 0} }, darray3E direction={ {0, 0, 0} })
std::array< double, 3 > darray3E
#define M_AXIS
void swap(RotationAxes &x) noexcept
void setAxis(darray3E origin, darray3E direction)
#define REGISTER(Base, Derived, name)
Definition: factory.hpp:206