[vtkusers] Help with vtkHierarchicalDataSet

Marc Cotran marc at cotran.ca
Thu Jun 7 10:09:40 EDT 2007


Hi Sunil,

I'm not sure if this will help you as I've no experience with that 
specific filter, but you could try calling Update() on it before your 
std::cout call. VTK pipelines are largely demand driven, so if you don't 
render the result of the pipeline, for example, the filter does not 
actually execute. Calling Update() forces the object to run.

Marc


Sunil Suram wrote:
> 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;
>
>
>
> /
> ------------------------------------------------------------------------
>
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>   



More information about the vtkusers mailing list