[vtkusers] rebuliding surface
yas ---
yas2349 at gmail.com
Tue Apr 23 08:10:08 EDT 2013
I nead to reuse surface object,
my problem:
I have two object ,when one object collide another,contact points should
delete;and surface again recounstruc.
at first ,I reconsturct suface with vtkmarching cube and save output of it
as vtkpolydata
,when delete point from polydata,and surface is not shown well,
my code is:
vtkIdType nCounet = surface->GetOutput()->GetNumberOfPoints();
vtkPoints* points=surface->GetOutput()->GetPoints();
vtkPolyData *polydata=surface->GetOutput();
vtkIdType a =polydata->GetNumberOfPoints();
//polydata->BuildLinks();
//// // Mark a cell as deleted.
// polydata->DeletePoint(1);
// polydata->DeletePoint(2);
// polydata->DeletePoint(3);
// polydata->DeletePoint(4);
// polydata->DeletePoint(5);
// polydata->DeletePoint(6);
// polydata->Update();
//
for ( int i=0;i<idx;i++) {
//indexOfremovepoints save index of points collide and should remove!!
ReallyDeletePoint(points, indexOfremovepoints[i]);
}
polydata->SetPoints(points);
polydata->Update();
//surface->GetOutput()->GetPointData()->SetScalars(inarraySurface);
//cout<<"number"<<surface->GetOutput()->GetNumberOfPoints();
//surface->GetOutput()->DeletePoint(indexOfremovepoints[i);
//surface->Update();
//nCounet = surface->GetOutput()->GetNumberOfPoints();
//surface->GetOutput()->SetPoints(points);
a =polydata->GetNumberOfPoints();
surface->SetOutput(polydata);
surface->Update();
vtkNew<vtkPolyDataMapper> isoMapper;
isoMapper->SetInput(surface);
isoMapper->ScalarVisibilityOff();
what is Your option about problem?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130423/ce3ded78/attachment.htm>
More information about the vtkusers
mailing list