Giter Site home page Giter Site logo

occt-samples-qopenglwidget's Introduction

About this page

Kirill Gavrilov Tartynskih is the Russian programmer. He's a native of Kirishi, and is currently employed as Principal Engineer.

Stereo-visualization has been a long time passion for him, but he was frustrated to find no Stereoscopic video players that met his needs. As a result he started to develop his own stereo-viewing software and sView is the result.

Open CASCADE Technology sView

Extra links

occt-samples-qopenglwidget's People

Contributors

gkv311 avatar huguesdelorme avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

occt-samples-qopenglwidget's Issues

Crash: Two separate views, shared context

I successfully used your example two create two separate views. it works out of the box.

Next, I tried to extract the V3d_Viewer and AIS_InteractiveContext out of the widget to create a shared state between both views (i.e. have the same context with different views).

In this case, the application crashes at the end of the second call to initializeGL, concretely at the line myView->SetWindow.

This worked well with the "normal" occt qt examples, but does not work anymore with your QOpenGlWidget-based example.

Do you have any suggestions, how I could use multiple views of the same context?

Weird dark colors on some configs

I built occt-samples-qopenglwidget on two different PCs both running Win10 x64 and got distinct colors brightness.
First PC with OpenGL 4.6:
image

Second PC with OpenGL 4.3:
image

What could cause that ?

OpenGL infos dump on second PC:
image

On both machines:
Visual C++ 2019
Qt 5.15.2
OpenCascade 7.6.0 from Download center

the cursor problem

the mouse in qt widget is different from the mouse in occt.
you can find that the cursor icon is different from the selected icon in OCCT.

And on the left up corner,they overlap together.but in the right down corner,it really diffs a lot
image

Animation

Hello Kirill,

I have two project which are written in c# and c++ with qt. In c# project I use OCCTProxy like you did and animation works like a charm. But when I use same code for this sample project I mean c++ project, does not work at all. I definitely don't understand what is the difference between them.

I'm going to add my animation class. For my improvement your ideas are very important to me so I'll wait your replies.

Animation.h.txt
Animation .cpp.txt

Open CASCADE 7.7.0 version on Debian 10- Build Problem

Hello @gkv311 ,

I'm trying this sample project on Debian 10 with Open CASCADE 7.7.0 version and Qt 5.15.11. I've prepared the pre-built shared objects from official release package: https://dev.opencascade.org/system/files/occt/OCC_7.7.0_release/opencascade-7.7.0.tgz

However, I'm getting attached errors that can be seen screenshot. Formerly, this sample project perfectly works on Debian 10 & Open CASCADE 7.6.0 versions with Qt 5.15.11. Do you have any idea about this issue?

Thank you in advance!
occt 7 7 0 errors on linux

MacOS Compatibility

Hi @gkv311,

We're looking for any potential pointers for getting this working with MacOS

We maintain a cross-platform application and integrate this component using Qt 5.15.2
We are using OpenCascade 7.6.1

While the component works well on Linux and Windows, on MacOS it seems to have some issues. From the log, the OpenGL context initialises correctly and all FBO creation calls succeed. The off-screen FBO also seems to be drawn to correctly, as V3d_View::Dump outputs an image that is correct.

To prevent crashing with a shared OpenGL context on MacOS, as per the Qt Docs, we need to setup the default surface format before QApplication is created. MacOS only supports OpenGL 4.1, so the GL_KHR_DEBUG extension is not available to us unfortunately.

Currently this results in a black screen, with no useful debug output

Any pointers or clues would be appreciated, or a better method of debugging these graphics issues on MacOS?

How to get the selected points from an ais_pointcloud object?

Hello @gkv311 ,
I ues your example to display some cad model(ais_shape) and pointcloud model(ais_pointcloud)succesfully, but when i want to select some points from an ais_pointcloud,it's not the same as selecting TopAbs_Face from the AIS_Slection.
The schematic diagram is as follows:
test
The code I select TopAbs_Face from an ais_shape object is as follows:

   if (!myOccView->getContext()->Selection()->IsEmpty()) {
        const Handle(AIS_Selection) selection = myOccView->getContext()->Selection();
        for (selection->Init(); selection->More(); selection->Next()) {
            Handle(SelectMgr_EntityOwner) entity = selection->Value();
            TopoDS_Shape shape = Handle(StdSelect_BRepOwner)::DownCast(entity)->Shape();

            // Create an explorer to iterate over all faces in the shape.
            TopExp_Explorer explorer_face(shape, TopAbs_FACE);
            ......
            }
    }
 The code I select points from an ais_shape object is as follows:
       Handle(AIS_Selection) selection = myOccView->getContext()->Selection();       
       Handle(AIS_PointCloud) myPointCloud = Handle(AIS_PointCloud)::DownCast(aisObj);
       for (selection->Init(); selection->More(); selection->Next()) {
                Handle(SelectMgr_EntityOwner) entity = selection->Value();
                Handle(AIS_PointCloudOwner) owner = Handle(AIS_PointCloudOwner)::DownCast(entity);
                Handle(TColStd_HPackedMapOfInteger) selectedPoints = owner->SelectedPoints();
                ......
       }
 I don't how to use the selectedPoints(TColStd_HPackedMapOfInteger object) to get every gp_pnt point,could you give me some advice or some sample code?Thanks in advance.

