Salome HOME
Minor doc: isIota()
[tools/medcoupling.git] / src / MEDCoupling / MEDCouplingMappedExtrudedMesh.hxx
index 939f2460d1f8429925c638c4e585ee9764a84a92..6cc714c5bd5764973491bde0fdf717fe836604c8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2015  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2016  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
@@ -31,12 +31,14 @@ namespace MEDCoupling
   class DataArrayInt;
   class DataArrayDouble;
   class MEDCouplingUMesh;
+  class MEDCouplingCMesh;
   class MEDCouplingFieldDouble;
 
   class MEDCouplingMappedExtrudedMesh : public MEDCouplingMesh
   {
   public:
     MEDCOUPLING_EXPORT static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId);
+    MEDCOUPLING_EXPORT static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingCMesh *mesh3D);
     MEDCOUPLING_EXPORT static MEDCouplingMappedExtrudedMesh *New();
     MEDCOUPLING_EXPORT MEDCouplingMeshType getType() const;
     MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
@@ -70,9 +72,9 @@ namespace MEDCoupling
     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 *getMesh2D() const { return _mesh2D.iAmATrollConstCast(); }
+    MEDCOUPLING_EXPORT MEDCouplingUMesh *getMesh1D() const { return _mesh1D.iAmATrollConstCast(); }
+    MEDCOUPLING_EXPORT DataArrayInt *getMesh3DIds() const { return _mesh3D_ids.iAmATrollConstCast(); }
     MEDCOUPLING_EXPORT MEDCouplingUMesh *build3DUnstructuredMesh() const;
     MEDCOUPLING_EXPORT MEDCouplingUMesh *buildUnstructured() const;
     MEDCOUPLING_EXPORT MEDCouplingFieldDouble *getMeasureField(bool) const;
@@ -105,8 +107,10 @@ namespace MEDCoupling
                                             const std::vector<std::string>& littleStrings);
     MEDCOUPLING_EXPORT void reprQuickOverview(std::ostream& stream) const;
     MEDCOUPLING_EXPORT std::string getVTKFileExtension() const;
+    MEDCOUPLING_EXPORT int get2DCellIdForExtrusion() const { return _cell_2D_id; }
   private:
     MEDCouplingMappedExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId);
+    MEDCouplingMappedExtrudedMesh(const MEDCouplingCMesh *mesh3D);
     MEDCouplingMappedExtrudedMesh(const MEDCouplingMappedExtrudedMesh& other, bool deepCopy);
     MEDCouplingMappedExtrudedMesh();
     void computeExtrusion(const MEDCouplingUMesh *mesh3D);
@@ -123,10 +127,10 @@ namespace MEDCoupling
     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;
+    MCAuto<MEDCouplingUMesh> _mesh2D;
+    MCAuto<MEDCouplingUMesh> _mesh1D;
     //! New to old 3D cell Ids Array
-    DataArrayInt *_mesh3D_ids;
+    MCAuto<DataArrayInt> _mesh3D_ids;
     int _cell_2D_id;
   };
 }