Salome HOME
Copyright update 2021
[tools/medcoupling.git] / src / INTERP_KERNEL / InterpolationPlanar.hxx
1 // Copyright (C) 2007-2021  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 // Author : Anthony Geay (CEA/DEN)\r
20 \r
21 #ifndef __INTERPOLATIONPLANAR_HXX__\r
22 #define __INTERPOLATIONPLANAR_HXX__\r
23 \r
24 #include "Interpolation.hxx"\r
25 #include "PlanarIntersector.hxx"\r
26 #include "NormalizedUnstructuredMesh.hxx"\r
27 #include "InterpolationOptions.hxx"\r
28 \r
29 namespace INTERP_KERNEL\r
30 {
31   /**
32    * \defgroup interpolationPlanar InterpolationPlanar
33    *
34    * \class InterpolationPlanar
35    * \brief Class used to compute the coefficients of the interpolation matrix between
36    * two local meshes in two dimensions. Meshes can contain mixed triangular and quadrangular elements.
37    */
38
39   template<class RealPlanar>\r
40   class InterpolationPlanar : public Interpolation< InterpolationPlanar<RealPlanar> >\r
41   {\r
42   private:\r
43     double _dim_caracteristic;\r
44   public:\r
45     InterpolationPlanar();\r
46     InterpolationPlanar(const InterpolationOptions & io);\r
47 \r
48     // geometric precision, debug print level, choice of the median plane, intersection etc ...\r
49     void setOptions(double precision, int printLevel,\r
50                     IntersectionType intersectionType, int orientation=0);\r
51 \r
52     // Main function to interpolate triangular and quadratic meshes\r
53     template<class MyMeshType, class MatrixType>\r
54     typename MyMeshType::MyConnType interpolateMeshes(const MyMeshType& meshS, const MyMeshType& meshT, MatrixType& result, const std::string& method);\r
55   public:\r
56     bool doRotate() const { return asLeafInterpPlanar().doRotate(); }\r
57     double medianPlane() const { return asLeafInterpPlanar().medianPlane(); }\r
58     template<class MyMeshType, class MyMatrixRow>\r
59       void performAdjustmentOfBB(PlanarIntersector<MyMeshType,MyMatrixRow>* intersector, std::vector<double>& bbox) const\r
60     { return asLeafInterpPlanar().performAdjustmentOfBB(intersector,bbox); }\r
61   protected:\r
62     RealPlanar& asLeafInterpPlanar() { return static_cast<RealPlanar&>(*this); }\r
63     const RealPlanar& asLeafInterpPlanar() const { return static_cast< const RealPlanar& >(*this); }\r
64   };\r
65 }\r
66 \r
67 #endif\r