simple example of Open Cascade 7.5 application

hi,
Today I try with simple example of Open Cascade 7.5 application

I don't have one file:
Severity Code Description Project File Line Suppression State
Error C1083 Cannot open include file: 'Graphic3d_WNT.hxx': No such file or directory WindowsProject1 C:\Users\pdusp\source\repos\WindowsProject1\WindowsProject1\WindowsProject1.cpp 10

I checked folder for this file in OpenCASCADE-7.5.0-vc14-64 but not found...

May I ask for help?

#include <iostream>
#include <AIS_InteractiveContext.hxx>
#include <AIS_Shape.hxx>
#include <Geom_Line.hxx>
#include <Geom_Circle.hxx>
#include <gp_Pnt.hxx>
#include <V3d_Viewer.hxx>
#include <V3d_View.hxx>
#include <WNT_Window.hxx>
#include <Graphic3d_WNT.hxx>

int main(int argc, char *argv[])
{
// Tworzenie okna
Handle(WNT_Window) aWindow = new WNT_Window(GetModuleHandle(NULL));
aWindow->SetSize(500, 500);

// Tworzenie viewer-a
Handle(V3d_Viewer) aViewer = new V3d_Viewer(aWindow);
aViewer->SetDefaultLights();
aViewer->SetLightOn();

// Tworzenie widoku
Handle(V3d_View) aView = aViewer->CreateView();

// Tworzenie interaktywnego kontekstu
Handle(AIS_InteractiveContext) aContext = new AIS_InteractiveContext(aViewer);

// Tworzenie linii
Handle(Geom_Line) aLine = new Geom_Line(gp_Pnt(0, 0, 0), gp_Pnt(100, 100, 0));
Handle(AIS_Shape) aLineShape = new AIS_Shape(aLine);
aContext->Display(aLineShape, Standard_True);

// Tworzenie okręgu
Handle(Geom_Circle) aCircle = new Geom_Circle(gp_Ax2(gp_Pnt(200, 200, 0), gp_Dir(0, 0, 1)), 50);
Handle(AIS_Shape) aCircleShape = new AIS_Shape(aCircle);
aContext->Display(aCircleShape, Standard_True);

// Tworzenie punktu
Handle(AIS_Shape) aPointShape = new AIS_Shape(new gp_Pnt(300, 300, 0));
aContext->Display(aPointShape, Standard_True);

// Wypisanie wszystkich obiektów na ekranie
aContext->UpdateCurrentViewer();

// Czekanie na zamknięcie okna
aWindow->EventLoop();

return 0;
}

gkv311 n's picture

'Graphic3d_WNT.hxx': No such file or directory

Such file never existed in OCCT, and your code relies on methods, which are not defined in used classes. Either contact the author of code sample you have listed or use some other working OCCT sample.

Piotr Dusiński's picture

thank you,

could I ask for a valuable tip, I have installed Open Cascade 7.5 on my laptop,
and I'm looking for the first program c++ to start that will draw me lines, a point, and a circle on the screen.
it would make me very happy and encourage me to continue programming and learning.
thank you and best regards
Piotr

gkv311 n's picture

To start writing an application, you should first decide which GUI framework you are going to use.

Basically speaking, line segments, point and circle could be displayed using the same presentation object - AIS_Shape. So you may start from learning how to create simple shapes in OCCT (TopoDS_Shape), probably with help of Geometry + Topology training materials and Overview sample showing code snippets for many simple things.

And why do you use obsolete version of OCCT, when there is OCCT 7.7 available for a while?