Salome HOME
Debugging before generation of classic fields/meshes from structure elements...
[tools/medcoupling.git] / src / MEDLoader / MEDFileFieldOverView.hxx
old mode 100755 (executable)
new mode 100644 (file)
index 7674889..ceceef4
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  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
@@ -23,7 +23,7 @@
 
 #include "MEDLoaderDefines.hxx"
 
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
 #include "MEDCouplingRefCountObject.hxx"
 #include "MEDCoupling1GTUMesh.hxx"
 
@@ -32,7 +32,7 @@
 
 #include <vector>
 
-namespace ParaMEDMEM
+namespace MEDCoupling
 {
   class DataArrayInt;
   class MEDCouplingMesh;
@@ -89,6 +89,7 @@ namespace ParaMEDMEM
     MEDLOADER_EXPORT void retrieveNumberIdsOnCells(DataArrayInt *& numIds, bool& isWithoutCopy) const;
     MEDLOADER_EXPORT void retrieveFamilyIdsOnNodes(DataArrayInt *& famIds, bool& isWithoutCopy) const;
     MEDLOADER_EXPORT void retrieveNumberIdsOnNodes(DataArrayInt *& numIds, bool& isWithoutCopy) const;
+    MEDLOADER_EXPORT DataArrayInt *retrieveGlobalNodeIdsIfAny() const;
     MEDLOADER_EXPORT std::vector< INTERP_KERNEL::NormalizedCellType > getGeoTypes() const;
     void setFamilyIdsOnCells(DataArrayInt *famIds);
     void setNumberIdsOnCells(DataArrayInt *numIds);
@@ -108,16 +109,16 @@ namespace ParaMEDMEM
     MEDMeshMultiLev(const MEDFileMesh *mesh, int nbNodes, const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& nbEntities);
   protected:
     const MEDFileMesh *_mesh;
-    std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > _pfls;
+    std::vector< MCAuto<DataArrayInt> > _pfls;
     std::vector< INTERP_KERNEL::NormalizedCellType > _geo_types;
     std::vector<int> _nb_entities;
-    MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _node_reduction;
+    MCAuto<DataArrayInt> _node_reduction;
     int _nb_nodes;
     //
-    MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _cell_fam_ids;
-    MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _cell_num_ids;
-    MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _node_fam_ids;
-    MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _node_num_ids;
+    MCAuto<DataArrayInt> _cell_fam_ids;
+    MCAuto<DataArrayInt> _cell_num_ids;
+    MCAuto<DataArrayInt> _node_fam_ids;
+    MCAuto<DataArrayInt> _node_num_ids;
   public:
     MEDLOADER_EXPORT static const int PARAMEDMEM_2_VTKTYPE_LGTH=34;
     MEDLOADER_EXPORT static const unsigned char PARAMEDMEM_2_VTKTYPE[PARAMEDMEM_2_VTKTYPE_LGTH];
@@ -133,20 +134,20 @@ namespace ParaMEDMEM
     static MEDUMeshMultiLev *New(const MEDFileUMesh *m, const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& nbEntities);
     void selectPartOfNodes(const DataArrayInt *pflNodes);
     MEDMeshMultiLev *prepare() const;
-    MEDUMeshMultiLev(const MEDStructuredMeshMultiLev& other, const MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh>& part);
+    MEDUMeshMultiLev(const MEDStructuredMeshMultiLev& other, const MCAuto<MEDCoupling1GTUMesh>& part);
     MEDLOADER_EXPORT bool buildVTUArrays(DataArrayDouble *& coords, DataArrayByte *&types, DataArrayInt *&cellLocations, DataArrayInt *& cells, DataArrayInt *&faceLocations, DataArrayInt *&faces) const;
   protected:
     void appendVertices(const DataArrayInt *verticesToAdd, DataArrayInt *nr);
   private:
-    void reorderNodesIfNecessary(MEDCouplingAutoRefCountObjectPtr<DataArrayDouble>& coords, DataArrayInt *nodalConnVTK, DataArrayInt *polyhedNodalConnVTK) const;
+    void reorderNodesIfNecessary(MCAuto<DataArrayDouble>& coords, DataArrayInt *nodalConnVTK, DataArrayInt *polyhedNodalConnVTK) const;
   private:
     MEDUMeshMultiLev(const MEDUMeshMultiLev& other);
     MEDUMeshMultiLev(const MEDFileUMesh *m, const std::vector<int>& levs);
     MEDUMeshMultiLev(const MEDFileUMesh *m, const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& nbEntities);
   private:
-    std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> > _parts;
+    std::vector< MCAuto<MEDCoupling1GTUMesh> > _parts;
     //! this attribute is used only for mesh with no cells but having coordinates. For classical umeshes those pointer is equal to pointer of coordinates of instances in this->_parts.
-    MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> _coords;
+    MCAuto<DataArrayDouble> _coords;
   };
 
   class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
@@ -166,8 +167,8 @@ namespace ParaMEDMEM
     void initStdFieldOfIntegers(const MEDFileStructuredMesh *m);
   protected:
     bool _is_internal;
-    MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _face_fam_ids;
-    MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _face_num_ids;
+    MCAuto<DataArrayInt> _face_fam_ids;
+    MCAuto<DataArrayInt> _face_num_ids;
   };
 
   class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
@@ -183,7 +184,7 @@ namespace ParaMEDMEM
     MEDCMeshMultiLev(const MEDFileCMesh *m, const std::vector<int>& levs);
     MEDCMeshMultiLev(const MEDFileCMesh *m, const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& nbEntities);
   private:
-    std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > _coords;
+    std::vector< MCAuto<DataArrayDouble> > _coords;
   };
 
   class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
@@ -199,7 +200,7 @@ namespace ParaMEDMEM
     MEDCurveLinearMeshMultiLev(const MEDFileCurveLinearMesh *m, const std::vector<int>& levs);
     MEDCurveLinearMeshMultiLev(const MEDFileCurveLinearMesh *m, const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& nbEntities);
   private:
-    MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> _coords;
+    MCAuto<DataArrayDouble> _coords;
     std::vector<int> _structure;
   };
 
@@ -233,7 +234,7 @@ namespace ParaMEDMEM
   private:
     INTERP_KERNEL::NormalizedCellType _geo_type;
     std::pair<int,int> _start_end;
-    MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _pfl;
+    MCAuto<DataArrayInt> _pfl;
     std::string _loc;
     int _nb_of_entity;
   };
@@ -241,7 +242,7 @@ namespace ParaMEDMEM
   class MEDFileField1TSStructItem : public BigMemoryObject
   {
   public:
-    MEDFileField1TSStructItem() { }
+    MEDFileField1TSStructItem():_computed(false),_type(ON_CELLS) { }
     MEDFileField1TSStructItem(TypeOfField a, const std::vector< MEDFileField1TSStructItem2 >& b);
     void checkWithMeshStruct(const MEDFileMeshStruct *mst, const MEDFileFieldGlobsReal *globs);
     bool operator==(const MEDFileField1TSStructItem& other) const;
@@ -303,8 +304,8 @@ namespace ParaMEDMEM
   private:
     MEDFileFastCellSupportComparator(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref);
   private:
-    MEDCouplingAutoRefCountObjectPtr<MEDFileMeshStruct> _mesh_comp;
-    std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileField1TSStruct> > _f1ts_cmps;
+    MCAuto<MEDFileMeshStruct> _mesh_comp;
+    std::vector< MCAuto<MEDFileField1TSStruct> > _f1ts_cmps;
   };
 }