TranslationPoint.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 __TRANSLATIONPOINT_HPP__
25 #define __TRANSLATIONPOINT_HPP__
26 
27 #include "BaseManipulation.hpp"
28 
29 namespace mimmo{
30 
74 protected:
75  //members
78  double m_alpha;
81 public:
82  TranslationPoint(darray3E direction = { {0, 0, 0} });
83  TranslationPoint(const bitpit::Config::Section & rootXML);
85 
86  TranslationPoint(const TranslationPoint & other);
87 
88  void buildPorts();
89 
91 
94  double getTranslation();
95 
96  void setDirection(darray3E direction);
97  void setOrigin(darray3E origin);
98  void setTranslation(double alpha);
99 
100  void execute();
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(TranslationPoint & x) noexcept;
107 };
108 
109 REGISTER_PORT(M_POINT, MC_ARRAY3, MD_FLOAT,__TRANSLATIONPOINT_HPP__)
110 REGISTER_PORT(M_AXIS, MC_ARRAY3, MD_FLOAT,__TRANSLATIONPOINT_HPP__)
111 REGISTER_PORT(M_VALUED, MC_SCALAR, MD_FLOAT,__TRANSLATIONPOINT_HPP__)
112 
113 
114 REGISTER(BaseManipulation, TranslationPoint, "mimmo.TranslationPoint")
115 };
116 
117 #endif /* __TRANSLATIONPOINT_HPP__ */
virtual void absorbSectionXML(const bitpit::Config::Section &slotXML, std::string name="")
#define MC_ARRAY3
#define MD_FLOAT
void setTranslation(double alpha)
#define M_POINT
TranslationPoint(darray3E direction={ {0, 0, 0} })
BaseManipulation is the base class of any manipulation object of the library.
TranslationPoint is the class that applies the a translation to a point.
void setDirection(darray3E direction)
#define MC_SCALAR
#define REGISTER_PORT(Name, Container, Datatype, ManipBlock)
#define M_VALUED
virtual void flushSectionXML(bitpit::Config::Section &slotXML, std::string name="")
void setOrigin(darray3E origin)
std::array< double, 3 > darray3E
#define M_AXIS
void swap(TranslationPoint &x) noexcept
#define REGISTER(Base, Derived, name)
Definition: factory.hpp:206