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:
- 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
- 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?