visualize an OCCT topological shape in VTK viewer

I want to visualize an OCCT topological shape in VTK viewer.

I refer to the tutorial of VIS.However there throw exception in 'Mapper->SetInputConnection(DS->GetOutputPort());'

Here is my code:

// 1 . Create IVtkOCC_Shape instance(VIS wrapper for OCCT shape) and initialize it with TopoDS_Shape object containing the actual geometry.
//TopoDS_Shape aShape = makebottle();
TopoDS_Shape aShape;
BRep_Builder B;
BRepTools::Read(aShape, "D:\\OpenCASCADE7.0.0-vc12-64\\opencascade-7.0.0\\data\\occ\\face.brep",B);

//Initialize aShape variable: e.g. load it from BREP file
IVtkOCC_Shape::Handle aShapeImpl = new IVtkOCC_Shape(aShape);

aShapeImpl = new IVtkOCC_Shape(aShape);

// 2 .Create VTK polygonal data source for the target OCCT topological shape and initialize it with created 
// IVtkOCC_Shape instance. At this stage the faceter is implicitly plugged.
vtkSmartPointer DS = vtkSmartPointer ::New();

// 3. visualize the load shape in usual VTK way starting a pipline from the newly created specific source.
vtkSmartPointer Mapper = vtkSmartPointer::New();
vtkSmartPointer Actor = vtkSmartPointer::New();
vtkSmartPointer renderer = vtkSmartPointer::New();
renderer->SetBackground(0.1, 0.2, 0.4);
vtkSmartPointer renWin = vtkSmartPointer::New();
renWin->SetSize(300, 300);
renWin->SetPosition(300, 300);
// vtkSmartPointer iren = vtkSmartPointer::New();
vtkSmartPointer style = vtkSmartPointer::New();


Heike Broichhausen's picture

Hello Rui,

this is exactly my problem as well. How did you sort this issue?

1364255742_147980's picture

Hello Rui Song ,

I also encountered this problem now, did you solve it? occ730