Menu is not there

MissingMenu
MissingMenu_AfterMinMaximizeWindow
MissingMenu_Details

The File menu is missing when the application is run. All other parts of the application works well. What could be the cause?

Thanks
Richard

occ viewer widget in a sub dialog

Hello,

I would like to know if it's possible or not to a have a QT Main Window (main application), then a button that creates/open a sub-dialog which 'hosts' the OCC viewer widget. ANd then several dialogs with occ viewers (from main single window/app) could be instanciated.

I know how to define and display a OCC viewer widget in a main window, but I can't embedd a viewer in a sub dialog panel.

The idea would be to build a kind of 'visual nodes/graph editor' (main window / app) with one 'visual node' embedding a OCC viewer widget.

Thnak you.

Default FBO Creation Problem when OCCTPage's parent is mainwindow::instance()

Hello @gkv311 ,

I've moved into the seperate branch with my question: https://github.com/NeziheSozen/occt-samples-qopenglwidget/tree/default_fbo_wrapper_investigation

It is very clear that the origin of the problem is not OCCT and there is something wrong with our using. However, we do not know how we can overcome and handle this problem of OCCT View not appearing.

Is it possible to implement a workaround solution like in destructor side?

Cannot mixed using QPainter

When I add QPainter code to draw some text for testing, I got an unexpected result, as following image.

image

the testing code I added is:

  {
    QPainter p(this);
    p.setPen(Qt::yellow);
    QFont font;
    font.setFamily("Arial");
    font.setPixelSize(32);
    p.setFont(font);
    p.drawText(QPoint(400, 50), QLatin1String("ABCDEFG"));
  }

image

Why the text drawing by QPainter looks bad?

sorry for my bad english.
Thanks for your project.

Compile error splines

@grotius-cnc
Hello, I tried to compile the occSketcher, but I get compilation issues.
Some are related to opencascade : I am using version 7.6.0, and there are some deprecated classes, but I can deal with it.
But others are related to Spline classes (see image below).
Could you please help me ?
I am using VisualStudio 2017 compiler on WIn10 x64.

image

Can't work on wayland

Error message:

Error: OpenGl_Context is unable to wrap OpenGL context

system info:

❯ neofetch
                   -`                    tim@TimTu-Arch 
                  .o+`                   -------------- 
                 `ooo/                   OS: Arch Linux x86_64 
                `+oooo:                  Host: Code01 Ver2.0 1 
               `+oooooo:                 Kernel: 6.4.3-arch1-1 
               -+oooooo+:                Uptime: 7 hours, 7 mins 
             `/:-:++oooo+:               Packages: 861 (pacman) 
            `/++++/+++++++:              Shell: bash 5.1.16 
           `/++++++++++++++:             Resolution: 2560x1600 
          `/+++ooooooooooooo/`           DE: Plasma 5.27.6 
         ./ooosssso++osssssso+`          WM: kwin 
        .oossssso-````/ossssss+`         Theme: NephriteLight [Plasma], Breeze [GTK2/3] 
       -osssssso.      :ssssssso.        Icons: [Plasma], Colloid [GTK2/3] 
      :osssssss/        osssso+++.       Terminal: konsole 
     /ossssssss/        +ssssooo/-       Terminal Font: Hack [SRC] 10 
   `/ossssso+/:-        -:/+osssso+-     CPU: AMD Ryzen 7 6800H with Radeon Graphics (16) @ 3.200GHz 
  `+sso+:-`                 `.-/+oso:    GPU: AMD ATI Radeon 680M 
 `++:.                           `-/+/   Memory: 6465MiB / 30808MiB 
 .`                                 `/

(It works well on X11)

Light and shadows in viewer

Hello
Is it possible to include soft or hard shadows in your occt viewer ?
Or maybe indicate the few code lines to add?
Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.