[vtkusers] isosurface update issue
newcfd
newcfd at yahoo.com
Tue Dec 4 04:13:19 EST 2018
I did it in the way you recommended, David. The old ones are still there.
rederWindow->Render() and QVTKOpenGLWidget->update() are added
as well. No help. VTK version 8.1.
void MyApp::redraw( const double value )
{
if ( m_pActor != nullptr )
{
renderer->RemoveActor(m_pActor );
m_pActor->Delete();
m_pActor = nullptr;
}
m_pActor = vtkActor::New();
vtkSmartPointer<vtkPolyDataMapper> mapper =
vtkSmartPointer<vtkPolyDataMapper>::New();
mapper->SetScalarRange(0.0, 1.0);
m_pActor->SetMapper( mapper );
renderer->AddActor( m_pActor );
renderer->SetBackground(1,1,1); // Background color white
vtkStructuredGrid * mesh =...
vtkSmartPointer<vtkContourFilter> filter =
vtkSmartPointer<vtkContourFilter>::New();
filter->SetInputData( mesh );
filter->SetNumberOfContours( 1 );
filter->Setvalue( 0, value ); // value is passed in
m_pActor->GetMapper()->SetInputConnection( filter->GetOutputPort() );
renderer->Render();
}
--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
More information about the vtkusers
mailing list