Salome HOME
fix conflict: ctest requires SUBDIRS, not ADD_SUBDIRECTORY directives
[tools/medcoupling.git] / src / MEDCoupling / MEDCouplingExtrudedMesh.hxx
index 951a591a4f579fcdf6978321282d90484ce9678c..c72f42cf4239e23009cb404f976dc83daa871d08 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2007-2012  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -33,89 +33,96 @@ namespace ParaMEDMEM
   class MEDCouplingUMesh;
   class MEDCouplingFieldDouble;
 
-  class MEDCOUPLING_EXPORT MEDCouplingExtrudedMesh : public MEDCouplingMesh
+  class MEDCouplingExtrudedMesh : public MEDCouplingMesh
   {
   public:
-    static MEDCouplingExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
-    static MEDCouplingExtrudedMesh *New();
-    MEDCouplingMeshType getType() const;
-    std::size_t getHeapMemorySize() const;
-    void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
-    int getNumberOfCells() const;
-    int getNumberOfNodes() const;
-    int getSpaceDimension() const;
-    int getMeshDimension() const;
-    MEDCouplingMesh *deepCpy() const;
+    MEDCOUPLING_EXPORT static MEDCouplingExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId);
+    MEDCOUPLING_EXPORT static MEDCouplingExtrudedMesh *New();
+    MEDCOUPLING_EXPORT MEDCouplingMeshType getType() const;
+    MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
+    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
+    MEDCOUPLING_EXPORT void copyTinyStringsFrom(const MEDCouplingMesh *other);
+    MEDCOUPLING_EXPORT int getNumberOfCells() const;
+    MEDCOUPLING_EXPORT int getNumberOfNodes() const;
+    MEDCOUPLING_EXPORT int getSpaceDimension() const;
+    MEDCOUPLING_EXPORT int getMeshDimension() const;
+    MEDCOUPLING_EXPORT MEDCouplingMesh *deepCpy() const;
     MEDCouplingExtrudedMesh *clone(bool recDeepCpy) const;
