[vtkusers] How to display PolyData(which converted from image data) and PolySource together

yoshihiko_nagamine at pis.hitachi.co.jp yoshihiko_nagamine at pis.hitachi.co.jp
Wed Jun 5 03:51:26 EDT 2002


Dear VTK users

I'm trying to display a PolyData and PolySource together.

After execute program, I expect the extracted born and
red sphere are appeared together on the window.

But, the result of this program only showed Extracted Born..

I  know  there are some mistakes in the program, but I cant find.

Dose anybody knows the hints or has the suggetions?

---------------------------------------------
I wrote following program:

//========================
// ****** Extract Born ******
//========================
//*** construct staff****
vtkContourFilter     volExtBorn     = new vtkContourFilter();
vtkPolyDataMapper  polyMapBorn  = new vtkPolyDataMapper();
vtkActor                actorBorn      = new vtkActor();
vtkRenderer           renderer       = new vtkRenderer();
vtkLight                 light             = new vtkLight();

volExtBorn.SetInput(imageReader.GetOutput());
volExtBorn.UseScalarTreeOn();
volExtBorn.SetValue(0, 1150);
// *** Mapping  ***
polyMapBorn.SetInput(volExtBorn.GetOutput());
polyMapBorn.ScalarVisibilityOff();
// *** Actor ***
actorBorn.SetMapper(polyMapBorn);
actorBorn.GetProperty().SetOpacity(0.5);

//========================
// ****** Sphere Source ****
//========================
vtkSphereSource sph = new vtkSphereSource();
vtkPolyDataMapper sphMapper = new vtkPolyDataMapper();
sphMapper.SetInput(sph.GetOutput());
sphMapper.ScalarVisibilityOff();
vtkActor sphActor = new vtkActor();
sphActor.SetMapper(sphMapper);
sphActor.GetProperty().SetColor(1,0,0);
sphActor.GetProperty().SetOpacity(0.8);

renderer.AddProp(sphActor);
renderer.AddProp(actorBorn);

------------------------------------------------

Thanks
----------------------------------------
Yoshihiko Nagamine




More information about the vtkusers mailing list