[vtkusers] suggestions for defining data
John Biddiscombe
jbiddiscombe at skippingmouse.co.uk
Thu Nov 7 18:20:45 EST 2002
Yes, do as you suggest. Read the file and as you read each point, use
vtkPointLocator::IsInsertedPoint and InsertPoint to create the pointlist.
That way you'll only ever have one copy of each point and no duplicates.
(You'll have to build cells out of the ID's as you insert them)
JB
----- Original Message -----
From: <walizada at ucalgary.ca>
To: <vtkusers at public.kitware.com>
Sent: Thursday, November 07, 2002 5:56 PM
Subject: [vtkusers] suggestions for defining data
>
>
> Hi,
>
> I'm just begun to use vtk and so please forgive me if my questions seem
> misdirected.
>
> I have a XDR encoded file which has the following type of geometry:
>
> The model comprises points which are placed in cables. and cables are
> organized into layers. Within a layer, each cable has the same number of
> points and cables are assumed to be parallel.
> A surface is created for each layer
> by forming quadrilaterals between the cables:
>
> n n+1
> Cable m --*--------*--
> / \
> Cable m+1 --*----------*--
> n n+1
>
> In the above example, a quadrilateral is formed from the 4 points shown.
> Note that perfect rectangles are not formed. There are three types of
> layers denoted by the following numbers:
>
> 0 - do nothing extra
> 1 - longitudinally running cables. Make quadrilaterals between the first
> and last cable.
> 2 - latitudinally running cables. The first and last point in each cable
> are connected so make an extra quadrilateral using the first and last
> points of adjacent cables.
>
> -666+layer_type #layer separator - float
> -777 #cable separator - float
> p0.x #float
> p0.y
> p0.z
> .
> pn.x
> pn.y
> pn.z
> -777 #start next cable
> p0.x
> p0.y
> p0.z
> .
> -777
> .
> -666+layer_type #start next layer
> .
> -333 #end of file marker - float
>
>
> -------------
>
> I don't have a problem reading in the file using the XDR library but I'm
> considering what would be the most efficient way for me to represent the
> data. I need to create quadrilaterals from the points
> but I feel the data structure would have a lot of redundancy since all the
> quadrilaterals would share common points.
> Here is my initial steps at trying to get the data in:
>
> 1. Read in all the points for each layer as vtkPoints.
> 2. Based on the layer type and cable structure create quadrilaterals
> by storing the vertexs in vtkIdType.
> 3. Create a vtkCellArray to hold the quadrilaterals.
> 4. create a vtkPolyData using the vtkCellArray.
>
> I would like some suggestions if this is the best way forward. What's the
> other choices that I have that may be less work, such as creating new
class
> based on other vtk IO classes that handle some of this.
>
> Thanks for any suggestions and for reading this far!
>
> Wahid
>
>
> _______________________________________________
> 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://public.kitware.com/mailman/listinfo/vtkusers
More information about the vtkusers
mailing list