-    bool isEqualIfNotWhy(const MEDCouplingMesh *other, double prec, std::string& reason) const throw(INTERP_KERNEL::Exception);
-    bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const;
-    void checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec,
-                              DataArrayInt *&cellCor, DataArrayInt *&nodeCor) const throw(INTERP_KERNEL::Exception);
-    void checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec,
-                                         DataArrayInt *&cellCor) const throw(INTERP_KERNEL::Exception);
-    INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const;
-    std::set<INTERP_KERNEL::NormalizedCellType> getAllGeoTypes() const;
-    DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception);
-    DataArrayInt *computeNbOfNodesPerCell() const throw(INTERP_KERNEL::Exception);
-    int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const;
-    void getNodeIdsOfCell(int cellId, std::vector<int>& conn) const;
-    void getCoordinatesOfNode(int nodeId, std::vector<double>& coo) const throw(INTERP_KERNEL::Exception);
-    std::string simpleRepr() const;
-    std::string advancedRepr() const;
-    void checkCoherency() const throw (INTERP_KERNEL::Exception);
-    void checkCoherency1(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
-    void checkCoherency2(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
-    void getBoundingBox(double *bbox) const;
-    void updateTime() const;
-    void renumberCells(const int *old2NewBg, bool check=true) throw(INTERP_KERNEL::Exception);
-    MEDCouplingUMesh *getMesh2D() const { return _mesh2D; }
-    MEDCouplingUMesh *getMesh1D() const { return _mesh1D; }
-    DataArrayInt *getMesh3DIds() const { return _mesh3D_ids; }
-    MEDCouplingUMesh *build3DUnstructuredMesh() const;
-    MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
-    MEDCouplingFieldDouble *getMeasureField(bool) const;
-    MEDCouplingFieldDouble *getMeasureFieldOnNode(bool) const;
-    MEDCouplingFieldDouble *buildOrthogonalField() const;
-    int getCellContainingPoint(const double *pos, double eps) const;
-    static int FindCorrespCellByNodalConn(const std::vector<int>& nodalConnec,
-                                          const int *revNodalPtr, const int *revNodalIndxPtr) throw(INTERP_KERNEL::Exception);
-    static void Project1DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps,
-                                MEDCouplingUMesh *&m1r, MEDCouplingUMesh *&m2r, double *v) throw(INTERP_KERNEL::Exception);
-    void rotate(const double *center, const double *vector, double angle);
-    void translate(const double *vector);
-    void scale(const double *point, double factor);
-    std::vector<int> getDistributionOfTypes() const throw(INTERP_KERNEL::Exception);
-    DataArrayInt *checkTypeConsistencyAndContig(const std::vector<int>& code, const std::vector<const DataArrayInt *>& idsPerType) const throw(INTERP_KERNEL::Exception);
-    void splitProfilePerType(const DataArrayInt *profile, std::vector<int>& code, std::vector<DataArrayInt *>& idsInPflPerType, std::vector<DataArrayInt *>& idsPerType) const throw(INTERP_KERNEL::Exception);
-    MEDCouplingMesh *buildPart(const int *start, const int *end) const;
-    MEDCouplingMesh *buildPartAndReduceNodes(const int *start, const int *end, DataArrayInt*& arr) const;
-    DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
-    MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const;
-    DataArrayDouble *getCoordinatesAndOwner() const;
-    DataArrayDouble *getBarycenterAndOwner() const;
+    MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const MEDCouplingMesh *other, double prec, std::string& reason) const;
+    MEDCOUPLING_EXPORT bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const;
+    MEDCOUPLING_EXPORT void checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec,
+                                                 DataArrayInt *&cellCor, DataArrayInt *&nodeCor) const;
+    MEDCOUPLING_EXPORT void checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec,
+                                                            DataArrayInt *&cellCor) const;
+    MEDCOUPLING_EXPORT INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const;
+    MEDCOUPLING_EXPORT std::set<INTERP_KERNEL::NormalizedCellType> getAllGeoTypes() const;
+    MEDCOUPLING_EXPORT DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const;
+    MEDCOUPLING_EXPORT DataArrayInt *computeNbOfNodesPerCell() const;
+    MEDCOUPLING_EXPORT DataArrayInt *computeNbOfFacesPerCell() const;
+    MEDCOUPLING_EXPORT DataArrayInt *computeEffectiveNbOfNodesPerCell() const;
+    MEDCOUPLING_EXPORT int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const;
+    MEDCOUPLING_EXPORT void getNodeIdsOfCell(int cellId, std::vector<int>& conn) const;
+    MEDCOUPLING_EXPORT void getCoordinatesOfNode(int nodeId, std::vector<double>& coo) const;
+    MEDCOUPLING_EXPORT std::string simpleRepr() const;
+    MEDCOUPLING_EXPORT std::string advancedRepr() const;
+    MEDCOUPLING_EXPORT void checkCoherency() const;
+    MEDCOUPLING_EXPORT void checkCoherency1(double eps=1e-12) const;
+    MEDCOUPLING_EXPORT void checkCoherency2(double eps=1e-12) const;
+    MEDCOUPLING_EXPORT void getBoundingBox(double *bbox) const;
+    MEDCOUPLING_EXPORT void updateTime() const;
+    MEDCOUPLING_EXPORT void renumberCells(const int *old2NewBg, bool check=true);
+    MEDCOUPLING_EXPORT MEDCouplingUMesh *getMesh2D() const { return _mesh2D; }
+    MEDCOUPLING_EXPORT MEDCouplingUMesh *getMesh1D() const { return _mesh1D; }
+    MEDCOUPLING_EXPORT DataArrayInt *getMesh3DIds() const { return _mesh3D_ids; }
+    MEDCOUPLING_EXPORT MEDCouplingUMesh *build3DUnstructuredMesh() const;
+    MEDCOUPLING_EXPORT MEDCouplingUMesh *buildUnstructured() const;
+    MEDCOUPLING_EXPORT MEDCouplingFieldDouble *getMeasureField(bool) const;
+    MEDCOUPLING_EXPORT MEDCouplingFieldDouble *getMeasureFieldOnNode(bool) const;
+    MEDCOUPLING_EXPORT MEDCouplingFieldDouble *buildOrthogonalField() const;
+    MEDCOUPLING_EXPORT int getCellContainingPoint(const double *pos, double eps) const;
+    MEDCOUPLING_EXPORT static int FindCorrespCellByNodalConn(const std::vector<int>& nodalConnec,
+                                                             const int *revNodalPtr, const int *revNodalIndxPtr);
+    MEDCOUPLING_EXPORT static void Project1DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps,
+                                                   MEDCouplingUMesh *&m1r, MEDCouplingUMesh *&m2r, double *v);
+    MEDCOUPLING_EXPORT void rotate(const double *center, const double *vector, double angle);
+    MEDCOUPLING_EXPORT void translate(const double *vector);
+    MEDCOUPLING_EXPORT void scale(const double *point, double factor);
+    MEDCOUPLING_EXPORT std::vector<int> getDistributionOfTypes() const;
+    MEDCOUPLING_EXPORT DataArrayInt *checkTypeConsistencyAndContig(const std::vector<int>& code, const std::vector<const DataArrayInt *>& idsPerType) const;
+    MEDCOUPLING_EXPORT void splitProfilePerType(const DataArrayInt *profile, std::vector<int>& code, std::vector<DataArrayInt *>& idsInPflPerType, std::vector<DataArrayInt *>& idsPerType) const;
+    MEDCOUPLING_EXPORT MEDCouplingMesh *buildPart(const int *start, const int *end) const;
+    MEDCOUPLING_EXPORT MEDCouplingMesh *buildPartAndReduceNodes(const int *start, const int *end, DataArrayInt*& arr) const;
+    MEDCOUPLING_EXPORT DataArrayInt *simplexize(int policy);
+    MEDCOUPLING_EXPORT MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const;
+    MEDCOUPLING_EXPORT DataArrayDouble *getCoordinatesAndOwner() const;
+    MEDCOUPLING_EXPORT DataArrayDouble *getBarycenterAndOwner() const;
+    MEDCOUPLING_EXPORT DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const;
+    MEDCOUPLING_EXPORT void getReverseNodalConnectivity(DataArrayInt *revNodal, DataArrayInt *revNodalIndx) const;
     //Serialization unserialisation
