Salome HOME
Copyright update 2020
[tools/medcoupling.git] / src / MEDCoupling / MEDCouplingUMesh.hxx
1 // Copyright (C) 2007-2020  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 (CEA/DEN)
20
21 #ifndef __PARAMEDMEM_MEDCOUPLINGUMESH_HXX__
22 #define __PARAMEDMEM_MEDCOUPLINGUMESH_HXX__
23
24 #include "MEDCoupling.hxx"
25 #include "MEDCouplingPointSet.hxx"
26 #include "MEDCouplingMemArray.hxx"
27
28 #include "CellModel.hxx"
29
30 #include <set>
31
32 namespace MEDCoupling
33 {
34   class MEDCouplingUMeshCellByTypeEntry;
35   class MEDCouplingUMeshCellIterator;
36   class MEDCoupling1SGTUMesh;
37   class MEDCoupling1GTUMesh;
38   class MEDCouplingSkyLineArray;
39
40   class MEDCouplingUMesh : public MEDCouplingPointSet
41   {
42   public:
43     MEDCOUPLING_EXPORT static MEDCouplingUMesh *New();
44     MEDCOUPLING_EXPORT static MEDCouplingUMesh *New(const std::string& meshName, int meshDim);
45     MEDCOUPLING_EXPORT std::string getClassName() const override { return std::string("MEDCouplingUMesh"); }
46     // Copy methods
47     MEDCOUPLING_EXPORT MEDCouplingUMesh *deepCopy() const;
48     MEDCOUPLING_EXPORT MEDCouplingUMesh *clone(bool recDeepCpy) const;
49     MEDCOUPLING_EXPORT MEDCouplingUMesh *deepCopyConnectivityOnly() const;
50
51     MEDCOUPLING_EXPORT void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other);
52     MEDCOUPLING_EXPORT void updateTime() const;
53     MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
54     MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
55     MEDCOUPLING_EXPORT MEDCouplingMeshType getType() const { return UNSTRUCTURED; }
56     MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const MEDCouplingMesh *other, double prec, std::string& reason) const;
57     MEDCOUPLING_EXPORT bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const;
58     MEDCOUPLING_EXPORT void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const;
59     MEDCOUPLING_EXPORT void checkConsistencyLight() const;
60     MEDCOUPLING_EXPORT void checkConsistency(double eps=1e-12) const;
61     MEDCOUPLING_EXPORT void setMeshDimension(int meshDim);
62     MEDCOUPLING_EXPORT void allocateCells(mcIdType nbOfCells=0);
63     MEDCOUPLING_EXPORT void insertNextCell(INTERP_KERNEL::NormalizedCellType type, mcIdType size, const mcIdType *nodalConnOfCell);
64     MEDCOUPLING_EXPORT void finishInsertingCells();
65     MEDCOUPLING_EXPORT MEDCouplingUMeshCellIterator *cellIterator();
66     MEDCOUPLING_EXPORT MEDCouplingUMeshCellByTypeEntry *cellsByType();
67     MEDCOUPLING_EXPORT std::set<INTERP_KERNEL::NormalizedCellType> getAllGeoTypes() const;
68     MEDCOUPLING_EXPORT std::vector<INTERP_KERNEL::NormalizedCellType> getAllGeoTypesSorted() const;
69     MEDCOUPLING_EXPORT std::set<INTERP_KERNEL::NormalizedCellType> getTypesOfPart(const mcIdType *begin, const mcIdType *end) const;
70     MEDCOUPLING_EXPORT void setConnectivity(DataArrayIdType *conn, DataArrayIdType *connIndex, bool isComputingTypes=true);
71     MEDCOUPLING_EXPORT const DataArrayIdType *getNodalConnectivity() const { return _nodal_connec; }
72     MEDCOUPLING_EXPORT const DataArrayIdType *getNodalConnectivityIndex() const { return _nodal_connec_index; }
73     MEDCOUPLING_EXPORT DataArrayIdType *getNodalConnectivity() { return _nodal_connec; }
74     MEDCOUPLING_EXPORT DataArrayIdType *getNodalConnectivityIndex() { return _nodal_connec_index; }
75     MEDCOUPLING_EXPORT INTERP_KERNEL::NormalizedCellType getTypeOfCell(mcIdType cellId) const;
76     MEDCOUPLING_EXPORT DataArrayIdType *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const;
77     MEDCOUPLING_EXPORT mcIdType getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const;
78     MEDCOUPLING_EXPORT void getNodeIdsOfCell(mcIdType cellId, std::vector<mcIdType>& conn) const;
79     MEDCOUPLING_EXPORT std::string simpleRepr() const;
80     MEDCOUPLING_EXPORT std::string advancedRepr() const;
81     MEDCOUPLING_EXPORT std::string cppRepr() const;
82     MEDCOUPLING_EXPORT std::string reprConnectivityOfThis() const;
83     MEDCOUPLING_EXPORT MEDCouplingUMesh *buildSetInstanceFromThis(std::size_t spaceDim) const;
84     MEDCOUPLING_EXPORT mcIdType getNumberOfNodesInCell(mcIdType cellId) const;
85     MEDCOUPLING_EXPORT mcIdType getNumberOfCells() const;
86     MEDCOUPLING_EXPORT int getMeshDimension() const;
87     MEDCOUPLING_EXPORT mcIdType getNodalConnectivityArrayLen() const;
88     MEDCOUPLING_EXPORT void computeTypes();
89     //! size of returned tinyInfo must be always the same.
90     MEDCOUPLING_EXPORT void getTinySerializationInformation(std::vector<double>& tinyInfoD, std::vector<mcIdType>& tinyInfo, std::vector<std::string>& littleStrings) const;
91     MEDCOUPLING_EXPORT bool isEmptyMesh(const std::vector<mcIdType>& tinyInfo) const;
92     MEDCOUPLING_EXPORT void resizeForUnserialization(const std::vector<mcIdType>& tinyInfo, DataArrayIdType *a1, DataArrayDouble *a2, std::vector<std::string>& littleStrings) const;
93     MEDCOUPLING_EXPORT void serialize(DataArrayIdType *&a1, DataArrayDouble *&a2) const;
94     MEDCOUPLING_EXPORT void unserialization(const std::vector<double>& tinyInfoD, const std::vector<mcIdType>& tinyInfo, const DataArrayIdType *a1, DataArrayDouble *a2, const std::vector<std::string>& littleStrings);
95     MEDCOUPLING_EXPORT std::string getVTKDataSetType() const;
96     MEDCOUPLING_EXPORT std::string getVTKFileExtension() const;
97     MEDCOUPLING_EXPORT void writeVTKLL(std::ostream& ofs, const std::string& cellData, const std::string& pointData, DataArrayByte *byteData) const;
98     MEDCOUPLING_EXPORT void reprQuickOverview(std::ostream& stream) const;
99     //tools
100     MEDCOUPLING_EXPORT static int AreCellsEqual(const mcIdType *conn, const mcIdType *connI, mcIdType cell1, mcIdType cell2, int compType);
101     MEDCOUPLING_EXPORT static int AreCellsEqualPolicy0(const mcIdType *conn, const mcIdType *connI, mcIdType cell1, mcIdType cell2);
102     MEDCOUPLING_EXPORT static int AreCellsEqualPolicy1(const mcIdType *conn, const mcIdType *connI, mcIdType cell1, mcIdType cell2);
103     MEDCOUPLING_EXPORT static int AreCellsEqualPolicy2(const mcIdType *conn, const mcIdType *connI, mcIdType cell1, mcIdType cell2);
104     MEDCOUPLING_EXPORT static int AreCellsEqualPolicy2NoType(const mcIdType *conn, const mcIdType *connI, mcIdType cell1, mcIdType cell2);
105     MEDCOUPLING_EXPORT static int AreCellsEqualPolicy7(const mcIdType *conn, const mcIdType *connI, mcIdType cell1, mcIdType cell2);
106     MEDCOUPLING_EXPORT void convertToPolyTypes(const mcIdType *cellIdsToConvertBg, const mcIdType *cellIdsToConvertEnd);
107     MEDCOUPLING_EXPORT void convertAllToPoly();
108     MEDCOUPLING_EXPORT void convertExtrudedPolyhedra();
109     MEDCOUPLING_EXPORT bool unPolyze();
110     MEDCOUPLING_EXPORT void simplifyPolyhedra(double eps);
111     MEDCOUPLING_EXPORT MEDCouplingUMesh *buildSpreadZonesWithPoly() const;
112     MEDCOUPLING_EXPORT std::vector<DataArrayIdType *> partitionBySpreadZone() const;
113     MEDCOUPLING_EXPORT DataArrayIdType *computeFetchedNodeIds() const;
114     MEDCOUPLING_EXPORT DataArrayIdType *getNodeIdsInUse(mcIdType& nbrOfNodesInUse) const;
115     MEDCOUPLING_EXPORT void computeNodeIdsAlg(std::vector<bool>& nodeIdsInUse) const;
116     MEDCOUPLING_EXPORT DataArrayIdType *computeNbOfNodesPerCell() const;
117     MEDCOUPLING_EXPORT DataArrayIdType *computeNbOfFacesPerCell() const;
118     MEDCOUPLING_EXPORT DataArrayIdType *computeEffectiveNbOfNodesPerCell() const;
119     MEDCOUPLING_EXPORT DataArrayIdType *zipCoordsTraducer();
120     MEDCOUPLING_EXPORT void findCommonCells(int compType, mcIdType startCellId, DataArrayIdType *& commonCellsArr, DataArrayIdType *& commonCellsIArr) const;
121     MEDCOUPLING_EXPORT bool areCellsIncludedIn(const MEDCouplingUMesh *other, int compType, DataArrayIdType *& arr) const;
122     MEDCOUPLING_EXPORT bool areCellsIncludedInPolicy7(const MEDCouplingUMesh *other, DataArrayIdType *& arr) const;
123     MEDCOUPLING_EXPORT void getReverseNodalConnectivity(DataArrayIdType *revNodal, DataArrayIdType *revNodalIndx) const;
124     MEDCOUPLING_EXPORT MCAuto<MEDCouplingUMesh> explodeIntoEdges(MCAuto<DataArrayIdType>& desc, MCAuto<DataArrayIdType>& descIndex, MCAuto<DataArrayIdType>& revDesc, MCAuto<DataArrayIdType>& revDescIndx) const;
125     MEDCOUPLING_EXPORT MEDCouplingUMesh *explode3DMeshTo1D(DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const;
126     MEDCOUPLING_EXPORT MEDCouplingUMesh *buildDescendingConnectivity(DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const;
127     MEDCOUPLING_EXPORT MEDCouplingUMesh *buildDescendingConnectivity2(DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const;
128     MEDCOUPLING_EXPORT MEDCouplingUMesh *explodeMeshIntoMicroEdges(DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const;
129     MEDCOUPLING_EXPORT void computeNeighborsOfCells(DataArrayIdType *&neighbors, DataArrayIdType *&neighborsIdx) const;
130     MEDCOUPLING_EXPORT void computeCellNeighborhoodFromNodesOne(const DataArrayIdType *nodeNeigh, const DataArrayIdType *nodeNeighI, MCAuto<DataArrayIdType>& cellNeigh, MCAuto<DataArrayIdType>& cellNeighIndex) const;
131     MEDCOUPLING_EXPORT static void ComputeNeighborsOfCellsAdv(const DataArrayIdType *desc, const DataArrayIdType *descI, const DataArrayIdType *revDesc, const DataArrayIdType *revDescI,
132                                                               DataArrayIdType *&neighbors, DataArrayIdType *&neighborsIdx);
133     MEDCOUPLING_EXPORT void computeNeighborsOfNodes(DataArrayIdType *&neighbors, DataArrayIdType *&neighborsIdx) const;
134     MEDCOUPLING_EXPORT void computeEnlargedNeighborsOfNodes(MCAuto<DataArrayIdType> &neighbors, MCAuto<DataArrayIdType>& neighborsIdx) const;
135     MEDCOUPLING_EXPORT MEDCouplingUMesh *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const;
136     MEDCOUPLING_EXPORT MEDCouplingUMesh *buildPartOfMySelf(const mcIdType *begin, const mcIdType *end, bool keepCoords=true) const;
137     MEDCOUPLING_EXPORT MEDCouplingUMesh *buildPartOfMySelfSlice(mcIdType start, mcIdType end, mcIdType step, bool keepCoords=true) const;
138     MEDCOUPLING_EXPORT void setPartOfMySelf(const mcIdType *cellIdsBg, const mcIdType *cellIdsEnd, const MEDCouplingUMesh& otherOnSameCoordsThanThis);
139     MEDCOUPLING_EXPORT void setPartOfMySelfSlice(mcIdType start, mcIdType end, mcIdType step, const MEDCouplingUMesh& otherOnSameCoordsThanThis);
140     MEDCOUPLING_EXPORT MEDCouplingUMesh *buildFacePartOfMySelfNode(const mcIdType *begin, const mcIdType *end, bool fullyIn) const;
141     MEDCOUPLING_EXPORT MEDCouplingUMesh *buildUnstructured() const;
142     MEDCOUPLING_EXPORT DataArrayIdType *findBoundaryNodes() const;
143     MEDCOUPLING_EXPORT MEDCouplingUMesh *buildBoundaryMesh(bool keepCoords) const;
144     MEDCOUPLING_EXPORT DataArrayIdType *findCellIdsOnBoundary() const;
145     MEDCOUPLING_EXPORT void findCellIdsLyingOn(const MEDCouplingUMesh& otherDimM1OnSameCoords, DataArrayIdType *&cellIdsRk0, DataArrayIdType *&cellIdsRk1) const;
146     MEDCOUPLING_EXPORT MEDCouplingUMesh *computeSkin() const;
147     MEDCOUPLING_EXPORT void findNodesToDuplicate(const MEDCouplingUMesh& otherDimM1OnSameCoords, DataArrayIdType *& nodeIdsToDuplicate,
148                                                  DataArrayIdType *& cellIdsNeededToBeRenum, DataArrayIdType *& cellIdsNotModified) const;
149     MEDCOUPLING_EXPORT void duplicateNodes(const mcIdType *nodeIdsToDuplicateBg, const mcIdType *nodeIdsToDuplicateEnd);
150     MEDCOUPLING_EXPORT void renumberNodesWithOffsetInConn(mcIdType offset);
151     MEDCOUPLING_EXPORT void renumberNodesInConn(const INTERP_KERNEL::HashMap<mcIdType,mcIdType>& newNodeNumbersO2N);
152     MEDCOUPLING_EXPORT void renumberNodesInConn(const mcIdType *newNodeNumbersO2N);
153     MEDCOUPLING_EXPORT void renumberNodesInConn(const std::map<mcIdType,mcIdType>& newNodeNumbersO2N) override;
154     MEDCOUPLING_EXPORT void shiftNodeNumbersInConn(mcIdType delta);
155     MEDCOUPLING_EXPORT void duplicateNodesInConn(const mcIdType *nodeIdsToDuplicateBg, const mcIdType *nodeIdsToDuplicateEnd, mcIdType offset);
156     MEDCOUPLING_EXPORT void renumberCells(const mcIdType *old2NewBg, bool check=true);
157     MEDCOUPLING_EXPORT DataArrayIdType *getCellsInBoundingBox(const double *bbox, double eps) const;
158     MEDCOUPLING_EXPORT DataArrayIdType *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps);
159     MEDCOUPLING_EXPORT MEDCouplingFieldDouble *getMeasureField(bool isAbs) const;
160     MEDCOUPLING_EXPORT DataArrayDouble *getPartMeasureField(bool isAbs, const mcIdType *begin, const mcIdType *end) const;
161     MEDCOUPLING_EXPORT MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const;
162     MEDCOUPLING_EXPORT MEDCouplingFieldDouble *buildOrthogonalField() const;
163     MEDCOUPLING_EXPORT MEDCouplingFieldDouble *buildPartOrthogonalField(const mcIdType *begin, const mcIdType *end) const;
164     MEDCOUPLING_EXPORT MEDCouplingFieldDouble *buildDirectionVectorField() const;
165     MEDCOUPLING_EXPORT MEDCouplingUMesh *buildSlice3D(const double *origin, const double *vec, double eps, DataArrayIdType *&cellIds) const;
166     MEDCOUPLING_EXPORT MEDCouplingUMesh *buildSlice3DSurf(const double *origin, const double *vec, double eps, DataArrayIdType *&cellIds) const;
167     MEDCOUPLING_EXPORT MCAuto<MEDCouplingUMesh> clipSingle3DCellByPlane(const double origin[3], const double vec[3], double eps) const;
168     MEDCOUPLING_EXPORT DataArrayIdType *getCellIdsCrossingPlane(const double *origin, const double *vec, double eps) const;
169     MEDCOUPLING_EXPORT bool isContiguous1D() const;
170     MEDCOUPLING_EXPORT void project1D(const double *pt, const double *v, double eps, double *res) const;
171     MEDCOUPLING_EXPORT double distanceToPoint(const double *ptBg, const double *ptEnd, mcIdType& cellId) const;
172     MEDCOUPLING_EXPORT DataArrayDouble *distanceToPoints(const DataArrayDouble *pts, DataArrayIdType *& cellIds) const;
173     MEDCOUPLING_EXPORT mcIdType getCellContainingPoint(const double *pos, double eps) const;
174     MEDCOUPLING_EXPORT void getCellsContainingPoint(const double *pos, double eps, std::vector<mcIdType>& elts) const;
175     MEDCOUPLING_EXPORT void getCellsContainingPoints(const double *pos, mcIdType nbOfPoints, double eps, MCAuto<DataArrayIdType>& elts, MCAuto<DataArrayIdType>& eltsIndex) const override;
176     MEDCOUPLING_EXPORT void getCellsContainingPointsLinearPartOnlyOnNonDynType(const double *pos, mcIdType nbOfPoints, double eps, MCAuto<DataArrayIdType>& elts, MCAuto<DataArrayIdType>& eltsIndex) const override;
177     MEDCOUPLING_EXPORT void checkButterflyCells(std::vector<mcIdType>& cells, double eps=1e-12) const;
178     MEDCOUPLING_EXPORT DataArrayIdType *convexEnvelop2D();
179     MEDCOUPLING_EXPORT DataArrayIdType *findAndCorrectBadOriented3DExtrudedCells();
180     MEDCOUPLING_EXPORT DataArrayIdType *findAndCorrectBadOriented3DCells();
181     MEDCOUPLING_EXPORT DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const;
182     MEDCOUPLING_EXPORT DataArrayDouble *getBoundingBoxForBBTreeFast() const;
183     MEDCOUPLING_EXPORT DataArrayDouble *getBoundingBoxForBBTree2DQuadratic(double arcDetEps=1e-12) const;
184     MEDCOUPLING_EXPORT DataArrayDouble *getBoundingBoxForBBTree1DQuadratic(double arcDetEps=1e-12) const;
185     MEDCOUPLING_EXPORT MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy);
186     MEDCOUPLING_EXPORT bool isFullyQuadratic() const;
187     MEDCOUPLING_EXPORT bool isPresenceOfQuadratic() const;
188     MEDCOUPLING_EXPORT void convertQuadraticCellsToLinear();
189     MEDCOUPLING_EXPORT DataArrayIdType *convertLinearCellsToQuadratic(int conversionType=0);
190     MEDCOUPLING_EXPORT void tessellate2D(double eps);
191     MEDCOUPLING_EXPORT MEDCoupling1SGTUMesh *tetrahedrize(int policy, DataArrayIdType *& n2oCells, mcIdType& nbOfAdditionalPoints) const;
192     MEDCOUPLING_EXPORT DataArrayIdType *simplexize(int policy);
193     MEDCOUPLING_EXPORT bool areOnlySimplexCells() const;
194     MEDCOUPLING_EXPORT void convertDegeneratedCells();
195     MEDCOUPLING_EXPORT DataArrayIdType *convertDegeneratedCellsAndRemoveFlatOnes();
196     MEDCOUPLING_EXPORT bool removeDegenerated1DCells();
197     MEDCOUPLING_EXPORT void are2DCellsNotCorrectlyOriented(const double *vec, bool polyOnly, std::vector<mcIdType>& cells) const;
198     MEDCOUPLING_EXPORT void orientCorrectly2DCells(const double *vec, bool polyOnly);
199     MEDCOUPLING_EXPORT void changeOrientationOfCells();
200     MEDCOUPLING_EXPORT void arePolyhedronsNotCorrectlyOriented(std::vector<mcIdType>& cells) const;
201     MEDCOUPLING_EXPORT void orientCorrectlyPolyhedrons();
202     MEDCOUPLING_EXPORT void invertOrientationOfAllCells();
203     MEDCOUPLING_EXPORT void getFastAveragePlaneOfThis(double *vec, double *pos) const;
204     MEDCOUPLING_EXPORT void attractSeg3MidPtsAroundNodes(double ratio, const mcIdType *nodeIdsBg, const mcIdType *nodeIdsEnd);
205     //Mesh quality
206     MEDCOUPLING_EXPORT MEDCouplingFieldDouble *getEdgeRatioField() const;
207     MEDCOUPLING_EXPORT MEDCouplingFieldDouble *getAspectRatioField() const;
208     MEDCOUPLING_EXPORT MEDCouplingFieldDouble *getWarpField() const;
209     MEDCOUPLING_EXPORT MEDCouplingFieldDouble *getSkewField() const;
210     MEDCOUPLING_EXPORT MEDCouplingFieldDouble *computeDiameterField() const;
211     //utilities for MED File RW
212     MEDCOUPLING_EXPORT std::vector<mcIdType> getDistributionOfTypes() const;
213     MEDCOUPLING_EXPORT DataArrayIdType *checkTypeConsistencyAndContig(const std::vector<mcIdType>& code, const std::vector<const DataArrayIdType *>& idsPerType) const;
214     MEDCOUPLING_EXPORT void splitProfilePerType(const DataArrayIdType *profile, std::vector<mcIdType>& code, std::vector<DataArrayIdType *>& idsInPflPerType, std::vector<DataArrayIdType *>& idsPerType, bool smartPflKiller=true) const;
215     MEDCOUPLING_EXPORT MEDCouplingUMesh *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh, DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *&revDesc, DataArrayIdType *&revDescIndx, DataArrayIdType *& nM1LevMeshIds, DataArrayIdType *&meshnM1Old2New) const;
216     MEDCOUPLING_EXPORT DataArrayIdType *sortCellsInMEDFileFrmt();
217     MEDCOUPLING_EXPORT bool checkConsecutiveCellTypes() const;
218     MEDCOUPLING_EXPORT bool checkConsecutiveCellTypesForMEDFileFrmt() const;
219     MEDCOUPLING_EXPORT bool checkConsecutiveCellTypesAndOrder(const INTERP_KERNEL::NormalizedCellType *orderBg, const INTERP_KERNEL::NormalizedCellType *orderEnd) const;
220     MEDCOUPLING_EXPORT DataArrayIdType *getLevArrPerCellTypes(const INTERP_KERNEL::NormalizedCellType *orderBg, const INTERP_KERNEL::NormalizedCellType *orderEnd, DataArrayIdType *&nbPerType) const;
221     MEDCOUPLING_EXPORT DataArrayIdType *getRenumArrForMEDFileFrmt() const;
222     MEDCOUPLING_EXPORT DataArrayIdType *getRenumArrForConsecutiveCellTypesSpec(const INTERP_KERNEL::NormalizedCellType *orderBg, const INTERP_KERNEL::NormalizedCellType *orderEnd) const;
223     MEDCOUPLING_EXPORT DataArrayIdType *rearrange2ConsecutiveCellTypes();
224     MEDCOUPLING_EXPORT std::vector<MEDCouplingUMesh *> splitByType() const;
225     MEDCOUPLING_EXPORT MEDCoupling1GTUMesh *convertIntoSingleGeoTypeMesh() const;
226     MEDCOUPLING_EXPORT DataArrayIdType *convertNodalConnectivityToStaticGeoTypeMesh() const;
227     MEDCOUPLING_EXPORT void convertNodalConnectivityToDynamicGeoTypeMesh(DataArrayIdType *&nodalConn, DataArrayIdType *&nodalConnIndex) const;
228     MEDCOUPLING_EXPORT static MEDCouplingUMesh *AggregateSortedByTypeMeshesOnSameCoords(const std::vector<const MEDCouplingUMesh *>& ms,
229                                                                                         DataArrayIdType *&szOfCellGrpOfSameType,
230                                                                                         DataArrayIdType *&idInMsOfCellGrpOfSameType);
231     MEDCOUPLING_EXPORT DataArrayIdType *keepCellIdsByType(INTERP_KERNEL::NormalizedCellType type, const mcIdType *begin, const mcIdType *end) const;
232     MEDCOUPLING_EXPORT DataArrayIdType *convertCellArrayPerGeoType(const DataArrayIdType *da) const;
233     MEDCOUPLING_EXPORT MEDCouplingUMesh *keepSpecifiedCells(INTERP_KERNEL::NormalizedCellType type, const mcIdType *idsPerGeoTypeBg, const mcIdType *idsPerGeoTypeEnd) const;
234     MEDCOUPLING_EXPORT std::vector<bool> getQuadraticStatus() const;
235     //
236     MEDCOUPLING_EXPORT MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const;
237     MEDCOUPLING_EXPORT DataArrayDouble *computeCellCenterOfMass() const;
238     MEDCOUPLING_EXPORT DataArrayDouble *computeCellCenterOfMassWithPrecision(double eps) const;
239     MEDCOUPLING_EXPORT DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const;
240     MEDCOUPLING_EXPORT DataArrayDouble *getPartBarycenterAndOwner(const mcIdType *begin, const mcIdType *end) const;
241     MEDCOUPLING_EXPORT DataArrayDouble *computePlaneEquationOf3DFaces() const;
242     MEDCOUPLING_EXPORT DataArrayIdType *conformize2D(double eps);
243     MEDCOUPLING_EXPORT DataArrayIdType *colinearize2D(double eps);
244     MEDCOUPLING_EXPORT DataArrayIdType *colinearizeKeepingConform2D(double eps);
245     MEDCOUPLING_EXPORT DataArrayIdType *conformize3D(double eps);
246     MEDCOUPLING_EXPORT mcIdType split2DCells(const DataArrayIdType *desc, const DataArrayIdType *descI, const DataArrayIdType *subNodesInSeg, const DataArrayIdType *subNodesInSegI, const DataArrayIdType *midOpt=0, const DataArrayIdType *midOptI=0);
247     MEDCOUPLING_EXPORT static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da);
248     MEDCOUPLING_EXPORT static MCAuto<MEDCouplingUMesh> Build1DMeshFromCoords(DataArrayDouble *da);
249     MEDCOUPLING_EXPORT static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2);
250     MEDCOUPLING_EXPORT static MEDCouplingUMesh *MergeUMeshes(const std::vector<const MEDCouplingUMesh *>& a);
251     MEDCOUPLING_EXPORT static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2);
252     MEDCOUPLING_EXPORT static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const std::vector<const MEDCouplingUMesh *>& meshes);
253     MEDCOUPLING_EXPORT static MEDCouplingUMesh *FuseUMeshesOnSameCoords(const std::vector<const MEDCouplingUMesh *>& meshes, int compType, std::vector<DataArrayIdType *>& corr);
254     MEDCOUPLING_EXPORT static void PutUMeshesOnSameAggregatedCoords(const std::vector<MEDCouplingUMesh *>& meshes);
255     MEDCOUPLING_EXPORT static void MergeNodesOnUMeshesSharingSameCoords(const std::vector<MEDCouplingUMesh *>& meshes, double eps);
256     MEDCOUPLING_EXPORT static bool IsPolygonWellOriented(bool isQuadratic, const double *vec, const mcIdType *begin, const mcIdType *end, const double *coords);
257     MEDCOUPLING_EXPORT static bool IsPolyhedronWellOriented(const mcIdType *begin, const mcIdType *end, const double *coords);
258     MEDCOUPLING_EXPORT static bool Is3DExtrudedStaticCellWellOriented(const mcIdType *begin, const mcIdType *end, const double *coords);
259     MEDCOUPLING_EXPORT static void CorrectExtrudedStaticCell(mcIdType *begin, mcIdType *end);
260     MEDCOUPLING_EXPORT static bool IsTetra4WellOriented(const mcIdType *begin, const mcIdType *end, const double *coords);
261     MEDCOUPLING_EXPORT static bool IsPyra5WellOriented(const mcIdType *begin, const mcIdType *end, const double *coords);
262     MEDCOUPLING_EXPORT static void SimplifyPolyhedronCell(double eps, const DataArrayDouble *coords, mcIdType index, DataArrayIdType *res, MEDCouplingUMesh *faces,
263                                                           DataArrayIdType *E_Fi, DataArrayIdType *E_F, DataArrayIdType *F_Ei, DataArrayIdType *F_E);
264     MEDCOUPLING_EXPORT static void ComputeVecAndPtOfFace(double eps, const double *coords, const mcIdType *begin, const mcIdType *end, double *v, double *p);
265     MEDCOUPLING_EXPORT static void TryToCorrectPolyhedronOrientation(mcIdType *begin, mcIdType *end, const double *coords);
266     MEDCOUPLING_EXPORT static MEDCouplingUMesh *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps, DataArrayIdType *&cellNb1, DataArrayIdType *&cellNb2);
267     MEDCOUPLING_EXPORT static void Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D,
268                                                              double eps, MEDCouplingUMesh *&splitMesh2D, MEDCouplingUMesh *&splitMesh1D, DataArrayIdType *&cellIdInMesh2D, DataArrayIdType *&cellIdInMesh1D);
269     MEDCOUPLING_EXPORT static bool BuildConvexEnvelopOf2DCellJarvis(const double *coords, const mcIdType *nodalConnBg, const mcIdType *nodalConnEnd, DataArrayIdType *nodalConnecOut);
270     MEDCOUPLING_EXPORT static std::vector<DataArrayIdType *> PartitionBySpreadZone(const DataArrayIdType *arrIn, const DataArrayIdType *arrIndxIn);
271     MEDCOUPLING_EXPORT static DataArrayIdType *ComputeSpreadZoneGradually(const DataArrayIdType *arrIn, const DataArrayIdType *arrIndxIn);
272     MEDCOUPLING_EXPORT static DataArrayIdType *ComputeSpreadZoneGraduallyFromSeed(const mcIdType *seedBg, const mcIdType *seedEnd, const DataArrayIdType *arrIn, const DataArrayIdType *arrIndxIn, mcIdType nbOfDepthPeeling, mcIdType& nbOfDepthPeelingPerformed);
273     MEDCOUPLING_EXPORT static void FindCommonCellsAlg(int compType, mcIdType startCellId, const DataArrayIdType *nodal, const DataArrayIdType *nodalI, const DataArrayIdType *revNodal, const DataArrayIdType *revNodalI,
274                                                       DataArrayIdType *& commonCellsArr, DataArrayIdType *& commonCellsIArr);
275     MEDCOUPLING_EXPORT DataArrayIdType *buildUnionOf2DMesh() const;
276     MEDCOUPLING_EXPORT DataArrayIdType *buildUnionOf3DMesh() const;
277     MEDCOUPLING_EXPORT DataArrayIdType *orderConsecutiveCells1D() const;
278     MEDCOUPLING_EXPORT MEDCouplingSkyLineArray* generateGraph() const;
279   private: // all private methods are impl in MEDCouplingUMesh_internal.cxx
280
281     MEDCouplingUMesh();
282     MEDCouplingUMesh(const MEDCouplingUMesh& other, bool deepCpy);
283     ~MEDCouplingUMesh();
284     void checkFullyDefined() const;
285     void checkConnectivityFullyDefined() const;
286     void reprConnectivityOfThisLL(std::ostringstream& stream) const;
287     //tools
288     DataArrayIdType *simplexizePol0();
289     DataArrayIdType *simplexizePol1();
290     DataArrayIdType *simplexizePlanarFace5();
291     DataArrayIdType *simplexizePlanarFace6();
292     void tessellate2DInternal(double eps);
293     void tessellate2DCurveInternal(double eps);
294     void subDivide2DMesh(const mcIdType *nodeSubdived, const mcIdType *nodeIndxSubdived, const mcIdType *desc, const mcIdType *descIndex);
295     void fillCellIdsToKeepFromNodeIds(const mcIdType *begin, const mcIdType *end, bool fullyIn, DataArrayIdType *&cellIdsKeptArr) const;
296     void split3DCurveWithPlane(const double *origin, const double *vec, double eps, std::vector<mcIdType>& cut3DCurve);
297     MEDCouplingUMesh *buildExtrudedMeshFromThisLowLev(mcIdType nbOfNodesOf1Lev, bool isQuad) const;
298     DataArrayDouble *fillExtCoordsUsingTranslation(const MEDCouplingUMesh *mesh1D, bool isQuad) const;
299     DataArrayDouble *fillExtCoordsUsingTranslAndAutoRotation(const MEDCouplingUMesh *mesh1D, bool isQuad) const;
300     DataArrayDouble *fillExtCoordsUsingTranslAndAutoRotation2D(const MEDCouplingUMesh *mesh1D, bool isQuad) const;
301     DataArrayDouble *fillExtCoordsUsingTranslAndAutoRotation3D(const MEDCouplingUMesh *mesh1D, bool isQuad) const;
302     static bool AreCellsEqualInPool(const std::vector<mcIdType>& candidates, int compType, const mcIdType *conn, const mcIdType *connI, DataArrayIdType *result) ;
303     MEDCouplingUMesh *buildPartOfMySelfKeepCoords(const mcIdType *begin, const mcIdType *end) const;
304     MEDCouplingUMesh *buildPartOfMySelfKeepCoordsSlice(mcIdType start, mcIdType end, mcIdType step) const;
305     DataArrayIdType *convertLinearCellsToQuadratic1D0(DataArrayIdType *&conn, DataArrayIdType *&connI, DataArrayDouble *& coords, std::set<INTERP_KERNEL::NormalizedCellType>& types) const;
306     DataArrayIdType *convertLinearCellsToQuadratic2DAnd3D0(const MEDCouplingUMesh *m1D, const DataArrayIdType *desc, const DataArrayIdType *descI, DataArrayIdType *&conn, DataArrayIdType *&connI, DataArrayDouble *& coords, std::set<INTERP_KERNEL::NormalizedCellType>& types) const;
307     DataArrayIdType *convertLinearCellsToQuadratic2D0(DataArrayIdType *&conn, DataArrayIdType *&connI, DataArrayDouble *& coords, std::set<INTERP_KERNEL::NormalizedCellType>& types) const;
308     DataArrayIdType *convertLinearCellsToQuadratic2D1(DataArrayIdType *&conn, DataArrayIdType *&connI, DataArrayDouble *& coords, std::set<INTERP_KERNEL::NormalizedCellType>& types) const;
309     DataArrayIdType *convertLinearCellsToQuadratic3D0(DataArrayIdType *&conn, DataArrayIdType *&connI, DataArrayDouble *& coords, std::set<INTERP_KERNEL::NormalizedCellType>& types) const;
310     DataArrayIdType *convertLinearCellsToQuadratic3D1(DataArrayIdType *&conn, DataArrayIdType *&connI, DataArrayDouble *& coords, std::set<INTERP_KERNEL::NormalizedCellType>& types) const;
311     DataArrayIdType *buildUnionOf2DMeshLinear(const MEDCouplingUMesh *skin, const DataArrayIdType *n2o) const;
312     DataArrayIdType *buildUnionOf2DMeshQuadratic(const MEDCouplingUMesh *skin, const DataArrayIdType *n2o) const;
313     template<int SPACEDIM>
314     void getCellsContainingPointsAlg(const double *coords, const double *pos, mcIdType nbOfPoints,
315                                      double eps, MCAuto<DataArrayIdType>& elts, MCAuto<DataArrayIdType>& eltsIndex, std::function<bool(INTERP_KERNEL::NormalizedCellType,int)> sensibilityTo2DQuadraticLinearCellsFunc) const;
316     void getCellsContainingPointsZeAlg(const double *pos, mcIdType nbOfPoints, double eps,
317                                        MCAuto<DataArrayIdType>& elts, MCAuto<DataArrayIdType>& eltsIndex,
318                                        std::function<bool(INTERP_KERNEL::NormalizedCellType,mcIdType)> sensibilityTo2DQuadraticLinearCellsFunc) const;
319 /// @cond INTERNAL
320     static MEDCouplingUMesh *MergeUMeshesLL(const std::vector<const MEDCouplingUMesh *>& a);
321     typedef mcIdType (*DimM1DescNbrer)(mcIdType id, mcIdType nb, const INTERP_KERNEL::CellModel& cm, bool compute, const mcIdType *conn1, const mcIdType *conn2);
322     template<class SonsGenerator>
323     MEDCouplingUMesh *buildDescendingConnectivityGen(DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx, DimM1DescNbrer nbrer) const;
324     static void DistanceToPoint3DSurfAlg(const double *pt, const mcIdType *cellIdsBg, const mcIdType *cellIdsEnd, const double *coords, const mcIdType *nc, const mcIdType *ncI, double& ret0, mcIdType& cellId);
325     static void DistanceToPoint2DCurveAlg(const double *pt, const mcIdType *cellIdsBg, const mcIdType *cellIdsEnd, const double *coords, const mcIdType *nc, const mcIdType *ncI, double& ret0, mcIdType& cellId);
326     static DataArrayIdType *ComputeSpreadZoneGraduallyFromSeedAlg(std::vector<bool>& fetched, const mcIdType *seedBg, const mcIdType *seedEnd, const DataArrayIdType *arrIn, const DataArrayIdType *arrIndxIn, mcIdType nbOfDepthPeeling, mcIdType& nbOfDepthPeelingPerformed);
327     static void FillInCompact3DMode(int spaceDim, mcIdType nbOfNodesInCell, const mcIdType *conn, const double *coo, double *zipFrmt);
328     static void AppendExtrudedCell(const mcIdType *connBg, const mcIdType *connEnd, mcIdType nbOfNodesPerLev, bool isQuad, std::vector<mcIdType>& ret);
329     static void Intersect1DMeshes(const MEDCouplingUMesh *m1Desc, const MEDCouplingUMesh *m2Desc, double eps, std::vector< std::vector<mcIdType> >& intersectEdge1, std::vector< std::vector<mcIdType> >& colinear2, std::vector< std::vector<mcIdType> >& subDiv2, std::vector<double>& addCoo, std::map<mcIdType,mcIdType>& mergedNodes);
330     static void IntersectDescending2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps,
331                                             std::vector< std::vector<mcIdType> >& intersectEdge1, std::vector< std::vector<mcIdType> >& colinear2, std::vector< std::vector<mcIdType> >& subDiv2,
332                                             MEDCouplingUMesh *& m1Desc, DataArrayIdType *&desc1, DataArrayIdType *&descIndx1, DataArrayIdType *&revDesc1, DataArrayIdType *&revDescIndx1,
333                                             std::vector<double>& addCoo,
334                                             MEDCouplingUMesh *& m2Desc, DataArrayIdType *&desc2, DataArrayIdType *&descIndx2, DataArrayIdType *&revDesc2, DataArrayIdType *&revDescIndx2);
335     static void BuildIntersectEdges(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, const std::vector<double>& addCoo, const std::vector< std::vector<mcIdType> >& subDiv, std::vector< std::vector<mcIdType> >& intersectEdge);
336     static void BuildIntersecting2DCellsFromEdges(double eps, const MEDCouplingUMesh *m1, const mcIdType *desc1, const mcIdType *descIndx1, const std::vector<std::vector<mcIdType> >& intesctEdges1, const std::vector< std::vector<mcIdType> >& colinear2,
337                                                   const MEDCouplingUMesh *m2, const mcIdType *desc2, const mcIdType *descIndx2, const std::vector<std::vector<mcIdType> >& intesctEdges2,
338                                                   const std::vector<double>& addCoords,
339                                                   std::vector<double>& addCoordsQuadratic, std::vector<mcIdType>& cr, std::vector<mcIdType>& crI, std::vector<mcIdType>& cNb1, std::vector<mcIdType>& cNb2);
340     static void AssemblyForSplitFrom3DCurve(const std::vector<mcIdType>& cut3DCurve, std::vector<mcIdType>& nodesOnPlane, const mcIdType *nodal3DSurf, const mcIdType *nodalIndx3DSurf,
341                                               const mcIdType *nodal3DCurve, const mcIdType *nodalIndx3DCurve,
342                                               const mcIdType *desc, const mcIdType *descIndx, std::vector< std::pair<mcIdType,mcIdType> >& cut3DSurf);
343     void assemblyForSplitFrom3DSurf(const std::vector< std::pair<mcIdType,mcIdType> >& cut3DSurf,
344                                     const mcIdType *desc, const mcIdType *descIndx, DataArrayIdType *nodalRes, DataArrayIdType *nodalResIndx, DataArrayIdType *cellIds) const;
345     void buildSubCellsFromCut(const std::vector< std::pair<mcIdType,mcIdType> >& cut3DSurf, const mcIdType *desc, const mcIdType *descIndx, const double *coords, double eps, std::vector<std::vector<mcIdType> >& res) const;
346     void split2DCellsLinear(const DataArrayIdType *desc, const DataArrayIdType *descI, const DataArrayIdType *subNodesInSeg, const DataArrayIdType *subNodesInSegI);
347     mcIdType split2DCellsQuadratic(const DataArrayIdType *desc, const DataArrayIdType *descI, const DataArrayIdType *subNodesInSeg, const DataArrayIdType *subNodesInSegI, const DataArrayIdType *mid, const DataArrayIdType *midI);
348     static bool Colinearize2DCell(const double *coords, const mcIdType *connBg, const mcIdType *connEnd, mcIdType offset, const std::map<mcIdType, bool>& forbiddenPoints, DataArrayIdType *newConnOfCell, DataArrayDouble *appendedCoords);
349     static void ComputeAllTypesInternal(std::set<INTERP_KERNEL::NormalizedCellType>& types, const DataArrayIdType *nodalConnec, const DataArrayIdType *nodalConnecIndex);
350     static bool OrderPointsAlongLine(const double * coo, mcIdType startNode, mcIdType endNode,
351                                                 const mcIdType * c, const mcIdType * cI, const mcIdType *idsBg, const mcIdType *endBg,
352                                                 std::vector<mcIdType> & pointIds, std::vector<mcIdType> & hitSegs);
353     static void ReplaceEdgeInFace(const mcIdType * sIdxConn, const mcIdType * sIdxConnE, mcIdType startNode, mcIdType endNode,
354                                       const std::vector<mcIdType>& insidePoints, std::vector<mcIdType>& modifiedFace);
355     void attractSeg3MidPtsAroundNodesUnderground(double ratio, const mcIdType *nodeIdsBg, const mcIdType *nodeIdsEnd);
356     DataArrayIdType *internalColinearize2D(double eps, bool stayConform);
357     template<class MAPCLS>
358     void renumberNodesInConnT(const MAPCLS& newNodeNumbersO2N);
359   public:
360     MEDCOUPLING_EXPORT static DataArrayIdType *ComputeRangesFromTypeDistribution(const std::vector<mcIdType>& code);
361     MEDCOUPLING_EXPORT static const int N_MEDMEM_ORDER=25;
362     MEDCOUPLING_EXPORT static const INTERP_KERNEL::NormalizedCellType MEDMEM_ORDER[N_MEDMEM_ORDER];
363     /// @endcond
364   private:
365     int _mesh_dim;
366     DataArrayIdType *_nodal_connec;
367     DataArrayIdType *_nodal_connec_index;
368     std::set<INTERP_KERNEL::NormalizedCellType> _types;
369   public:
370     static double EPS_FOR_POLYH_ORIENTATION;
371   };
372
373   class MEDCouplingUMeshCell;
374
375   class MEDCouplingUMeshCellIterator
376   {
377   public:
378     MEDCOUPLING_EXPORT MEDCouplingUMeshCellIterator(MEDCouplingUMesh *mesh);
379     MEDCOUPLING_EXPORT MEDCouplingUMeshCellIterator(MEDCouplingUMesh *mesh, MEDCouplingUMeshCell *itc, mcIdType bg, mcIdType end);
380     MEDCOUPLING_EXPORT ~MEDCouplingUMeshCellIterator();
381     MEDCOUPLING_EXPORT MEDCouplingUMeshCell *nextt();
382   private:
383     MEDCouplingUMesh *_mesh;
384     MEDCouplingUMeshCell *_cell;
385     bool _own_cell;
386     mcIdType _cell_id;
387     mcIdType _nb_cell;
388   };
389
390   class MEDCouplingUMeshCellByTypeIterator;
391
392   class MEDCouplingUMeshCellByTypeEntry
393   {
394   public:
395     MEDCOUPLING_EXPORT MEDCouplingUMeshCellByTypeEntry(MEDCouplingUMesh *mesh);
396     MEDCOUPLING_EXPORT MEDCouplingUMeshCellByTypeIterator *iterator();
397     MEDCOUPLING_EXPORT ~MEDCouplingUMeshCellByTypeEntry();
398   private:
399     MEDCouplingUMesh *_mesh;
400   };
401
402   class MEDCouplingUMeshCellEntry
403   {
404   public:
405     MEDCOUPLING_EXPORT MEDCouplingUMeshCellEntry(MEDCouplingUMesh *mesh,  INTERP_KERNEL::NormalizedCellType type, MEDCouplingUMeshCell *itc, mcIdType bg, mcIdType end);
406     MEDCOUPLING_EXPORT ~MEDCouplingUMeshCellEntry();
407     MEDCOUPLING_EXPORT INTERP_KERNEL::NormalizedCellType getType() const;
408     MEDCOUPLING_EXPORT mcIdType getNumberOfElems() const;
409     MEDCOUPLING_EXPORT MEDCouplingUMeshCellIterator *iterator();
410   private:
411     MEDCouplingUMesh *_mesh;
412     INTERP_KERNEL::NormalizedCellType _type;
413     MEDCouplingUMeshCell *_itc;
414     mcIdType _bg;
415     mcIdType _end;
416   };
417
418   class MEDCouplingUMeshCellByTypeIterator
419   {
420   public:
421     MEDCOUPLING_EXPORT MEDCouplingUMeshCellByTypeIterator(MEDCouplingUMesh *mesh);
422     MEDCOUPLING_EXPORT ~MEDCouplingUMeshCellByTypeIterator();
423     MEDCOUPLING_EXPORT MEDCouplingUMeshCellEntry *nextt();
424   private:
425     MEDCouplingUMesh *_mesh;
426     MEDCouplingUMeshCell *_cell;
427     mcIdType _cell_id;
428     mcIdType _nb_cell;
429   };
430
431   class MEDCouplingUMeshCell
432   {
433   public:
434     MEDCOUPLING_EXPORT MEDCouplingUMeshCell(MEDCouplingUMesh *mesh);
435     MEDCOUPLING_EXPORT void next();
436     MEDCOUPLING_EXPORT std::string repr() const;
437     MEDCOUPLING_EXPORT INTERP_KERNEL::NormalizedCellType getType() const;
438     MEDCOUPLING_EXPORT const mcIdType *getAllConn(mcIdType& lgth) const;
439   private:
440     mcIdType *_conn;
441     mcIdType *_conn_indx;
442     mcIdType _conn_lgth;
443     static const int NOTICABLE_FIRST_VAL=-7;
444   };
445 }
446
447 #endif