[vtkusers] Cannot get visualized the Bounding Box

Bill Chivas billno123 at hotmail.com
Wed Mar 16 07:28:11 EDT 2011


Hello all,

i have the following code and i want to see the white bounding box of the sphere. What is wrong?


#include <vtkSmartPointer.h>
#include <vtkInformation.h>
#include <vtkSphereSource.h>
#include <vtkOutlineFilter.h>
#include <vtkSelection.h>
#include <vtkSelectionNode.h>
#include <vtkPolyData.h>
#include <vtkUnstructuredGrid.h>
#include <vtkPolyDataMapper.h>
#include <vtkDataSetMapper.h>
#include <vtkProperty.h>
#include <vtkRenderWindow.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkRenderer.h>
#include <vtkSphereSource.h>
#include <vtkOutlineSource.h>

int main(int, char *[])
{
    vtkSmartPointer<vtkSphereSource> sphereSource =
      vtkSmartPointer<vtkSphereSource>::New();
  sphereSource->Update();

    vtkOutlineFilter *outline = vtkOutlineFilter::New();
    outline->SetInput(sphereSource->GetOutput());
    vtkPolyDataMapper *mapOutline = vtkPolyDataMapper::New();
    mapOutline->SetInput(outline->GetOutput());
    vtkActor *outlineActor = vtkActor::New();
    outlineActor->SetMapper(mapOutline);
    outlineActor->GetProperty()->SetColor(1, 1, 1);
    

    vtkSmartPointer<vtkRenderWindow> renderWindow =
    vtkSmartPointer<vtkRenderWindow>::New();
  renderWindow->SetSize(900, 300);
 
  // And one interactor
  vtkSmartPointer<vtkRenderWindowInteractor> interactor =
    vtkSmartPointer<vtkRenderWindowInteractor>::New();
  interactor->SetRenderWindow(renderWindow); 
 
  // Setup the renderers
  vtkSmartPointer<vtkRenderer> leftRenderer =
    vtkSmartPointer<vtkRenderer>::New();
    leftRenderer->AddActor(outlineActor);
      leftRenderer->ResetCamera();

  renderWindow->Render();
  interactor->Start();
 
  return EXIT_SUCCESS;
}

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110316/31ad4c4a/attachment.htm>


More information about the vtkusers mailing list