<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Hi,</div><div>Could this be related to the problem I asked about a few days ago? I haven't had any responses.</div>
<div><span style="font-family:'.HelveticaNeueUI';font-size:15px;line-height:19px;white-space:nowrap"><a href="http://www.vtk.org/pipermail/vtkusers/2012-December/126783.html">http://www.vtk.org/pipermail/vtkusers/2012-December/126783.html</a></span></div>
<div><span style="font-family:'.HelveticaNeueUI';font-size:15px;line-height:19px;white-space:nowrap"><br></span></div><div>Thanks</div><div>Craig<br></div><div><br>On 11 Dec 2012, at 18:27, David Gobbi <<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>> wrote:<br>
<br></div><blockquote type="cite"><div><span>Hi David,</span><br><span></span><br><span>You can get the polyline picking to work by increasing the tolerance:</span><br><span></span><br><span>self.cellPicker.SetTolerance(0.005)</span><br>
<span></span><br><span>I'll continue looking through the code to see why the new code</span><br><span>behaves differently from the old, though. I suspect there have</span><br><span>been minor changes to the way that tolerances are applied.</span><br>
<span></span><br><span> - David</span><br><span></span><br><span></span><br><span>On Tue, Dec 11, 2012 at 10:51 AM, David vanEe <<a href="mailto:david.vanee@convergent.ca">david.vanee@convergent.ca</a>> wrote:</span><br>
<blockquote type="cite"><span>Sure, this version will work with just python/vtk. Thanks for taking a look.</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span></span><br>
</blockquote><blockquote type="cite"><span>import vtk</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>class MyInteractorStyle(vtk.vtkInteractorStyleTrackballCamera):</span><br>
</blockquote><blockquote type="cite"><span> def __init__(self, actorData, actorList):</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span> self.actorData = actorData</span><br>
</blockquote><blockquote type="cite"><span> self.actorList = actorList</span><br></blockquote><blockquote type="cite"><span> self.cellPicker = vtk.vtkCellPicker()</span><br></blockquote><blockquote type="cite">
<span></span><br></blockquote><blockquote type="cite"><span> self.AddObserver("MouseMoveEvent", self.OnMotion)</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite">
<span> def OnMotion(self, obj, event):</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span> iren = obj.GetInteractor()</span><br></blockquote><blockquote type="cite">
<span> renwin = iren.GetRenderWindow()</span><br></blockquote><blockquote type="cite"><span> ren = renwin.GetRenderers().GetFirstRenderer()</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote>
<blockquote type="cite"><span> x, y = iren.GetEventPosition()</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span> # invert Y value</span><br></blockquote>
<blockquote type="cite"><span> actualY = ren.GetSize()[1] - y</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span> # dim all actors</span><br></blockquote>
<blockquote type="cite"><span> for (index, actor) in enumerate(self.actorList):</span><br></blockquote><blockquote type="cite"><span> (zValue, cellType, dimColor, brightColor) = self.actorData[index]</span><br>
</blockquote><blockquote type="cite"><span> actor.GetProperty().SetDiffuseColor(*dimColor)</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span> self.cellPicker.Pick(x, actualY, 0, ren)</span><br>
</blockquote><blockquote type="cite"><span> dataSet = self.cellPicker.GetDataSet()</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span> if dataSet is not None:</span><br>
</blockquote><blockquote type="cite"><span> # highlight picked actor</span><br></blockquote><blockquote type="cite"><span> for (index, actor) in enumerate(self.actorList):</span><br></blockquote><blockquote type="cite">
<span> if actor.GetMapper().GetInput() == dataSet:</span><br></blockquote><blockquote type="cite"><span> (zOffset, cellType, dimColor, brightColor) = self.actorData[index]</span><br></blockquote>
<blockquote type="cite"><span> actor.GetProperty().SetDiffuseColor(*brightColor)</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span> renwin.Render()</span><br>
</blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span># simple point coords used by both actors</span><br></blockquote><blockquote type="cite"><span>coords = [(0.0, 0.0),</span><br>
</blockquote><blockquote type="cite"><span> (1.0, 0.0),</span><br></blockquote><blockquote type="cite"><span> (1.0, 1.0),</span><br></blockquote><blockquote type="cite"><span> (0.0, 1.0)]</span><br>
</blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>actorData = [(1.0, vtk.VTK_POLY_LINE, (0.5,0.0,0.0), (1.0, 0.0, 0.0)),</span><br></blockquote><blockquote type="cite"><span> (0.0, vtk.VTK_QUAD, (0.0, 0.0, 0.5), (0.0, 0.0, 1.0))]</span><br>
</blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>ren = vtk.vtkRenderer()</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite">
<span>renwin = vtk.vtkRenderWindow()</span><br></blockquote><blockquote type="cite"><span>renwin.AddRenderer(ren)</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>actorList = []</span><br>
</blockquote><blockquote type="cite"><span>for data in actorData:</span><br></blockquote><blockquote type="cite"><span> (zValue, cellType, dimColor, brightColor) = data</span><br></blockquote><blockquote type="cite"><span></span><br>
</blockquote><blockquote type="cite"><span> points = vtk.vtkPoints()</span><br></blockquote><blockquote type="cite"><span> for (pointIndex, coord) in enumerate(coords):</span><br></blockquote><blockquote type="cite">
<span> points.InsertPoint(pointIndex, coord[0], coord[1], zValue)</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span> idList = vtk.vtkIdList()</span><br></blockquote>
<blockquote type="cite"><span> idList.SetNumberOfIds(len(coords))</span><br></blockquote><blockquote type="cite"><span> for pointIndex in range(len(coords)):</span><br></blockquote><blockquote type="cite"><span> idList.SetId(pointIndex, pointIndex)</span><br>
</blockquote><blockquote type="cite"><span> cells = vtk.vtkCellArray()</span><br></blockquote><blockquote type="cite"><span> cells.InsertNextCell(idList)</span><br></blockquote><blockquote type="cite"><span></span><br>
</blockquote><blockquote type="cite"><span> grid = vtk.vtkUnstructuredGrid()</span><br></blockquote><blockquote type="cite"><span> grid.SetPoints(points)</span><br></blockquote><blockquote type="cite"><span> grid.SetCells(cellType, cells)</span><br>
</blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span> mapper = vtk.vtkDataSetMapper()</span><br></blockquote><blockquote type="cite"><span> mapper.SetInput(grid)</span><br>
</blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span> actor = vtk.vtkActor()</span><br></blockquote><blockquote type="cite"><span> actor.SetMapper(mapper)</span><br></blockquote>
<blockquote type="cite"><span> actor.GetProperty().SetRepresentation(1)</span><br></blockquote><blockquote type="cite"><span> actor.GetProperty().SetLineWidth(5.0)</span><br></blockquote><blockquote type="cite"><span> actor.GetProperty().SetDiffuseColor(*dimColor)</span><br>
</blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span> ren.AddActor(actor)</span><br></blockquote><blockquote type="cite"><span> actorList.append(actor)</span><br></blockquote>
<blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>interactor = vtk.vtkRenderWindowInteractor()</span><br></blockquote><blockquote type="cite"><span>interactor.SetInteractorStyle(MyInteractorStyle(actorData, actorList))</span><br>
</blockquote><blockquote type="cite"><span>interactor.SetRenderWindow(renwin)</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>interactor.Initialize()</span><br></blockquote>
<blockquote type="cite"><span>interactor.Start()</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span></span><br>
</blockquote><blockquote type="cite"><span>-----Original Message-----</span><br></blockquote><blockquote type="cite"><span>From: David Gobbi [<a href="mailto:david.gobbi@gmail.com">mailto:david.gobbi@gmail.com</a>]</span><br>
</blockquote><blockquote type="cite"><span>Sent: Tuesday, December 11, 2012 9:08 AM</span><br></blockquote><blockquote type="cite"><span>To: David vanEe</span><br></blockquote><blockquote type="cite"><span>Cc: <a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a></span><br>
</blockquote><blockquote type="cite"><span>Subject: Re: [vtkusers] vtkCellPicker failing to pick vtkPolyLine (using Python and wx)</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite">
<span>Hi David,</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>I was the one who made the changes to the vtkCellPicker code, and I'd be glad to investigate to see why the behavior changed.</span><br>
</blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Can you send me an example that uses just python, i.e. no wx?</span><br></blockquote><blockquote type="cite"><span></span><br>
</blockquote><blockquote type="cite"><span> - David</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>On Tue, Dec 11, 2012 at 9:26 AM, David vanEe <<a href="mailto:david.vanee@convergent.ca">david.vanee@convergent.ca</a>> wrote:</span><br>
</blockquote><blockquote type="cite"><blockquote type="cite"><span>Hi all,</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite">
<blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>I've recently updated my VTK from 5.4 to 5.10.1, and some old</span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>vtkCellPicker code isn't doing what I want anymore. This 'simple'</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">
<span>example works fine in</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>5.4 (both the blue and red actor highlight when you mouse-over them),</span><br></blockquote></blockquote>
<blockquote type="cite"><blockquote type="cite"><span>but in</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>5.10.1 only the blue (quad) actor works. The only difference between</span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>the two actors (aside from coordinates and colors) is the cellType of</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">
<span>vtk.VTK_POLY_LINE vs vtk.VTK_QUAD.</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>I've tried looking for changes in the pick routine, but</span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>vtkCellPicker.cxx has undergone substantial changes and I was unable</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">
<span>to locate the cause. Any suggestions for getting the picker to pick the polyline?</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite">
<blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>Thanks in advance,</span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>Dave</span><br></blockquote></blockquote><blockquote type="cite">
<blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite">
<blockquote type="cite"><span>import wx</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>import vtk</span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite">
<blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>from vtk.wx.wxVTKRenderWindowInteractor import</span><br></blockquote></blockquote><blockquote type="cite">
<blockquote type="cite"><span>wxVTKRenderWindowInteractor</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">
<span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>class myVTKInteractor(wxVTKRenderWindowInteractor):</span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> def __init__(self, parent):</span><br></blockquote>
</blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> wxVTKRenderWindowInteractor.__init__(self, parent, -1)</span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite">
<blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> self.Enable(1)</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">
<span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> self.AddObserver("ExitEvent", lambda o,e,f=self: f.Close())</span><br></blockquote></blockquote><blockquote type="cite">
<blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> self.ren = vtk.vtkRenderer()</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote>
</blockquote><blockquote type="cite"><blockquote type="cite"><span> self.GetRenderWindow().AddRenderer(self.ren)</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite">
<blockquote type="cite"><span> # simple point coords used by both actors</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite">
<blockquote type="cite"><span> coords = [(0.0, 0.0),</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">
<span> (1.0, 0.0),</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> (1.0, 1.0),</span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> (0.0, 1.0)]</span><br></blockquote>
</blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">
<span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> self.actorData = [(1.0, vtk.VTK_POLY_LINE, (0.5,0.0,0.0),</span><br></blockquote></blockquote><blockquote type="cite">
<blockquote type="cite"><span>(1.0, 0.0, 0.0)),</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">
<span> (0.0, vtk.VTK_QUAD, (0.0, 0.0, 0.5), (0.0,</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>0.0, 1.0))]</span><br></blockquote></blockquote><blockquote type="cite">
<blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> self.actorList = []</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote>
</blockquote><blockquote type="cite"><blockquote type="cite"><span> for data in self.actorData:</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote>
<blockquote type="cite"><blockquote type="cite"><span> (zValue, cellType, dimColor, brightColor) = data</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote>
</blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">
<span> points = vtk.vtkPoints()</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> for (pointIndex, coord) in enumerate(coords):</span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> points.InsertPoint(pointIndex, coord[0], coord[1],</span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>zValue)</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite">
<blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> idList = vtk.vtkIdList()</span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> idList.SetNumberOfIds(len(coords))</span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> for pointIndex in range(len(coords)):</span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> idList.SetId(pointIndex, pointIndex)</span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> cells = vtk.vtkCellArray()</span><br></blockquote>
</blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> cells.InsertNextCell(idList)</span><br></blockquote>
</blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">
<span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> grid = vtk.vtkUnstructuredGrid()</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">
<span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> grid.SetPoints(points)</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> grid.SetCells(cellType, cells)</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite">
<blockquote type="cite"><span> mapper = vtk.vtkDataSetMapper()</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite">
<blockquote type="cite"><span> mapper.SetInput(grid)</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">
<span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> actor = vtk.vtkActor()</span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> actor.SetMapper(mapper)</span><br></blockquote>
</blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> actor.GetProperty().SetRepresentation(1)</span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> actor.GetProperty().SetLineWidth(5.0)</span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> actor.GetProperty().SetDiffuseColor(*dimColor)</span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite">
<blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> self.ren.AddActor(actor)</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">
<span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> self.actorList.append(actor)</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">
<span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote>
<blockquote type="cite"><blockquote type="cite"><span> self.cellPicker = vtk.vtkCellPicker()</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote>
<blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">
<span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> def OnMotion(self, event):</span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite">
<blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> # invert Y value</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">
<span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> actualY = self.ren.GetSize()[1] - event.GetY()</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">
<span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote>
<blockquote type="cite"><blockquote type="cite"><span> # dim all actors</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite">
<blockquote type="cite"><span> for (index, actor) in enumerate(self.actorList):</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite">
<blockquote type="cite"><span> (zValue, cellType, dimColor, brightColor) =</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>self.actorData[index]</span><br></blockquote>
</blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> actor.GetProperty().SetDiffuseColor(*dimColor)</span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite">
<blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> self.cellPicker.Pick(event.GetX(), actualY, 0, self.ren)</span><br></blockquote></blockquote>
<blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> dataSet = self.cellPicker.GetDataSet()</span><br></blockquote></blockquote>
<blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">
<span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> if dataSet is not None:</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> # highlight picked actor</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote>
</blockquote><blockquote type="cite"><blockquote type="cite"><span> for (index, actor) in enumerate(self.actorList):</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> if actor.GetMapper().GetInput() == dataSet:</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">
<span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> (zOffset, cellType, dimColor, brightColor) =</span><br></blockquote></blockquote><blockquote type="cite">
<blockquote type="cite"><span>self.actorData[index]</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">
<span> actor.GetProperty().SetDiffuseColor(*brightColor)</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite">
<blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> self.Render()</span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite">
<blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>def wxVTKRenderWindowInteractorExample():</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> app = wx.PySimpleApp()</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote>
</blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">
<span> frame = wx.Frame(None, -1, "wxVTKRenderWindowInteractor",</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>size=(400,400))</span><br></blockquote></blockquote><blockquote type="cite">
<blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> widget = myVTKInteractor(frame)</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote>
</blockquote><blockquote type="cite"><blockquote type="cite"><span> sizer = wx.BoxSizer(wx.VERTICAL)</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote>
<blockquote type="cite"><blockquote type="cite"><span> sizer.Add(widget, 1, wx.EXPAND)</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite">
<blockquote type="cite"><span> frame.SetSizer(sizer)</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">
<span> frame.Layout()</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote>
</blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> frame.Show()</span><br></blockquote></blockquote><blockquote type="cite">
<blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> app.MainLoop()</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote>
<blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">
<span>if __name__ == "__main__":</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> wxVTKRenderWindowInteractorExample()</span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite">
<blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite">
<blockquote type="cite"><span>--</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>David A. Van Ee, BASc, EIT</span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>Convergent Manufacturing Technologies Inc.</span><br>
</blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>6190 Agronomy Rd, Suite 403</span><br></blockquote>
</blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>Vancouver BC Canada V6T 1Z3</span><br></blockquote></blockquote>
<blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">
<span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>Email: <a href="mailto:david.vanee@convergent.ca">david.vanee@convergent.ca</a> | Tel: 604-822-9682 x103</span><br></blockquote>
</blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>WWW: <a href="http://www.convergent.ca">http://www.convergent.ca</a> | Fax: 604-822-9659</span><br>
</blockquote></blockquote><span>_______________________________________________</span><br><span>Powered by <a href="http://www.kitware.com">www.kitware.com</a></span><br><span></span><br><span>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a></span><br>
<span></span><br><span>Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a></span><br><span></span><br><span>Follow this link to subscribe/unsubscribe:</span><br>
<span><a href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a></span><br></div></blockquote></body></html>