I am having some difficulty reading in a .vtk file with information regarding points, vertices, scalars, and normals into a contour filter. When I try to connect the /vtkPolyDataReader to /vtkMarchingContourFilter, it does not see any points to draw contours for. I know there are nearly 7k points in the file but I just can not figure out why the contour filters are not seeing the points. Here is the relevant bit of code I am using in case you are interested:<br>
<br><br> vtkSmartPointer<vtkPolyDataReader> PolyData =<br> vtkSmartPointer<vtkPolyDataReader>::New();<br> PolyData->SetFileName( argv[1] ); <br> PolyData->Update();<br><br> vtkSmartPointer<vtkPolyData> Input =<br>
vtkSmartPointer<vtkPolyData>::New();<br> Input->ShallowCopy( PolyData->GetOutput() );<br><br> vtkSmartPointer<vtkMarchingContourFilter> Extract1 =<br> vtkSmartPointer<vtkMarchingContourFilter>::New();<br>
Extract1->SetInputConnection( Input->GetProducerPort() );<br> Extract1->GenerateValues( atoi( argv[2] ),0,4096 );<br> std::cout << std::endl << "The # of contours is: ";<br> std::cout << Extract1->GetNumberOfContours() << std::endl << std::endl;<br>
<br>It has crossed my mind that perhaps creating contours from points is not possible. Does anyone know if that might be true?<br><br>Thank you for your time and help,<br>Luke H<br>