Sat, 07/23/2022 - 05:04
Forums:
Hello everyone, This problem has troubled me for several days. I try to compile OCC and VTK,But no effect. My configuration: vs2019 + occ 7.6 +vtk 8.2/9.1
this is my simple code:
#include <BRepPrimAPI_MakeBox.hxx>
#include <IVtkTools_ShapeDataSource.hxx>
#include <vtkType.h>
#include <vtkAutoInit.h>
#include <vtkRenderWindow.h>
#include <vtkActor.h>
#include <vtkRenderer.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkPolyDataMapper.h>
#include <vtkInteractorStyleTrackballCamera.h>
VTK_MODULE_INIT(vtkRenderingOpenGL2)
VTK_MODULE_INIT(vtkInteractionStyle)
int main()
{
BRepPrimAPI_MakeBox mkBox(1., 2., 3);
const TopoDS_Shape& shape = mkBox.Shape();
vtkNew<vtkRenderWindow> renWin;
vtkNew<vtkRenderer> ren;
renWin->AddRenderer(ren);
renWin->SetSize(640, 640);
vtkNew<vtkInteractorStyleTrackballCamera> istyle;
vtkNew<vtkRenderWindowInteractor> iren;
iren->SetRenderWindow(renWin);
iren->SetInteractorStyle(istyle);
vtkNew<IVtkTools_ShapeDataSource> DS ;
DS->SetShape(new IVtkOCC_Shape(shape));
vtkNew<vtkPolyDataMapper> mapper;
mapper->SetInputConnection(DS->GetOutputPort());
vtkNew<vtkActor> actor;
actor->SetMapper(mapper);
ren->AddActor(actor);
renWin->Render();
iren->Start();
return 0;
}
line: mapper->SetInputConnection(DS->GetOutputPort()); // error
ERROR: In D:\Software\3rdParty_useByMyself\VTK\VTK8_2\VTK-8.2.0_src\Common\ExecutionModel\vtkAlgorithm.cxx, line 908
IVtkTools_ShapeDataSource (000001E1CE813170): Attempt to get output port index 0 for an algorithm with -829853712 output ports.
Can anyone help me? thank you very much
Sat, 07/23/2022 - 09:23
I think there is no problem with this code.
Sat, 12/31/2022 - 14:10
I have the same problem with u,and i don't how to do either.
Tue, 11/14/2023 - 06:12
i have the same problem. has this problem been solved?
qt6 + vtk9.3.2 + occ7.5.0
Tue, 11/14/2023 - 11:53
i think i found the reason. when your application run as "Debug" mode, the VTK and OCC need use the debug libs and dlls.
Sun, 12/31/2023 - 19:07
i have the same problem. has this problem been solved?
Fri, 01/12/2024 - 16:53
Hello, did you try to specify debug/release libs?
Best regards, Dmitrii.