ApplyFilter.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 __APPLYFILTER_HPP__
25 #define __APPLYFILTER_HPP__
26 
27 #include "Apply.hpp"
28 
29 namespace mimmo{
73 class ApplyFilter: public Apply{
74 
75 public:
76 
77  ApplyFilter();
78  ApplyFilter(const bitpit::Config::Section & rootXML);
79 
80  ~ApplyFilter();
81 
82  ApplyFilter(const ApplyFilter & other);
83 
84  void buildPorts();
85 
86  using Apply::setScaling;
87 
88  void execute();
89 
90  using Apply::getOutput;
91 
92  virtual void absorbSectionXML(const bitpit::Config::Section & slotXML, std::string name="");
93  virtual void flushSectionXML(bitpit::Config::Section & slotXML, std::string name="");
94 
95 protected:
96 
97  using Apply::m_input;
98  using Apply::m_scalarinput;
99  using Apply::m_filter;
100  using Apply::m_factor;
101  using Apply::m_output;
103  void swap(ApplyFilter & x) noexcept;
104  void checkInput();
105 
106 private:
107  void setAnnotation(bool activate) = delete;
108  void setCellsAnnotationName(const std::string & label) = delete;
109  void setVerticesAnnotationName(const std::string & label) = delete;
110  void setAnnotationThreshold(double threshold) = delete;
111  MimmoPiercedVector<long> * getAnnotatedVertices() = delete;
112  MimmoPiercedVector<long> * getAnnotatedCells() = delete;
113 
114 };
115 
116 REGISTER_PORT(M_GDISPLS, MC_SCALAR, MD_MPVECARR3FLOAT_, __APPLYFILTER_HPP__)
117 REGISTER_PORT(M_SCALARFIELD, MC_SCALAR, MD_MPVECFLOAT_, __APPLYFILTER_HPP__)
118 REGISTER_PORT(M_FILTER, MC_SCALAR, MD_MPVECFLOAT_, __APPLYFILTER_HPP__)
119 
120 REGISTER(BaseManipulation, ApplyFilter, "mimmo.ApplyFilter")
121 
122 };
123 
124 #endif /* __APPLYFILTER_HPP__ */
#define M_GDISPLS
ApplyFilter is a class that applies a filter field to a deformation field defined on a geometry.
Definition: ApplyFilter.hpp:73
dmpvecarr3E m_input
Definition: Apply.hpp:124
Apply is the class that applies the deformation resulting from a manipulation object to the geometry.
Definition: Apply.hpp:89
void setScaling(double alpha)
Definition: Apply.cpp:158
dmpvecarr3E m_output
Definition: Apply.hpp:128
BaseManipulation is the base class of any manipulation object of the library.
#define MC_SCALAR
virtual void flushSectionXML(bitpit::Config::Section &slotXML, std::string name="")
#define MD_MPVECARR3FLOAT_
#define REGISTER_PORT(Name, Container, Datatype, ManipBlock)
double m_factor
Definition: Apply.hpp:127
dmpvector1D m_filter
Definition: Apply.hpp:126
#define MD_MPVECFLOAT_
#define M_SCALARFIELD
void swap(ApplyFilter &x) noexcept
Definition: ApplyFilter.cpp:69
virtual void absorbSectionXML(const bitpit::Config::Section &slotXML, std::string name="")
dmpvecarr3E * getOutput()
Definition: Apply.cpp:216
dmpvector1D m_scalarinput
Definition: Apply.hpp:125
#define M_FILTER
#define REGISTER(Base, Derived, name)
Definition: factory.hpp:206