[vtkusers] Error when deleting a vtkImageData object !

pof jd379252 at gmail.com
Fri Jan 1 09:03:07 EST 2010


Hi vtk'ers

I'm having a problem when I'm deleting a vtkImageData object.
I obtain the following error message (located in 
vtkImageAlgorithm::Execute()) :
"Definition of Execute() method should be in subclass and you should 
really use the ExecuteData(vtkInformation *request,...) signature instead"

Up to now, I've found no other workaround than NOT deleting the object, 
which I'm obviously not really happy with.

Herebelow is a small sample code that reproduces the problem (I'm using 
vtk5.0.4 under MSVC++8).

Any idea where my mistake comes from?
JD.

    // Define vtk objects
    vtkBMPReader* m_ImageReader = vtkBMPReader::New();
    vtkImageData* m_ImageData = vtkImageData::New();
    vtkTexture* m_Texture = vtkTexture::New();

    // Read bmp file
    m_ImageReader->SetFileName("Image.bmp");
    // Get data from image file
    m_ImageData = m_ImageReader->GetOutput();
    m_ImageData->Update();
    // Assign data to texture
    m_Texture->SetInput(m_ImageData);
    m_Texture->Update();
    // Other stuff
    // ...
    // ...
    // Now do some cleaning
    m_ImageReader->Delete();
    m_ImageData->Delete(); //  Commenting this line  "solve" the error !
    m_Texture->Delete();




More information about the vtkusers mailing list