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

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Thu Mar 19 08:28:41 EDT 2015


Chiranjib,

That's a painfully loaded question, I am afraid :). Here's a Wiki page
that will hopefully give you some background [1]. I admit, we're
woefully missing a good design document that describes the complete
picture from proxies to views and representations. It's been on the
TODO list for a while now.

Utkarsh


[1] http://www.paraview.org/ParaView/index.php/Views_And_Representations

On Thu, Mar 19, 2015 at 7:53 AM, Chiranjib Sur <sur.chiranjib at gmail.com> wrote:
> 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();
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Search the list archives at:
> http://markmail.org/search/?q=Paraview-developers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview-developers
>


More information about the Paraview-developers mailing list