<div dir="ltr"><div class="gmail_default" style="font-size:small">Ok</div><div class="gmail_default" style="font-size:small">I have got it.</div><div class="gmail_default" style="font-size:small">This works:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><pre style="color:rgb(0,0,0);font-family:"Courier New";font-size:9pt"><pre style="font-family:"Courier New";font-size:9pt"><span style="color:rgb(0,0,128);font-weight:bold">def </span>DummyFunc(<span style="color:rgb(128,128,128)">obj</span>, ev):<br> <span style="color:rgb(0,0,128)">print</span>(ev, DummyFunc.data)<br><br>DummyFunc.data = renwin<br><span style="color:rgb(128,128,128);font-style:italic"># How do I pass my obj_2 ?<br></span>interactor.AddObserver(<span style="color:rgb(0,128,128);font-weight:bold">'LeftButtonPressEvent'</span>, DummyFunc)<br></pre></pre></div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_default" style="font-size:small">David, you may be able to explain this better than I can but I assume this is what happens:</div><div class="gmail_quote"><div class="gmail_default" style="font-size:small"> Here we are adding a new attribute to DummyFunc. We can do this because Python functions are in fact objects.</div><br></div><div class="gmail_quote"><div class="gmail_default" style="font-size:small">This is something totally strange to C++ programmers!</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">What a neat approach!</div><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote">On Sun, Nov 12, 2017 at 8:59 AM, Andrew Maclean <span dir="ltr"><<a href="mailto:andrew.amaclean@gmail.com" target="_blank">andrew.amaclean@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="font-size:small">David,</div><div style="font-size:small"><br></div><div style="font-size:small">When I try this I get:</div><div>TypeError: DummyFunc() missing 1 required positional argument: 'data'<br></div><div style="font-size:small"><br></div><div style="font-size:small">I used a slightly different approach in <a href="https://lorensen.github.io/VTKExamples/site/Python/VisualizationAlgorithms/StreamlinesWithLineWidget/" target="_blank">https://lorensen.github.io/<wbr>VTKExamples/site/Python/<wbr>VisualizationAlgorithms/<wbr>StreamlinesWithLineWidget/</a> </div><div style="font-size:small"><br></div><div style="font-size:small">Regards</div><div style="font-size:small"> Andrew</div><div class="gmail_extra"><br><div class="gmail_quote"><div style="font-size:small;display:inline"></div> 2. Re: <div style="font-size:small;display:inline"></div>SetClientData in python (David Gobbi)<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">---------- Forwarded message ----------<br>From: David Gobbi <<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>><br>To:<div style="font-size:small;display:inline"></div> "Serge K." <<a href="mailto:skab12@gmail.com" target="_blank">skab12@gmail.com</a>><br>Cc: VTK Users <<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>><br>Bcc: <br>Date: Fri, 10 Nov 2017 11:17:26 -0700<br>Subject: Re: [vtkusers] SetClientData in python<br><div dir="ltr"><div>Hi Serge,</div><div><br></div><div>The way to do this in Python is to add attributes to your callback function.</div><div><br></div><div> def DummyFunc(obj, ev, data):</div><div> print(ev, data)</div><div><br></div><div> <div style="font-size:small;display:inline"></div>DummyFunc.CallData = whatever</div><div><br></div><div> interactor.AddObserver('LeftBu<wbr>ttonPressEvent', DummyFunc)<br></div><div><br></div><div>So the vtkCallbackCommand really isn't needed in Python (and, as you have noticed, it really can't be used in Python anyway).</div><div><br></div><div> - David</div><div><br></div><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 10, 2017 at 10:32 AM, Serge K. <span dir="ltr"><<a href="mailto:skab12@gmail.com" target="_blank">skab12@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi All, <div><br></div><div>I am playing with MouseEventObserver.py example and I would like to add a ClientData on my callback function. There are many examples in C++ like this one: <a href="https://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/ClientData" target="_blank">https://www.vtk.org/Wiki/<wbr>VTK/Examples/Cxx/Interaction/C<wbr>lientData</a></div><div><br></div><div>However, I do not know how to do that in Python.</div><div><br></div><div>Indeed, if I create a <span style="background-color:rgb(249,249,249);color:rgb(0,0,0);font-family:monospace,monospace;font-size:1em">vtkCallbackCommand</span> , SetCal<wbr>lBack function does not exist.</div><div><br></div><div>Any Idea? Thanks for your answer.</div><div><br></div><div>Serge</div><div><br></div><div>ps: python36 - vtk 7.1.1</div><div> </div><div><br></div><div><pre style="box-sizing:inherit;color:rgb(55,71,79);font-feature-settings:'kern' 1;font-family:"Roboto Mono","Courier New",Courier,monospace;background-color:transparent;font-size:13.6px;margin-top:0px;margin-bottom:0px;border-radius:0.2rem;line-height:1.4;padding:1.05rem 1.2rem;overflow:auto;vertical-align:top"><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-ch" style="box-sizing:inherit;color:rgb(153,153,153)"><div style="font-size:small;display:inline"></div>#!/usr/bin/env python</span>
<span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-kn" style="box-sizing:inherit;color:rgb(59,120,231)">from</span> <span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-nn" style="box-sizing:inherit;color:rgb(236,64,122)">__future__</span> <span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-kn" style="box-sizing:inherit;color:rgb(59,120,231)">import</span> <span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">print_function</span>
<span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-hll" style="box-sizing:inherit;display:block;padding:0px 1.2rem;background-color:rgba(240,240,240,0.8)"><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-kn" style="box-sizing:inherit;color:rgb(59,120,231)">import</span> <span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-nn" style="box-sizing:inherit;color:rgb(236,64,122)">vtk</span>
</span>
<span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-hll" style="box-sizing:inherit;display:block;padding:0px 1.2rem;background-color:rgba(240,240,240,0.8)"><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">source</span> <span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-o" style="box-sizing:inherit;color:inherit">=</span> <span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">vtk</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-o" style="box-sizing:inherit;color:inherit">.</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">vtkSphereSource</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">()</span>
</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">source</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-o" style="box-sizing:inherit;color:inherit">.</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">SetCenter</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">(</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-mi" style="box-sizing:inherit;color:rgb(231,76,60)">0</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">,</span> <span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-mi" style="box-sizing:inherit;color:rgb(231,76,60)">0</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">,</span> <span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-mi" style="box-sizing:inherit;color:rgb(231,76,60)">0</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">)</span>
<span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">source</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-o" style="box-sizing:inherit;color:inherit">.</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">SetRadius</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">(</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-mi" style="box-sizing:inherit;color:rgb(231,76,60)">1</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">)</span>
<span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">source</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-o" style="box-sizing:inherit;color:inherit">.</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">Update</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">()</span>
<span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-hll" style="box-sizing:inherit;display:block;padding:0px 1.2rem;background-color:rgba(240,240,240,0.8)"><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">mapper</span> <span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-o" style="box-sizing:inherit;color:inherit">=</span> <span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">vtk</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-o" style="box-sizing:inherit;color:inherit">.</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">vtkPolyDataMapper</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">()</span>
</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">mapper</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-o" style="box-sizing:inherit;color:inherit">.</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">SetInputConnection</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">(</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">sour<wbr>ce</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-o" style="box-sizing:inherit;color:inherit">.</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">GetOutputPort</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">())</span>
<span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-hll" style="box-sizing:inherit;display:block;padding:0px 1.2rem;background-color:rgba(240,240,240,0.8)"><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">actor</span> <span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-o" style="box-sizing:inherit;color:inherit">=</span> <span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">vtk</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-o" style="box-sizing:inherit;color:inherit">.</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">vtkActor</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">()</span>
</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">actor</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-o" style="box-sizing:inherit;color:inherit">.</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">SetMapper</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">(</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">mapper</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">)</span>
<span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-hll" style="box-sizing:inherit;display:block;padding:0px 1.2rem;background-color:rgba(240,240,240,0.8)"><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">renderer</span> <span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-o" style="box-sizing:inherit;color:inherit">=</span> <span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">vtk</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-o" style="box-sizing:inherit;color:inherit">.</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">vtkRenderer</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">()</span>
</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">renderer</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-o" style="box-sizing:inherit;color:inherit">.</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">SetBackground</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">(</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-mi" style="box-sizing:inherit;color:rgb(231,76,60)">1</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">,</span> <span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-mi" style="box-sizing:inherit;color:rgb(231,76,60)">1</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">,</span> <span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-mi" style="box-sizing:inherit;color:rgb(231,76,60)">1</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">)</span>
<span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">renderer</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-o" style="box-sizing:inherit;color:inherit">.</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">AddActor</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">(</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">actor</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">)</span>
<span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-hll" style="box-sizing:inherit;display:block;padding:0px 1.2rem;background-color:rgba(240,240,240,0.8)"><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">renwin</span> <span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-o" style="box-sizing:inherit;color:inherit">=</span> <span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">vtk</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-o" style="box-sizing:inherit;color:inherit">.</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">vtkRenderWindow</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">()</span>
</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">renwin</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-o" style="box-sizing:inherit;color:inherit">.</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">AddRenderer</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">(</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">renderer</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">)</span>
<span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-hll" style="box-sizing:inherit;display:block;padding:0px 1.2rem;background-color:rgba(240,240,240,0.8)"><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">interactor</span> <span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-o" style="box-sizing:inherit;color:inherit">=</span> <span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">vtk</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-o" style="box-sizing:inherit;color:inherit">.</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">vtkRenderWindowInteractor</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">(<wbr>)</span>
</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-hll" style="box-sizing:inherit;display:block;padding:0px 1.2rem;background-color:rgba(240,240,240,0.8)"><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">interactor</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-o" style="box-sizing:inherit;color:inherit">.</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">SetInteractorStyle</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">(</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit"><wbr>vtk</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-o" style="box-sizing:inherit;color:inherit">.</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">vtkInteractorStyleTrackbal<wbr>lCamera</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">())</span>
</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">interactor</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-o" style="box-sizing:inherit;color:inherit">.</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">SetRenderWindow</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">(</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">ren<wbr>win</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">)</span>
<span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-k" style="box-sizing:inherit;color:rgb(59,120,231)">def</span> <span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-nf" style="box-sizing:inherit;color:rgb(194,24,91)">DummyFunc</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">(</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">obj</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">,</span> <span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">ev, my_obj_2</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">):</span>
<span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-k" style="box-sizing:inherit;color:rgb(59,120,231)">print</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">(</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-s2" style="box-sizing:inherit;color:rgb(13,144,79)">obj, my_obj_2</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">)</span>
# obj_2 = vtk.whatever()
<span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-c1" style="box-sizing:inherit;color:rgb(153,153,153)"># How do I pass my obj_2 ? </span>
<span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">interactor</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-o" style="box-sizing:inherit;color:inherit">.</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">AddObserver</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">(</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-s1" style="box-sizing:inherit;color:rgb(13,144,79)">'LeftBu<wbr>ttonPressEvent'</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">,</span> <span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">DummyFunc</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">)</span>
<span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">interactor</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-o" style="box-sizing:inherit;color:inherit">.</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">Initialize</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">()</span>
<span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">interactor</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-o" style="box-sizing:inherit;color:inherit">.</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-n" style="box-sizing:inherit">Start</span><span class="gmail-m_-6893549548514988956gmail-m_1312691308307342834gmail-m_-3980039467529281132gmail-p" style="box-sizing:inherit">()</span></pre></div></div></blockquote></div></div></div>
<br><br></blockquote></div><span class="gmail-HOEnZb"><font color="#888888"><div><br></div>-- <br><div class="gmail-m_-6893549548514988956gmail_signature">______________________________<wbr>_____________<br>Andrew J. P. Maclean<br><br>______________________________<wbr>_____________</div>
</font></span></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">___________________________________________<br>Andrew J. P. Maclean<br><br>___________________________________________</div>
</div></div>