Salome HOME
bos #26432 [CEA 26431] import/export SAUV removal V9_8_0b1
authoreap <eap@opencascade.com>
Wed, 20 Oct 2021 12:18:04 +0000 (15:18 +0300)
committervsr <vsr@opencascade.com>
Fri, 5 Nov 2021 11:07:17 +0000 (14:07 +0300)
src/Plugins/MEDReader/plugin/MEDLoaderForPV/MEDFileFieldRepresentationTree.cxx
src/Plugins/MEDReader/plugin/MEDLoaderForPV/MEDFileFieldRepresentationTree.hxx
src/Plugins/MEDReader/plugin/MEDReaderIO/vtkMEDReader.cxx
src/Plugins/MEDReader/plugin/MEDReaderIO/vtkMEDReader.h
src/Plugins/MEDReader/plugin/ParaViewPlugin/Resources/MEDReaderServer.xml
src/Plugins/MEDReader/plugin/Test/testMEDReader5.py [deleted file]
src/Plugins/MEDReader/plugin/Test/tests.set

index 0846ce58b7b7d23167160089673608ce3d6812b8..7ede5e465f30c19a5995308e8c37e588053c4a88 100644 (file)
@@ -26,7 +26,6 @@
 #include "MEDCouplingFieldDouble.hxx"
 #include "InterpKernelGaussCoords.hxx"
 #include "MEDFileData.hxx"
-#include "SauvReader.hxx"
 #include "MEDCouplingMemArray.txx"
 
 #ifdef MEDREADER_USE_MPI
@@ -1291,11 +1290,10 @@ void MEDFileFieldRepresentationTree::loadInMemory(MEDCoupling::MEDFileFields *fi
   this->computeFullNameInLeaves();
 }
 
