[prev in list] [next in list] [prev in thread] [next in thread] 

List:       paraview
Subject:    [Paraview] Rendering a VTK vtkRenderWindow() in ParaView's PythonView
From:       Léo_Pessanha <leonardopessanha74 () gmail ! com>
Date:       2018-08-02 19:42:37
Message-ID: CAE=GJrZrNWNy8LeXeGqEKJ_3_ENrLBXhA0R9PKdkO0FOGtVrbQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi!

In this post
<https://blog.kitware.com/paraview-python-view-is-now-more-versatile/> there's
a link to a list of potentially usable libraries in ParaView's PythonView
and VTK is listed among them.

I am trying to render a vtkRenderWindow() with a vtkCylinderSource() in it.

import vtk
> rw = vtk.vtkRenderWindow()
> ren = vtk.vtkRenderer()
> rw.AddRenderer(ren)
> cylinder = vtk.vtkCylinderSource()
> cylinder.SetResolution(8)
> cylinderMapper = vtk.vtkPolyDataMapper()
> cylinderMapper.SetInputConnection(cylinder.GetOutputPort())
> cylinderActor = vtk.vtkActor()
> cylinderActor.SetMapper(cylinderMapper)
> cylinderActor.RotateX(30.0)
> cylinderActor.RotateY(-45.0)
> ren.AddActor(cylinderActor)
> ren.SetBackground(0.1, 0.2, 0.4)
> rw.Render()


I've tried separating the graphics structure in the | render(view, width,
heigh) | from the source actor and mapper part of the code but no sucess

The result does not show up in the python view but instead it opens a  new
opengl context

Is it possible to do what I am trying to?

Best regards,
Leonardo Pessanha
Laboratory of Computational Methods in Engineering
Federal University of Rio de Janeiro - COPPE
Rio de Janeiro, RJ, Brasil

[Attachment #5 (text/html)]

<div dir="ltr">Hi!<div><br><div><font face="arial, helvetica, sans-serif">In <a \
href="https://blog.kitware.com/paraview-python-view-is-now-more-versatile/" \
target="_blank">this post</a>  there&#39;s a link to a list of  <span \
style="color:rgb(68,68,68);letter-spacing:0.28px">potentially usable libraries in \
ParaView&#39;s PythonView and  </span></font><span \
style="color:rgb(68,68,68);font-family:arial,helvetica,sans-serif;letter-spacing:0.28px">VTK \
is listed among them.  </span></div><div><font face="arial, helvetica, \
sans-serif"><span style="color:rgb(68,68,68);letter-spacing:0.28px"><br></span></font></div><div><font \
face="arial, helvetica, sans-serif"><font color="#444444"><span \
style="letter-spacing:0.28px">I am trying to render a vtkRenderWindow() with a \
vtkCylinderSource() in it.</span></font><br><br><blockquote class="gmail_quote" \
style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex"><font color="#444444"><span \
style="letter-spacing:0.28px">import vtk<br></span></font><font color="#444444"><span \
style="letter-spacing:0.28px">rw = vtk.vtkRenderWindow()<br></span></font><font \
color="#444444"><span style="letter-spacing:0.28px">ren = \
vtk.vtkRenderer()<br></span></font><font color="#444444"><span \
style="letter-spacing:0.28px">rw.AddRenderer(ren)<br></span></font><font \
color="#444444"><span style="letter-spacing:0.28px">cylinder = \
vtk.vtkCylinderSource()<br></span></font><font color="#444444"><span \
style="letter-spacing:0.28px">cylinder.SetResolution(8)<br></span></font><font \
color="#444444"><span style="letter-spacing:0.28px">cylinderMapper = \
vtk.vtkPolyDataMapper()<br></span></font><font color="#444444"><span \
style="letter-spacing:0.28px">cylinderMapper.SetInputConnection(cylinder.GetOutputPort())<br></span></font><font \
color="#444444"><span style="letter-spacing:0.28px">cylinderActor = \
vtk.vtkActor()<br></span></font><font color="#444444"><span \
style="letter-spacing:0.28px">cylinderActor.SetMapper(cylinderMapper)<br></span></font><font \
color="#444444"><span \
style="letter-spacing:0.28px">cylinderActor.RotateX(30.0)<br></span></font><font \
color="#444444"><span \
style="letter-spacing:0.28px">cylinderActor.RotateY(-45.0)<br></span></font><font \
color="#444444"><span \
style="letter-spacing:0.28px">ren.AddActor(cylinderActor)<br></span></font><font \
color="#444444"><span style="letter-spacing:0.28px">ren.SetBackground(0.1, 0.2, \
0.4)</span></font><font color="#444444"><span \
style="letter-spacing:0.28px"><br></span></font><font color="#444444"><span \
style="letter-spacing:0.28px">rw.Render()</span></font></blockquote></font></div><div><font \
face="arial, helvetica, sans-serif"><span \
style="color:rgb(68,68,68);letter-spacing:0.28px"><br></span></font></div><div><font \
color="#444444" face="arial, helvetica, sans-serif"><span \
style="letter-spacing:0.28px">I&#39;ve tried separating the  graphics structure in \
the | render(view, width, heigh) | from the source actor and mapper part of the code \
but no sucess  </span></font></div><div><font color="#444444" face="arial, helvetica, \
sans-serif"><span style="letter-spacing:0.28px"><br></span></font></div><div><font \
color="#444444" face="arial, helvetica, sans-serif"><span \
style="letter-spacing:0.28px">The result does not show up in the python view but \
instead it opens a   new opengl context</span></font></div><div><font color="#444444" \
face="arial, helvetica, sans-serif"><span \
style="letter-spacing:0.28px"><br></span></font></div><div>Is it possible to do what \
I am trying to?</div><div><br></div><div>Best regards,</div><div><div><div dir="ltr" \
class="gmail-m_-668665592548781775gmail_signature"><div dir="ltr"><div \
dir="ltr"><div><div><div><div><div><span><div \
style="color:rgb(0,0,0);font-family:&quot;Helvetica \
Neue&quot;,Helvetica,Arial,&quot;Lucida \
Grande&quot;,sans-serif,serif,EmojiFont;font-size:13px">Leonardo \
Pessanha<br>Laboratory of Computational Methods in Engineering  </div><div \
style="color:rgb(0,0,0);font-family:&quot;Helvetica \
Neue&quot;,Helvetica,Arial,&quot;Lucida \
Grande&quot;,sans-serif,serif,EmojiFont;font-size:13px">Federal University of Rio de \
Janeiro - COPPE</div><div style="color:rgb(0,0,0);font-family:&quot;Helvetica \
Neue&quot;,Helvetica,Arial,&quot;Lucida \
Grande&quot;,sans-serif,serif,EmojiFont;font-size:13px">Rio de Janeiro, RJ, \
Brasil</div><div><br></div></span></div></div></div></div></div></div><div><div \
style="font-size:12.8px"></div><div \
style="font-size:12.8px"></div></div></div></div></div></div></div></div>



_______________________________________________
Powered by www.kitware.com

ParaView discussion is moving! Please visit https://discourse.paraview.org/ for future posts.

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/paraview


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic