Salome HOME
EDF12599 : Addition of ShrinkFactor property for ELNO Mesh filter in MEDReader.
[modules/paravis.git] / src / Plugins / MEDReader / IO / vtkELNOMeshFilter.cxx
index 513b063705f4f7ae412829a7811e116d77a83e2d..62aa3e6e4ebd3058c1ecf34b1392359fa6c65a84 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2010-2014  CEA/DEN, EDF R&D
+// Copyright (C) 2010-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
@@ -41,7 +41,7 @@
 
 vtkStandardNewMacro(vtkELNOMeshFilter);
 
-vtkELNOMeshFilter::vtkELNOMeshFilter()
+vtkELNOMeshFilter::vtkELNOMeshFilter():ShrinkFactor(0.9999)
 {
 }
 
@@ -71,7 +71,7 @@ int vtkELNOMeshFilter::RequestData(vtkInformation *request,
   usgInClone->ShallowCopy(usgIn);
   vtkSmartPointer<vtkShrinkFilter> shrink(vtkSmartPointer<vtkShrinkFilter>::New());
   shrink->SetInputData(usgInClone);
-  shrink->SetShrinkFactor(0.9999);
+  shrink->SetShrinkFactor(this->ShrinkFactor);
   shrink->Update();
   vtkUnstructuredGrid *shrinked(shrink->GetOutput());
   usgInClone->Delete();
@@ -117,7 +117,10 @@ int vtkELNOMeshFilter::RequestData(vtkInformation *request,
           key->GetRange(data->GetInformation(),dict,0,0,dictSize);
         }
       if(data == NULL)
-        continue;
+        {
+          delete [] dict;
+          continue;
+        }
       
       vtkInformation *info(data->GetInformation());
       const char *arrayOffsetName(info->Get(vtkQuadratureSchemeDefinition::QUADRATURE_OFFSET_ARRAY_NAME()));
@@ -139,6 +142,7 @@ int vtkELNOMeshFilter::RequestData(vtkInformation *request,
             usgOut->GetPointData()->AddArray(data);
           else
             shrinked->GetFieldData()->AddArray(data);
+          delete [] dict;
           continue;
         }
       else
@@ -192,7 +196,10 @@ int vtkELNOMeshFilter::RequestData(vtkInformation *request,
                 }
             }
           else
-            continue ;
+            {
+              delete [] dict;
+              continue ;
+            }
         }
       delete [] dict;
     }