Salome HOME
Implementation of MEDCouplingPointSet.computeDiameterField (EDF10718)
[tools/medcoupling.git] / src / INTERP_KERNEL / DiameterCalculator.hxx
1 // Copyright (C) 2007-2015  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 __DIAMETERCALCULATOR_HXX__
22 #define __DIAMETERCALCULATOR_HXX__
23
24 #include "INTERPKERNELDefines.hxx"
25
26 #include "NormalizedGeometricTypes"
27
28 namespace INTERP_KERNEL
29 {
30   class DiameterCalculator
31   {
32   public:
33     INTERPKERNEL_EXPORT virtual ~DiameterCalculator() { }
34     INTERPKERNEL_EXPORT virtual NormalizedCellType getType() const = 0;
35     INTERPKERNEL_EXPORT virtual double computeForOneCell(const int *bg, const int *endd, const double *coordsPtr) const = 0;
36     INTERPKERNEL_EXPORT virtual void computeForListOfCellIdsUMeshFrmt(const int *bgIds, const int *endIds, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const = 0;
37     INTERPKERNEL_EXPORT virtual void computeForRangeOfCellIdsUMeshFrmt(int bgId, int endId, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const = 0;
38     INTERPKERNEL_EXPORT virtual void computeFor1SGTUMeshFrmt(int nbOfCells, const int *connPtr, const double *coordsPtr, double *resPtr) const = 0;
39   };
40
41   class DiameterCalulatorTRI3S2 : public DiameterCalculator
42   {
43   public:
44     NormalizedCellType getType() const { return TYPE; }
45     double computeForOneCell(const int *bg, const int *endd, const double *coordsPtr) const { return computeForOneCellInternal(bg,endd,coordsPtr); }
46     double computeForOneCellInternal(const int *bg, const int *endd, const double *coordsPtr) const;
47     void computeForListOfCellIdsUMeshFrmt(const int *bgIds, const int *endIds, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
48     void computeForRangeOfCellIdsUMeshFrmt(int bgId, int endId, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
49     void computeFor1SGTUMeshFrmt(int nbOfCells, const int *connPtr, const double *coordsPtr, double *resPtr) const;
50   public:
51     static NormalizedCellType TYPE;
52   };
53
54   class DiameterCalulatorTRI3S3 : public DiameterCalculator
55   {
56   public:
57     NormalizedCellType getType() const { return TYPE; }
58     double computeForOneCell(const int *bg, const int *endd, const double *coordsPtr) const { return computeForOneCellInternal(bg,endd,coordsPtr); }
59     double computeForOneCellInternal(const int *bg, const int *endd, const double *coordsPtr) const;
60     void computeForListOfCellIdsUMeshFrmt(const int *bgIds, const int *endIds, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
61     void computeForRangeOfCellIdsUMeshFrmt(int bgId, int endId, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
62     void computeFor1SGTUMeshFrmt(int nbOfCells, const int *connPtr, const double *coordsPtr, double *resPtr) const;
63   public:
64     static NormalizedCellType TYPE;
65   };
66
67   class DiameterCalulatorQUAD4S2 : public DiameterCalculator
68   {
69   public:
70     NormalizedCellType getType() const { return TYPE; }
71     double computeForOneCell(const int *bg, const int *endd, const double *coordsPtr) const { return computeForOneCellInternal(bg,endd,coordsPtr); }
72     double computeForOneCellInternal(const int *bg, const int *endd, const double *coordsPtr) const;
73     void computeForListOfCellIdsUMeshFrmt(const int *bgIds, const int *endIds, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
74     void computeForRangeOfCellIdsUMeshFrmt(int bgId, int endId, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
75     void computeFor1SGTUMeshFrmt(int nbOfCells, const int *connPtr, const double *coordsPtr, double *resPtr) const;
76   public:
77     static NormalizedCellType TYPE;
78   };
79
80   class DiameterCalulatorQUAD4S3 : public DiameterCalculator
81   {
82   public:
83     NormalizedCellType getType() const { return TYPE; }
84     double computeForOneCell(const int *bg, const int *endd, const double *coordsPtr) const { return computeForOneCellInternal(bg,endd,coordsPtr); }
85     double computeForOneCellInternal(const int *bg, const int *endd, const double *coordsPtr) const;
86     void computeForListOfCellIdsUMeshFrmt(const int *bgIds, const int *endIds, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
87     void computeForRangeOfCellIdsUMeshFrmt(int bgId, int endId, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
88     void computeFor1SGTUMeshFrmt(int nbOfCells, const int *connPtr, const double *coordsPtr, double *resPtr) const;
89   public:
90     static NormalizedCellType TYPE;
91   };
92
93   class DiameterCalulatorTETRA4 : public DiameterCalculator
94   {
95   public:
96     NormalizedCellType getType() const { return TYPE; }
97     double computeForOneCell(const int *bg, const int *endd, const double *coordsPtr) const { return computeForOneCellInternal(bg,endd,coordsPtr); }
98     double computeForOneCellInternal(const int *bg, const int *endd, const double *coordsPtr) const;
99     void computeForListOfCellIdsUMeshFrmt(const int *bgIds, const int *endIds, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
100     void computeForRangeOfCellIdsUMeshFrmt(int bgId, int endId, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
101     void computeFor1SGTUMeshFrmt(int nbOfCells, const int *connPtr, const double *coordsPtr, double *resPtr) const;
102   public:
103     static NormalizedCellType TYPE;
104   };
105
106   class DiameterCalulatorHEXA8 : public DiameterCalculator
107   {
108   public:
109     NormalizedCellType getType() const { return TYPE; }
110     double computeForOneCell(const int *bg, const int *endd, const double *coordsPtr) const { return computeForOneCellInternal(bg,endd,coordsPtr); }
111     double computeForOneCellInternal(const int *bg, const int *endd, const double *coordsPtr) const;
112     void computeForListOfCellIdsUMeshFrmt(const int *bgIds, const int *endIds, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
113     void computeForRangeOfCellIdsUMeshFrmt(int bgId, int endId, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
114     void computeFor1SGTUMeshFrmt(int nbOfCells, const int *connPtr, const double *coordsPtr, double *resPtr) const;
115   public:
116     static NormalizedCellType TYPE;
117   };
118
119   class DiameterCalulatorPENTA6 : public DiameterCalculator
120   {
121   public:
122     NormalizedCellType getType() const { return TYPE; }
123     double computeForOneCell(const int *bg, const int *endd, const double *coordsPtr) const { return computeForOneCellInternal(bg,endd,coordsPtr); }
124     double computeForOneCellInternal(const int *bg, const int *endd, const double *coordsPtr) const;
125     void computeForListOfCellIdsUMeshFrmt(const int *bgIds, const int *endIds, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
126     void computeForRangeOfCellIdsUMeshFrmt(int bgId, int endId, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
127     void computeFor1SGTUMeshFrmt(int nbOfCells, const int *connPtr, const double *coordsPtr, double *resPtr) const;
128   public:
129     static NormalizedCellType TYPE;
130   };
131
132   class DiameterCalulatorPYRA5 : public DiameterCalculator
133   {
134   public:
135     NormalizedCellType getType() const { return TYPE; }
136     double computeForOneCell(const int *bg, const int *endd, const double *coordsPtr) const { return computeForOneCellInternal(bg,endd,coordsPtr); }
137     double computeForOneCellInternal(const int *bg, const int *endd, const double *coordsPtr) const;
138     void computeForListOfCellIdsUMeshFrmt(const int *bgIds, const int *endIds, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
139     void computeForRangeOfCellIdsUMeshFrmt(int bgId, int endId, const int *indPtr, const int *connPtr, const double *coordsPtr, double *resPtr) const;
140     void computeFor1SGTUMeshFrmt(int nbOfCells, const int *connPtr, const double *coordsPtr, double *resPtr) const;
141   public:
142     static NormalizedCellType TYPE;
143   };
144 }
145
146 #endif