[vtk-developers] 3D geographical Visualisation code

John Ownsoul mongwarrior at yahoo.com
Sat Oct 20 10:54:55 EDT 2007


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.




More information about the vtk-developers mailing list