1 // Copyright (C) 2007-2022 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"
26 #include "MCIdType.hxx"
28 namespace INTERP_KERNEL
30 class OrientationInverter
33 INTERPKERNEL_EXPORT static OrientationInverter *BuildInstanceFrom(NormalizedCellType gt);
34 INTERPKERNEL_EXPORT virtual ~OrientationInverter() { }
35 INTERPKERNEL_EXPORT virtual void operate(mcIdType *beginPt, mcIdType *endPt) const = 0;
38 class OrientationInverterChecker : public OrientationInverter
41 OrientationInverterChecker(unsigned nbNodes):_nb_nodes(nbNodes) { }
42 void operate(mcIdType *beginPt, mcIdType *endPt) const { check(beginPt,endPt); operateAndShutUp(beginPt); }
43 virtual void operateAndShutUp(mcIdType *beginPt) const = 0;
45 unsigned getNbNodes() const { return _nb_nodes; }
47 void check(mcIdType *beginPt, mcIdType *endPt) const;
52 class OrientationInverterSEG2 : public OrientationInverterChecker
55 OrientationInverterSEG2():OrientationInverterChecker(2u) { }
56 void operateAndShutUp(mcIdType *beginPt) const;
59 class OrientationInverterSEG3 : public OrientationInverterChecker
62 OrientationInverterSEG3():OrientationInverterChecker(3u) { }
63 void operateAndShutUp(mcIdType *beginPt) const;
66 class OrientationInverter2DLinear : public OrientationInverterChecker
69 OrientationInverter2DLinear(unsigned nbNodes):OrientationInverterChecker(nbNodes) { }
70 void operateAndShutUp(mcIdType *beginPt) const;
73 class OrientationInverter2DQuadratic : public OrientationInverterChecker
76 OrientationInverter2DQuadratic(unsigned nbNodes):OrientationInverterChecker(nbNodes) { }
77 void operateAndShutUp(mcIdType *beginPt) const;
80 class OrientationInverterPolygon : public OrientationInverter
83 void operate(mcIdType *beginPt, mcIdType *endPt) const;
86 class OrientationInverterQPolygon : public OrientationInverter
89 void operate(mcIdType *beginPt, mcIdType *endPt) const;
92 class OrientationInverterTetra4 : public OrientationInverterChecker
95 OrientationInverterTetra4():OrientationInverterChecker(4u) { }
96 void operateAndShutUp(mcIdType *beginPt) const;
99 class OrientationInverterTetra10 : public OrientationInverterChecker
102 OrientationInverterTetra10():OrientationInverterChecker(10u) { }
103 void operateAndShutUp(mcIdType *beginPt) const;
106 class OrientationInverterPyra5 : public OrientationInverterChecker
109 OrientationInverterPyra5():OrientationInverterChecker(5u) { }
110 void operateAndShutUp(mcIdType *beginPt) const;
113 class OrientationInverterPyra13 : public OrientationInverterChecker
116 OrientationInverterPyra13():OrientationInverterChecker(13u) { }
117 void operateAndShutUp(mcIdType *beginPt) const;
120 class OrientationInverter3DExtrusionLinear : public OrientationInverterChecker
123 OrientationInverter3DExtrusionLinear(unsigned nbNodes):OrientationInverterChecker(nbNodes) { }
124 void operateAndShutUp(mcIdType *beginPt) const;
127 class OrientationInverter3DExtrusionQuadratic : public OrientationInverterChecker
130 OrientationInverter3DExtrusionQuadratic(unsigned nbNodes):OrientationInverterChecker(nbNodes) { }
131 void operateAndShutUp(mcIdType *beginPt) const;