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

Search the Forums
See All Topics
Open CASCADEShowroomGet it!Developer CornerSupport and ProductsAbout us
Technical overview
Areas of use
Shape factory
Shape gallery
What's new
System requirements
Download Center
Public license
Getting started
Open Source community
Training and e-learning
A-la Carte Support
Value-added software
Complementary Components
Customer Corner
Company Profile
Marketing Materials
Contact Us
Home / Developer Corner / Forums / Usage issues / OCC + nglib: variable casting ...

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
  • New features to enhance the development process
  • Open CASCADE Technology 6.7.1 is available for download!
  • Open CASCADE Technology 6.7.0 is available for download!

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