Open CASCADE, the 3D modelling kernel
3D modeling & numerical simulation

Search the Forums
See All Topics

OCC + nglib: variable casting ...

OCC + nglib: variable casting ...
Víctor SV 2013/02/18 11:44
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 :))

Víctor SV 2013/02/19 12:01
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;
Latest news
  • Open CASCADE CAD Assistant for iOS platform is available!
  • Open CASCADE Technology 6.9.0 is available for download!
  • JT Assistant for Android

  • © OPEN CASCADE 2000 - 2015  |  Search  |  Contacts   |  Site map