[vtkusers] Rendering speed is window-size dependent - Example Script

Andrea Gavana andrea.gavana at gmail.com
Fri Jan 26 09:55:48 EST 2007


Hi Mark,

> Oh I meant to ask, what mappers are you using? I guess this isn't
> volume rendering that you're trying? With volume rendering you can set
> the quality - not sure if it's the same for whatever you're using. Let
> us know what classes you're using and maybe we can point something
> out.

This is the small part of the code in which VTK is involved:

class Viewer(wxVTKRenderWindow):

    def __init__(self, parent):

        wxVTKRenderWindow.__init__(self, parent, -1)

        self.ren = vtk.vtkRenderer()
        self.GetRenderWindow().AddRenderer(self.ren)

        reader = vtk.vtkUnstructuredGridReader()
        reader.SetFileName("VTKExample.vtk")
        reader.SetScalarsName("_I_PORV")

        surfaceMapper = vtk.vtkDataSetMapper()
        surfaceMapper.SetInputConnection(reader.GetOutputPort())
        surfaceMapper.SetScalarRange((1e3, 2e6))

        surfaceActor = vtk.vtkActor()
        surfaceActor.SetMapper(surfaceMapper)

        self.ren.AddActor(surfaceActor)


That's all. So I have a vtkUnstructuredGridReader to read the grid
stored in the file, a vtkDataSetMapper and a vtkActor. It's nothing
special, just a small snippet. I visualize a 3D unstructured grid with
"_I_PORV" set as a scalar.

> Also, you're not compiled and running in debug mode are you?

No, the only build I have made was the Release one, using Visual
Studio .NET 2003. It was one month ago, but I don't think things have
changed that much in this respect (i.e., Wolfgang is reporting no
problems from his part) :-((((

Thank you for your answer and your suggestions.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.virgilio.it/infinity77/



More information about the vtkusers mailing list