<div dir="ltr"><div>Hi David,</div><div>Thanks for pointing out, <br></div><div>Just to be clear InsertValue(id, val) trows error because val should be int, I tried InsertTuple(id, tuple) it didn't throw an error but didn't work either. End up re-initializing the vtk.vtkUnsignedCharArray in def select_color(self) as<br></div><div> self.colors = vtk.vtkUnsignedCharArray()<br> self.colors.SetNumberOfComponents(4)</div><div><br></div><div>and it works smooth. :)</div><div><br></div><div>Thanks,<br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Jun 5, 2018 at 11:41 PM David E DeMarle <<a href="mailto:dave.demarle@kitware.com">dave.demarle@kitware.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">Hi Ahishek,<div><br></div><div>It looks to me like you are appending to the end of the self.colors. Call self.colors.GetNumberOfTuples() to verify that.</div><div>If you fix (do replacement with Insertvalue(id, value) instead of InserNextValue(value)) I think it will do what you are trying to do.</div><div><br></div><div>hth</div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="m_-5699322465623920039gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>David E DeMarle<br>Kitware, Inc.<br>Principal Engineer<br><a href="https://maps.google.com/?q=21+Corporate+Drive+Clifton+Park,+NY+12065&entry=gmail&source=g">21 Corporate Drive</a><br><a href="https://maps.google.com/?q=21+Corporate+Drive+Clifton+Park,+NY+12065&entry=gmail&source=g">Clifton Park, NY 12065</a>-8662<br>Phone: 518-881-4909</div></div></div></div></div></div>
<br><div class="gmail_quote"></div></div><div class="gmail_extra"><div class="gmail_quote">On Mon, Jun 4, 2018 at 8:35 PM, Abhishek <span dir="ltr"><<a href="mailto:abhishekworld@gmail.com" target="_blank">abhishekworld@gmail.com</a>></span> wrote:<br></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Greetings,</div><div>I am new to VTK so may be my question is very basic.</div><div><br></div><div>I have following code, where the aim is to be able to change the lines colors using dynamically based on data we get from <code>QColorDialog</code>. if I apply the color directly to <code>vtkActor</code> and re-render the window then it just works fine.
But eventually I wan to be able to change individual line Points color and thats why I am setting <code>self.linesPolyData.GetCellData().SetScalars(self.colors)</code> when I change the color using <code>QPushButton</code> in function <code>def select_color(self):</code> it doesn't re-render the lines with new color. What am I doing wrong?</div><div><br></div><div><pre class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-lang-py m_-5699322465623920039m_-3442476987470343207inbox-inbox-prettyprint m_-5699322465623920039m_-3442476987470343207inbox-inbox-prettyprinted"><code><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-kwd">from</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">Analysis</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">Channel</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-kwd">import</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">*</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-kwd">import</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> vtk
</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-kwd">import</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> numpy </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-kwd">as</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> np
</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-kwd">import</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> itertools
</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-kwd">import</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> sys
</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-kwd">import</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> math
</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-kwd">from</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">PyQt5</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-kwd">import</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">QtGui</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">,</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">QtCore</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-kwd">from</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">PyQt5</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">QtWidgets</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-kwd">import</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">QApplication</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">,</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">QWidget</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">,</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">QGridLayout</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">,</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">QScrollArea</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">,</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">QPushButton</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">,</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">QColorDialog</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-kwd">from</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> vtk</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">qt</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">QVTKRenderWindowInteractor</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-kwd">import</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">QVTKRenderWindowInteractor</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-com"># Qt Class which will render the objects</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-kwd">class</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">MainWindow</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">(</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">QWidget</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">):</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-kwd">def</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> __init__</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">(</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">,</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> parent </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">=</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-kwd">None</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">):</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
super</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">().</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">__init__</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">()</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">layout </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">=</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">QGridLayout</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">(</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">)</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">color_button </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">=</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">QPushButton</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">(</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-str">'Select Color'</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">)</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">layout</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">addWidget</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">(</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">color_button</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">)</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">color_button</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">clicked</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">connect</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">(</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">select_color</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">)</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">color </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">=</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">[</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-lit">255</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">,</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-lit">255</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">,</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-lit">0</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">,</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-lit">255</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">]</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">colors </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">=</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> vtk</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">vtkUnsignedCharArray</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">()</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">colors</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">SetNumberOfComponents</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">(</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-lit">4</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">)</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-com"># Create the polydata where we will store all the geometric data</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">linesPolyData </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">=</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> vtk</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">vtkPolyData</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">()</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-com"># Create three points</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
origin </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">=</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">[</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-lit">0.0</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">,</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-lit">0.0</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">,</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-lit">0.0</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">]</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
p0 </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">=</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">[</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-lit">1.0</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">,</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-lit">0.0</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">,</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-lit">0.0</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">]</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
p1 </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">=</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">[</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-lit">0.0</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">,</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-lit">1.0</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">,</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-lit">0.0</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">]</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-com"># Create a vtkPoints container and store the points in it</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
pts </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">=</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> vtk</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">vtkPoints</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">()</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
pts</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">InsertNextPoint</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">(</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">origin</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">)</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
pts</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">InsertNextPoint</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">(</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">p0</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">)</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
pts</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">InsertNextPoint</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">(</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">p1</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">)</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">linesPolyData</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">SetPoints</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">(</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">pts</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">)</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-com"># Create the first line (between Origin and P0)</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
line0 </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">=</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> vtk</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">vtkLine</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">()</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
line0</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">GetPointIds</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">().</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">SetId</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">(</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-lit">0</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">,</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-lit">0</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">)</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-com"># the second 0 is the index of the Origin in linesPolyData's points</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
line0</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">GetPointIds</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">().</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">SetId</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">(</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-lit">1</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">,</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-lit">1</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">)</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-com"># the second 1 is the index of P0 in linesPolyData's points</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-com"># Create the second line (between Origin and P1)</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
line1 </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">=</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> vtk</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">vtkLine</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">()</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
line1</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">GetPointIds</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">().</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">SetId</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">(</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-lit">0</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">,</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-lit">0</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">)</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-com"># the second 0 is the index of the Origin in linesPolyData's points</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
line1</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">GetPointIds</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">().</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">SetId</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">(</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-lit">1</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">,</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-lit">2</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">)</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-com"># 2 is the index of P1 in linesPolyData's points</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">lines </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">=</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> vtk</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">vtkCellArray</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">()</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">lines</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">InsertNextCell</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">(</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">line0</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">)</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">lines</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">InsertNextCell</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">(</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">line1</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">)</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-com"># Add the lines to the polydata container</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">linesPolyData</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">SetLines</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">(</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">lines</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">)</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-kwd">for</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> i </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-kwd">in</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> range</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">(</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-lit">0</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">,</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">lines</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">GetNumberOfCells</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">()):</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">colors</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">InsertNextTuple</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">(</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">color</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">)</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">linesPolyData</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">GetCellData</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">().</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">SetScalars</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">(</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">colors</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">)</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">mapper </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">=</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> vtk</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">vtkPolyDataMapper</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">()</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">mapper</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">SetInputData</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">(</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">linesPolyData</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">)</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">actor </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">=</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> vtk</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">vtkActor</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">()</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">actor</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">SetMapper</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">(</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">mapper</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">)</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">actor</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">GetProperty</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">().</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">SetLineWidth</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">(</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-lit">4</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">)</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">vtk_widget </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">=</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">QVTKRenderWindowInteractor</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">()</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-com"># vtk_widget.setMinimumSize(round(1024/3), round(1024/3))</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
ren </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">=</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> vtk</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">vtkRenderer</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">()</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">vtk_widget</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">GetRenderWindow</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">().</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">AddRenderer</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">(</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">ren</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">)</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
ren</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">AddActor</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">(</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">actor</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">)</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
ren</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">ResetCamera</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">()</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
interactor </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">=</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">vtk_widget</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">GetRenderWindow</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">().</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">GetInteractor</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">()</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
interactor</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">Initialize</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">()</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
interactor</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">Start</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">()</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">layout</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">addWidget</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">(</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">vtk_widget</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">)</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-kwd">def</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> select_color</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">(</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">):</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
color </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">=</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">QColorDialog</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">getColor</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">(</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">QtCore</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">Qt</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">green</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">,</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">)</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-kwd">if</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> color</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">isValid</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">():</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">color </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">=</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> color</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">getRgb</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">()</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-kwd">for</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> i </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-kwd">in</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> range</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">(</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-lit">0</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">,</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">lines</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">GetNumberOfCells</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">()):</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">colors</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">InsertNextTuple</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">(</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">color</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">)</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">linesPolyData</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">GetCellData</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">().</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">SetScalars</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">(</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">colors</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">)</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">mapper</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">SetInputData</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">(</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">linesPolyData</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">)</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">linesPolyData</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">Modified</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">()</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">mapper</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">Modified</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">()</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-com"># self.actor.GetProperty().Modified()</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
self</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">vtk_widget</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">Render</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">()</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-kwd">if</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> __name__ </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">==</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-str">'__main__'</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">:</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
app </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">=</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">QApplication</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">(</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">sys</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">argv</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">)</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
win </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">=</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln"> </span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-typ">MainWindow</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">()</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
win</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">show</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">()</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">
sys</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">exit</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">(</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">app</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">.</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pln">exec_</span><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">())<br><span style="font-family:serif"><font size="2"><br></font></span></span></code></pre><pre class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-lang-py m_-5699322465623920039m_-3442476987470343207inbox-inbox-prettyprint m_-5699322465623920039m_-3442476987470343207inbox-inbox-prettyprinted"><span style="font-family:serif"><font size="2"><code><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun">--<br></span></code></font></span></pre><pre class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-lang-py m_-5699322465623920039m_-3442476987470343207inbox-inbox-prettyprint m_-5699322465623920039m_-3442476987470343207inbox-inbox-prettyprinted"><code><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun"><font size="2"><span style="font-family:serif">Abhishek</span><br></font></span></code></pre><pre class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-lang-py m_-5699322465623920039m_-3442476987470343207inbox-inbox-prettyprint m_-5699322465623920039m_-3442476987470343207inbox-inbox-prettyprinted"><code><span class="m_-5699322465623920039m_-3442476987470343207inbox-inbox-pun"><font size="2"><span style="font-family:serif"><a href="http://zeroth.me" target="_blank">zeroth.me</a></span><span class="m_-5699322465623920039HOEnZb"><font color="#888888"><br></font></span></font></span></code></pre></div></div><span class="m_-5699322465623920039HOEnZb"><font color="#888888">-- <br><div dir="ltr" class="m_-5699322465623920039m_-3442476987470343207gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Abhishek Patil<br></div><a href="http://zeroth.me" target="_blank">zeroth.me</a><br></div></div>
</font></span><br></blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">_______________________________________________<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>
<br></blockquote></div><br></div>
</blockquote></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Abhishek Patil<br></div><a href="http://zeroth.me">zeroth.me</a><br></div></div>