OCC + nglib: variable casting ...

Hello all,

i have some problems using nglib and OCC because my poor knowledge about C++ ...
Some one can tell me how to do the following variable castings?

OCCGeometry -> Ng_OCC_Geometry
* Ng_OCC_Geometry -> OCCGeometry
* Mesh -> * Ng_Mesh
* Ng_Mesh -> * Mesh

is it posible?

I know that is a stupid question, but will be very useful for me.

Thanks :))

victorsv's picture

Hello again,

maybe this is not the best site to do this question, but i think that this can be useful for someone who use OCC and netgen.

With Netgen we can found 2 "layers" to wrap OCC geometries for meshing. With nglib (nglib.h) we can load a geometry and mesh it, but if we want to do something with the geometrys (mesh subdomains, merge meshes, ...) we have to use occgeom (occgeom.hpp) and some classes from OpenCascade.

nglib uses the following variable types for geometries and meshes: Ng_OCC_Geometry and Ng_Mesh.
occgeom uses OCCGeomtry and Mesh. Here comes the stupid thing... I have some problems to understand this in C++... The variable types for geometries and meshes in nglib are only pointers to the OCCGeometry and Mesh variables!!

Here comes an example:

OCCGeometry *occgeom; //occgeom
Ng_OCC_Geometry *ngoccgeom; //nglib
Mesh *mesh; //occgeom
Ng_Mesh *ngmesh; //nglib

ngoccgeom = (Ng_OCC_Geometry *)&occgeom;
occgeom = (OCCGeometry *) *ngoccgeom;
ngmesh = (Ng_Mesh *)&mesh;
mesh = (Mesh *) *ngmesh;