Salome HOME
Get rid off deepCopy in // mode and limitation of number of requestInformation
[modules/paravis.git] / src / Plugins / MEDReader / plugin / MEDReaderIO / vtkMEDReader.h
old mode 100644 (file)
new mode 100755 (executable)
index a142ff5..03b1cb4
@@ -1,4 +1,4 @@
-// Copyright (C) 2010-2020  CEA/DEN, EDF R&D
+// Copyright (C) 2010-2022  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
@@ -25,7 +25,9 @@
 
 #include "vtkMultiBlockDataSetAlgorithm.h"
 #include "vtkInformationGaussDoubleVectorKey.h"
+#include "vtkNew.h"
 
+class vtkDataArraySelection;
 class vtkDataSet;
 class vtkMutableDirectedGraph;
 class vtkInformationDataObjectMetaDataKey;
@@ -39,11 +41,11 @@ class VTK_EXPORT vtkMEDReader : public vtkMultiBlockDataSetAlgorithm
   void operator=(const vtkMEDReader&); // Not implemented.
  public:
   static vtkMEDReader *New();
-  vtkTypeMacro(vtkMEDReader, vtkMultiBlockDataSetAlgorithm);
+  vtkTypeMacro(vtkMEDReader, 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);
@@ -60,13 +62,13 @@ class VTK_EXPORT vtkMEDReader : public vtkMultiBlockDataSetAlgorithm
 
   // Description
   // Reload will delete the internal reader and recreate it with default properties
+  // As well as reset public properties to their default values, except for the FileName
   virtual void Reload();
 
-  virtual int GetServerModifTime();
-  //
-  virtual void GenerateVectors(int);
-  virtual void ChangeMode(int);
-  virtual void GhostCellGeneratorCallForPara(int);
+  // Description
+  // ReloadInternals will delete the internal reader and recreate it
+  virtual void ReloadInternals();
+
   static const char *GetSeparator();
 
   // Description
@@ -74,13 +76,39 @@ class VTK_EXPORT vtkMEDReader : public vtkMultiBlockDataSetAlgorithm
   static vtkInformationDataObjectMetaDataKey* META_DATA();
   static vtkInformationGaussDoubleVectorKey* GAUSS_DATA();
 
+  // Description
+  // Control if MPI should be used for distribution when using a distributed server
+  // Only has an effect if MEDREADER_USE_MPI is defined.
+  // Default is true
+  vtkSetMacro(DistributeWithMPI, bool);
+  vtkGetMacro(DistributeWithMPI, bool);
+
+  // Description
+  // Control if vectors should be generated
+  // Default is false
+  void GenerateVectors(int);
+  vtkGetMacro(GenerateVect, bool);
+
+  // Description
+  // Control to set is std or mode should be used
+  // Default is false
+  void ChangeMode(int);
+  vtkGetMacro(IsStdOrMode, bool);
+
+  // Description
+  // Control if a Ghost Cell Generator should be used
+  // Default is true
+  void GhostCellGeneratorCallForPara(int);
+  vtkGetMacro(GCGCP, bool);
+
+
  protected:
   vtkMEDReader();
   virtual ~vtkMEDReader();
   virtual int RequestInformation(vtkInformation*, vtkInformationVector**, vtkInformationVector*);
   virtual int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*);
  private:
-  void UpdateSIL(vtkInformation *request, vtkInformation *info);
+  void UpdateSIL(vtkInformation * request, vtkInformation * info);
   virtual double PublishTimeStepsIfNeeded(vtkInformation*, bool& isUpdated);
   virtual void FillMultiBlockDataSetInstance(vtkMultiBlockDataSet *output, double reqTS, ExportedTinyInfo *internalInfo=0);
   vtkDataSet *RetrieveDataSetAtTime(double reqTS, ExportedTinyInfo *internalInfo);
@@ -90,6 +118,16 @@ class VTK_EXPORT vtkMEDReader : public vtkMultiBlockDataSetAlgorithm
 
   class vtkMEDReaderInternal;
   vtkMEDReaderInternal* Internal;
+
+  vtkNew<vtkDataArraySelection> FieldSelection;
+  vtkNew<vtkDataArraySelection> TimeFlagSelection;
+  std::string FileName;
+  //when false -> std, true -> mode. By default std (false).
+  bool IsStdOrMode = false;
+  //when false -> do nothing. When true cut off or extend to nbOfCompo=3 vector arrays.
+  bool GenerateVect = false;
+  bool GCGCP = true;
+  bool DistributeWithMPI = true;
 };
 
 #endif //__vtkMEDReader_h_