[vtk-developers] Generic method for getting a sub-cell

Will Schroeder will.schroeder at kitware.com
Thu Apr 1 16:17:12 EDT 2010


David in the long term I don't see why we couldn't easily add
something like this to both the cell and dataset APIs. To minimize the
initial effort (i.e., so you don't have to do it to all the datasets)
I'd initially just add it to the affected cell types (e.g., triangle
strip, polyline, polyvert, etc.) Also, if I understand correctly you
are returning a new cell (or a pointer to an internal cell instance),
have you looked at alternative APIs to return the information faster,
and more compactly? I'm thinking of something akin to
vtkCellArray::GetNextCell(npts,pts)...just curious.


On Thu, Apr 1, 2010 at 1:40 PM, David Gobbi <david.gobbi at gmail.com> wrote:
> Hi All,
>
> Would it be possible to add a generic method for getting a sub-cell from a cell?
>
> vtkCell *cell->GetSubCell(int subId);
> void cell->GetSubCell(int subId, vtkGenericCell *subCell);
>
> Even better would be an easy way of iterating through the sub-cells in
> a vtkDataSet directly:
>
> data->GetNumberOfSubCells(vtkIdType cellId);
> data->GetSubCell(vtkIdType cellId, int subId, vtkGenericCell *subCell);
>
> There are several times when I've had to add special cases to my code
> to handle triangle strips, and if there was a generic method for
> getting sub-cells, my code could be a lot simpler.
>
>   David
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>



-- 
William J. Schroeder, PhD
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065
will.schroeder at kitware.com
http://www.kitware.com
(518) 881-4902



More information about the vtk-developers mailing list