<br>Hi David,<br>          Thanks for the reply. It is working fine for me. But this time I am facing a new problem. If I add any actor to the to the renderer then 1st widget is moving only at the first time after that I am not able to move it. 2nd widget is moving without any problem.<br>
Plz see the pipeline I have followed.<br><br>   // Input is a polydata file like brainImageSmooth.vtk in VTKData/Data<br>
<meta name="qrichtext" content="1"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<p style="margin: 0px; text-indent: 0px;">    vtkPolyDataReader *reader = vtkPolyDataReader::New();</p>
<p style="margin: 0px; text-indent: 0px;">    reader-&gt;SetFileName(argv[1]);</p>
<p style="margin: 0px; text-indent: 0px;">    reader-&gt;Update();</p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">    vtkPolyData *polyData = reader-&gt;GetOutput();</p>
<p style="margin: 0px; text-indent: 0px;">    vtkPolyDataMapper* surfaceMapper = vtkPolyDataMapper::New();</p>
<p style="margin: 0px; text-indent: 0px;">    surfaceMapper-&gt;SetInput(polyData);</p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">    vtkActor* surfaceActor = vtkActor::New();</p>
<p style="margin: 0px; text-indent: 0px;">    surfaceActor-&gt;SetMapper(surfaceMapper);</p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">    // a renderer and render window</p>
<p style="margin: 0px; text-indent: 0px;">    vtkRenderer *renderer =</p>
<p style="margin: 0px; text-indent: 0px;">            vtkRenderer::New();</p>
<p style="margin: 0px; text-indent: 0px;">    vtkRenderWindow *renderWindow =</p>
<p style="margin: 0px; text-indent: 0px;">            vtkRenderWindow::New();</p>
<p style="margin: 0px; text-indent: 0px;">    renderWindow-&gt;AddRenderer(renderer);</p>
<p style="margin: 0px; text-indent: 0px;">    renderer-&gt;AddActor(surfaceActor);</p>
<p style="margin: 0px; text-indent: 0px;">    // an interactor</p>
<p style="margin: 0px; text-indent: 0px;">    vtkRenderWindowInteractor *renderWindowInteractor =</p>
<p style="margin: 0px; text-indent: 0px;">            vtkRenderWindowInteractor::New();</p>
<p style="margin: 0px; text-indent: 0px;">    renderWindowInteractor-&gt;SetRenderWindow(renderWindow);</p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">    vtkSphereWidget *sphereWidget1 =</p>
<p style="margin: 0px; text-indent: 0px;">            vtkSphereWidget::New();</p>
<p style="margin: 0px; text-indent: 0px;">    sphereWidget1-&gt;SetInteractor(renderWindowInteractor);</p>
<p style="margin: 0px; text-indent: 0px;">    sphereWidget1-&gt;SetRepresentationToSurface();</p>
<p style="margin: 0px; text-indent: 0px;">    sphereWidget1-&gt;SetCenter(-10.0, 0.0, 0.0);</p>
<p style="margin: 0px; text-indent: 0px;">    sphereWidget1-&gt;SetRadius(4);</p>
<p style="margin: 0px; text-indent: 0px;">    sphereWidget1-&gt;On();</p>
<p style="margin: 0px; text-indent: 0px;">    vtkSphereWidget *sphereWidget2 =</p>
<p style="margin: 0px; text-indent: 0px;">            vtkSphereWidget::New();</p>
<p style="margin: 0px; text-indent: 0px;">    sphereWidget2-&gt;SetInteractor(renderWindowInteractor);</p>
<p style="margin: 0px; text-indent: 0px;">    sphereWidget2-&gt;SetRepresentationToSurface();</p>
<p style="margin: 0px; text-indent: 0px;">    sphereWidget2-&gt;SetCenter(10.0, 0.0, 0.0);</p>
<p style="margin: 0px; text-indent: 0px;">    sphereWidget2-&gt;SetRadius(4);</p>
<p style="margin: 0px; text-indent: 0px;"></p>
<p style="margin: 0px; text-indent: 0px;">    sphereWidget2-&gt;On();</p>
<p style="margin: 0px; text-indent: 0px;">    renderWindow-&gt;Render();</p>
<p style="margin: 0px; text-indent: 0px;">    renderWindowInteractor-&gt;Initialize();</p>
<p style="margin: 0px; text-indent: 0px;">    renderWindowInteractor-&gt;Start();</p><br><div class="gmail_quote"><br>Thanks and Regards,<br>Satya.<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="gmail_quote"><div>The following works fine for me - can you explain the problem in more detail?</div><div> </div><div>#include &lt;vtkPolyDataMapper.h&gt;</div>
<div>#include &lt;vtkActor.h&gt;</div><div>#include &lt;vtkRenderWindow.h&gt;</div><div>#include &lt;vtkRenderer.h&gt;</div><div>#include &lt;vtkRenderWindowInteractor.h&gt;</div><div>#include &lt;vtkPolyData.h&gt;</div>
<div>
#include &lt;vtkSmartPointer.h&gt;</div><div>#include &lt;vtkSphereSource.h&gt;</div><div>#include &lt;vtkSphereWidget.h&gt;</div><div>#include &lt;vtkSphereRepresentation.h&gt;</div><div>#include &lt;vtkBoxWidget2.h&gt;</div>

<div>#include &lt;vtkCommand.h&gt;</div><div><br></div><div>int main(int argc, char *argv[])</div><div>{</div><div>  // a renderer and render window</div><div>  vtkSmartPointer&lt;vtkRenderer&gt; renderer = </div><div>      vtkSmartPointer&lt;vtkRenderer&gt;::New();</div>

<div>  vtkSmartPointer&lt;vtkRenderWindow&gt; renderWindow = </div><div>      vtkSmartPointer&lt;vtkRenderWindow&gt;::New();</div><div>  renderWindow-&gt;AddRenderer(renderer);</div><div>  </div><div>  // an interactor</div>

<div>  vtkSmartPointer&lt;vtkRenderWindowInteractor&gt; renderWindowInteractor = </div><div>      vtkSmartPointer&lt;vtkRenderWindowInteractor&gt;::New();</div><div>  renderWindowInteractor-&gt;SetRenderWindow(renderWindow);</div>

<div><br></div><div>  vtkSmartPointer&lt;vtkSphereWidget&gt; sphereWidget1 = </div><div>      vtkSmartPointer&lt;vtkSphereWidget&gt;::New();</div><div>  sphereWidget1-&gt;SetInteractor(renderWindowInteractor);</div><div>
  sphereWidget1-&gt;SetRepresentationToSurface();</div>
<div>  </div><div>   vtkSmartPointer&lt;vtkSphereWidget&gt; sphereWidget2 = </div><div>      vtkSmartPointer&lt;vtkSphereWidget&gt;::New();</div><div>  sphereWidget2-&gt;SetInteractor(renderWindowInteractor);</div><div>  sphereWidget2-&gt;SetRepresentationToSurface();</div>

<div>  sphereWidget2-&gt;SetCenter(2.0, 0.0, 0.0);</div><div> </div><div>  sphereWidget1-&gt;On();</div><div>  sphereWidget2-&gt;On();</div><div>  renderWindow-&gt;Render();</div><div>  renderWindowInteractor-&gt;Start();</div>

<div>  </div><div>  return EXIT_SUCCESS;</div><div>}</div><div><br></div>Thanks,<br><font color="#888888"><br><div>David </div></font></div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" 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" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br>