[vtk-developers] Polyhedral challenge

Mark Olesen Mark.Olesen at faurecia.com
Wed Feb 24 05:40:12 EST 2010


On Tue, 2010-02-23 at 12:13 -0500, Will Schroeder wrote:
> The third method below is implemented and supports polyhedron.
> Comments welcome.
> 
> 
>   // Description:
>   // Insert/create cell in object by type and list of point ids
> defining
>   // cell topology. Most cells require just a type which implicitly
> defines
>   // a set of points and their ordering. However, some cells like
>   // vtkPolyhedron require points plus a list of faces. Note when
> inserting
>   // faces, the standard vtkCellArray format is assumed
> (n,i,j,k,n,i,j,k,...).
>   vtkIdType InsertNextCell(int type, vtkIdType npts, vtkIdType *pts);
>   vtkIdType InsertNextCell(int type, vtkIdList *ptIds);
>   vtkIdType InsertNextCell(int type, vtkIdType npts, vtkIdType
> *ptIds, 
>                            vtkIdType nfaces, vtkIdType *faces);

Thanks for the information!

This is a little nitpicking, but I'd suggest the third parameter be
named '*pts' instead of '*ptIds' for consistent naming of this parameter
type (vtkIdType vs. vtkIdList). Also, the comment 

// the standard vtkCellArray format is assumed (n,id1,id2,...,idn,
n,id1,id2,...,idn, ...) might be less confusing than with i,j,k.



If I understand the vtkPolyhedron insertion method correctly, the
'*pts' (or '*ptIds') would be a list of the _unique_ points used by the
cell and specified as global point indices whereas the '*faces' contains
local addressing.

In general this makes sense, however, it would also be extremely
convenient for the end-user if the first InsertNextCell() method could
also be used directly for polyhedra. This would greatly simplify the
end-user coding and perhaps avoid code repetition.

In this case the 'npts' and '*pts' parameters of
    InsertNextCell(int type, vtkIdType npts, vtkIdType *pts)
would represent the number of faces and the face-stream, respectively,
The face stream would be in the standard vtkCellArray format, but with
global point ids.


I've attached a pseudo-code example to illustrate what I mean.
Please let me know what you think.

/mark



DISCLAIMER:
This electronic transmission (and any attachments thereto) is intended solely for the use of the addressee(s). It may contain confidential or legally privileged information. If you are not the intended recipient of this message, you must delete it immediately and notify the sender. Any unauthorized use or disclosure of this message is strictly prohibited. Faurecia does not guarantee the integrity of this transmission and shall therefore never be liable if the message is altered or falsified nor for any virus, interception or damage to your system.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: InsertNextCell-proto.C
Type: text/x-csrc
Size: 2029 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20100224/cf2976ce/attachment-0001.c>


More information about the vtk-developers mailing list