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++) {
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],
#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 {
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;
//--------------------------------------------------------------------
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());
}
}
// Create new output image
- mBinaryImage = vtkImageData::New();
+ mBinaryImage = vtkSmartPointer<vtkImageData>::New();
mBinaryImage->SetScalarTypeToUnsignedChar();
mBinaryImage->SetOrigin(&origin[0]);
mBinaryImage->SetSpacing(&mSpacing[0]);
std::vector<double> mOrigin;
std::vector<unsigned long> mSize;
clitk::DicomRT_ROI * mROI;
- vtkImageData * mBinaryImage;
+ vtkSmartPointer<vtkImageData> mBinaryImage;
};
//--------------------------------------------------------------------
//------------------------------------------------------------------------------
vvStructureSetActor::~vvStructureSetActor()
{
+
}
//------------------------------------------------------------------------------