<div class="gmail_quote">On Mon, Mar 8, 2010 at 2:14 AM, satyanarayana reddy <span dir="ltr">&lt;<a href="mailto:satyajanga@gmail.com">satyajanga@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<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>

<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><div class="im">
<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>
</div><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><div class="im">
<p style="margin:0px;text-indent:0px">            vtkRenderWindow::New();</p>
<p style="margin:0px;text-indent:0px">    renderWindow-&gt;AddRenderer(renderer);</p>
</div><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><div class="im">
<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>
</div><p style="margin:0px;text-indent:0px">    vtkSphereWidget *sphereWidget1 =</p><div class="im">
<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>
</div><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><div class="im">
<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>
</div><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><p style="margin:0px;text-indent:0px"><br></p></blockquote><div><br></div><div class="gmail_quote">Can you post the smallest fully compilable demonstration of the problem? Please use sources instead of reading data files as that is much easier for others to reproduce.</div>
<br clear="all">Thanks,<br><br><div>David</div></div>