v0.1.0
Fast, portable C library for geometry input/output
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Modules
stl_occ_brep.h
Go to the documentation of this file.
1 /****************************************************************************
2 ** gmio
3 ** Copyright Fougue (24 Jun. 2016)
4 ** contact@fougue.pro
5 **
6 ** This software is a reusable library whose purpose is to provide complete
7 ** I/O support for various CAD file formats (eg. STL)
8 **
9 ** This software is governed by the CeCILL-B license under French law and
10 ** abiding by the rules of distribution of free software. You can use,
11 ** modify and/ or redistribute the software under the terms of the CeCILL-B
12 ** license as circulated by CEA, CNRS and INRIA at the following URL
13 ** "http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html".
14 ****************************************************************************/
15 
32 #ifndef __cplusplus
33 # error C++ compiler required
34 #endif
35 
36 #ifndef GMIO_SUPPORT_STL_OCC_BREP_H
37 #define GMIO_SUPPORT_STL_OCC_BREP_H
38 
39 #include "support_global.h"
40 #include "../gmio_stl/stl_mesh.h"
41 
42 #include <vector>
43 
44 #include <Poly_Triangulation.hxx>
45 #include <TopoDS_Shape.hxx>
46 class TopoDS_Face;
47 
62 {
64  explicit gmio_stl_mesh_occshape(const TopoDS_Shape& shape);
65 
66  inline const TopoDS_Shape* shape() const { return m_shape; }
67 
68 private:
69  static void get_triangle(
70  const void* cookie, uint32_t tri_id, gmio_stl_triangle* tri);
71 
72  void init_C_members();
73 
74  struct face_data {
75  gp_Trsf trsf;
76  bool is_reversed;
77  const TColgp_Array1OfPnt* ptr_nodes;
78  };
79  struct triangle_data {
80  const Poly_Triangle* ptr_triangle;
81  const face_data* ptr_face_data;
82  };
83 
84  std::vector<face_data> m_vec_face_data;
85  std::vector<triangle_data> m_vec_triangle_data;
86  const TopoDS_Shape* m_shape;
87 };
88 
89 #endif /* GMIO_SUPPORT_STL_OCC_BREP_H */
90 
Provides an interface for accessing the underlying(hidden) user mesh.
Definition: stl_mesh.h:30
const void * cookie
Opaque pointer on the user mesh, passed as first argument to hook functions.
Definition: stl_mesh.h:34
STL mesh triangle.
Definition: stl_triangle.h:30
Provides access to all the internal triangles of OpenCascade's TopoDS_Shape.
Definition: stl_occ_brep.h:61
Global declarations for the support module.
const TopoDS_Shape * shape() const
Definition: stl_occ_brep.h:66
Fougue © 2016