|
OCCT-Light 0.1
C ABI and C++ veneer for multi-language CAD workflows
|
OCCT-Light: native OCCT BRep file I/O. More...


Go to the source code of this file.
Classes | |
| struct | occtl_io_brep_write_options |
Macros | |
| #define | OCCTL_IO_BREP_WRITE_OPTIONS_VERSION_1 1u |
| #define | OCCTL_IO_BREP_WRITE_OPTIONS_INIT {OCCTL_IO_BREP_WRITE_OPTIONS_VERSION_1, NULL, 1} |
Typedefs | |
| typedef struct occtl_io_brep_write_options | occtl_io_brep_write_options_t |
Functions | |
| void | occtl_io_brep_write_options_init (occtl_io_brep_write_options_t *options) |
| occtl_status_t | occtl_io_brep_read (const char *path, occtl_graph_t **out_graph, occtl_node_id_t *out_root) |
| occtl_status_t | occtl_io_brep_write (const occtl_graph_t *graph, occtl_node_id_t root, const char *path, const occtl_io_brep_write_options_t *options) |
OCCT-Light: native OCCT BRep file I/O.
Read and write .brep files via OCCT's DEBREP_Provider / DEBREP_ConfigurationNode. The provider round-trips through OCCT's internal shape representation.
| typedef struct occtl_io_brep_write_options occtl_io_brep_write_options_t |
Options for occtl_io_brep_write. Pass NULL for defaults (binary output, triangulations included). The format flavour (binary vs ASCII) is determined by the DEBREP_Provider from its configuration — the caller can rely on OCCT's default binary encoding without setting it explicitly here.
| occtl_status_t occtl_io_brep_read | ( | const char * | path, |
| occtl_graph_t ** | out_graph, | ||
| occtl_node_id_t * | out_root | ||
| ) |
Reads a BRep file and ingests it into a freshly-created graph.
The returned graph contains the topology rooted at out_root. Caller owns the graph and must release it via occtl_graph_free.
| [in] | path | Borrows it. NUL-terminated UTF-8 path to the file. |
| [out] | out_graph | Owns it. Receives a new graph on success; NULL on failure. |
| [out] | out_root | Borrows it. Receives the NodeId of the root entity. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | path, out_graph, or out_root is NULL. |
| OCCTL_IO_ERROR | Filesystem failure or unreadable file. |
| OCCTL_FORMAT_ERROR | File contents were not a valid BRep stream. |
\par Thread Safety Yes.
| occtl_status_t occtl_io_brep_write | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | root, | ||
| const char * | path, | ||
| const occtl_io_brep_write_options_t * | options | ||
| ) |
Writes the topology rooted at root to a BRep file.
Triangulation policy is taken from options; pass NULL for defaults (binary, triangulations included). The output format (binary / ASCII) is managed by the DEBREP_Provider internally.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | root | Root node id to serialise. |
| [in] | path | Borrows it. NUL-terminated UTF-8 path; existing file is overwritten. |
| [in] | options | Borrows it. May be NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or path is NULL; or options has invalid fields (non-NULL p_next, write_triangulation not in {0,1}). |
| OCCTL_NOT_FOUND | root is invalid or has been removed. |
| OCCTL_VERSION_MISMATCH | options has an unsupported struct_version. |
| OCCTL_IO_ERROR | Filesystem failure or unwritable file. |
\par Thread Safety Yes (read-only on graph).
| void occtl_io_brep_write_options_init | ( | occtl_io_brep_write_options_t * | options | ) |
Initialises options to default values matching OCCTL_IO_BREP_WRITE_OPTIONS_INIT.
NULL-tolerant.
| [out] | options | Borrows it. May be NULL (no-op). |
\par Thread Safety Yes.