From: srit Date: Fri, 25 Mar 2011 14:21:11 +0000 (+0000) Subject: More vtkSmartPointer X-Git-Tag: v1.2.0~112 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=c93a32f96e61514b8b945d515ffcf11c2a12ae66;p=clitk.git More vtkSmartPointer --- diff --git a/common/clitkDicomRT_Contour.cxx b/common/clitkDicomRT_Contour.cxx index 6059f03..9a98045 100644 --- a/common/clitkDicomRT_Contour.cxx +++ b/common/clitkDicomRT_Contour.cxx @@ -72,7 +72,7 @@ bool clitk::DicomRT_Contour::Read(gdcm::SQItem * item) assert(points.size() == static_cast(mNbOfPoints)*3); // Organize values - mData = vtkPoints::New(); + mData = vtkSmartPointer::New(); mData->SetDataTypeToDouble(); mData->SetNumberOfPoints(mNbOfPoints); for(unsigned int i=0; i::New(); mMesh->Allocate(); //for cell structures - mMesh->SetPoints(vtkPoints::New()); + mPoints = vtkSmartPointer::New(); + mMesh->SetPoints(mPoints); vtkIdType ids[2]; for (unsigned int idx=0 ; idxGetPoints()->InsertNextPoint(mData->GetPoint(idx)[0], diff --git a/common/clitkDicomRT_Contour.h b/common/clitkDicomRT_Contour.h index 8596702..88100f4 100644 --- a/common/clitkDicomRT_Contour.h +++ b/common/clitkDicomRT_Contour.h @@ -21,11 +21,11 @@ #define CLITKDICOMRT_CONTOUR_H #include "clitkCommon.h" -#include "clitkDicomRT_Contour.h" #include #include #include #include +#include namespace clitk { @@ -47,8 +47,9 @@ protected: void ComputeMesh(); unsigned int mNbOfPoints; std::string mType; - vtkPoints * mData; - vtkPolyData * mMesh; + vtkSmartPointer mData; + vtkSmartPointer mMesh; + vtkSmartPointer mPoints; bool mMeshIsUpToDate; ///Z location of the contour double mZ; diff --git a/common/clitkDicomRT_ROI.cxx b/common/clitkDicomRT_ROI.cxx index 6096ddc..48099e0 100644 --- a/common/clitkDicomRT_ROI.cxx +++ b/common/clitkDicomRT_ROI.cxx @@ -195,7 +195,7 @@ clitk::DicomRT_Contour * clitk::DicomRT_ROI::GetContour(int n) //-------------------------------------------------------------------- void clitk::DicomRT_ROI::ComputeMesh() { - vtkAppendPolyData * append = vtkAppendPolyData::New(); + vtkSmartPointer append = vtkSmartPointer::New(); for(unsigned int i=0; iAddInput(mListOfContours[i]->GetMesh()); } diff --git a/common/clitkDicomRT_ROI_ConvertToImageFilter.cxx b/common/clitkDicomRT_ROI_ConvertToImageFilter.cxx index 6c2fd39..7b4d04e 100644 --- a/common/clitkDicomRT_ROI_ConvertToImageFilter.cxx +++ b/common/clitkDicomRT_ROI_ConvertToImageFilter.cxx @@ -156,7 +156,7 @@ void clitk::DicomRT_ROI_ConvertToImageFilter::Update() } // Create new output image - mBinaryImage = vtkImageData::New(); + mBinaryImage = vtkSmartPointer::New(); mBinaryImage->SetScalarTypeToUnsignedChar(); mBinaryImage->SetOrigin(&origin[0]); mBinaryImage->SetSpacing(&mSpacing[0]); diff --git a/common/clitkDicomRT_ROI_ConvertToImageFilter.h b/common/clitkDicomRT_ROI_ConvertToImageFilter.h index 33d74b6..8e4e27c 100644 --- a/common/clitkDicomRT_ROI_ConvertToImageFilter.h +++ b/common/clitkDicomRT_ROI_ConvertToImageFilter.h @@ -56,7 +56,7 @@ namespace clitk { std::vector mOrigin; std::vector mSize; clitk::DicomRT_ROI * mROI; - vtkImageData * mBinaryImage; + vtkSmartPointer mBinaryImage; }; //-------------------------------------------------------------------- diff --git a/vv/vvStructureSetActor.cxx b/vv/vvStructureSetActor.cxx index b6f08f8..9a9ac8c 100644 --- a/vv/vvStructureSetActor.cxx +++ b/vv/vvStructureSetActor.cxx @@ -30,6 +30,7 @@ vvStructureSetActor::vvStructureSetActor() //------------------------------------------------------------------------------ vvStructureSetActor::~vvStructureSetActor() { + } //------------------------------------------------------------------------------