[vtkusers] BUG in vtkQuadricClustering?
Mathieu Malaterre
mathieu.malaterre at kitware.com
Thu Mar 25 13:48:53 EST 2004
Bernd,
Could you reproduce this bug, using a vtk dataset such as
VTKData/Data/office.binary.vtk ? If not could you please send us a
dataset to possibly be able to reproduce the bug ?
Thanks
Mathieu
Hentschel, Bernd wrote:
> Hi all,
>
> I've just been fiddling around with the append functionality of vtkQuadricClustering (using VTK4.2.2). I use it to decimate an isosurface extracted from a number of strucutred grid blocks. My code looks as follows:
>
> vtkQuadricClustering* pCluster = vtkQuadricClustering::New();
> float fBounds[6] = {0.0f, 3.54f, -3.63f, 3.63f, -3.63f, 3.63f}; //the bounds of the total data set
> float fSpacing[3] = {0.1f,0.1f,0.1f};
> float fOrigin[3] = {0.0f,-3.63f,-3.63f};
> pCluster->SetDivisionSpacing(fSpacing);
> pCluster->SetDivisionOrigin(fOrigin);
> pCluster->StartAppend(fBounds);
>
> vector<vtkStructuredGridReader*> vecReaders;
> vector<vtkContourFilter*> vecContours;
> vecReaders.reserve(20);
> vecContours.reserve(20);
> int i;
> for(i=0; i<20; ++i)
> {
> vecReaders.push_back(vtkStructuredGridReader::New());
> vecReaders[i]->SetFileName(oDSName.GetFileName(1,i).c_str()); //this just gives me the filename for t=1,block=i
>
> vecContours.push_back(vtkContourFilter::New());
> vecContours[i]->SetInput(vecReaders[i]->GetOutput());
> vecContours[i]->SetValue(0,0.65);
> vecContours[i]->Update();
>
> pCluster->Append(vecContours[i]->GetOutput());
> }
> pCluster->EndAppend();
> pCluster->Update();
>
> According to the docu this should do perfectly well. What happens is this: the call "pCluster->EndAppend()" crashes. I stepped into the code and discovered that vtkQuadricClustering::EndAppendVertexGeometry(vtkPolyData *input) is called with a NULL pointer in "input", which makes sense since the input pointer of pCluster is never set. From the code of "EndAppendVertexGeometry" I see that there is a complete traversal of the input vertices, which in this case, so I assume, should contain all vertices of all appended inputs. But even if I specified the input the traversal would be done only for the first input's vertices. Is this a problem or just a major mistake/misassumption on my part?
>
> Greetings,
> Bernd
>
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
More information about the vtkusers
mailing list