1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (EDF R&D)
21 #ifndef __ORIENTATIONINVERTER_HXX__
22 #define __ORIENTATIONINVERTER_HXX__
24 #include "INTERPKERNELDefines.hxx"
25 #include "NormalizedGeometricTypes"
27 namespace INTERP_KERNEL
29 class OrientationInverter
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;
37 class OrientationInverterChecker : public OrientationInverter
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;
44 unsigned getNbNodes() const { return _nb_nodes; }
46 void check(int *beginPt, int *endPt) const;
51 class OrientationInverterSEG2 : public OrientationInverterChecker
54 OrientationInverterSEG2():OrientationInverterChecker(2u) { }
55 void operateAndShutUp(int *beginPt) const;
58 class OrientationInverterSEG3 : public OrientationInverterChecker
61 OrientationInverterSEG3():OrientationInverterChecker(3u) { }
62 void operateAndShutUp(int *beginPt) const;
65 class OrientationInverter2DLinear : public OrientationInverterChecker
68 OrientationInverter2DLinear(unsigned nbNodes):OrientationInverterChecker(nbNodes) { }
69 void operateAndShutUp(int *beginPt) const;
72 class OrientationInverter2DQuadratic : public OrientationInverterChecker
75 OrientationInverter2DQuadratic(unsigned nbNodes):OrientationInverterChecker(nbNodes) { }
76 void operateAndShutUp(int *beginPt) const;
79 class OrientationInverterPolygon : public OrientationInverter
82 void operate(int *beginPt, int *endPt) const;
85 class OrientationInverterQPolygon : public OrientationInverter
88 void operate(int *beginPt, int *endPt) const;
91 class OrientationInverterTetra4 : public OrientationInverterChecker
94 OrientationInverterTetra4():OrientationInverterChecker(4u) { }
95 void operateAndShutUp(int *beginPt) const;
98 class OrientationInverterTetra10 : public OrientationInverterChecker
101 OrientationInverterTetra10():OrientationInverterChecker(10u) { }
102 void operateAndShutUp(int *beginPt) const;
105 class OrientationInverterPyra5 : public OrientationInverterChecker
108 OrientationInverterPyra5():OrientationInverterChecker(5u) { }
109 void operateAndShutUp(int *beginPt) const;
112 class OrientationInverterPyra13 : public OrientationInverterChecker
115 OrientationInverterPyra13():OrientationInverterChecker(13u) { }
116 void operateAndShutUp(int *beginPt) const;
119 class OrientationInverter3DExtrusionLinear : public OrientationInverterChecker
122 OrientationInverter3DExtrusionLinear(unsigned nbNodes):OrientationInverterChecker(nbNodes) { }
123 void operateAndShutUp(int *beginPt) const;
126 class OrientationInverter3DExtrusionQuadratic : public OrientationInverterChecker
129 OrientationInverter3DExtrusionQuadratic(unsigned nbNodes):OrientationInverterChecker(nbNodes) { }
130 void operateAndShutUp(int *beginPt) const;