RotationGeometry.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 __ROTATIONGEOMETRY_HPP__
25 #define __ROTATIONGEOMETRY_HPP__
26 
27 #include "BaseManipulation.hpp"
28 
29 namespace mimmo{
30 
80 private:
81  //members
82  darray3E m_origin;
83  darray3E m_direction;
84  double m_alpha;
85  dmpvector1D m_filter;
86  dmpvecarr3E m_displ;
88 public:
89  RotationGeometry(darray3E origin = { {0, 0, 0} }, darray3E direction = { {0, 0, 0} });
90  RotationGeometry(const bitpit::Config::Section & rootXML);
92 
93  RotationGeometry(const RotationGeometry & other);
95 
96  void buildPorts();
97 
98  void setAxis(darray3E origin, darray3E direction);
99  void setOrigin(darray3E origin);
100  void setDirection(darray3E direction);
101  void setRotation(double alpha);
102  void setFilter(dmpvector1D *filter);
103 
105 
106  void execute();
107  void apply();
108 
109  virtual void absorbSectionXML(const bitpit::Config::Section & slotXML, std::string name = "");
110  virtual void flushSectionXML(bitpit::Config::Section & slotXML, std::string name= "");
111 
112 protected:
113  void swap(RotationGeometry & x) noexcept;
114  void checkFilter();
115 };
116 
117 REGISTER_PORT(M_AXIS, MC_ARRAY3, MD_FLOAT,__ROTATIONGEOMETRY_HPP__)
118 REGISTER_PORT(M_VALUED, MC_SCALAR, MD_FLOAT,__ROTATIONGEOMETRY_HPP__)
119 REGISTER_PORT(M_FILTER, MC_SCALAR, MD_MPVECFLOAT_,__ROTATIONGEOMETRY_HPP__)
120 REGISTER_PORT(M_GEOM, MC_SCALAR, MD_MIMMO_,__ROTATIONGEOMETRY_HPP__)
121 REGISTER_PORT(M_GDISPLS, MC_SCALAR, MD_MPVECARR3FLOAT_,__ROTATIONGEOMETRY_HPP__)
122 REGISTER_PORT(M_POINT, MC_ARRAY3, MD_FLOAT,__ROTATIONGEOMETRY_HPP__)
123 
124 
125 REGISTER(BaseManipulation, RotationGeometry, "mimmo.RotationGeometry")
126 
127 };
128 
129 #endif /* __ROTATIONGEOMETRY_HPP__ */
#define M_GDISPLS
void setAxis(darray3E origin, darray3E direction)
void setFilter(dmpvector1D *filter)
#define M_GEOM
RotationGeometry is the class that applies a rotation to a given geometry patch.
#define MC_ARRAY3
#define MD_FLOAT
#define M_POINT
virtual void absorbSectionXML(const bitpit::Config::Section &slotXML, std::string name="")
BaseManipulation is the base class of any manipulation object of the library.
RotationGeometry(darray3E origin={ {0, 0, 0} }, darray3E direction={ {0, 0, 0} })
#define MC_SCALAR
dmpvecarr3E * getDisplacements()
#define MD_MPVECARR3FLOAT_
#define REGISTER_PORT(Name, Container, Datatype, ManipBlock)
void setRotation(double alpha)
virtual void flushSectionXML(bitpit::Config::Section &slotXML, std::string name="")
#define M_VALUED
void swap(RotationGeometry &x) noexcept
#define MD_MIMMO_
#define MD_MPVECFLOAT_
void setOrigin(darray3E origin)
std::array< double, 3 > darray3E
#define M_AXIS
void setDirection(darray3E direction)
#define M_FILTER
#define REGISTER(Base, Derived, name)
Definition: factory.hpp:206
RotationGeometry & operator=(RotationGeometry other)