From e30124f59c8894c636dd8dfd2efba99a29078cdb Mon Sep 17 00:00:00 2001
From: George Zagaris <george.zagaris@kitware.com>
Date: Wed, 14 Mar 2012 13:49:20 -0400
Subject: [PATCH] ENH: Remove vtkContourValues and use endl

Removed vtkContourValues and used endl instead of
std::endl per VTK conventions.

Change-Id: I99ec34c17759d8318405e6536469652dcebed46d
---
 AMR/vtkAMRCutPlane.cxx | 31 +++++++++++++++----------------
 AMR/vtkAMRCutPlane.h   |  1 -
 2 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/AMR/vtkAMRCutPlane.cxx b/AMR/vtkAMRCutPlane.cxx
index b211ff9f70e..c66206a4139 100644
--- a/AMR/vtkAMRCutPlane.cxx
+++ b/AMR/vtkAMRCutPlane.cxx
@@ -30,7 +30,6 @@
 #include "vtkLocator.h"
 #include "vtkPointLocator.h"
 #include "vtkPolyData.h"
-#include "vtkContourValues.h"
 #include "vtkIdList.h"
 #include "vtkDoubleArray.h"
 #include "vtkPointData.h"
@@ -42,6 +41,7 @@
 
 #include <cassert>
 #include <algorithm>
+using std::endl;
 
 vtkStandardNewMacro(vtkAMRCutPlane);
 
@@ -60,21 +60,12 @@ vtkAMRCutPlane::vtkAMRCutPlane()
   this->Controller       = vtkMultiProcessController::GetGlobalController();
   this->Plane            = NULL;
   this->UseNativeCutter  = 1;
-  this->contourValues    = vtkContourValues::New();
 }
 
 //------------------------------------------------------------------------------
 vtkAMRCutPlane::~vtkAMRCutPlane()
 {
-
   this->blocksToLoad.clear();
-
-  if( this->contourValues != NULL )
-    {
-    this->contourValues->Delete();
-    }
-  this->contourValues = NULL;
-
   if( this->Plane != NULL )
     {
     this->Plane->Delete();
@@ -87,23 +78,23 @@ void vtkAMRCutPlane::PrintSelf( std::ostream &oss, vtkIndent indent )
 {
   this->Superclass::PrintSelf( oss, indent );
   oss << indent << "LevelOfResolution: "
-      << this->LevelOfResolution << std::endl;
+      << this->LevelOfResolution << endl;
   oss << indent << "UseNativeCutter: "
-      << this->UseNativeCutter << std::endl;
+      << this->UseNativeCutter << endl;
   oss << indent << "Controller: "
-      << this->Controller << std::endl;
+      << this->Controller << endl;
   oss << indent << "Center: ";
   for( int i=0; i < 3; ++i )
     {
     oss << this->Center[i ] << " ";
     }
-  oss << std::endl;
+  oss << endl;
   oss << indent << "Normal: ";
   for( int i=0; i < 3; ++i )
     {
     oss << this->Normal[i] << " ";
     }
-  oss << std::endl;
+  oss << endl;
 }
 
 //------------------------------------------------------------------------------
@@ -224,7 +215,15 @@ int vtkAMRCutPlane::RequestData(
         }
       else
         {
-        this->CutAMRBlock( grid, mbds );
+        if( grid != NULL )
+          {
+          this->CutAMRBlock( grid, mbds );
+          }
+        else
+          {
+          mbds->SetBlock(blockIdx,NULL);
+          ++blockIdx;
+          }
         }
       } // END for all data
     } // END for all levels
diff --git a/AMR/vtkAMRCutPlane.h b/AMR/vtkAMRCutPlane.h
index 85105ead8df..d1edd645c2e 100644
--- a/AMR/vtkAMRCutPlane.h
+++ b/AMR/vtkAMRCutPlane.h
@@ -143,7 +143,6 @@ class VTK_AMR_EXPORT vtkAMRCutPlane : public vtkMultiBlockDataSetAlgorithm
     bool UseNativeCutter;
     vtkMultiProcessController *Controller;
     vtkPlane *Plane;
-    vtkContourValues *contourValues;
 
 // BTX
     std::vector<int> blocksToLoad;
-- 
GitLab