Salome HOME
Overload of MEDLoader.ReadField method to ease access of medcoupling for new comers
[tools/medcoupling.git] / src / MEDLoader / SauvReader.cxx
index 96281f0ad897dad0d40e954f091b3672745d92f4..38c0651eb35f3db3dc6381b01393a3f74fa053bc 100644 (file)
@@ -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
@@ -24,7 +24,7 @@
 #include "SauvReader.hxx"
 
 #include "SauvMedConvertor.hxx"
-#include "MEDCouplingAutoRefCountObjectPtr.hxx"
+#include "MCAuto.hxx"
 #include "NormalizedUnstructuredMesh.hxx"
 #include "MEDCouplingRefCountObject.hxx"
 
@@ -32,7 +32,7 @@
 #include <sstream>
 #include <iostream>
 
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
 using namespace SauvUtilities;
 using namespace std;
 
@@ -48,7 +48,7 @@ SauvReader* SauvReader::New(const std::string& fileName)
 {
   if ( fileName.empty() ) THROW_IK_EXCEPTION("Invalid file name");
 
-  ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr< SauvUtilities::FileReader> parser;
+  MEDCoupling::MCAuto< SauvUtilities::FileReader> parser;
 
   // try to open as XRD
   parser = new XDRReader( fileName.c_str() );
@@ -86,7 +86,7 @@ std::size_t SauvReader::getHeapMemorySizeWithoutChildren() const
   return 0;
 }
 
-std::vector<const BigMemoryObject *> SauvReader::getDirectChildren() const
+std::vector<const BigMemoryObject *> SauvReader::getDirectChildrenWithNull() const
 {
   return std::vector<const BigMemoryObject *>();
 }
@@ -112,7 +112,7 @@ std::string SauvReader::lineNb() const
  */
 //================================================================================
 
-ParaMEDMEM::MEDFileData * SauvReader::loadInMEDFileDS()
+MEDCoupling::MEDFileData * SauvReader::loadInMEDFileDS()
 {
   SauvUtilities::IntermediateMED iMed; // intermadiate DS
   _iMed = &iMed;
@@ -146,7 +146,7 @@ ParaMEDMEM::MEDFileData * SauvReader::loadInMEDFileDS()
           THROW_IK_EXCEPTION("XDR : ENREGISTREMENT DE TYPE " << recordNumber << " not implemented!!!");
     }
 
-  ParaMEDMEM::MEDFileData* medFileData = iMed.convertInMEDFileDS();
+  MEDCoupling::MEDFileData* medFileData = iMed.convertInMEDFileDS();
 
   return medFileData;
 }
@@ -384,7 +384,7 @@ void SauvReader::read_PILE_SOUS_MAILLAGE(const int                 nbObjects,
       else
         for (initIntReading(nbElements); more(); next());
 
-      // not a composit group
+      // not a composite group
       if (castemCellType>0 && nbSubGroups==0)
         {
           group._cellType = SauvUtilities::gibi2medGeom(castemCellType);
@@ -638,7 +638,7 @@ void SauvReader::read_PILE_COORDONNEES (const int nbObjects, std::vector<std::st
 
 //================================================================================
 /*!
- * \brief Finds or create a Group equal to a given field support 
+ * \brief Find or create a Group equal to a given field support
  */
 //================================================================================
 
@@ -647,7 +647,7 @@ void SauvReader::setFieldSupport(const vector<SauvUtilities::Group*>& supports,
 {
   SauvUtilities::Group* group = NULL;
   set<SauvUtilities::Group*> sup_set( supports.begin(), supports.end() );
-  if (sup_set.size() == 1 ) // one or equal supports
+  if ( sup_set.size() == 1 ) // one or equal supports
     {
       group = supports[0];
     }
@@ -715,7 +715,7 @@ void SauvReader::setFieldSupport(const vector<SauvUtilities::Group*>& supports,
           // relocate sub-components according to a new order of groups
           if ( isModified )
             {
-              vector< DoubleField::_Sub_data > newSub( field->_sub.size() );
+              vector< DoubleField::_Sub_data > newSub   ( field->_sub.size() );
               vector< vector< double > >       newValues( field->_comp_values.size() );
               size_t iFromSub = 0, iNewSub = 0, iNewComp = 0;
               for ( ; iFromSub < field->_sub.size(); iFromSub += groups.size() )