Salome HOME
22261: EDF 2698 SMESH: Memory leak when displaying 2D quadratic elements as arcs
authoreap <eap@opencascade.com>
Wed, 24 Jul 2013 12:39:21 +0000 (12:39 +0000)
committereap <eap@opencascade.com>
Wed, 24 Jul 2013 12:39:21 +0000 (12:39 +0000)
src/VTKViewer/VTKViewer_ArcBuilder.cxx
src/VTKViewer/VTKViewer_ArcBuilder.h
src/VTKViewer/VTKViewer_GeometryFilter.cxx

index a3c7d6e7b829154f8829ec42dcede80f5a5a2c3a..dd87a91a31919ce991f4c81447787dc0b1ecb61e 100644 (file)
@@ -23,7 +23,7 @@
 //
 #include "VTKViewer_ArcBuilder.h"
 
-#include <math.h>
+#include <cmath>
 #include <float.h>
 
 //VTK includes
 #define ANGLE_PRECISION 0.5
 //#define _MY_DEBUG_
 
+#include <limits>
 #ifdef _MY_DEBUG_
 #include <iostream>
 #endif
 
-
 bool CheckAngle(const double compare, const double angle){
   if((angle <= compare - ANGLE_PRECISION) || (angle >= compare + ANGLE_PRECISION))
     return true;
@@ -115,11 +115,16 @@ Vec::Vec (const double Xv,
           const double Zv)
 {
   double D = sqrt (Xv * Xv + Yv * Yv + Zv * Zv);
-  if(D != 0) {
+  if(D > std::numeric_limits<double>::min() ) {
     coord.SetX(Xv / D);
     coord.SetY(Yv / D);
     coord.SetZ(Zv / D);
   }
+  else {
+    coord.SetX(0);
+    coord.SetY(0);
+    coord.SetZ(0);
+  }
 }
 
 /*!
@@ -159,8 +164,7 @@ Vec Vec::VectMultiplication(const Vec & Other) const{
   double x = GetXYZ().Y()*Other.GetXYZ().Z() - GetXYZ().Z()*Other.GetXYZ().Y();
   double y = GetXYZ().Z()*Other.GetXYZ().X() - GetXYZ().X()*Other.GetXYZ().Z();
   double z = GetXYZ().X()*Other.GetXYZ().Y() - GetXYZ().Y()*Other.GetXYZ().X();
-  Vec *aRes  = new Vec(x,y,z);
-  return *aRes;
+  return Vec(x,y,z);
 }
 
 /*---------------------Class Plane --------------------------------*/
@@ -282,44 +286,42 @@ VTKViewer_ArcBuilder::VTKViewer_ArcBuilder(const Pnt& thePnt1,
     aInputPnts.push_back(thePnt2);
     aInputPnts.push_back(thePnt3);
     
-    vtkUnstructuredGrid* aGrid = BuildGrid(aInputPnts);
+    vtkSmartPointer<vtkUnstructuredGrid> aGrid = BuildGrid(aInputPnts);
+    aGrid->Delete();
     
     bool needRotation = true;
     if(anAngle  == 0 || anAngle == 180)
       needRotation = false;
     
     if(aGrid) {
-      vtkUnstructuredGrid* aTransformedGrid;
       if(needRotation) {
-        aTransformedGrid = TransformGrid(aGrid,aAxis,anAngle);    
+        aGrid = TransformGrid(aGrid,aAxis,anAngle);    
+        aGrid->Delete();
 #ifdef _MY_DEBUG_
         cout<<"Need Rotation!!!"<<endl;
 #endif
       }
       else {
-        aTransformedGrid = aGrid;
 #ifdef _MY_DEBUG_
         cout<<"Rotation does not need!!!"<<endl;
 #endif
       }
       
       double coords[3];
-      aTransformedGrid->GetPoint(0,coords);
+      aGrid->GetPoint(0,coords);
       myPnt1 = Pnt(coords[0],coords[1],coords[2], thePnt1.GetScalarValue());
-      aTransformedGrid->GetPoint(1,coords);
+      aGrid->GetPoint(1,coords);
       myPnt2 = Pnt(coords[0],coords[1],coords[2], thePnt2.GetScalarValue());
-      aTransformedGrid->GetPoint(2,coords);
+      aGrid->GetPoint(2,coords);
       myPnt3 = Pnt(coords[0],coords[1],coords[2], thePnt3.GetScalarValue());
-      std::vector<double> aScalarValues;
-      vtkUnstructuredGrid* anArc = BuildArc(aScalarValues);
-      vtkUnstructuredGrid* anTransArc;
-      if(needRotation)
-        anTransArc = TransformGrid(anArc,aAxis,-anAngle);
-      else
-        anTransArc = anArc;
-      
-      myPoints = anTransArc->GetPoints();
-      myScalarValues = aScalarValues;
+
+      vtkSmartPointer<vtkUnstructuredGrid> anArc = BuildArc(myScalarValues);
+      anArc->Delete();
+      if(needRotation) {
+        anArc = TransformGrid(anArc,aAxis,-anAngle);
+        anArc->Delete();
+      }
+      myPoints = anArc->GetPoints();
       myStatus = Arc_Done;
     }
   }
@@ -333,6 +335,7 @@ VTKViewer_ArcBuilder::VTKViewer_ArcBuilder(const Pnt& thePnt1,
     aList.push_back(thePnt3);
     vtkUnstructuredGrid* aGrid = BuildGrid(aList);
     myPoints = aGrid->GetPoints();
+    aGrid->Delete();
 
     myScalarValues.clear();
     myScalarValues.push_back(thePnt1.GetScalarValue());
@@ -414,7 +417,8 @@ double InterpolateScalarValue(int index, int count, double firstValue, double mi
   return value;
 }
 
-vtkUnstructuredGrid* VTKViewer_ArcBuilder::BuildArc(std::vector<double>& theScalarValues){
+vtkUnstructuredGrid* VTKViewer_ArcBuilder::BuildArc(std::vector<double>& theScalarValues)
+{
   double x1 = myPnt1.GetXYZ().X(); double x2 = myPnt2.GetXYZ().X(); double x3 = myPnt3.GetXYZ().X();
   double y1 = myPnt1.GetXYZ().Y(); double y2 = myPnt2.GetXYZ().Y(); double y3 = myPnt3.GetXYZ().Y();
   double z =  myPnt1.GetXYZ().Z();  //Points on plane || XOY
@@ -608,10 +612,10 @@ vtkIdType Build1DArc(vtkIdType cellId, vtkUnstructuredGrid* input,
     vtkPoints* aPoints = aBuilder.GetPoints();
     std::vector<double> aScalarValues = aBuilder.GetScalarValues();
     vtkIdType aNbPts = aPoints->GetNumberOfPoints();
-    aNewPoints = new vtkIdType[aNbPts];
+    std::vector< vtkIdType > aNewPoints( aNbPts );
     vtkIdType curID;
     vtkIdType aCellType = VTK_POLY_LINE;
-    
+
     aNewPoints[0] = pts[0];
     for(vtkIdType idx = 1; idx < aNbPts-1;idx++) {
       curID = output->GetPoints()->InsertNextPoint(aPoints->GetPoint(idx));
@@ -620,17 +624,17 @@ vtkIdType Build1DArc(vtkIdType cellId, vtkUnstructuredGrid* input,
       aNewPoints[idx] = curID;
     }
     aNewPoints[aNbPts-1] = pts[1];
-    
-    aResult = output->InsertNextCell(aCellType,aNbPts,aNewPoints);
+
+    aResult = output->InsertNextCell(aCellType,aNbPts,&aNewPoints[0]);
     return aResult;
-  } 
+  }
 }
 
 /*!
  * Add all points from the input vector theCollection into thePoints. 
  * Array theIds - it is array with ids of added points.
  */
-vtkIdType MergevtkPoints(const std::vector<vtkPoints*>& theCollection,
+vtkIdType MergevtkPoints(const std::vector< vtkSmartPointer< vtkPoints > >& theCollection,
                          const std::vector< std::vector<double> >& theScalarCollection,
                          vtkPoints* thePoints,
                          std::map<int, double>& thePntId2ScalarValue,
@@ -638,9 +642,9 @@ vtkIdType MergevtkPoints(const std::vector<vtkPoints*>& theCollection,
   vtkIdType aNbPoints = 0;
   vtkIdType anIdCounter = 0;
   vtkIdType aNewPntId = 0;
-  
+
   //Compute number of points
-  std::vector<vtkPoints*>::const_iterator it = theCollection.begin();
+  std::vector< vtkSmartPointer< vtkPoints > >::const_iterator it = theCollection.begin();
   for(;it != theCollection.end();it++){
     vtkPoints* aPoints = *it;
     if(aPoints) { 
index 93aea12f3e631d1348fc256c9451ba609fcb0a07..732b15afdac56f42f55cd9fb6bd2563d3f465d7b 100644 (file)
@@ -26,6 +26,7 @@
 #include <vector>
 
 #include <vtkType.h>
+#include <vtkSmartPointer.h>
 
 class vtkCell;
 class vtkDataArray;
@@ -37,7 +38,7 @@ class Pnt;
 
 typedef std::list<Pnt> PntList;
 
-vtkIdType MergevtkPoints(const std::vector<vtkPoints*>& theCollection,
+vtkIdType MergevtkPoints(const std::vector< vtkSmartPointer< vtkPoints > >& theCollection,
                          const std::vector< std::vector<double> >& theScalarCollection,
                          vtkPoints* thePoints,
                          std::map<int, double>& thePntId2ScalarValue,
@@ -184,7 +185,7 @@ class VTKViewer_ArcBuilder{
 
   double myAngle;
   ArcStatus myStatus;
-  vtkPoints* myPoints;
+  vtkSmartPointer<vtkPoints> myPoints;
   std::vector<double> myScalarValues;
 };
 
index 5ae1a78eda7925549c18f6d7dd157dcc4e9f2a7c..b713ef68fd615c196ac4fbfcade26744770d48b9 100755 (executable)
@@ -382,10 +382,10 @@ VTKViewer_GeometryFilter
         }
         case VTK_TETRA: {
 #ifdef SHOW_COINCIDING_3D_PAL21924
-         faceIdsTmp->Reset();
-         for (int ai=0; ai<npts; ai++)
-           faceIdsTmp->InsertNextId(pts[ai]);
-         input->GetCellNeighbors(cellId, faceIdsTmp, cellIdsTmp);
+          faceIdsTmp->Reset();
+          for (int ai=0; ai<npts; ai++)
+            faceIdsTmp->InsertNextId(pts[ai]);
+          input->GetCellNeighbors(cellId, faceIdsTmp, cellIdsTmp);
 #endif
           for (faceId = 0; faceId < 4; faceId++)
             {
@@ -398,10 +398,10 @@ VTKViewer_GeometryFilter
             numFacePts = 3;
             input->GetCellNeighbors(cellId, faceIds, cellIds);
 #ifdef SHOW_COINCIDING_3D_PAL21924
-           int nbNeighbors = 0;
-           for(int ai=0;ai<cellIds->GetNumberOfIds();ai++) {
-             if (cellIdsTmp->IsId(cellIds->GetId(ai)) == -1) nbNeighbors++;
-           }
+            int nbNeighbors = 0;
+            for(int ai=0;ai<cellIds->GetNumberOfIds();ai++) {
+              if (cellIdsTmp->IsId(cellIds->GetId(ai)) == -1) nbNeighbors++;
+            }
             bool process = nbNeighbors <= 0;
 #else
             bool process = cellIds->GetNumberOfIds() <= 0 || GetAppendCoincident3D();
@@ -421,10 +421,10 @@ VTKViewer_GeometryFilter
         }
         case VTK_VOXEL: {
 #ifdef SHOW_COINCIDING_3D_PAL21924
-         faceIdsTmp->Reset();
-         for (int ai=0; ai<npts; ai++)
-           faceIdsTmp->InsertNextId(pts[ai]);
-         input->GetCellNeighbors(cellId, faceIdsTmp, cellIdsTmp);
+          faceIdsTmp->Reset();
+          for (int ai=0; ai<npts; ai++)
+            faceIdsTmp->InsertNextId(pts[ai]);
+          input->GetCellNeighbors(cellId, faceIdsTmp, cellIdsTmp);
 #endif
           for (faceId = 0; faceId < 6; faceId++)
             {
@@ -438,10 +438,10 @@ VTKViewer_GeometryFilter
             numFacePts = 4;
             input->GetCellNeighbors(cellId, faceIds, cellIds);
 #ifdef SHOW_COINCIDING_3D_PAL21924
-           int nbNeighbors = 0;
-           for(int ai=0;ai<cellIds->GetNumberOfIds();ai++) {
-             if (cellIdsTmp->IsId(cellIds->GetId(ai)) == -1) nbNeighbors++;
-           }
+            int nbNeighbors = 0;
+            for(int ai=0;ai<cellIds->GetNumberOfIds();ai++) {
+              if (cellIdsTmp->IsId(cellIds->GetId(ai)) == -1) nbNeighbors++;
+            }
             bool process = nbNeighbors <= 0;
 #else
             bool process = cellIds->GetNumberOfIds() <= 0 || GetAppendCoincident3D();
@@ -461,10 +461,10 @@ VTKViewer_GeometryFilter
         }
         case VTK_HEXAHEDRON: {
 #ifdef SHOW_COINCIDING_3D_PAL21924
-         faceIdsTmp->Reset();
-         for (int ai=0; ai<npts; ai++)
-           faceIdsTmp->InsertNextId(pts[ai]);
-         input->GetCellNeighbors(cellId, faceIdsTmp, cellIdsTmp);
+          faceIdsTmp->Reset();
+          for (int ai=0; ai<npts; ai++)
+            faceIdsTmp->InsertNextId(pts[ai]);
+          input->GetCellNeighbors(cellId, faceIdsTmp, cellIdsTmp);
 #endif
           for (faceId = 0; faceId < 6; faceId++)
             {
@@ -478,10 +478,10 @@ VTKViewer_GeometryFilter
             numFacePts = 4;
             input->GetCellNeighbors(cellId, faceIds, cellIds);
 #ifdef SHOW_COINCIDING_3D_PAL21924
-           int nbNeighbors = 0;
-           for(int ai=0;ai<cellIds->GetNumberOfIds();ai++) {
-             if (cellIdsTmp->IsId(cellIds->GetId(ai)) == -1) nbNeighbors++;
-           }
+            int nbNeighbors = 0;
+            for(int ai=0;ai<cellIds->GetNumberOfIds();ai++) {
+              if (cellIdsTmp->IsId(cellIds->GetId(ai)) == -1) nbNeighbors++;
+            }
             bool process = nbNeighbors <= 0;
 #else
             bool process = cellIds->GetNumberOfIds() <= 0 || GetAppendCoincident3D();
@@ -501,10 +501,10 @@ VTKViewer_GeometryFilter
         }
         case VTK_WEDGE: {
 #ifdef SHOW_COINCIDING_3D_PAL21924
-         faceIdsTmp->Reset();
-         for (int ai=0; ai<npts; ai++)
-           faceIdsTmp->InsertNextId(pts[ai]);
-         input->GetCellNeighbors(cellId, faceIdsTmp, cellIdsTmp);
+          faceIdsTmp->Reset();
+          for (int ai=0; ai<npts; ai++)
+            faceIdsTmp->InsertNextId(pts[ai]);
+          input->GetCellNeighbors(cellId, faceIdsTmp, cellIdsTmp);
 #endif
           for (faceId = 0; faceId < 5; faceId++)
             {
@@ -524,10 +524,10 @@ VTKViewer_GeometryFilter
 
             input->GetCellNeighbors(cellId, faceIds, cellIds);
 #ifdef SHOW_COINCIDING_3D_PAL21924
-           int nbNeighbors = 0;
-           for(int ai=0;ai<cellIds->GetNumberOfIds();ai++) {
-             if (cellIdsTmp->IsId(cellIds->GetId(ai)) == -1) nbNeighbors++;
-           }
+            int nbNeighbors = 0;
+            for(int ai=0;ai<cellIds->GetNumberOfIds();ai++) {
+              if (cellIdsTmp->IsId(cellIds->GetId(ai)) == -1) nbNeighbors++;
+            }
             bool process = nbNeighbors <= 0;
 #else
             bool process = cellIds->GetNumberOfIds() <= 0 || GetAppendCoincident3D();
@@ -547,10 +547,10 @@ VTKViewer_GeometryFilter
         }
         case VTK_HEXAGONAL_PRISM: {
 #ifdef SHOW_COINCIDING_3D_PAL21924
-         faceIdsTmp->Reset();
-         for (int ai=0; ai<npts; ai++)
-           faceIdsTmp->InsertNextId(pts[ai]);
-         input->GetCellNeighbors(cellId, faceIdsTmp, cellIdsTmp);
+          faceIdsTmp->Reset();
+          for (int ai=0; ai<npts; ai++)
+            faceIdsTmp->InsertNextId(pts[ai]);
+          input->GetCellNeighbors(cellId, faceIdsTmp, cellIdsTmp);
 #endif
           for (faceId = 0; faceId < 8; faceId++)
           {
@@ -571,10 +571,10 @@ VTKViewer_GeometryFilter
             }
             input->GetCellNeighbors(cellId, faceIds, cellIds);
 #ifdef SHOW_COINCIDING_3D_PAL21924
-           int nbNeighbors = 0;
-           for(int ai=0;ai<cellIds->GetNumberOfIds();ai++) {
-             if (cellIdsTmp->IsId(cellIds->GetId(ai)) == -1) nbNeighbors++;
-           }
+            int nbNeighbors = 0;
+            for(int ai=0;ai<cellIds->GetNumberOfIds();ai++) {
+              if (cellIdsTmp->IsId(cellIds->GetId(ai)) == -1) nbNeighbors++;
+            }
             bool process = nbNeighbors <= 0;
 #else
             bool process = cellIds->GetNumberOfIds() <= 0 || GetAppendCoincident3D();
@@ -594,10 +594,10 @@ VTKViewer_GeometryFilter
         }
         case VTK_PYRAMID: {
 #ifdef SHOW_COINCIDING_3D_PAL21924
-         faceIdsTmp->Reset();
-         for (int ai=0; ai<npts; ai++)
-           faceIdsTmp->InsertNextId(pts[ai]);
-         input->GetCellNeighbors(cellId, faceIdsTmp, cellIdsTmp);
+          faceIdsTmp->Reset();
+          for (int ai=0; ai<npts; ai++)
+            faceIdsTmp->InsertNextId(pts[ai]);
+          input->GetCellNeighbors(cellId, faceIdsTmp, cellIdsTmp);
 #endif
           for (faceId = 0; faceId < 5; faceId++)
             {
@@ -616,10 +616,10 @@ VTKViewer_GeometryFilter
               }
             input->GetCellNeighbors(cellId, faceIds, cellIds);
 #ifdef SHOW_COINCIDING_3D_PAL21924
-           int nbNeighbors = 0;
-           for(int ai=0;ai<cellIds->GetNumberOfIds();ai++) {
-             if (cellIdsTmp->IsId(cellIds->GetId(ai)) == -1) nbNeighbors++;
-           }
+            int nbNeighbors = 0;
+            for(int ai=0;ai<cellIds->GetNumberOfIds();ai++) {
+              if (cellIdsTmp->IsId(cellIds->GetId(ai)) == -1) nbNeighbors++;
+            }
             bool process = nbNeighbors <= 0;
 #else
             bool process = cellIds->GetNumberOfIds() <= 0 || GetAppendCoincident3D();
@@ -647,10 +647,10 @@ VTKViewer_GeometryFilter
             int idp = 0;
             input->GetFaceStream(cellId, nFaces, ptIds);
 #ifdef SHOW_COINCIDING_3D_PAL21924
-           faceIdsTmp->Reset();
-           for (int ai=0; ai<npts; ai++)
-             faceIdsTmp->InsertNextId(pts[ai]);
-           input->GetCellNeighbors(cellId, faceIdsTmp, cellIdsTmp);
+            faceIdsTmp->Reset();
+            for (int ai=0; ai<npts; ai++)
+              faceIdsTmp->InsertNextId(pts[ai]);
+            input->GetCellNeighbors(cellId, faceIdsTmp, cellIdsTmp);
 #endif
             for (faceId = 0; faceId < nFaces; faceId++)
               {
@@ -679,13 +679,13 @@ VTKViewer_GeometryFilter
                 // TODO understand and fix display of several polyhedrons                
                 input->GetCellNeighbors(cellId, faceIds, cellIds);
 #ifdef SHOW_COINCIDING_3D_PAL21924
-               int nbNeighbors = 0;
-               for(int ai=0;ai<cellIds->GetNumberOfIds();ai++) {
-                 if (cellIdsTmp->IsId(cellIds->GetId(ai)) == -1) nbNeighbors++;
-               }
-               bool process = nbNeighbors <= 0;
+                int nbNeighbors = 0;
+                for(int ai=0;ai<cellIds->GetNumberOfIds();ai++) {
+                  if (cellIdsTmp->IsId(cellIds->GetId(ai)) == -1) nbNeighbors++;
+                }
+                bool process = nbNeighbors <= 0;
 #else
-               bool process = cellIds->GetNumberOfIds() <= 0 || GetAppendCoincident3D();
+                bool process = cellIds->GetNumberOfIds() <= 0 || GetAppendCoincident3D();
 #endif
                 if (process || myShowInside
                     || (!allVisible && !cellVis[cellIds->GetId(0)]))
@@ -767,20 +767,20 @@ VTKViewer_GeometryFilter
             else //3D nonlinear cell
             {
 #ifdef SHOW_COINCIDING_3D_PAL21924
-             faceIdsTmp->Reset();
-             int npts1 = 0;
-             switch (aCellType ){
-             case VTK_QUADRATIC_TETRA:         npts1 = 4; break;
-             case VTK_QUADRATIC_HEXAHEDRON:    npts1 = 8; break;
-             case VTK_TRIQUADRATIC_HEXAHEDRON: npts1 = 8; break;
-             case VTK_QUADRATIC_WEDGE:         npts1 = 6; break;
-             case VTK_QUADRATIC_PYRAMID:       npts1 = 5; break;
-             }
-             if ( npts1 > 0 ) {
-               for (int ai=0; ai<npts; ai++)
-                 faceIdsTmp->InsertNextId(pts[ai]);
-               input->GetCellNeighbors(cellId, faceIdsTmp, cellIdsTmp);
-             }
+              faceIdsTmp->Reset();
+              int npts1 = 0;
+              switch (aCellType ){
+              case VTK_QUADRATIC_TETRA:         npts1 = 4; break;
+              case VTK_QUADRATIC_HEXAHEDRON:    npts1 = 8; break;
+              case VTK_TRIQUADRATIC_HEXAHEDRON: npts1 = 8; break;
+              case VTK_QUADRATIC_WEDGE:         npts1 = 6; break;
+              case VTK_QUADRATIC_PYRAMID:       npts1 = 5; break;
+              }
+              if ( npts1 > 0 ) {
+                for (int ai=0; ai<npts; ai++)
+                  faceIdsTmp->InsertNextId(pts[ai]);
+                input->GetCellNeighbors(cellId, faceIdsTmp, cellIdsTmp);
+              }
 #endif
               aCellType = VTK_TRIANGLE;
               numFacePts = 3;
@@ -788,13 +788,13 @@ VTKViewer_GeometryFilter
                 vtkCell *face = cell->GetFace(j);
                 input->GetCellNeighbors(cellId, face->PointIds, cellIds);
 #ifdef SHOW_COINCIDING_3D_PAL21924
-               int nbNeighbors = 0;
-               for(int ai=0;ai<cellIds->GetNumberOfIds();ai++) {
-                 if (cellIdsTmp->IsId(cellIds->GetId(ai)) == -1) nbNeighbors++;
-               }
-               bool process = nbNeighbors <= 0;
+                int nbNeighbors = 0;
+                for(int ai=0;ai<cellIds->GetNumberOfIds();ai++) {
+                  if (cellIdsTmp->IsId(cellIds->GetId(ai)) == -1) nbNeighbors++;
+                }
+                bool process = nbNeighbors <= 0;
 #else
-               bool process = cellIds->GetNumberOfIds() <= 0 || GetAppendCoincident3D();
+                bool process = cellIds->GetNumberOfIds() <= 0 || GetAppendCoincident3D();
 #endif
                 if ( process || myShowInside ) {
                   face->Triangulate(0,lpts,coords);
@@ -1356,7 +1356,8 @@ void VTKViewer_GeometryFilter::BuildArcedPolygon(vtkIdType cellId,
                                                  vtkUnstructuredGrid* input,
                                                  vtkPolyData *output,
                                                  TMapOfVectorId& theDimension2VTK2ObjIds,
-                                                 bool triangulate){
+                                                 bool triangulate)
+{
   vtkIdType aCellType = VTK_POLYGON;
   vtkIdType *aNewPoints = NULL;
   vtkIdType aNbPoints = 0;
@@ -1370,7 +1371,7 @@ void VTKViewer_GeometryFilter::BuildArcedPolygon(vtkIdType cellId,
   vtkDataArray* inputScalars = input->GetPointData()->GetScalars();
   vtkDataArray* outputScalars = output->GetPointData()->GetScalars();
 
-  std::vector<vtkPoints*> aCollection;
+  std::vector< vtkSmartPointer<vtkPoints> > aCollection;
   std::vector< std::vector<double> > aScalarCollection;
 
   vtkCell* aCell = input->GetCell(cellId);