[vtkusers] Re: Beginner

Eduardo Kortright eduardo at cs.uno.edu
Mon Nov 25 12:54:10 EST 2002


Hello Vahid,

Are your measurements taken at regularly spaced locations?  Then you could
create a vtkImageData data set object.  If not, you could create a
vtkPolyData and treat your measurements as a set of arbitrarily located
points (containing either many separate vertices or one big polyvertex).

If you go with a vtkPolyData, you will also have to create a vtkPoints (a
points array), and specify the location of each measurement by inserting the
coordinates of each point.  You would also have to create a vtkCellArray to
define the relationship among your points (either a set of vertices or one
polyvertex).  Then you would add the points and cells to your polydata
(using the SetPoints and the SetVerts methods, respectively).

Once you have those in place, you can add "attributes" to your points.  You
would store each measurement (e.g. Temperature, Velocity, etc.) in its own
array (for instance, create a vtkFloatArray to hold the temperatures, and
another vtkFloatArray with 3 components per entry to hold the velocity
data).

Finally, you need to associate your attributes with your points.  Say you
have a data set (either vtkImageData or vtkPolyData) object called 'ds'.
Also, say you have stored your temperatures in a float array called
'temperatureData', and so on.  Then you could do (in Tcl; C++ would be very
similar):

    [ds GetPointData] SetScalars temperatureData
    [ds GetPointData] SetVectors velocityData

(etc., etc.).

I hope this points you in the right direction.  I highly recommend the VTK
User's Guide (for version 4.0), especially the sections titled "Manually
Create vtkPolyData" and "Manually Creating vtkImageData".

--
Eduardo Kortright                         Department of Computer Science
eduardo at cs.uno.edu                        University of New Orleans
Phone: (504) 280-6626                     Lakefront Campus
Fax:   (504) 280-7228                     New Orleans, LA 70148

> From: Vahid Zahiri <vahid at elham.iut.ac.ir>
> Reply-To: vahid at elham.iut.ac.ir
> Organization: Isfahan Univ of Tech Computer Center
> To: vtkusers at public.kitware.com
> Date: Sun, 24 Nov 2002 23:36:39 +0330
> Subject: [vtkusers] Beginner
>
>
>  Hello,
>  I'm beginner,and i only need a simple guide,and if i know name of
>  vtk tools that i need then i can read DOC.
>  I have some points and for each point i have many data
>  like a Pressure(scaler), Temperature(scaler), Velocity(vector),....
>  what is it in vtk can store them(Pressure , Temperature,...) ?
>  Is vtk have a Class that I can store all of them in this Class?
>  Thanks In Advance ,
>  Vahid
>
> --
> _________________________________
>  Vahid Zahiri
>  Isfahan University of Technology (I.U.T)
>  Isfahan IRAN
>  work Phone : +98 (311) 3915824




More information about the vtkusers mailing list