-    void getTinySerializationInformation(std::vector<double>& tinyInfoD, std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const;
-    void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector<std::string>& littleStrings) const;
-    void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const;
-    void unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2,
-                         const std::vector<std::string>& littleStrings);
+    MEDCOUPLING_EXPORT void getTinySerializationInformation(std::vector<double>& tinyInfoD, std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const;
+    MEDCOUPLING_EXPORT void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector<std::string>& littleStrings) const;
+    MEDCOUPLING_EXPORT void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const;
+    MEDCOUPLING_EXPORT void unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2,
+                                            const std::vector<std::string>& littleStrings);
+    MEDCOUPLING_EXPORT void reprQuickOverview(std::ostream& stream) const;
+    MEDCOUPLING_EXPORT std::string getVTKFileExtension() const;
   private:
-    MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
+    MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId);
     MEDCouplingExtrudedMesh(const MEDCouplingExtrudedMesh& other, bool deepCopy);
     MEDCouplingExtrudedMesh();
-    void computeExtrusion(const MEDCouplingUMesh *mesh3D) throw(INTERP_KERNEL::Exception);
-    void computeExtrusionAlg(const MEDCouplingUMesh *mesh3D) throw(INTERP_KERNEL::Exception);
+    void computeExtrusion(const MEDCouplingUMesh *mesh3D);
+    void computeExtrusionAlg(const MEDCouplingUMesh *mesh3D);
     void build1DExtrusion(int idIn3DDesc, int newId, int nbOf1DLev, MEDCouplingUMesh *subMesh,
                           const int *desc3D, const int *descIndx3D,
                           const int *revDesc3D, const int *revDescIndx3D,
-                          bool computeMesh1D) throw(INTERP_KERNEL::Exception);
+                          bool computeMesh1D);
     int findOppositeFaceOf(int current2DCell, int current3DCell, const std::vector<int>& connSorted,
                            const int *desc3D, const int *descIndx3D,
-                           const int *conn2D, const int *conn2DIndx) throw(INTERP_KERNEL::Exception);
+                           const int *conn2D, const int *conn2DIndx);
     void computeBaryCenterOfFace(const std::vector<int>& nodalConnec, int lev1DId);
     ~MEDCouplingExtrudedMesh();
-    void writeVTKLL(std::ostream& ofs, const std::string& cellData, const std::string& pointData) const throw(INTERP_KERNEL::Exception);
-    std::string getVTKDataSetType() const throw(INTERP_KERNEL::Exception);
+    void writeVTKLL(std::ostream& ofs, const std::string& cellData, const std::string& pointData, DataArrayByte *byteData) const;
+    std::string getVTKDataSetType() const;
   private:
     MEDCouplingUMesh *_mesh2D;
     MEDCouplingUMesh *_mesh1D;