Two (simple) questions !

Hi,

Background: I want to use certain parts of the OpenCascade library to develop my application. It is a simple geometric modeller for FE analysis and optimization. I have looked through the docs for OCAF and found these confusing and really do not have the time to get to grips with it. Also the visualization is written in-house. So I basically want to use modules upto and including geometric algorithms and data exchange. Two questions have arised in my mind and I would like to get some input from more experienced OC users.

1) If I am building a geometric model 'on the fly' what is the best way to do this. The way I see it is that I need a class that holds the geometric entities created and updated the topological associations of them. For example class GMModel which would have methods such as add edge, add face etc. Is there something in OC that has this capabiblities already ? What do people do for this situation ?

2) The second question regard assigning attributes to OC entities. For example an integer id, or a double value to an edge of face. From what I understand part of OCAF's philosophy is this key driven process to which entities of any type are grouped. I know people out there are not using OCAF so how do you approach this problem ??

Your help would be greatly appreciated

Kind regards Simon

Mikael Aronsson's picture

Hi !

I do not USE AIS or OCAF, I did not like OCAF very much and found it a it complicated to use, I guess it is more useful in a CAD application (I am working on a 3D modeler), and I needed some unusual stuff in the OpenGL window which was more complicated to do with AIS, also AIS does not have much in terms of optimization (display lists, culling and so on).

So I have done my own set of classes to handle this, I build a tree hierarchy oj objects that takes care of everything, it was not very hard to do.

At the moment these classes are pretty much useless outside my modeler, but I intend to create a library out of this, but that will not happen in the near future (this year).

About the geometric models, I create a subtree inside the hierarchy with all the shapes used to build an object (using my own classes, but each class has a TopoDS_Shape inside), the I can traverse this tree to regenrate the object was something change in the design.

I do not now if it is a godd solution, but so far it works very good.

Sorry, I guess I was not of much help here.

Mikael