DeleteCell()

Tim Hutton T.Hutton at eastman.ucl.ac.uk
Tue Jan 18 11:28:02 EST 2000


Forgot to cc this to the group.

>Date: Tue, 18 Jan 2000 16:19:13 +0000
>To: Sylvain Jaume <jaume at tele.ucl.ac.be>
>From: Tim Hutton <T.Hutton at eastman.ucl.ac.uk>
>Subject: Re: DeleteCell()
>In-Reply-To: <Pine.GSO.4.10.10001181656141.26040-100000 at sirrah>
>
>At 17:06 18/01/00 +0100, you wrote:
>>Hello vtk users,
>>
>>Since I didn't get an answer to my question last week, I ask it again:
>
>Oi, oi! Don't get stroppy! :) Just kidding.
>
>>A method of vtkPolyData, DeleteCell(int cellId), allows for suppressing
>>triangle in a polydata. When I write myPolyData->DeleteCell(0) to delete
>>the first triangle, I get a Segmentation Fault. Since I'm not familiar
>>with cellId, probably my input argument is wrong. Anybody has experience
>>with DeleteCell() ?
>
>I've added below a reply I got from Will about this a few months back.
Hope it is revealing for you.
>
>Can I offer a suggestion for discussion to all vtk folk and users. Would
it be feasible to have a function
>ReallyDeleteCell() (or whatever) that trawled through a list of cells,
restructuring it to delete those that have been marked as deleted. Any
comments on this?
>
>Cheers,
>
>Tim.
>
>---------------------------------
>
>X-Sender: krunner4 at pop.nycap.rr.com
>X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.0.58 
>Date: Mon, 15 Nov 1999 14:32:41 -0500
>To: Tim Hutton <T.Hutton at eastman.ucl.ac.uk>, vtkusers at gsao.med.ge.com
>From: Will Schroeder <will.schroeder at kitware.com>
>Subject: Re: Can delete cells from vtkPolyData?
>
>Hi Tim-
>
>>At 05:35 PM 11/15/99 +0000, Tim Hutton wrote:
>>I'm having a little trouble understanding what I'm doing wrong. I want to
>>perform a test on each cell in a vtkPolyData, to decide whether to
deletit or not. vtkPolyData::DeleteCell() seems to have no effect; when I
>>visualise the mesh all the cells are still there, even if I call it for all
>>of them! Help!
>
>The unstructured data structures in VTK (vtkUnstructuredGrid, vtkPolyData)
have been designed to represent large collections of data in compact form.
It's not easy to edit them, because typically contiguous arrays are used.
>
>The DeleteCell() method is used to "mark" a cell deleted, even though the
cell is not actually discarded (or removed from the contiguous
vtkCellArray) array. You have to refer to what's being marked to determine
if the cell has actually been deleted. That's a bit tricky.
>
>If you look in vtkDecimatePro, you'll see DeleteCell() in action.
DeleteCell() is used to mark triangles deleted. Later, GetCellType() is
used to determine whether a cell has been deleted (i.e., whether the type
has been set to VTK_EMPTY_CELL).
>
>What's happening is this: the cell connectivity is maintained in instances
of vtkCellArray. When direct access is required, vtkCellTypes is created on
the fly; and when topological information (like cell neighbors) is
required, the class vtkCellLinks is created. The DeleteCell() method simply
marks the type in vtkCellTypes as VTK_EMPTY_CELL, but does not actually
remove the data from vtkCellArray.
>
>After marking things deleted, vtkDecimatePro makes a final pass through
the data structures extracting all non-deleted cells, and then passing this
data to the output. It does this because filters ignore the CellTypes
information because it is not passed to the upstream filter's output (to
conserve memory, mainly).
>
>What we've been seeing lately is that the VTK users are getting very
sophisticated, and are running against the limits of the design. For
example: editing data - should we add a new dataset type to VTK that
supports a full topological hierarchy and allows cell-by-cell,
face-by-face, edge-by-edge, and/or point-by-point editing? Another idea is
to modify theCellArray so that deleted cells are marked in some fashion, so
the rendering classes (and other filters) skip the deleted cells. I don't
know, but we're interested in feedback on this issue.
>
>Will
>
>
>


-----------------------------------------------------------------------------
This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.
-----------------------------------------------------------------------------




More information about the vtkusers mailing list