[vtkusers] plod 3d reader question

bigreddot at ftml.net bigreddot at ftml.net
Wed Nov 18 18:52:44 EST 2009


I am reading in the example Plot 3D file as so:

     plot3d_->SetXYZFileName( "/share/home/bryanv/bluntfinxyz.bin" );
     plot3d_->SetQFileName( "/share/home/bryanv/bluntfinq.bin" );
     plot3d_->AddFunction( DENSITY );
     plot3d_->AddFunction( PRESSURE );
     // add several more functions
     plot3d_->Update( );

Then later I create an isosurface colored by an array component:

     vtkSmartPointer<vtkContourFilter> iso = vtkContourFilter::New( );
     iso->SetInputConnection( plot3d_->GetOutputPort( ) );
     iso->UseScalarTreeOn( );
     iso->GenerateValues( 15, 0, 5 );

     iso_mapper_->SetInputConnection( iso->GetOutputPort( ) );
     iso_mapper_->ScalarVisibilityOn( );
     iso_mapper_->SetScalarModeToUsePointFieldData( );
     iso_mapper_->ColorByArrayComponent( "Density", 0 );
     iso_mapper_->SetScalarRange( 0, 5 );

Later if I change ColorByArrayComponent and SetScalarRange, the 
colormapping of the isosurface changes to reflect a different array in 
the plot 3d source. All good!

But what I would also like to is generate isosurfaces based on the 
different array sources as well. The above code just seems to default to 
whatever the first array source is ("Density" in this case). What do I 
have to do to tell the vtkContourFilter to use a different array in 
plot3d_ for its input (analogous to ColorByArrayComponent for the 
colormapping)? I assume I need to reset the input connection, but reset 
it to *what*?

I have looked several times at the class references, but I did not see 
anything that seemed related to selecting different outputs except 
vtkAlgorithm::GetOutputPort(int index), which of course is not what I need.

Regards

Bryan



More information about the vtkusers mailing list