[Paraview-developers] How rendering of vtk object happens in Paraview

Chiranjib Sur sur.chiranjib at gmail.com
Thu Mar 19 07:53:07 EDT 2015


Hi All,
This might sound a naive question to the experienced Paraview users (which
I am not).

I want to understand how the rendering happens in Paraview for any vtk
object. For example, if I want to render a STL file in the paraview window,
how do I do it ?
The underlying vtkSTLreader is able to read the file (if I open the file
using File>Open menu and then press "Apply" button).
I am trying to understand the mechanism behind these operations so that i
can customise and develop my own piece of utiilty.

The following vtk example creates a new visualization window but I want to
render the object in the paraview window.

Thanks much for your help. Is there some place where I can browse/read to
bring up my understanding about the paraview infrastructure.

Thanks,
Chiranjib


Here is the sample vtk code I am refering to (which creates a new viz
window - which I don't want to get)

vtkSmartPointer<vtkSTLReader> reader = vtkSmartPointer<vtkSTLReader>::New();
       reader->SetFileName("filename.stl");
       reader->Update();

       /*
       VTK rendering : a separate visualization windows Pops up
       */

         vtkSmartPointer<vtkPolyDataMapper> mapper =
 vtkSmartPointer<vtkPolyDataMapper>::New();
         mapper->SetInputConnection(reader->GetOutputPort());

         vtkSmartPointer<vtkActor> actor = vtkSmartPointer<vtkActor>::New();
         actor->SetMapper(mapper);

         vtkSmartPointer<vtkRenderer> renderer =
vtkSmartPointer<vtkRenderer>::New();
         vtkSmartPointer<vtkRenderWindow> renderWindow =
vtkSmartPointer<vtkRenderWindow>::New();
         renderWindow->AddRenderer(renderer);

         vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor
= vtkSmartPointer<vtkRenderWindowInteractor>::New();
         renderWindowInteractor->SetRenderWindow(renderWindow);

         renderer->AddActor(actor);
         renderer->SetBackground(.3, .6, .3); // Background color green

         renderWindow->Render();
         renderWindowInteractor->Start();
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20150319/a62b5e03/attachment.html>


More information about the Paraview-developers mailing list