[vtkusers] Help with vtkHierarchicalDataSet
Sunil Suram
sunils at iastate.edu
Wed Jun 6 20:22:58 EDT 2007
Hi,
I am trying to add an isosurface to a hierarchical dataset. I check
for the number of polygons before I write it out and it is always 0 (zero).
Below is the code snippet. Any help will be appreciated.
Thanks,
Sunil
dataset is a vtkHierarchicalDataSet
vtkHierarchicalDataSetAlgorithm* alg =
vtkHierarchicalDataSetAlgorithm::New();
alg->SetInput( 0, dataset );
vtkHierarchicalDataSetGeometryFilter* filter1 =
vtkHierarchicalDataSetGeometryFilter::New( );
filter1->SetInputConnection( 0, alg->GetOutputPort(0) );
vtkContourFilter *contour = vtkContourFilter::New();
contour->SetInputConnection( 0, filter1->GetOutputPort(0) );
contour->SetValue( 0, value );
contour->UseScalarTreeOff();
vtkPolyDataNormals *normals = vtkPolyDataNormals::New();
normals->SetInputConnection( 0, contour->GetOutputPort(0) );
vtkHierarchicalDataSetGeometryFilter* filter =
vtkHierarchicalDataSetGeometryFilter::New( );
filter->SetInputConnection( 0, contour->GetOutputPort(0) );
int numPolys = filter->GetOutput()->GetNumberOfPolys();
std::cout << " The number of polys is "<< numPolys << std::endl;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070606/ae562b2c/attachment.htm>
More information about the vtkusers
mailing list