<div dir="ltr">Context2D should support vtkPolyData. See the following commit.<div><br></div><div>
<span></span>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(175,173,36);background-color:rgb(255,255,255)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">commit 1469ea5dcb33d69710ed4099789ebc0fa2bcdf57</span></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">Author: Alvaro Sanchez <<a href="mailto:alvaro.sanchez@kitware.com">alvaro.sanchez@kitware.com</a>></span></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">Date: <span class="gmail-Apple-converted-space"> </span>Mon Oct 17 19:00:43 2016 -0400</span></p>
<p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255);min-height:13px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>Added support for vtkPolyData in vtkContext2D.</span></p>
<p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255);min-height:13px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span></span></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>vtkContext2D takes a new type of item which directly draws a 2D mesh</span></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>represented by a vtkPolyData object. Internally, vtkContextDevice2D makes</span></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>the API calls necessary to draw the internal primitives of vtkPolyData.</span></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>Added a test demonstrating the use of vtkPolyDataItem.</span></p>
<p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255);min-height:13px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span></span></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>Added interaction and batched primitives for drawing.</span></p>
<p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255);min-height:13px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span></span></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>vtkInteractiveArea derives from vtkContextArea and implements basic interaction</span></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>(zoom and panning). Currently, two types of vtkPolyData primitives are supported,</span></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>Lines and Polygons. Lines are batched and drawn using ContextDevice2D::DrawLines.</span></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>Polygons are first decomposed into a set of triangles and then drawn using</span></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>ContextDevice2D::CoreDrawTriangles. Primitives are colored per vertex.</span></p>
<p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255);min-height:13px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span></span></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>Suppressed run-time warning.</span></p>
<p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255);min-height:13px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span></span></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>Setting the current renderer in the interactor style. Removed</span></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>unecessary initializations.</span></p>
<p class="gmail-p3" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255);min-height:13px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span></span></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>Using defined symbolic names for scalar modes.</span></p>
<br></div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Jun 15, 2018 at 5:02 AM Roman Hiestand <<a href="mailto:roman.hiestand@fluxim.com">roman.hiestand@fluxim.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Dan,</div><div><br></div><div>Thank you for the information! I assume there is no mapper from vtkPolyData to vtkContext2D? At least I didn't find one.</div><div>Migrating our code to vtkContext2D would be too tedious, so for now we stick to the current solution. If we need a better SVG/PDF output, we will use either Qt or a specialized library like cairo.</div><div><br></div><div>Regards</div><div>Roman</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 14, 2018 at 5:39 PM, Dan Lipsa <span dir="ltr"><<a href="mailto:dan.lipsa@kitware.com" target="_blank">dan.lipsa@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Roman,<div>For the new OpenGL2 backend only 2D polygon data drawn within a vtkContext2D can be exported as vector data in a PDF or SVG. This is because GL2PS uses a feature removed from recent OpenGL versions (glFeedbackBuffer). So, if exporting vector data is important to your application you'll have to port it to draw everything inside a vtkContext2D class. We are currently doing this port for the cdat.</div><div><br></div></div><br><div class="gmail_quote"><div><div class="m_-533099038093434747h5"><div dir="ltr">On Thu, Jun 14, 2018 at 11:16 AM Roman Hiestand <<a href="mailto:roman.hiestand@fluxim.com" target="_blank">roman.hiestand@fluxim.com</a>> wrote:<br></div></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_-533099038093434747h5"><div dir="ltr"><div>Hello</div><div><br></div><div>Since upgrading to VTK 8.1.1 and using the OpenGL2 backend I have noticed that when exporting to vector graphics formats such as PDF and SVG using vtkGL2PSExporter a large part of the scene is rasterized.</div><div>I have a 2D scene with a vtkPolyDataMapper and some axis (vtkCubeAxesActor2D), the camera is set to parallel projection.</div><div>When I try to export the scene to PDF or SVG using vtkGL2PSExporter the vtkPolyData is rasterized, while the axis (including labels etc) is exported in vector graphics.</div><div><br></div><div>I tried fiddling around with the parameters of vtkGL2PSExporter, but I wasn't able to achieve all-vector-graphics like with VTK 8.0 and (old) OpenGL backend.</div><div><br></div><div>Has anyone a clue how to create a non-rasterized output? When debugging the code, I saw that vtkGL2PSExporter rasterizes the background, but why is the vtkPolyDataMapper considered to be background?<br></div><div><br></div><div>I also tried exporting the same vtkPolyData with ParaView (5.5.1 64bit Windows) to PDF or SVG, and I have the same effect there, the polydata is rasterized.</div><div><br></div><div>Regards</div><div>Roman</div><div><br></div><div><br><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div style="text-align:center"><div dir="ltr"><div><div dir="ltr"><div style="text-align:left"><font size="2"><span style="font-family:arial,helvetica,sans-serif"></span></font><span></span></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div></div></div></div>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">https://public.kitware.com/mailman/listinfo/vtkusers</a><br>
</blockquote></div>
</blockquote></div><br><br clear="all"><br>-- <br><div class="m_-533099038093434747gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div style="text-align:center"><div dir="ltr"><div><div dir="ltr"><div style="text-align:left"><span style="color:black" lang="EN-US"></span><font size="2"><span style="font-family:arial,helvetica,sans-serif"></span></font><font size="2"><span style="font-family:arial,helvetica,sans-serif"></span></font><font size="2"><span style="font-family:arial,helvetica,sans-serif"></span></font><br><font size="2"><span style="font-family:arial,helvetica,sans-serif">Fluxim AG</span></font><br><font size="2"><span style="font-family:arial,helvetica,sans-serif"></span></font><font size="2"><span style="font-family:arial,helvetica,sans-serif">Roman Hiestand</span></font><br><font size="2"><span style="font-family:arial,helvetica,sans-serif"></span></font><font size="2"><span style="font-family:arial,helvetica,sans-serif">Katharina-Sulzer-Platz 2</span></font><br><font size="2"><span style="font-family:arial,helvetica,sans-serif"></span></font><font size="2"><span style="font-family:arial,helvetica,sans-serif">8406 Winterthur</span></font><br><font size="2"><span style="font-family:arial,helvetica,sans-serif"></span></font><font size="2"><span style="font-family:arial,helvetica,sans-serif">Switzerland</span></font><br><font size="2"><span style="font-family:arial,helvetica,sans-serif"></span></font><font size="2"><span style="font-family:arial,helvetica,sans-serif"></span></font><br><font size="2"><span style="font-family:arial,helvetica,sans-serif"></span></font><br><font size="2"><span style="font-family:arial,helvetica,sans-serif"><a href="http://www.fluxim.com" target="_blank">www.fluxim.com</a></span></font><br><font size="2"><span style="font-family:arial,helvetica,sans-serif"></span></font><font size="2"><span style="font-family:arial,helvetica,sans-serif">Email: <a href="mailto:roman.hiestand@fluxim.com" target="_blank">roman.hiestand@fluxim.com</a></span></font><br><font size="2"><span style="font-family:arial,helvetica,sans-serif"></span></font><font size="2"><span style="font-family:arial,helvetica,sans-serif">Phone: +41 44 500 4770</span></font><br><font size="2"><span style="font-family:arial,helvetica,sans-serif"></span></font><font size="2"><span style="font-family:arial,helvetica,sans-serif">Fax: +41 44 500 4779</span></font><span></span></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div>
</blockquote></div>