Mon, 11/11/2024 - 14:11
Forums:
Hello everyone,
Got problems with showing STEP file.
This code show only show black rectangle.
reader.TransferRoots(); TopoDS_Shape shape = reader.OneShape(); // Create a new context and view Handle(AIS_InteractiveContext) newContext = new AIS_InteractiveContext(SharedViewer::getViewer());//just class for storing static Handle(V3d_Viewer) viewer; Handle(V3d_View) newView = SharedViewer::getViewer()->CreateView(); Handle(OcctWindow) customWindow = new OcctWindow(newTab); newView->SetWindow(customWindow); if (!customWindow->IsMapped()) { customWindow->Map(); } Handle(AIS_Shape) aisShape = new AIS_Shape(shape); newContext->Display(aisShape, AIS_Shaded, 0, false); newView->FitAll(); newView->Redraw();
for OcctWindow implementation i used this example from openCASCADE
And somebody could explain pls this implementation of View, moment about inheriting AIS_ViewController. Because in tools folder with plugins, they don't use such implementation. Same for FreeCAD source code(mb need further investigation).
Could provide any additional information if needed.
Thx in advance.
UPD: Fixed there was a problem with initialization of local variables for view, which further destroys.