[vtk-developers] 3D geographical Visualisation code

Berk Geveci berk.geveci at kitware.com
Sat Oct 20 12:11:48 EDT 2007


Hi John,

This mailing list is for discussions on the development of VTK not
questions about VTK usage. In the future, please post such questions
to the VTK users list.

Best,
-berk

On 10/20/07, John Ownsoul <mongwarrior at yahoo.com> wrote:
>
> Dear Fellows;
>
>
> I import x,y,z values from my file and bring them into a vector. But i don't
> know what to do then. Could you help me to write the Java code or algorithm?
> Or, if it is possible, could you send me the file which contains the
> coordinates and resistivity values, and a code which reads the file and
> visualize it?
>
> Here is my code:
>
>
>             File file = new File("file.txt");
>
>             FileInputStream fis = null;
>             BufferedInputStream bis = null;
>             DataInputStream dis = null;
>             fis = new FileInputStream(file);
>             bis = new BufferedInputStream(fis);
>             dis = new DataInputStream(bis);
>
>             String temp;,
>
>             vtkIdList ids = new vtkIdList();
>             vtkPoints points = new vtkPoints();
>             vtkDoubleArray values = new vtkDoubleArray();
>            values.SetNumberOfTuples(19470);    // i have 1970 points
>             values.SetNumberOfComponents(1);
>             values.SetName("resistivity");
>
>             double x,y,z,r;
>             int qwe=0;   //qwe is the counter
>             //x,y,z values are the coordinates
>             // r is the resistivity value
>
>             while (dis.available() != 0)
>             {
>             qwe++;
>             temp=dis.readLine();
>
>             processLine(temp); //this method generates the coordinates and
> the resistivity value from the variable "temp"
>
>             System.out.println("x : " + x + ", y : " + y + ", z : " + z + ",
> resist. : " + r );
>             points.InsertPoint(qwe, x, y, z);
>             values.InsertValue(qwe,r);
>             ids.InsertNextId(qwe);
>             }
>             fis.close();
>             bis.close();
>             dis.close();
>
>              // i could only write this code.
> --
> View this message in context: http://www.nabble.com/3D-geographical-Visualisation-code-tf4658218.html#a13310617
> Sent from the VTK - Dev mailing list archive at Nabble.com.
>
> _______________________________________________
> vtk-developers mailing list
> vtk-developers at vtk.org
> http://www.vtk.org/mailman/listinfo/vtk-developers
>



More information about the vtk-developers mailing list