-void MEDFileFieldRepresentationTree::loadMainStructureOfFile(const char *fileName, bool isMEDOrSauv, int iPart, int nbOfParts)
+void MEDFileFieldRepresentationTree::loadMainStructureOfFile(const char *fileName, int iPart, int nbOfParts)
 {
   MCAuto<MEDFileMeshes> ms;
   MCAuto<MEDFileFields> fields;
-  if(isMEDOrSauv)
     {
       if((iPart==-1 && nbOfParts==-1) || (iPart==0 && nbOfParts==1))
         {
@@ -1336,23 +1334,6 @@ void MEDFileFieldRepresentationTree::loadMainStructureOfFile(const char *fileNam
 #endif
         }
     }
-  else
-    {
-      MCAuto<MEDCoupling::SauvReader> sr(MEDCoupling::SauvReader::New(fileName));
-      MCAuto<MEDCoupling::MEDFileData> mfd(sr->loadInMEDFileDS());
-      ms=mfd->getMeshes(); ms->incrRef();
-      int nbMeshes(ms->getNumberOfMeshes());
-      for(int i=0;i<nbMeshes;i++)
-        {
-          MEDCoupling::MEDFileMesh *tmp(ms->getMeshAtPos(i));
-          MEDCoupling::MEDFileUMesh *tmp2(dynamic_cast<MEDCoupling::MEDFileUMesh *>(tmp));
-          if(tmp2)
-            tmp2->forceComputationOfParts();
-        }
-      fields=mfd->getFields();
-      if(fields.isNotNull())
-        fields->incrRef();
-    }
   loadInMemory(fields,ms);
 }
 
index a9c7ddbecf9d165bc7c5514fada0b5abbb5f3eeb..a408a89e5766130d7d72bffc24e878a6a6292d08 100644 (file)
@@ -158,7 +158,7 @@ public:
   void printMySelf(std::ostream& os) const;
   std::map<std::string,bool> dumpState() const;
   //non const methods
-  void loadMainStructureOfFile(const char *fileName, bool isMEDOrSauv, int iPart, int nbOfParts);
+  void loadMainStructureOfFile(const char *fileName, int iPart, int nbOfParts);
   void loadInMemory(MEDCoupling::MEDFileFields *fields, MEDCoupling::MEDFileMeshes *meshes);
   void removeEmptyLeaves();
   // static methods
index 4a01e0238aebf22386b9030ab481800e968cd70d..c489edb1260f7a5127ef9c8fae93e02065317c5b 100644 (file)
@@ -65,7 +65,7 @@ class vtkMEDReader::vtkMEDReaderInternal
 {
 
 public:
-  vtkMEDReaderInternal(vtkMEDReader *master):TK(0),IsMEDOrSauv(true),IsStdOrMode(false),GenerateVect(false),SIL(0),LastLev0(-1),GCGCP(true)
+  vtkMEDReaderInternal(vtkMEDReader *master):TK(0),IsStdOrMode(false),GenerateVect(false),SIL(0),LastLev0(-1),GCGCP(true)
   {
   }
 
@@ -81,8 +81,6 @@ public:
 
   TimeKeeper TK;
   std::string FileName;
-  //when true the file is MED file. when false it is a Sauv file
-  bool IsMEDOrSauv;
   //when false -> std, true -> mode. By default std (false).
   bool IsStdOrMode;
   //when false -> do nothing. When true cut off or extend to nbOfCompo=3 vector arrays.
@@ -229,13 +227,6 @@ int vtkMEDReader::RequestInformation(vtkInformation *request, vtkInformationVect
   try
     {
       // Process file meta data
-      std::size_t pos(this->Internal->FileName.find_last_of('.'));
-      if(pos!=std::string::npos)
-        {
-          std::string ext(this->Internal->FileName.substr(pos));
-          if(ext.find("sauv")!=std::string::npos)
-            this->Internal->IsMEDOrSauv=false;
-        }
       if(this->Internal->Tree.getNumberOfLeavesArrays()==0)
         {
           int iPart(-1),nbOfParts(-1);
@@ -247,7 +238,7 @@ int vtkMEDReader::RequestInformation(vtkInformation *request, vtkInformationVect
               nbOfParts=vmpc->GetNumberOfProcesses();
             }
 #endif
-          this->Internal->Tree.loadMainStructureOfFile(this->Internal->FileName.c_str(),this->Internal->IsMEDOrSauv,iPart,nbOfParts);
+          this->Internal->Tree.loadMainStructureOfFile(this->Internal->FileName.c_str(),iPart,nbOfParts);
           
           // Leaves
           this->Internal->Tree.activateTheFirst();//This line manually initialize the status of server (this) with the remote client.
index d7611967fcf86449b656191fe1a68e482d7d4e37..cae7cadd07848c70a83c80e7c7d4a0a70ef7edc2 100644 (file)
@@ -43,7 +43,7 @@ class VTK_EXPORT vtkMEDReader : public vtkMultiBlockDataSetAlgorithm
   void PrintSelf(ostream& os, vtkIndent indent);
   virtual void SetFileName(const char*);
   virtual char *GetFileName();
-  virtual const char *GetFileExtensions() { return ".med .rmed .sauv .sauve"; }
+  virtual const char *GetFileExtensions() { return ".med .rmed"; }
   virtual const char *GetDescriptiveName() { return "MED file (Data Exchange Model)"; }
   //
   virtual void SetFieldsStatus(const char *name, int status);
index afde62054bc553f955521ea428cfa12f2d105439..346d0e80fd801a0cd3a6c70640cebe531226de87 100644 (file)
@@ -3,7 +3,7 @@
     <SourceProxy name="MEDReader" class="vtkMEDReader" label="MED Reader">
 
       <Hints>
-       <ReaderFactory extensions="med rmed sauv sauve"
+       <ReaderFactory extensions="med rmed"
                       file_description="MED Files">
        </ReaderFactory>
       </Hints>
diff --git a/src/Plugins/MEDReader/plugin/Test/testMEDReader5.py b/src/Plugins/MEDReader/plugin/Test/testMEDReader5.py
deleted file mode 100644 (file)
index 7906d90..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-#  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2021  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, 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
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-# Author : Anthony Geay
-
-import os
-import sys
-
-from medcoupling import *
-from paraview.simple import *
-from MEDReaderHelper import WriteInTmpDir,RetriveBaseLine
-
-def GenerateCase():
-  """ This test is CEA specific one. It generates a .sauv file
-  that is then read by MEDReader
-  """
-  fname="testMEDReader5.sauv"
-  #########
-  arr=DataArrayDouble(5) ; arr.iota()
-  c=MEDCouplingCMesh("mesh")
-  c.setCoords(arr,arr,arr)
-  m=c.buildUnstructured()
-  mbis=m.deepCopy() ; mbis.translate([5,0,0]) ; mbis.tetrahedrize(PLANAR_FACE_5)
-  m=MEDCouplingUMesh.MergeUMeshes([mbis,m]) ; m.setName(c.getName())
-  mm=MEDFileUMesh()
-  mm.setMeshAtLevel(0,m)
-  grp0=DataArrayInt.Range(0,m.getNumberOfCells(),2) ; grp0.setName("grp0")
-  grp1=DataArrayInt.Range(1,m.getNumberOfCells(),2) ; grp1.setName("grp1")
-  grp2=DataArrayInt.Range(0,m.getNumberOfNodes(),7) ; grp2.setName("grp2")
-  mm.setGroupsAtLevel(0,[grp0,grp1])
-  mm.setGroupsAtLevel(1,[grp2])
-  ms=MEDFileMeshes()
-  ms.pushMesh(mm)
-  f=MEDCouplingFieldDouble(ON_CELLS) ; f.setName("fCell") ; f.setMesh(m[:10])
-  arr=DataArrayDouble(f.getNumberOfTuplesExpected()) ; arr.iota() ; f.setArray(arr)
-  f2=MEDCouplingFieldDouble(ON_NODES) ; f2.setName("fNode") ; f2.setMesh(m)
-  arr=DataArrayDouble(f2.getNumberOfTuplesExpected()) ; arr.iota() ; f2.setArray(arr)
-
-  fs=MEDFileFields()
-  f1ts=MEDFileField1TS()
-  #f1ts.setFieldNoProfileSBT(f)
-  pfl=DataArrayInt(10); pfl.iota() ; pfl.setName("pfl") ; f1ts.setFieldProfile(f,mm,0,pfl)
-  fmts=MEDFileFieldMultiTS()
-  fmts.pushBackTimeStep(f1ts)
-  fs.pushField(fmts)
-  f1ts=MEDFileField1TS()
-  f1ts.setFieldNoProfileSBT(f2)
-  fmts=MEDFileFieldMultiTS()
-  fmts.pushBackTimeStep(f1ts)
-  fs.pushField(fmts)
-
-  mfd=MEDFileData()
-  mfd.setMeshes(ms)
-  mfd.setFields(fs)
-  #mfd.write(fname,2) not activated because useless
-  #
-  sw=SauvWriter();
-  sw.setMEDFileDS(mfd);
-  sw.write(fname);
-  del mm,m,c,f,arr
-  del f1ts
-  return fname
-
-
-@WriteInTmpDir
-def test(baseline_file):
-  fname = GenerateCase()
-  ################### MED write is done -> Go to MEDReader
-  myMedReader=MEDReader(FileName=fname)
-  myMedReader.AllArrays = ['TS0/mesh/ComSup1/fNode@@][@@P1']
-  myMedReader.AllTimeSteps = ['0000']
-
-  Clip1=Clip(ClipType="Plane",Input=myMedReader)
-  Clip1.Scalars = ['POINTS', 'FamilyIdNode']
-  Clip1.ClipType.Origin = [2.0, 2.0, 2.0]
-  Clip1.ClipType = "Plane"
-  Clip1.ClipType.Normal = [0.04207410474474753, 0.9319448861971525, 0.3601506612529047]
-  Clip1.Invert = 1
-
-  DataRepresentation2 = Show()
-  DataRepresentation2.EdgeColor = [0.0, 0.0, 0.5000076295109483]
-  DataRepresentation2.ScalarOpacityUnitDistance = 1.5768745057161244
-  DataRepresentation2.ExtractedBlockIndex = 1
-  DataRepresentation2.ScaleFactor = 0.4
-
-  if '-D' not in sys.argv:
-    RenderView1=GetRenderView()
-    RenderView1.CenterOfRotation=[2.,2.,2.]
-    RenderView1.CameraViewUp=[0.24562884954787187,0.6907950752417243,-0.680050463047831]
-    RenderView1.CameraPosition=[-2.5085697461776486,11.6185941755061,10.14210560568201]
-    RenderView1.CameraFocalPoint=[2.,2.,2.]
-    RenderView1.CameraParallelScale=5.071791174723188
-
-    LookupTable=GetLookupTableForArray("fNode",1,RGBPoints=[0.0,0.23,0.299,0.754,55.0,0.706,0.016,0.15],VectorMode='Magnitude',NanColor=[0.25,0.0,0.0],ColorSpace='Diverging',ScalarRangeInitialized=1.0,AllowDuplicateScalars=1)
-    DataRepresentation2 = Show()
-    DataRepresentation2.EdgeColor = [0.0, 0.0, 0.5000076295109483]
-    DataRepresentation2.ScalarOpacityUnitDistance = 1.5768745057161244
-    DataRepresentation2.ExtractedBlockIndex = 1
-    DataRepresentation2.ScaleFactor = 0.4
-    DataRepresentation2.ColorArrayName=('POINTS','fNode')
-    DataRepresentation2.LookupTable=LookupTable
-
-    RenderView1.ViewSize=[300,300]
-    Render()
-
-    # compare with baseline image
-    import vtk.test.Testing
-    from vtk.util.misc import vtkGetTempDir
-    vtk.test.Testing.VTK_TEMP_DIR = vtk.util.misc.vtkGetTempDir()
-    vtk.test.Testing.compareImage(GetActiveView().GetRenderWindow(), baseline_file,
-                                                                threshold=1)
-    vtk.test.Testing.interact()
-
-if __name__ == "__main__":
-  outImgName="testMEDReader5.png"
-  baseline_file = RetriveBaseLine(outImgName)
-  test(baseline_file)
-  pass
index 9a25de4632f89318b709cf19271ef5eab28c470b..3f7f6a8227f87a97e9d3bcf2ea6975ebf32d3cea 100644 (file)
@@ -29,4 +29,4 @@
 
 # 11 and 12 have been willingly removed due to problem in image comparisons
 
-SET(TEST_NUMBERS 0 1 2 3 4 6 7 8 9 10 13 14 15 16 17 18 19 20 21 22)
+SET(TEST_NUMBERS 0 1 2 3 4 6 7 8 9 10 13 14 15 16 17 18 19 20 21 22)