[vtkusers] vtkParticle reader

John Ownsoul mongwarrior at yahoo.com
Mon Oct 22 07:04:57 EDT 2007


Dear Fellows;

I have points and resistivity values and i want to visualize them with
vtkParticle reader. But I don't know how to do this, could you send me a
sample code about this?

Here is my Java 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();


-- 
View this message in context: http://www.nabble.com/vtkParticle-reader-tf4670320.html#a13341638
Sent from the VTK - Users mailing list archive at Nabble.com.




More information about the vtkusers mailing list