[Paraview] vtkSource to selection window?

Sebastian Geller geller150 at gmx.de
Tue Feb 8 11:30:15 EST 2005


Hello

I started as described in the "The Paraview Guide" book chapter 18.2 to 
have a button,
where something happens if pressed.
In this case a vtkSphere will be added to the RenderWindow.

The code example:

void vtkPVRenderView::PrintColor()
{
   this->PrintColorButton->SetLabel("it works");
   vtkRenderWindow *renWindow = this->GetRenderWindow();
   vtkRenderer *ren = renWindow->GetRenderers()->GetFirstRenderer();
   renWindow->AddRenderer(ren);
   double array[3];
   array[0] = 3.0;
   array[1] = 2.0;
   array[2] = 4.0;
   vtkSphereSource *vtksphere = vtkSphereSource::New();
   vtksphere->SetCenter(array);
   vtksphere->SetRadius(sphere->getRadius() );
   vtkPolyDataMapper *sphereMapper = vtkPolyDataMapper::New();
   sphereMapper->SetInput(vtksphere->GetOutput());
   vtkActor *sphereActor = vtkActor::New();
   sphereActor->SetMapper(sphereMapper);
   ren->AddActor(sphereActor);
   renWindow->Render();

*   
((vtkPVWindow*)this->ParentWindow)->GetMainView()->GetSplitFrame()->UnpackSiblings();
   ((vtkPVWindow*)this->ParentWindow)->Script("pack %s -side top -fill 
both -expand t",
   
((vtkPVWindow*)this->ParentWindow)->GetMainView()->GetSplitFrame()->GetWidgetName());
   if (!((vtkPVWindow*)this->ParentWindow)->GetCurrentPVSource())   
{      return;   }
   ((vtkPVWindow*)this->ParentWindow)->GetCurrentPVSource()->Pack();*
}

ok so far it works - I can press the button and see in the RenderWindow 
the Sphere ;-)
The last bold lines - switch the view to the "Selection Window".
How can I bring now the Sphere in this PrintColor() function to this 
"SelectionWindow" as when I press
in the "Source" menu the Sphere item?
There are any code examples available ?

Best regards
Sebastian


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/paraview/attachments/20050208/5c5b30c9/attachment.html


More information about the ParaView mailing list