From vtkusers Tue May 04 04:55:59 2010 From: Roland Krause Date: Tue, 04 May 2010 04:55:59 +0000 To: vtkusers Subject: [vtkusers] How can I force a vtkRenderer to rerun the pipeline? Message-Id: <769903.65305.qm () web81108 ! mail ! mud ! yahoo ! com> X-MARC-Message: https://marc.info/?l=vtkusers&m=127294938018364 Is there a way to force an update/rerun of the entire rendering pipeline from a either vtkRenderer or a vtkActor, i.e. if I didn't keep track of all the filters and geometry involved? I use a vtkWarpVector to show a deformed structure on a (vtkUnstructuredGrid) and I change the values in the vtkWarpVector but I don't want to rerun vtkGeometryFilter cause it's already slow enough. Here is a sketch of how it works: float * dspl = ...; // large array with displacements allocated someplace else int dsplsize; // size of the above VTK_NEW_PTR(dsplArray,vtkFloatArray); dsplArray->SetNumberOfComponents(3); dsplArray->SetArray(dspl,dsplsize,1); vtkSmartPointer & usgrid = ... ; // get that from some function somwhere vtkPointData * pointData = usgrid->GetPointData(); pointData->AddArray(dsplArray); pointData->SetVectors(dsplArray); VTK_NEW_PTR(pGridFilter,vtkGeometryFilter); pGridFilter->SetInput(usgrid); VTK_NEW_PTR(pWarpVector,vtkWarpVector); pWarpVector->SetInput(pGridFilter->GetOutput()); pWarpVector->SetScaleFactor(warpScaleFactor); VTK_NEW_PTR(pPolyData,vtkPolyData); pPolyData = pWarpVector->GetPolyDataOutput(); // Create the "original" mapper VTK_NEW_PTR(pMapper,vtkPolyDataMapper); pMapper->SetInput(pPolyData); VTK_NEW_PTR(pActor,vtkActor); pActor->SetMapper(pMapper); pRenderer->AddActor(pActor); Now when it's done I want to change the values in dspl, and rerender the code w/o executing the entire code again e.g. I'd prefer that pRenderer->GetRenderWindow()->Render(); would render the scene with the actual values in dspl but it does not. I've tried calling vtkActor->Modified(), vtkActor->GetMapper()->Modified(), vtkActor->GetMapper()->GetInput()->Modified() but nothing changes. Is this because the vtkWarpVector makes copies of the data in dspl? If so, is there a way to prevent that? Any ideas? Thanks, Roland _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe: http://www.vtk.org/mailman/listinfo/vtkusers