[vtkusers] Problem with vtkExtractEdges not updating
Ted Christiansen
ted at caept.com
Wed Jul 31 14:51:16 EDT 2002
Hello,
I am using vtkExtractEdges to show the edges of elements in an
unstructured grid. It is setup first with the
vtkPoints/vtkUnstructuredGrid in the "design" condition. Then I show a
deformed plot and modify the vtkPoints to their deformed locations. For
some reason I cant get the vtkExtractEdges to update - the extracted
edges show the wrong shape! I have tried using UpdateData(vtkGrid) - it
works sometimes and other times crashes. Does anyone have a suggestion
to get this filter to update the mapper?
All of the vtk objects are member variables of a class (are not
temporary).
// initial setup
m_vtkEdgePoints->Allocate(m_nodes.GetSize());
m_vtkEdgeGrid->Allocate(m_faces.GetSize());
... add faces here
m_vtkEdgeGrid->SetPoints(m_vtkEdgePoints);
m_vtkEdgeFilter->SetInput(m_vtkEdgeGrid);
m_vtkEdgeMapper->SetInput(m_vtkEdgeFilter->GetOutput());
m_vtkEdgeMapper->ImmediateModeRenderingOn();
m_vtkEdgeActor->SetMapper(m_vtkEdgeMapper);
pDoc->Props->AddItem(m_vtkEdgeActor);
<snip>
// after deformed display, now return to "design" condition
for (i=0;i<m_nodes.GetSize();i++) {
node = &m_nodes[i];
m_vtkEdgePoints->InsertPoint(i, node->X(), node->Y(), node->Z());
}
// THIS CAUSES A CRASH SOMETIMES:
m_vtkEdgeFilter->UpdateData(m_vtkEdgeGrid);
Regards,
Ted
More information about the vtkusers
mailing list