Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Opencascade visualization in QT
Forum Updated to NodeBB v4.3 + New Features

Opencascade visualization in QT

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 628 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    medihe
    wrote on last edited by VRonin
    #1

    Hi everyone,

    I am trying to execute an opencascade example: "MakeBottle". This example returns a TopoDS_Shape. I have been able to compile but I am not see any bottle. The qt window is empty. You can find the code below:

    int main(int argc, char *argv[])
    {
    
      QApplication a(argc, argv);
    
      // create a Qt window
      QWidget *window = new QWidget();
    
        // create a bottle (TopoDS_Shape)
      TopoDS_Shape myBottle = MakeBottle(70., 120., 30.);
    
      // th DisplayDonnection
      Handle(Aspect_DisplayConnection) aDisplayConnection;
    
      // the GraphicDriver
      Handle(OpenGl_GraphicDriver) aGraphicDriver = new OpenGl_GraphicDriver(aDisplayConnection);
    
      // creating the Viewer
      Handle(V3d_Viewer) aViewer = new V3d_Viewer(aGraphicDriver, Standard_ExtString("my3dViewer"));
    
      // creating a View
      Handle(V3d_View) aView = aViewer->CreateView();
    
    
      Handle(WNT_Window) wind = new WNT_Window((Aspect_Handle)window->winId());
    
      // the Interactive context
      Handle(AIS_InteractiveContext) aContext = new AIS_InteractiveContext(aViewer);
    
      Handle(AIS_Shape) anAISShape = new AIS_Shape(myBottle);
      aContext->Display(anAISShape, true);
    
      aView->SetWindow(wind);
    
      window->show();
      return a.exec();
    
    }
    

    Thanks in advance.

    Kind regards.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      OpenCascade is providing Qt examples, did you try them ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • gde23G Offline
        gde23G Offline
        gde23
        wrote on last edited by
        #3

        I guess the problem is rather related to the setup of the OpenGl context for the viewer or something like that than to OCCT. What OS are you on?

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved