<div class="gmail_quote">On Mon, Mar 8, 2010 at 2:14 AM, satyanarayana reddy <span dir="ltr"><<a href="mailto:satyajanga@gmail.com">satyajanga@gmail.com</a>></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->SetFileName(argv[1]);</p>
<p style="margin:0px;text-indent:0px"> reader->Update();</p>
<p style="margin:0px;text-indent:0px"></p>
<p style="margin:0px;text-indent:0px"> vtkPolyData *polyData = reader->GetOutput();</p>
<p style="margin:0px;text-indent:0px"> vtkPolyDataMapper* surfaceMapper = vtkPolyDataMapper::New();</p>
<p style="margin:0px;text-indent:0px"> surfaceMapper->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->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->AddRenderer(renderer);</p>
</div><p style="margin:0px;text-indent:0px"> renderer->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->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->SetInteractor(renderWindowInteractor);</p>
<p style="margin:0px;text-indent:0px"> sphereWidget1->SetRepresentationToSurface();</p>
</div><p style="margin:0px;text-indent:0px"> sphereWidget1->SetCenter(-10.0, 0.0, 0.0);</p>
<p style="margin:0px;text-indent:0px"> sphereWidget1->SetRadius(4);</p>
<p style="margin:0px;text-indent:0px"> sphereWidget1->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->SetInteractor(renderWindowInteractor);</p>
<p style="margin:0px;text-indent:0px"> sphereWidget2->SetRepresentationToSurface();</p>
</div><p style="margin:0px;text-indent:0px"> sphereWidget2->SetCenter(10.0, 0.0, 0.0);</p>
<p style="margin:0px;text-indent:0px"> sphereWidget2->SetRadius(4);</p>
<p style="margin:0px;text-indent:0px"></p>
<p style="margin:0px;text-indent:0px"> sphereWidget2->On();</p>
<p style="margin:0px;text-indent:0px"> renderWindow->Render();</p>
<p style="margin:0px;text-indent:0px"> renderWindowInteractor->Initialize();</p>
<p style="margin:0px;text-indent:0px"> renderWindowInteractor->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>