[vtkusers] Does vtkUnstructuredGrid behaves differently in 5.0.4 than 4.4.2?

Thuc Bui bui at calcreek.com
Wed Oct 22 13:48:37 EDT 2008


Dear All,

Correction! My VTK 5.0.4 was compiled with Visual Studio 2005 not 2008. And
I also just found out that by just replacing the deprecated function
strdup() called in vtkDataReader::ReadArray() by _strdup(), the crash in
free(type) would go away.

Thuc

-----Original Message-----
From: Thuc Bui 
Sent: Wednesday, October 22, 2008 10:14 AM
To: Mathieu Malaterre
Cc: vtkusers at vtk.org
Subject: RE: [vtkusers] Does vtkUnstructuredGrid behaves differently in
5.0.4 than 4.4.2?

Dear Mathieu,

Thank you very much for taking you time to answer my question. I actually
did try Update() right after I had posted my question. I inserted the call
to Update() right after unstructuredGridData was set to the output of
unstructGridReader as follows

...
vtkUnstructuredGrid* unstructuredGridData =
dynamic_cast<vtkUnstructuredGrid*>(unstructGridReader->GetOutput());
unstructuredGridData->Update();
...

Unfortunately, it crashed in vtkDataReader::ReadArray() at the very end at
free(type) right before to return array.

My VTK5.0.4 is compiled with Visual Studio 2008. I wonder if there are some
issues with this particular compiler or simply some settings are incorrectly
set in Cmake 2.6.

I will follow you suggestion to file a bug report.

Thuc

-----Original Message-----
From: Mathieu Malaterre [mailto:mathieu.malaterre at gmail.com] 
Sent: Wednesday, October 22, 2008 12:59 AM
To: Thuc Bui
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] Does vtkUnstructuredGrid behaves differently in
5.0.4 than 4.4.2?

On Wed, Oct 22, 2008 at 1:14 AM, Thuc Bui <bui at calcreek.com> wrote:
> Hi All,
>
> I hope someone can help me out. I am porting my application using VTK
4.4.2
> to 5.0.4 and encountering a behavior of vtkUnstructuredGrid that is
> different (and fatal in my case) from 4.4.2. Below are the codes that I
use
> showing 5.0.4 returns zero for both the number of cells and points whilst
> 4.4.2 returns correct numbers.
>
> Can any one point out for me what should I modify my codes to get the
> correct behavior of 4.4.2?
>
> Many thanks in advance for your help,
> Thuc Bui
>
> vtkDataSetReader* unstructGridReader = vtkDataSetReader::New();
>
> // the file is in unstructured grid format
> unstructGridReader->SetFileName("myVTKdata.txt");
>
> // to force a re-read because in actual code, unstructGridReader is
> // instantiated else where and the file could be modified in between
> unstructGridReader->Modified();


Call ->Update() instead.  If this used to work on VTK 4.4, this is a
bug, then fill in a bug report.


-- 
Mathieu





More information about the vtkusers mailing list