[vtkusers] Re: deleting point

Goodwin Lawlor goodwin.lawlor at ucd.ie
Wed Jun 23 13:46:28 EDT 2004


This is a repost of Petru Pau's earlier post (!?)
cf. http://public.kitware.com/pipermail/vtkusers/2004-June/074435.html

Here's a response to the original post:
http://public.kitware.com/pipermail/vtkusers/2004-June/074448.html

In the end Petru used vtkThreshold to do the job.

I dont think the answer has changed...

hth

Goodwin

<bourouis.sami at voila.fr> wrote in message
news:10492784.1088008924972.JavaMail.www at wwinf4003...
hello all,
I tried to test this function that should remove
a point and all incident cells:
- get all cells incident to the point;
- for each cell in the above set
- - remove the cell
- remove the point.

        void removePoint(int pointIndex, vtkPolyData p)
        {
            vtkIdList adjacentCells = vtkIdList.New();
            p.GetPointCells(pointIndex, adjacentCells);

            int nrPoints = p.GetNumberOfPoints();

            int nrAdjCells = adjacentCells.GetNumberOfIds();
            for (int i=0; i<nrAdjCells; i++)
            {
                int cellId = adjacentCells.GetId(i);
                p.RemoveReferenceToCell(pointIndex, cellId);
                p.RemoveCellReference(cellId);
                p.DeleteCell(cellId);
            }
            p.DeletePoint(pointIndex);

            nrPoints = p.GetNumberOfPoints();
        }

This function does _not_ work To give an idea, I added the variable
nrPoints. In the examples that I tried, after the last line, the value of
nrPoints
does not change .
the poly data has the same number of points as before.



------------------------------------------

Faites un voeu et puis Voila ! www.voila.fr





_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers






More information about the vtkusers mailing list