Hi everyone <div><br></div><div>I am trying to have some interaction between a tracked pointer and vtkActors in a scene. </div><div><br></div><div>My actors are simple objects I call like vtkConeSource, vtkPolyDataMapper and vtkActor.</div>
<div><br></div><div>Basically I am building a line using vtkLineSource and testing if the line intersects any actors in my scene with vtkOBBTree using the code below. </div><div><br></div><div><div><span class="Apple-tab-span" style="white-space:pre">        </span>tBox = vtkOBBTree::New(); </div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>iter = vtkCollectionIterator::New(); </div><div><span class="Apple-tab-span" style="white-space:pre">        </span>iter-&gt;SetCollection(actrList); </div><div><span class="Apple-tab-span" style="white-space:pre">        </span>iter-&gt;InitTraversal(); </div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>int c = 0;<span class="Apple-tab-span" style="white-space:pre">                        </span>// counter to change state</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>int poked = -1;<span class="Apple-tab-span" style="white-space:pre">                </span>// actor poked</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>while ( !iter-&gt;IsDoneWithTraversal() )</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>{</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>vtkActor* tmp_actr = (vtkActor*) iter-&gt;GetCurrentObject(); </div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>tmp_actr-&gt;GetMapper()-&gt;GetInput()-&gt;Update();<span class="Apple-tab-span" style="white-space:pre">                                </span>// update the object</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>tBox-&gt;SetDataSet( tmp_actr-&gt;GetMapper()-&gt;GetInput() ); </div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>tBox-&gt;BuildLocator(); </div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>if( tBox-&gt;IntersectWithLine(lasserP1, lasserP2, NULL, NULL) != 0 )</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>{</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>poked = c; </div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>break;</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>}</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>iter-&gt;GoToNextItem(); </div><div><span class="Apple-tab-span" style="white-space:pre">                </span>c++;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div></div><div><br></div><div>However, because the vtkOBBTree tests against vtkDataSet (ie vtkConeSource) the new (translated or rotated) coordinates are not updated when I test the intersection again. </div>
<div><br></div><div>As far as I can tell I would need to update the &#39;center&#39; of the vtkDataSet downstream from the vtkActor... </div><div><br></div><div>I hope anyone can share any suggestions. </div><div><br></div>
<div>Sergio </div>