From d90a85b95172ce5791bf701c8ad1e227f26c4b46 Mon Sep 17 00:00:00 2001 From: machado Date: Wed, 13 May 2009 09:31:31 +0000 Subject: [PATCH] *** empty log message *** --- src/creaVtk.txx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/creaVtk.txx b/src/creaVtk.txx index bbebc1d..f0ea5be 100644 --- a/src/creaVtk.txx +++ b/src/creaVtk.txx @@ -22,7 +22,8 @@ namespace crea vtkImageData* CREA_EXPORT NewVtkImageDataFromRaw( T* data, int nx, int ny, - int nz) + int nz, + bool do_not_desalloc) { // std::cout << "NV "<::SizedName() << std::endl; @@ -67,8 +68,11 @@ namespace crea = dynamic_cast*>(array); array->SetNumberOfComponents( 1 ); size_t size = (long)nx*(long)ny*(long)nz; - // The last param of SetArray is set to 1 to keep the class from deleting the array when it cleans up or reallocates memory. - tarray->SetArray( data, size, 1 ); + // The last param of SetArray is set to 1 to keep the class from deleting the array + // when it cleans up or reallocates memory. + int dndesa = 0; + if (do_not_desalloc) dndesa = 1; + tarray->SetArray( data, size, dndesa ); image->GetPointData( )->SetScalars( tarray ); array->Delete( ); return image; -- 2.45.1