[vtkusers] Animating vtk files

PsyVis osue80 at bangor.ac.uk
Wed Nov 12 08:39:04 EST 2008


Hello 

I'm trying to animate through a series of PolyData .vtk files in java - The
first frame loads fine then when I press the start button to animate through
the files the whole app crashes.

Here is the method for changing the timeslice which is executed inside a
thread.

public void changeTimeSlice(int n) {

        frameCount = n;

        wlFile = new String(wlDir + File.separator + File.separator +
dataName + "_WATER_ELEVATION_" + frameCount + ".vtk");                                            
// file to be loaded     
       
        wl.getPartwl().SetFileName(wlFile);                  // set the
PolyData Readers filename
        wl.getPartwl().Modified();                              // tell the
PolyDataReader that it has been modified
        wl.getPartwl().Update();                               // force a
read on the polyDataReader
        
        wl.getPartMapperwl().Update();                     // tell the
PolyData Mapper to update
       
        SwingUtilities.invokeLater(new Runnable() {

            @Override
            public void run() {
              
                rp.getRenWin().Modified();                      // tell the
renderpanel that it has been modified
                rp.getRenWin().Render();                        // tell the
render panel to render
            }
        });
    }

Here is the debug file for the PolyDataReader:

Debug: In C:\martink\vtk42\VTK\IO\vtkDataReader.h, line 54
vtkPolyDataReader (0x0C3C8A28): vtkPolyDataReader (0x0C3C8A28): setting
FileName to C:\\Documents and Settings\\Rich\My
Documents\\Dyfi_Data\\RUN_01\\Water_Elevation\\Dyfi_run_01_WATER_ELEVATION_0.vtk


Debug: In C:\martink\vtk42\VTK\IO\vtkPolyDataReader.cxx, line 107
vtkPolyDataReader (0x0C3C8A28): Reading vtk polygonal data...


Debug: In C:\martink\vtk42\VTK\IO\vtkDataReader.cxx, line 369
vtkPolyDataReader (0x0C3C8A28): Opening vtk file


Debug: In C:\martink\vtk42\VTK\IO\vtkDataReader.cxx, line 407
vtkPolyDataReader (0x0C3C8A28): Reading vtk file header


Debug: In C:\martink\vtk42\VTK\IO\vtkDataReader.cxx, line 443
vtkPolyDataReader (0x0C3C8A28): Reading vtk file entitled: vtk output


Debug: In C:\martink\vtk42\VTK\Common\vtkProcessObject.h, line 96
vtkPolyDataReader (0x0C3C8A28): vtkPolyDataReader (0x0C3C8A28): returning
Progress of 0


Debug: In C:\martink\vtk42\VTK\IO\vtkDataReader.cxx, line 1089
vtkPolyDataReader (0x0C3C8A28): Read 23309 points


Debug: In C:\martink\vtk42\VTK\Common\vtkProcessObject.h, line 96
vtkPolyDataReader (0x0C3C8A28): vtkPolyDataReader (0x0C3C8A28): returning
Progress of 0.5


Debug: In C:\martink\vtk42\VTK\Common\vtkProcessObject.h, line 96
vtkPolyDataReader (0x0C3C8A28): vtkPolyDataReader (0x0C3C8A28): returning
Progress of 0.75


Debug: In C:\martink\vtk42\VTK\IO\vtkPolyDataReader.cxx, line 238
vtkPolyDataReader (0x0C3C8A28): Read 45663 polygons


Debug: In C:\martink\vtk42\VTK\IO\vtkDataReader.cxx, line 556
vtkPolyDataReader (0x0C3C8A28): Reading vtk cell data


Debug: In C:\martink\vtk42\VTK\IO\vtkDataReader.cxx, line 684
vtkPolyDataReader (0x0C3C8A28): Reading vtk point data


Debug: In C:\martink\vtk42\VTK\IO\vtkDataReader.h, line 283
vtkPolyDataReader (0x0C3C8A28): vtkPolyDataReader (0x0C3C8A28): setting
ScalarLut to default


Debug: In C:\martink\vtk42\VTK\Common\vtkProcessObject.h, line 96
vtkPolyDataReader (0x0C3C8A28): vtkPolyDataReader (0x0C3C8A28): returning
Progress of 0.875


Debug: In C:\martink\vtk42\VTK\Common\vtkProcessObject.h, line 96
vtkPolyDataReader (0x0C3C8A28): vtkPolyDataReader (0x0C3C8A28): returning
Progress of 0.9375


Debug: In C:\martink\vtk42\VTK\IO\vtkDataReader.cxx, line 1789
vtkPolyDataReader (0x0C3C8A28): Closing vtk file


Debug: In C:\martink\vtk42\VTK\Common\vtkSource.h, line 126
vtkPolyDataReader (0x0C3C8A28): vtkPolyDataReader (0x0C3C8A28): returning
ErrorCode of 0


Debug: In C:\martink\vtk42\VTK\Common\vtkSource.h, line 167
vtkPolyDataReader (0x0C3C8A28): vtkPolyDataReader (0x0C3C8A28): setting
ErrorCode to 0


Debug: In C:\martink\vtk42\VTK\IO\vtkDataReader.h, line 54
vtkPolyDataReader (0x0C3C8A28): vtkPolyDataReader (0x0C3C8A28): setting
FileName to C:\\Documents and Settings\\Rich\My
Documents\\Dyfi_Data\\RUN_01\\Water_Elevation\\Dyfi_run_01_WATER_ELEVATION_1.vtk


Debug: In C:\martink\vtk42\VTK\IO\vtkPolyDataReader.cxx, line 107
vtkPolyDataReader (0x0C3C8A28): Reading vtk polygonal data...


Debug: In C:\martink\vtk42\VTK\IO\vtkDataReader.cxx, line 369
vtkPolyDataReader (0x0C3C8A28): Opening vtk file


Debug: In C:\martink\vtk42\VTK\IO\vtkDataReader.cxx, line 407
vtkPolyDataReader (0x0C3C8A28): Reading vtk file header


Debug: In C:\martink\vtk42\VTK\IO\vtkDataReader.cxx, line 443
vtkPolyDataReader (0x0C3C8A28): Reading vtk file entitled: vtk output


Debug: In C:\martink\vtk42\VTK\Common\vtkProcessObject.h, line 96
vtkPolyDataReader (0x0C3C8A28): vtkPolyDataReader (0x0C3C8A28): returning
Progress of 0



I've checked it is getting the right files, I am in a bit of bewilderment
over this.

Cheers

Rich
-- 
View this message in context: http://www.nabble.com/Animating-vtk-files-tp20460514p20460514.html
Sent from the VTK - Users mailing list archive at Nabble.com.




More information about the vtkusers mailing list