SpecularPoints.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 __SPECULARPOINTS_HPP__
25 #define __SPECULARPOINTS_HPP__
26 
27 #include "ProjPatchOnSurface.hpp"
28 
29 namespace mimmo{
30 
92 
93 private:
94  bool m_insideout;
95  bool m_force;
96  darray4E m_plane;
97  darray3E m_origin;
98  darray3E m_normal;
99  bool m_implicit;
100  dmpvector1D * m_scalar;
101  dmpvecarr3E * m_vector;
102  dmpvector1D m_scalarMirrored;
103  dmpvecarr3E m_vectorMirrored;
106 public:
107  SpecularPoints();
108  SpecularPoints(const bitpit::Config::Section & rootXML);
109  ~SpecularPoints();
110 
111  SpecularPoints(const SpecularPoints & other);
113  void buildPorts();
114 
117 
123 
124  darray4E getPlane();
125  bool isInsideOut();
126  bool isForced();
127 
128  void setVectorData(dmpvecarr3E * vdata);
129  void setScalarData(dmpvector1D * data);
131  void setPlane(darray4E plane);
132  void setPlane(darray3E origin, darray3E normal);
133  void setOrigin(darray3E origin);
134  void setNormal(darray3E normal);
135  void setInsideOut(bool flag);
136  void setForce(bool flag);
137 
138  void execute();
139 
140  void clear();
141 
142  virtual void absorbSectionXML(const bitpit::Config::Section & slotXML, std::string name= "");
143  virtual void flushSectionXML(bitpit::Config::Section & slotXML, std::string name= "");
144 
145 protected:
146  virtual void plotOptionalResults();
147  void swap(SpecularPoints & x) noexcept;
148 
149 private:
150  //interface method disabling
153  void setBuildSkdTree(bool build){BITPIT_UNUSED(build); ProjPrimitivesOnSurfaces::setBuildSkdTree(false);};
154  void setWorkingOnTarget(bool flag){ProjPatchOnSurface::setWorkingOnTarget(flag);}
155  bool isWorkingOnTarget(){return ProjPatchOnSurface::isWorkingOnTarget();}
156 
157 };
158 
160 REGISTER_PORT(M_SCALARFIELD, MC_SCALAR, MD_MPVECFLOAT_,__SPECULARPOINTS_HPP__)
161 REGISTER_PORT(M_GEOM, MC_SCALAR, MD_MIMMO_,__SPECULARPOINTS_HPP__)
162 REGISTER_PORT(M_GEOM2, MC_SCALAR, MD_MIMMO_,__SPECULARPOINTS_HPP__)
163 REGISTER_PORT(M_PLANE, MC_ARRAY4, MD_FLOAT,__SPECULARPOINTS_HPP__)
164 REGISTER_PORT(M_POINT, MC_ARRAY3, MD_FLOAT,__SPECULARPOINTS_HPP__)
165 REGISTER_PORT(M_AXIS, MC_ARRAY3, MD_FLOAT,__SPECULARPOINTS_HPP__)
166 
167 REGISTER(BaseManipulation, SpecularPoints, "mimmo.SpecularPoints")
168 };
169 
170 #endif /* __SPECULARPOINTS_HPP__ */
std::array< double, 4 > darray4E
void setInsideOut(bool flag)
void swap(SpecularPoints &x) noexcept
virtual void absorbSectionXML(const bitpit::Config::Section &slotXML, std::string name="")
#define M_GEOM
livector1D getMirroredLabels()
virtual void plotOptionalResults()
#define MC_ARRAY3
#define MD_FLOAT
std::vector< darray3E > dvecarr3E
std::vector< long > livector1D
#define M_GEOM2
dmpvecarr3E * getMirroredVectorData()
#define M_POINT
BaseManipulation is the base class of any manipulation object of the library.
MimmoPiercedVector is the basic data container for mimmo library.
dmpvecarr3E * getOriginalVectorData()
#define M_VECTORFIELD
SpecularPoints is a class that mirrors a point cloud w.r.t. a reference plane, on a target surface ge...
#define MC_ARRAY4
#define MC_SCALAR
void setPatch(MimmoSharedPointer< MimmoObject > geo)
#define MD_MPVECARR3FLOAT_
#define REGISTER_PORT(Name, Container, Datatype, ManipBlock)
dmpvector1D * getOriginalScalarData()
void setPlane(darray4E plane)
void setOrigin(darray3E origin)
#define M_PLANE
void setPointCloud(MimmoSharedPointer< MimmoObject > targetpatch)
Executable block class capable of projecting a surface patch, 3DCurve or PointCloud on a 3D surface,...
dvecarr3E getMirroredRawCoords()
MimmoSharedPointer< MimmoObject > getMirroredPointCloud()
#define MD_MIMMO_
SpecularPoints & operator=(SpecularPoints other)
void setVectorData(dmpvecarr3E *vdata)
MimmoSharedPointer< MimmoObject > getProjectedElement()
#define MD_MPVECFLOAT_
#define M_SCALARFIELD
std::array< double, 3 > darray3E
#define M_AXIS
void setForce(bool flag)
MimmoSharedPointer is a custom implementation of shared pointer.
virtual void flushSectionXML(bitpit::Config::Section &slotXML, std::string name="")
void setScalarData(dmpvector1D *data)
void setNormal(darray3E normal)
dmpvector1D * getMirroredScalarData()
#define REGISTER(Base, Derived, name)
Definition: factory.hpp:206