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