<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
<br><span style="" lang="EN-US">I have a rendering
scene with more than a hundred pickable VTK Actors (which can be modified/moved/changed when selected).</span><div id="msgParts" class="MsgPartsContainer ClearBoth"><div class="HasLayout"><div class=" Expanded"><div style="z-index: 1;" class="ReadMsgContainer HasLayout ClearBoth FullPart NoHistory Read RmIc HideH HideShadows"><div id="mp0_ctr"><div id="mp0_msgPartFullBody" class="MsgPartBody FullBody ClearBoth"><div><div id="mpf0_readMsgBodyContainer" class="ReadMsgBody"><div class="SandboxScopeClass ExternalClass" id="mpf0_MsgContainer">

<p class="ecxMsoNormal"><span style="" lang="EN-US">Each VTK
Actor will be closely linked (conceptually speaking!) with an object, 
one for each individual Actor, which contains data and procedures to 
create and modify the Actor.</span></p><p class="ecxMsoNormal"><br></p><p class="ecxMsoNormal">So
 when an Actor is picked I would like to quickly also find the object 
that is the "custodian" the Actor and not only the Actor itself.<br></p><p class="ecxMsoNormal"><br><span style="" lang="EN-US"> </span></p><span style="" lang="EN-US">The idea is
that PropPicker is used to identify the Actor, and from that it’s “custodian" (some python pseudocode below)</span>

<p class="ecxMsoNormal"><span style="" lang="EN-US"><br></span></p><p class="ecxMsoNormal"><span style="" lang="EN-US">Anyone who knows
an easy way to make this work (something essential that I have missed)?</span></p>


<p class="ecxMsoNormal"><span style="" lang="EN-US"><br></span></p>


<p class="ecxMsoNormal"><span style="" lang="EN-US">Thanks and Rgds Gary</span></p><p class="ecxMsoNormal"><span style="" lang="EN-US"><br></span></p><p class="ecxMsoNormal"><span style="" lang="EN-US">--------------<br></span></p><p class="ecxMsoNormal"><span style="" lang="EN-US">&nbsp;</span></p><p class="ecxMsoNormal"><span style="" lang="EN-US">#python pseudocode++:<br></span></p><p class="ecxMsoNormal">&nbsp;</p>

<p class="ecxMsoNormal">def takeAction(obj=custodian:</p><p class="ecxMsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #do something cool<br></p><p class="ecxMsoNormal"><br></p><p class="ecxMsoNormal">def _LeftButtonPressEvent(iren):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Find picked Actor<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (x, y) = iren.GetEventPosition()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.propPick = vtk.vtkPropPicker()<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; selectedActor = self.propPick.GetActor()</p><p class="ecxMsoNormal"><br></p><p class="ecxMsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Find Actor's 'custodian' object</p><p class="ecxMsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; custodian = &lt;HOW TO FIND THIS ONE??&gt; </p><p class="ecxMsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; takeAction(custodian)<br></p><br><br><p class="ecxMsoNormal">#Create 'custodian' objects for each vtkActor</p><p class="ecxMsoNormal">#which also create the Actors immediately (and the pipeline behind)<br><span style="" lang="EN-US"></span></p><p class="ecxMsoNormal">item1 = Item(resolution=5, type='circle', radius=0.9)</p><p class="ecxMsoNormal">item2 = Item(resolution=10, type='shoulder', width=4.2, length=7.8)<br><span style="" lang="EN-US"></span></p><p class="ecxMsoNormal"><span style="" lang="EN-US"><br></span></p><p class="ecxMsoNormal"><span style="" lang="EN-US">#retrieve actors<br></span></p><p class="ecxMsoNormal"><span style="" lang="EN-US">actor1 =
item1.GetActor()</span></p>

<p class="ecxMsoNormal"><span style="" lang="EN-US">actor2 = item2.GetActor()</span><span style="" lang="EN-US"></span></p>

<p class="ecxMsoNormal"><span style="" lang="EN-US"><br></span></p><p class="ecxMsoNormal"><span style="" lang="EN-US">#rendering scene<br></span></p><p class="ecxMsoNormal"><span style="" lang="EN-US">ren = vtk.vtkRenderer()<br>renWin = vtk.vtkRenderWindow()<br>renWin.SetSize(700,700)<br>renWin.AddRenderer(self.ren)<br>iren = vtk.vtkRenderWindowInteractor()<br></span></p><p class="ecxMsoNormal"><span style="" lang="EN-US">iren.SetRenderWindow(self.renWin)<br>
</span><span style="" lang="EN-US">iren.SetInteractorStyle(None)<br>iren.AddObserver("LeftButtonPressEvent", ButtonEvent)<br></span></p><p class="ecxMsoNormal"><span style="" lang="EN-US">ren.AddActor(actor1)</span></p><p class="ecxMsoNormal"><span style="" lang="EN-US">ren.AddActor(actor2)</span></p></div></div></div></div></div></div></div></div></div>                                               </body>
</html>