Salome HOME
Update copyrights
[tools/medcoupling.git] / src / INTERP_KERNEL / OrientationInverter.hxx
1 // Copyright (C) 2007-2019  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 (EDF R&D)
20
21 #ifndef __ORIENTATIONINVERTER_HXX__
22 #define __ORIENTATIONINVERTER_HXX__
23
24 #include "INTERPKERNELDefines.hxx"
25 #include "NormalizedGeometricTypes"
26
27 namespace INTERP_KERNEL
28 {
29   class OrientationInverter
30   {
31   public:
32     INTERPKERNEL_EXPORT static OrientationInverter *BuildInstanceFrom(NormalizedCellType gt);
33     INTERPKERNEL_EXPORT virtual ~OrientationInverter() { }
34     INTERPKERNEL_EXPORT virtual void operate(int *beginPt, int *endPt) const = 0;
35   };
36
37   class OrientationInverterChecker : public OrientationInverter
38   {
39   public:
40     OrientationInverterChecker(unsigned nbNodes):_nb_nodes(nbNodes) { }
41     void operate(int *beginPt, int *endPt) const { check(beginPt,endPt); operateAndShutUp(beginPt); }
42     virtual void operateAndShutUp(int *beginPt) const = 0;
43   protected:
44     unsigned getNbNodes() const { return _nb_nodes; }
45   private:
46     void check(int *beginPt, int *endPt) const;
47   private:
48     unsigned _nb_nodes;
49   };
50
51   class OrientationInverterSEG2 : public OrientationInverterChecker
52   {
53   public:
54     OrientationInverterSEG2():OrientationInverterChecker(2u) { }
55     void operateAndShutUp(int *beginPt) const;
56   };
57
58   class OrientationInverterSEG3 : public OrientationInverterChecker
59   {
60   public:
61     OrientationInverterSEG3():OrientationInverterChecker(3u) { }
62     void operateAndShutUp(int *beginPt) const;
63   };
64
65   class OrientationInverter2DLinear : public OrientationInverterChecker
66   {
67   public:
68     OrientationInverter2DLinear(unsigned nbNodes):OrientationInverterChecker(nbNodes) { }
69     void operateAndShutUp(int *beginPt) const;
70   };
71
72   class OrientationInverter2DQuadratic : public OrientationInverterChecker
73   {
74   public:
75     OrientationInverter2DQuadratic(unsigned nbNodes):OrientationInverterChecker(nbNodes) { }
76     void operateAndShutUp(int *beginPt) const;
77   };
78
79   class OrientationInverterPolygon : public OrientationInverter
80   {
81   public:
82     void operate(int *beginPt, int *endPt) const;
83   };
84
85   class OrientationInverterQPolygon : public OrientationInverter
86   {
87   public:
88     void operate(int *beginPt, int *endPt) const;
89   };
90
91   class OrientationInverterTetra4 : public OrientationInverterChecker
92   {
93   public:
94     OrientationInverterTetra4():OrientationInverterChecker(4u) { }
95     void operateAndShutUp(int *beginPt) const;
96   };
97
98   class OrientationInverterTetra10 : public OrientationInverterChecker
99   {
100   public:
101     OrientationInverterTetra10():OrientationInverterChecker(10u) { }
102     void operateAndShutUp(int *beginPt) const;
103   };
104
105   class OrientationInverterPyra5 : public OrientationInverterChecker
106   {
107   public:
108     OrientationInverterPyra5():OrientationInverterChecker(5u) { }
109     void operateAndShutUp(int *beginPt) const;
110   };
111
112   class OrientationInverterPyra13 : public OrientationInverterChecker
113   {
114   public:
115     OrientationInverterPyra13():OrientationInverterChecker(13u) { }
116     void operateAndShutUp(int *beginPt) const;
117   };
118
119   class OrientationInverter3DExtrusionLinear : public OrientationInverterChecker
120   {
121   public:
122     OrientationInverter3DExtrusionLinear(unsigned nbNodes):OrientationInverterChecker(nbNodes) { }
123     void operateAndShutUp(int *beginPt) const;
124   };
125
126   class OrientationInverter3DExtrusionQuadratic : public OrientationInverterChecker
127   {
128   public:
129     OrientationInverter3DExtrusionQuadratic(unsigned nbNodes):OrientationInverterChecker(nbNodes) { }
130     void operateAndShutUp(int *beginPt) const;
131   };
132 }
133
134 #endif