OCC use case

Hi all,


We are building a robot supervisor within which we would like to add tools to specify and edit the robot environment geometry. The geometry we work on is rather simple (nurbs curves and surfaces describing the walls, ceilings, floors, windows, switches...). We already have a simple data model and viewer of ours handling the geometry but we have no way to interact with it, create the geometry from scratch, edit it... So we are currently investigating OCC to check whether this is a good match for our needs.


A question that arises is the relation between our very own data model and OCC's data model. OCC provides data model, visualization, interaction layers of its own and we are not sure whether our framework can live side-by-side with OCC. Basically there are 2 possible architectures which we envisage:

  1. The first one is based on is a 1-to-1 relation between our very own data model and OCC's, in real-time
    • This requires our data model to let OCC know about any modification of the data in real-time
    • And OCC to let our framework know about changes as soon as they occur
    • We can visualize and edit data either with our view or with OCC's
  2. The second possible architecture relies on 2 modes:
    • In the first mode only our data-model can be edited and visualized
    • When transitioning to the 2nd mode, our data-model data is converted to OCC's data-model and only OCC data can be edited
    • When coming back to the 1st mode OCC's data is translated to our data model


We would like to avoid mode 2 (heavy to use because of the modes transitions), so we have investigated mode 1.


The problem with mode 1 is that we have not been able to find an observers / callback mechanism (or so) which could tell our data-model when OCC data is update. Is there such a callback mechanism in OCC? What should we look at?




Antoine Rennuit.

Benjamin Bihler's picture

Hi Antoine,

I am not sure whether I have completely understood your question. But if you are interested in how to implement user interactions with the 3D view in Open CASCADE, you might want to look at ..\OpenCascadeFolder\samples\qt\Common\src\View.cxx. This is a Qt widget and the methods View::mousePressEvent(...), View::mouseReleaseEvent(...) and View::mouseMoveEvent(...) handle the user interactions.

I hope that this helps you a little bit.


Forum supervisor's picture

Hello Antoine,
We believe we can help you develop the required connection - we have sent some information to your personal email.

Best regards,

Forum supervisor