opencascade program is running on client computer but does not show view

David

Active CAD practitioner
I have finalized my program and have sent it to client together with the relevant dlls in the same directory as the exe file (created with Visual Studio 19). The client can run the program and there are no error messages, but the view window (similar to the one fo Quaoars tutorial) is not showing at all. Any idea ?
 

David

Active CAD practitioner
Further info: I have naturally installed the Visual Studio 19 redist.

I assume the program cannot find the graphic driver ?
Handle(OpenGl_GraphicDriver) graphicDriver = new OpenGl_GraphicDriver(displayConnection);

I tried to use environmental variable on the customer's PC:
CSF_GraphicShr = ....TKOpenGl.dll
but it did not help either.

The complete program works, but "only" the visualization and off-screen visualization is not showing up (no info / message popping up, just stops further processing and ends.

I hope it is not necessary to install the complete OpenCascade package on the customer's PC, as the program only uses a few of the libraries.
 

David

Active CAD practitioner
I installed now VS Studio 22 and OCCT binaries on the client's windows 11 pc. Now I believe to know, that the fault isUnbehandelte Ausnahme bei 0x00007FF8155E478C in GFM_Forge3D.exe: Microsoft C++-Ausnahme: Aspect_GraphicDeviceDefinitionError bei Speicherort 0x00000077D352F6B8.
Any idea what to do wiht Aspect_GraphicDeviceDefinitionError on a PC ?
kind regards,
David
 

JSlyadne

Administrator
Staff member
More information is needed.

Do you have a possibility to run application with debug info at client's PC?

Do you see any output in log/console?
 

David

Active CAD practitioner
no output in log/console.
I can debug on client computer and here is the code, where the above mentioned fault is mentioned:

Handle(V3d_View) view = viewer->CreateView();
Handle(Aspect_NeutralWindow) wnd = new Aspect_NeutralWindow();
wnd->SetSize(width, height);
wnd->SetVirtual(true);
view->SetWindow(wnd);
view->SetBackgroundColor(background);

At the last line, I get the error message:
Exception at 0x00007FF8155E478C in GFM_Forge3D.exe: Microsoft C++-Exception: Aspect_GraphicDeviceDefinitionError in memory at 0x00000077D352F6B8.
Any idea ?
 

natalia

Moderator
Staff member
Hi, David

First of all if you have installed OCCT on the customer PC, let’s check whether draw and inspector are started there? To launch draw, just start draw.bat and do the next:

Code:
>> pload ALL

>> vinit

>> vtrihedron t

The result should be a visualized viewer with trihedron shown. Here, you may debug it and check which window created(Aspect_NeutralWindow or WNT_Window or another) and compare this way with your.

If you use qt application, you may start inspector.bat from the OCCT installed directory. It shows usual qt widget filled with OCCT view window.


It’s also possible to start samples of OCCT if you installed them. These samples are examples of creating viewer for lots of different UI libraries(csharp, java, qt, qml)

Another question, which UI library you use? The platform is Windows, isn’t it?
 

David

Active CAD practitioner
Hi natalia,

I could narrow down the spot where it fails. It can show 3D viewer, but it fails here in the try block (showing no specific exception, though):
Handle(Aspect_DisplayConnection) displayConnection = new Aspect_DisplayConnection();
Handle(OpenGl_GraphicDriver) graphicDriver = new OpenGl_GraphicDriver(displayConnection);
Handle(V3d_Viewer) viewer = new V3d_Viewer(graphicDriver);
viewer->SetDefaultLights();
viewer->SetLightOn();
// prepare context
Handle(AIS_InteractiveContext) context = new AIS_InteractiveContext(viewer);
// prepare off-screen view
Handle(V3d_View) view = viewer->CreateView();
Handle(Aspect_NeutralWindow) wnd = new Aspect_NeutralWindow();
wnd->SetSize(width, height);
wnd->SetVirtual(true);
try
{
view->SetWindow(wnd, nullptr);
}
catch (...) {}

Therefore: it has to do something with the NeutralWindow. The other view that is working was done according to quaoar's tutorial.
kind regards,
David
 

JSlyadne

Administrator
Staff member
Did you go down to SetWindow(...) method?

As Natalia mentioned, it's also worth to try if Draw.exe or Inspector.exe delivered with OCCT works or not. If they're Ok, likely, the issue is somewhere in the configuration. Anyway, it'll be the good point to start.
 

David

Active CAD practitioner
I have not OpenCascade installed at clients PC, but only the needed dll files. So I cannot run Draw.exe.
Yes I went down to view->SetWindow(wnd) where the debugging stops with the above mentioned error message.
Acutally, I fear, that I need to install the complete OCCT package on each client's PC just to get the set-up for OpenGL correct...
 

David

Active CAD practitioner
I found the mistake:
it was the following line, which obviously works on some windows machines, but on some not.
Handle(Aspect_NeutralWindow) wnd = new Aspect_NeutralWindow();
I assume it is the correct approach only on Android systems.

with the correct approach of Quaoar with WNT_Window it worked.
 

JSlyadne

Administrator
Staff member
I found the mistake:
it was the following line, which obviously works on some windows machines, but on some not.
Handle(Aspect_NeutralWindow) wnd = new Aspect_NeutralWindow();
I assume it is the correct approach only on Android systems.

with the correct approach of Quaoar with WNT_Window it worked.
Aspect_Window is an interface mapping the camera's view to a platform-specific window. For Window platform OCCT provides the corresponding wrapper called WNT_Window , and for Linux it's Xw_Window. What the NeutralWindow is for I can hardly say as never used by myself.
 
Top