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