]> Creatis software - clitk.git/commitdiff
More vtkSmartPointer
authorsrit <srit>
Fri, 25 Mar 2011 14:21:11 +0000 (14:21 +0000)
committersrit <srit>
Fri, 25 Mar 2011 14:21:11 +0000 (14:21 +0000)
common/clitkDicomRT_Contour.cxx
common/clitkDicomRT_Contour.h
common/clitkDicomRT_ROI.cxx
common/clitkDicomRT_ROI_ConvertToImageFilter.cxx
common/clitkDicomRT_ROI_ConvertToImageFilter.h
vv/vvStructureSetActor.cxx

index 6059f03b6644799d1bfff59410b17d499355e5b4..9a98045faf174182f8cd7cc0f23b1c45c4356988 100644 (file)
@@ -72,7 +72,7 @@ bool clitk::DicomRT_Contour::Read(gdcm::SQItem * item)
   assert(points.size() == static_cast<unsigned int>(mNbOfPoints)*3);
 
   // Organize values
-  mData = vtkPoints::New();
+  mData = vtkSmartPointer<vtkPoints>::New();
   mData->SetDataTypeToDouble();
   mData->SetNumberOfPoints(mNbOfPoints);
   for(unsigned int i=0; i<mNbOfPoints; i++) {
@@ -111,9 +111,10 @@ vtkPolyData * clitk::DicomRT_Contour::GetMesh()
 void clitk::DicomRT_Contour::ComputeMesh()
 {
 //  DD("ComputeMesh Contour");
-  mMesh = vtkPolyData::New();
+  mMesh = vtkSmartPointer<vtkPolyData>::New();
   mMesh->Allocate(); //for cell structures
-  mMesh->SetPoints(vtkPoints::New());
+  mPoints = vtkSmartPointer<vtkPoints>::New();
+  mMesh->SetPoints(mPoints);
   vtkIdType ids[2];
   for (unsigned int idx=0 ; idx<mNbOfPoints ; idx++) {
     mMesh->GetPoints()->InsertNextPoint(mData->GetPoint(idx)[0],
index 8596702eeb84edb2f3e086601b968c3e23cc1449..88100f4f9ee213d40ce2c7d869c4251fdac77e14 100644 (file)
 #define CLITKDICOMRT_CONTOUR_H
 
 #include "clitkCommon.h" 
-#include "clitkDicomRT_Contour.h"
 #include <gdcm.h>
 #include <gdcmSQItem.h>
 #include <vtkPoints.h>
 #include <vtkPolyData.h>
+#include <vtkSmartPointer.h>
 
 namespace clitk {
 
@@ -47,8 +47,9 @@ protected:
   void ComputeMesh();
   unsigned int mNbOfPoints;
   std::string mType;
-  vtkPoints * mData;
-  vtkPolyData * mMesh;
+  vtkSmartPointer<vtkPoints> mData;
+  vtkSmartPointer<vtkPolyData> mMesh;
+  vtkSmartPointer<vtkPoints> mPoints;
   bool mMeshIsUpToDate;
   ///Z location of the contour
   double mZ;
index 6096ddc761f05643fbe3e5e9c5b007da4af88ef4..48099e0dfa2eee6c924b7cf91d5ad719c1bfb7a5 100644 (file)
@@ -195,7 +195,7 @@ clitk::DicomRT_Contour * clitk::DicomRT_ROI::GetContour(int n)
 //--------------------------------------------------------------------
 void clitk::DicomRT_ROI::ComputeMesh()
 {
-  vtkAppendPolyData * append = vtkAppendPolyData::New();
+  vtkSmartPointer<vtkAppendPolyData> append = vtkSmartPointer<vtkAppendPolyData>::New();
   for(unsigned int i=0; i<mListOfContours.size(); i++) {
     append->AddInput(mListOfContours[i]->GetMesh());
   }
index 6c2fd39b035cc7c8337b9415579a6cea63489cff..7b4d04e72609f6161a109aec2c32c9f836645bc5 100644 (file)
@@ -156,7 +156,7 @@ void clitk::DicomRT_ROI_ConvertToImageFilter::Update()
   }
 
   // Create new output image
-  mBinaryImage = vtkImageData::New();
+  mBinaryImage = vtkSmartPointer<vtkImageData>::New();
   mBinaryImage->SetScalarTypeToUnsignedChar();
   mBinaryImage->SetOrigin(&origin[0]);
   mBinaryImage->SetSpacing(&mSpacing[0]);
index 33d74b63df6acde0dd1027bdcc819b262deb27e3..8e4e27cb7d5609c3faeb5484b4db81ebfa8a3e51 100644 (file)
@@ -56,7 +56,7 @@ namespace clitk {
     std::vector<double> mOrigin;
     std::vector<unsigned long> mSize;
     clitk::DicomRT_ROI * mROI;
-    vtkImageData * mBinaryImage;
+    vtkSmartPointer<vtkImageData> mBinaryImage;
   };
   //--------------------------------------------------------------------
 
index b6f08f86af87f4b5c05b057894faf37dd2eaa620..9a9ac8c674f4dd6e61aa84832c1dd260d6f7b30f 100644 (file)
@@ -30,6 +30,7 @@ vvStructureSetActor::vvStructureSetActor()
 //------------------------------------------------------------------------------
 vvStructureSetActor::~vvStructureSetActor()
 {
+
 }
 //------------------------------------------------------------------------------