[vtkusers] how to link new points added to a polydata

cerina cerine-baratelli at hotmail.fr
Thu Sep 13 06:15:32 EDT 2012


Good morning,
I have a 3D Mesh, with the MouseinteractorStyle class i added new points to
this polydata. But, how can I build links between those points and the
existed points of my polydata (adding edges, creating cells for my new
points...)
here is how i added the new points:
polydata->GetPoints()->InsertPoint(150,-1.79482e-008, 0.0012, -0.0048);
polydata->GetPoints()->InsertPoint(151,-0.00083353, 0.0012, -0.00472707); 
polydata->GetPoints()->InsertPoint(152,-0.00164172, 0.0012, -0.00451052);
cout<<"ok d'insertion des points"<<endl;
polydata->GetPoints()->Modified();
polydata->Modified();
polydata->Update();
polydata->IsEdge(150,151);
polydata->IsEdge(150,152);
polydata->IsEdge(151,152);
cout<<"ok d'insertion edge"<<endl;
polydata->BuildLinks(3);
vtkIdList* pts=vtkIdList::New();
pts->InsertId(0,150);
pts->InsertNextId(151);
pts->InsertNextId(152);
polydata->GetPolys()->InsertNextCell(pts);
vtkIdList* ptss=vtkIdList::New();
ptss->InsertId(0,11);
ptss->InsertNextId(151);
ptss->InsertNextId(152);
polydata->GetPolys()->InsertNextCell(ptss);
polydata->GetPolys()->Modified();
polydata->Modified();
polydata->Update();

this example is added to the MouseInteractorStyle of the sphereSource
example.When running my program, the points are added, but the cells and
egde are not (the program is crashed when it come to add edges)

is there any suggestion to how to do this.
thanks

Cerina



--
View this message in context: http://vtk.1045678.n5.nabble.com/how-to-link-new-points-added-to-a-polydata-tp5716039.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list