[vtkusers] Initialize a vtkContourWidget from vtkContourFilter
Xiaopeng Yang
yxp233 at postech.ac.kr
Mon Mar 7 20:10:35 EST 2011
Hello all,
I am trying to initialize a vtkContourWidget from vtkContourFilter. But the
initialized vtkContourWidget is out of order. I think it is because of the
poor quality of the polydata I defined from the contour. Could you provide
any idea how to get good polydata? Thanks in advance!
Here is my code:
vtkExtractVOI * extract = vtkExtractVOI::New();
extract->SetInput(connector2->GetOutput());
extract->SetVOI(0,512,0,512,101,101);
vtkContourFilter * contour = vtkContourFilter::New();
contour->SetInput( connector2->GetOutput() );
contour->SetValue(0, 128);
vtkStripper *stripper = vtkStripper::New();
stripper->SetInput(contour->GetOutput());
stripper->Update();
vtkPolyData * testPoly = vtkPolyData::New();
testPoly->SetPoints(stripper->GetOutput()->GetPoints());
vtkOrientedGlyphContourRepresentation *contourRep =
vtkOrientedGlyphContourRepresentation::New();
vtkContourWidget *contourWidget = vtkContourWidget::New();
contourWidget->SetInteractor(iren);
contourWidget->SetRepresentation(contourRep);
contourWidget->On();
contourWidget->Initialize(orderedPolyData);
contourWidget->Render();
Best,
Yang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110308/a475bd69/attachment.htm>
More information about the vtkusers
mailing list