|
OCCT-Light 0.1
C ABI and C++ veneer for multi-language CAD workflows
|
OCCT-Light: topology module public API. More...
#include <stddef.h>#include <stdint.h>#include "occtl_core.h"#include "occtl_curves.h"#include "occtl_curves2d.h"#include "occtl_geom.h"#include "occtl_surfaces.h"#include "occtl_topo_build.h"#include "occtl_topo_relation.h"#include "occtl_topo_types.h"

Go to the source code of this file.
Classes | |
| struct | occtl_topo_make_product_info |
| struct | occtl_edge_view |
| struct | occtl_coedge_view |
| struct | occtl_face_view |
| struct | occtl_vertex_view |
| struct | occtl_wire_view |
| struct | occtl_shell_view |
| struct | occtl_solid_view |
| struct | occtl_compound_view |
Macros | |
| #define | OCCTL_TOPO_MAKE_PRODUCT_INFO_VERSION_1 1u |
| #define | OCCTL_TOPO_MAKE_PRODUCT_INFO_INIT |
| #define | OCCTL_EDGE_VIEW_VERSION_1 1u |
| #define | OCCTL_EDGE_VIEW_INIT |
| #define | OCCTL_COEDGE_VIEW_VERSION_1 1u |
| #define | OCCTL_COEDGE_VIEW_INIT |
| #define | OCCTL_FACE_VIEW_VERSION_1 1u |
| #define | OCCTL_FACE_VIEW_INIT {OCCTL_FACE_VIEW_VERSION_1, NULL, 0.0, 0.0, 0.0, 0.0, 0.0, OCCTL_NODE_ID_INVALID, 0u, 0, 0, 0} |
| #define | OCCTL_VERTEX_VIEW_VERSION_1 1u |
| #define | OCCTL_VERTEX_VIEW_INIT {OCCTL_VERTEX_VIEW_VERSION_1, NULL, {0.0, 0.0, 0.0}, 0.0} |
| #define | OCCTL_WIRE_VIEW_VERSION_1 1u |
| #define | OCCTL_WIRE_VIEW_INIT {OCCTL_WIRE_VIEW_VERSION_1, NULL, 0, 0, 0} |
| #define | OCCTL_SHELL_VIEW_VERSION_1 1u |
| #define | OCCTL_SHELL_VIEW_INIT {OCCTL_SHELL_VIEW_VERSION_1, NULL, 0, 0} |
| #define | OCCTL_SOLID_VIEW_VERSION_1 1u |
| #define | OCCTL_SOLID_VIEW_INIT {OCCTL_SOLID_VIEW_VERSION_1, NULL, 0} |
| #define | OCCTL_COMPOUND_VIEW_VERSION_1 1u |
| #define | OCCTL_COMPOUND_VIEW_INIT {OCCTL_COMPOUND_VIEW_VERSION_1, NULL, 0} |
Typedefs | |
| typedef struct occtl_node_iter | occtl_node_iter_t |
| typedef occtl_status_t(* | occtl_node_visitor_t) (occtl_node_id_t node, void *user_data) |
| Callback for occtl_graph_for_each. | |
| typedef occtl_status_t(* | occtl_ref_visitor_t) (occtl_ref_id_t ref, void *user_data) |
| Callback for occtl_graph_for_each_ref. | |
| typedef occtl_status_t(* | occtl_rep_visitor_t) (occtl_rep_id_t rep, void *user_data) |
| Callback for occtl_graph_for_each_rep. | |
| typedef struct occtl_topo_make_product_info | occtl_topo_make_product_info_t |
| typedef struct occtl_edge_view | occtl_edge_view_t |
| typedef struct occtl_coedge_view | occtl_coedge_view_t |
| typedef struct occtl_face_view | occtl_face_view_t |
| typedef struct occtl_vertex_view | occtl_vertex_view_t |
| typedef struct occtl_wire_view | occtl_wire_view_t |
| typedef struct occtl_shell_view | occtl_shell_view_t |
| typedef struct occtl_solid_view | occtl_solid_view_t |
| typedef struct occtl_compound_view | occtl_compound_view_t |
OCCT-Light: topology module public API.
Defines occtl_graph_t (the topology graph), session-local identity types (occtl_node_id_t / occtl_ref_id_t / occtl_rep_id_t), persistent identity (occtl_uid_t, declared in occtl_core.h, and occtl_ref_uid_t), graph lifecycle, count queries, identity conversion, geometry accessors, opaque node-iteration, and high-level topology builders.
| #define OCCTL_COEDGE_VIEW_INIT |
| #define OCCTL_EDGE_VIEW_INIT |
| #define OCCTL_TOPO_MAKE_PRODUCT_INFO_INIT |
| typedef struct occtl_coedge_view occtl_coedge_view_t |
Aggregate snapshot of a coedge's scalar state.
uv_start / uv_end are the UV-space endpoints of the coedge's pcurve on the parent face's surface, as reported by BRepGraph_Tool::CoEdge::UVPoints. When has_pcurve is 0 they default to (0,0).
| typedef struct occtl_compound_view occtl_compound_view_t |
Aggregate snapshot of a compound's scalar state.
| typedef struct occtl_edge_view occtl_edge_view_t |
Aggregate snapshot of an edge's scalar state.
Each aggregate view struct opens with struct_version and p_next. Callers must initialise the struct with the matching init function or INIT literal so the library can dispatch on the version they understand. Filler functions write scalars only, so view lifetime ends with the function call.
Fields after p_next are written by the library. All fields are caller-owned (no borrowed pointers): the snapshot is decoupled from the source graph and survives subsequent mutation.
The boolean fields are 0/1; the int32_t storage forbids bool per the ABI rules. Face-context queries (is_seam_on_face, is_boundary_on_face) are not part of the snapshot; use the occtl_topo_edge_is_*_on_face accessors for those.
| typedef struct occtl_face_view occtl_face_view_t |
Aggregate snapshot of a face's scalar state.
| typedef struct occtl_node_iter occtl_node_iter_t |
Opaque iterator over a sequence of node IDs.
Holds a snapshot view rooted in a graph; created by one of the enumeration factories below. Yielded IDs are session-local occtl_node_id_t values whose kind is determined by the factory used to create the iterator (e.g. occtl_graph_face_iter_create yields OCCTL_KIND_FACE). Removed nodes are filtered internally and never exposed. Iteration order is documented per factory.
Lifetime: borrows from the source graph. Valid until either occtl_node_iter_free is called on the iterator or the source graph is freed. Adding nodes, calling a future compact, or freeing the graph while an iterator is live is undefined behaviour. Removing a node that has not yet been visited is well-defined (the iterator filters it out); removing the node currently positioned at is undefined. Release iterators before any mutating call to keep the contract simple.
Not thread-safe with respect to its own state. Distinct iterators over the same graph may be advanced from distinct threads if the graph is not concurrently mutated (matching the read-only concurrency contract on graph reads).
| typedef struct occtl_shell_view occtl_shell_view_t |
Aggregate snapshot of a shell's scalar state.
| typedef struct occtl_solid_view occtl_solid_view_t |
Aggregate snapshot of a solid's scalar state.
| typedef struct occtl_topo_make_product_info occtl_topo_make_product_info_t |
Info for occtl_topo_make_product.
When root == OCCTL_NODE_ID_INVALID, an empty product is created. Otherwise the product wraps root with placement as a shape root.
| typedef struct occtl_vertex_view occtl_vertex_view_t |
Aggregate snapshot of a vertex's scalar state.
| typedef struct occtl_wire_view occtl_wire_view_t |
Aggregate snapshot of a wire's scalar state.
| void occtl_coedge_view_init | ( | occtl_coedge_view_t * | view | ) |
Initialises view to default values matching OCCTL_EDGE_VIEW_INIT.
NULL-tolerant.
| [out] | view | Borrows it. May be NULL (no-op). |
\par Thread Safety Yes.
| void occtl_compound_view_init | ( | occtl_compound_view_t * | view | ) |
Initialises view to default values matching OCCTL_EDGE_VIEW_INIT.
NULL-tolerant.
| [out] | view | Borrows it. May be NULL (no-op). |
\par Thread Safety Yes.
| void occtl_edge_view_init | ( | occtl_edge_view_t * | view | ) |
Initialises view to default values matching OCCTL_EDGE_VIEW_INIT.
NULL-tolerant.
| [out] | view | Borrows it. May be NULL (no-op). |
\par Thread Safety Yes.
| void occtl_face_view_init | ( | occtl_face_view_t * | view | ) |
Initialises view to default values matching OCCTL_EDGE_VIEW_INIT.
NULL-tolerant.
| [out] | view | Borrows it. May be NULL (no-op). |
\par Thread Safety Yes.
| occtl_status_t occtl_graph_coedge_count | ( | const occtl_graph_t * | graph, |
| size_t * | out_count | ||
| ) |
Returns the number of active (non-removed) solids in the graph.
| [in] | graph | Graph pointer. Must be non-NULL. |
| [out] | out_count | Borrows it (caller-allocated slot). Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
\par Thread Safety Yes (read-only).
| occtl_status_t occtl_graph_coedge_iter_create | ( | const occtl_graph_t * | graph, |
| occtl_node_iter_t ** | out_iter | ||
| ) |
Creates an iterator over all active solids.
Iterator borrows from graph; release with occtl_node_iter_free before mutating or freeing the graph. Iteration order is implementation-defined but stable for a given graph state.
| [in] | graph | Must be non-NULL. |
| [out] | out_iter | Owns it. Must be non-NULL. On success receives a new iterator; on failure set to NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_iter is NULL. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_graph_color_entries | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t * | out_nodes, | ||
| occtl_color_rgba_t * | out_colors, | ||
| size_t | cap, | ||
| size_t * | out_count | ||
| ) |
Lists nodes that have an explicit colour entry.
Two-call buffer pattern: pass out_nodes and out_colors as NULL with cap 0 to learn the entry count, then call again with both arrays of at least that many elements. Values are snapshots copied from the graph-owned colour metadata.
| [in] | graph | Borrows it. Must be non-NULL. |
| [out] | out_nodes | Borrows it. Length cap; may be NULL only on the sizing call. |
| [out] | out_colors | Borrows it. Length cap; may be NULL only on the sizing call. |
| [in] | cap | Capacity of out_nodes and out_colors. |
| [out] | out_count | Borrows it. Must be non-NULL. Receives total count. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL, or only one output array is NULL on a refill call. |
| OCCTL_BUFFER_TOO_SMALL | Output arrays are non-NULL and cap is smaller than out_count. |
\par Thread Safety Yes (read-only on graph metadata).
| occtl_status_t occtl_graph_color_get | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | target, | ||
| occtl_color_rgba_t * | out_color | ||
| ) |
Retrieves the colour of a target node.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | target | Node ID to query. Must be valid and active. |
| [out] | out_color | Borrows it. Must be non-NULL. Receives the stored colour, or opaque white if no colour was previously set. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_color is NULL. |
| OCCTL_NOT_FOUND | target is invalid or removed. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_graph_color_set | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | target, | ||
| occtl_color_rgba_t | color | ||
| ) |
Sets a colour on a target node.
The colour is stored as an RGBA value and associated with target in an internal graph-wide colour metadata.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | target | Node ID to colour. Must be valid and active. |
| [in] | color | RGBA colour value (by value). |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL, or any color channel in color is non-finite. |
| OCCTL_NOT_FOUND | target is invalid or removed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_graph_color_unset | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | target | ||
| ) |
Removes the colour associated with a target node.
After this call, occtl_graph_color_get returns the default colour (opaque white). Idempotent — calling on a node with no colour set is a successful no-op.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | target | Node ID to clear. Must be valid and active. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_NOT_FOUND | target is invalid or removed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_graph_compound_count | ( | const occtl_graph_t * | graph, |
| size_t * | out_count | ||
| ) |
Returns the number of active (non-removed) solids in the graph.
| [in] | graph | Graph pointer. Must be non-NULL. |
| [out] | out_count | Borrows it (caller-allocated slot). Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
\par Thread Safety Yes (read-only).
| occtl_status_t occtl_graph_compound_iter_create | ( | const occtl_graph_t * | graph, |
| occtl_node_iter_t ** | out_iter | ||
| ) |
Creates an iterator over all active solids.
Iterator borrows from graph; release with occtl_node_iter_free before mutating or freeing the graph. Iteration order is implementation-defined but stable for a given graph state.
| [in] | graph | Must be non-NULL. |
| [out] | out_iter | Owns it. Must be non-NULL. On success receives a new iterator; on failure set to NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_iter is NULL. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_graph_compsolid_count | ( | const occtl_graph_t * | graph, |
| size_t * | out_count | ||
| ) |
Returns the number of active (non-removed) solids in the graph.
| [in] | graph | Graph pointer. Must be non-NULL. |
| [out] | out_count | Borrows it (caller-allocated slot). Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
\par Thread Safety Yes (read-only).
| occtl_status_t occtl_graph_compsolid_iter_create | ( | const occtl_graph_t * | graph, |
| occtl_node_iter_t ** | out_iter | ||
| ) |
Creates an iterator over all active solids.
Iterator borrows from graph; release with occtl_node_iter_free before mutating or freeing the graph. Iteration order is implementation-defined but stable for a given graph state.
| [in] | graph | Must be non-NULL. |
| [out] | out_iter | Owns it. Must be non-NULL. On success receives a new iterator; on failure set to NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_iter is NULL. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_graph_create | ( | occtl_graph_t ** | out_graph | ) |
Creates an empty topology graph.
The returned graph is heap-allocated; the caller owns it and must release it with occtl_graph_free. The graph starts with zero entities.
| [out] | out_graph | Owns it. Must be non-NULL. On success receives a valid handle (never NULL); on failure set to NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | out_graph is NULL. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes.
| occtl_status_t occtl_graph_edge_count | ( | const occtl_graph_t * | graph, |
| size_t * | out_count | ||
| ) |
Returns the number of active (non-removed) solids in the graph.
| [in] | graph | Graph pointer. Must be non-NULL. |
| [out] | out_count | Borrows it (caller-allocated slot). Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
\par Thread Safety Yes (read-only).
| occtl_status_t occtl_graph_edge_iter_create | ( | const occtl_graph_t * | graph, |
| occtl_node_iter_t ** | out_iter | ||
| ) |
Creates an iterator over all active solids.
Iterator borrows from graph; release with occtl_node_iter_free before mutating or freeing the graph. Iteration order is implementation-defined but stable for a given graph state.
| [in] | graph | Must be non-NULL. |
| [out] | out_iter | Owns it. Must be non-NULL. On success receives a new iterator; on failure set to NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_iter is NULL. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_graph_face_count | ( | const occtl_graph_t * | graph, |
| size_t * | out_count | ||
| ) |
Returns the number of active (non-removed) solids in the graph.
| [in] | graph | Graph pointer. Must be non-NULL. |
| [out] | out_count | Borrows it (caller-allocated slot). Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
\par Thread Safety Yes (read-only).
| occtl_status_t occtl_graph_face_iter_create | ( | const occtl_graph_t * | graph, |
| occtl_node_iter_t ** | out_iter | ||
| ) |
Creates an iterator over all active solids.
Iterator borrows from graph; release with occtl_node_iter_free before mutating or freeing the graph. Iteration order is implementation-defined but stable for a given graph state.
| [in] | graph | Must be non-NULL. |
| [out] | out_iter | Owns it. Must be non-NULL. On success receives a new iterator; on failure set to NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_iter is NULL. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_graph_for_each | ( | const occtl_graph_t * | graph, |
| uint64_t | kind_mask, | ||
| occtl_node_visitor_t | visitor, | ||
| void * | user_data | ||
| ) |
Iterates over all nodes in graph whose kind is in kind_mask using internal per-kind iterators. Calls visitor for each matching node.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | kind_mask | Bitwise OR of occtl_node_kind_t values. |
| [in] | visitor | Callback invoked for each matching node. |
| [in,out] | user_data | Passed through to visitor. May be NULL. |
| OCCTL_OK | On completion. |
| OCCTL_INVALID_ARGUMENT | graph or visitor is NULL. \par Thread Safety Yes (read-only). |
| occtl_status_t occtl_graph_for_each_ref | ( | const occtl_graph_t * | graph, |
| uint64_t | ref_kind_mask, | ||
| occtl_ref_visitor_t | visitor, | ||
| void * | user_data | ||
| ) |
Iterates over all references in graph whose kind is in ref_kind_mask. Calls visitor for each matching reference.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | ref_kind_mask | Bitwise OR of occtl_ref_kind_t values. |
| [in] | visitor | Callback invoked for each matching ref. |
| [in,out] | user_data | Passed through. May be NULL. |
| OCCTL_OK | On completion. |
| OCCTL_INVALID_ARGUMENT | graph or visitor is NULL. |
\par Thread Safety Yes (read-only).
| occtl_status_t occtl_graph_for_each_rep | ( | const occtl_graph_t * | graph, |
| uint64_t | rep_kind_mask, | ||
| occtl_rep_visitor_t | visitor, | ||
| void * | user_data | ||
| ) |
Iterates over all representations in graph whose kind is in rep_kind_mask. Calls visitor for each matching representation.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | rep_kind_mask | Bitwise OR of occtl_rep_kind_t values. |
| [in] | visitor | Callback invoked for each matching rep. |
| [in,out] | user_data | Passed through. May be NULL. |
| OCCTL_OK | On completion. |
| OCCTL_INVALID_ARGUMENT | graph or visitor is NULL. |
\par Thread Safety Yes (read-only).
| void occtl_graph_free | ( | occtl_graph_t * | graph | ) |
Releases a graph and all associated resources.
NULL-tolerant (free on NULL is a no-op). After this returns, all NodeIds, RefIds, and borrowed pointers obtained from this graph are invalidated.
| [in] | graph | Graph to free. May be NULL. |
\par Thread Safety No — do not free a graph that another thread may be using.
| occtl_status_t occtl_graph_history_deleted_all | ( | const occtl_graph_t * | graph, |
| occtl_uid_t * | out_buf, | ||
| size_t | cap, | ||
| size_t * | out_count | ||
| ) |
Dump all deleted input UIDs recorded on graph.
| [in] | graph | Borrows it. Must be non-NULL. |
| [out] | out_buf | Borrows it. May be NULL for sizing. |
| [in] | cap | Capacity of out_buf in entries. |
| [out] | out_count | Borrows it. Must be non-NULL. Receives required count. |
| OCCTL_OK | On sizing or successful fill. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_BUFFER_TOO_SMALL | out_buf is non-NULL and cap is too small. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_graph_history_generated | ( | const occtl_graph_t * | graph, |
| occtl_uid_t | input_uid, | ||
| occtl_uid_t * | out_buf, | ||
| size_t | cap, | ||
| size_t * | out_count | ||
| ) |
Look up Generated history images of an input UID recorded on graph.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | input_uid | Input entity UID recorded by a shape-modifying operation. |
| [out] | out_buf | Borrows it. May be NULL for sizing. |
| [in] | cap | Capacity of out_buf in entries. |
| [out] | out_count | Borrows it. Must be non-NULL. Receives required count. |
| OCCTL_OK | On sizing or successful fill. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL, or input_uid is malformed. |
| OCCTL_BUFFER_TOO_SMALL | out_buf is non-NULL and cap is too small. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_graph_history_modified | ( | const occtl_graph_t * | graph, |
| occtl_uid_t | input_uid, | ||
| occtl_uid_t * | out_buf, | ||
| size_t | cap, | ||
| size_t * | out_count | ||
| ) |
Look up Modified history images of an input UID recorded on graph.
History is owned by the graph that received the operation result. The function uses the two-call buffer pattern: pass out_buf NULL to query the required count, then call again with enough capacity.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | input_uid | Input entity UID recorded by a shape-modifying operation. |
| [out] | out_buf | Borrows it. May be NULL for sizing. |
| [in] | cap | Capacity of out_buf in entries. |
| [out] | out_count | Borrows it. Must be non-NULL. Receives required count. |
| OCCTL_OK | On sizing or successful fill. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL, or input_uid is malformed. |
| OCCTL_BUFFER_TOO_SMALL | out_buf is non-NULL and cap is too small. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_graph_material_get | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | target, | ||
| occtl_material_info_t * | out_info, | ||
| char * | name_buf, | ||
| size_t | name_buf_size, | ||
| size_t * | out_name_required | ||
| ) |
Retrieves material-lite data from a target node (two-call buffer pattern).
Call once with name_buf == NULL to learn the required material-name buffer size in out_name_required, then call again with a buffer of at least that size. out_info is always populated on success; when name_buf is NULL its name pointer is NULL and name_len is the stored name byte length. When name_buf is supplied, out_info->name points at name_buf. The written name is NUL-terminated and out_name_required includes that terminator.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | target | Node ID to query. Must be valid and active. |
| [out] | out_info | Borrows it. Must be non-NULL. |
| [out] | name_buf | Owns it (caller-allocated). May be NULL to query required size. |
| [in] | name_buf_size | Size of name_buf in bytes. |
| [out] | out_name_required | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, out_info, or out_name_required is NULL. |
| OCCTL_NOT_FOUND | target is invalid / removed, or has no material set. |
| OCCTL_BUFFER_TOO_SMALL | name_buf is non-NULL and name_buf_size is too small. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_graph_material_nodes | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t * | out_nodes, | ||
| size_t | cap, | ||
| size_t * | out_count | ||
| ) |
Lists nodes that have explicit material-lite data.
Two-call buffer pattern: pass out_nodes as NULL with cap 0 to learn the count, then call again with an array of at least that many elements. Retrieve each material record with occtl_graph_material_get.
| [in] | graph | Borrows it. Must be non-NULL. |
| [out] | out_nodes | Borrows it. Length cap; may be NULL to query count. |
| [in] | cap | Capacity of out_nodes in elements. |
| [out] | out_count | Borrows it. Must be non-NULL. Receives total count. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_BUFFER_TOO_SMALL | out_nodes is non-NULL and cap is too small. |
\par Thread Safety Yes (read-only on graph metadata).
| occtl_status_t occtl_graph_material_set | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | target, | ||
| const occtl_material_info_t * | info | ||
| ) |
Sets material-lite data on a target node.
The material record is copied into graph-owned metadata. The name field in info is a borrowed byte span and does not need to be NUL-terminated. Density is optional; when present it must be finite and strictly positive. Diffuse colour is optional and uses the same channel convention as occtl_color_rgba_t.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | target | Node ID to annotate. Must be valid and active. |
| [in] | info | Borrows it. Must be non-NULL with a recognised struct_version and NULL p_next. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or info is NULL, or an info field is malformed. |
| OCCTL_VERSION_MISMATCH | info->struct_version is unsupported. |
| OCCTL_NOT_FOUND | target is invalid or removed. |
\par Thread Safety No (mutates graph metadata).
| occtl_status_t occtl_graph_material_unset | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | target | ||
| ) |
Removes material-lite data from a target node.
Idempotent: removing a missing material is a successful no-op.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | target | Node ID to modify. Must be valid and active. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_NOT_FOUND | target is invalid or removed. |
\par Thread Safety No (mutates graph metadata).
| occtl_status_t occtl_graph_metadata_get | ( | const occtl_graph_t * | graph, |
| const char * | key, | ||
| size_t | keyLen, | ||
| char * | buf, | ||
| size_t | bufSize, | ||
| size_t * | out_required | ||
| ) |
Retrieves UTF-8 metadata from the graph itself (two-call buffer pattern).
Call once with buf == NULL to learn the required buffer size in out_required, then call again with a buffer of at least that size. The written value is NUL-terminated; out_required includes the NUL terminator.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | key | Metadata key bytes. Borrowed; must be non-NULL and non-empty. |
| [in] | keyLen | Length of key in bytes. |
| [out] | buf | Owns it (caller-allocated). May be NULL to query required size. |
| [in] | bufSize | Size of buf in bytes. |
| [out] | out_required | Borrows it. Must be non-NULL. Receives required size including NUL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_required is NULL, or key is NULL/empty. |
| OCCTL_NOT_FOUND | key is not set on graph. |
| OCCTL_BUFFER_TOO_SMALL | buf is non-NULL and bufSize is too small. |
\par Thread Safety Yes (read-only on graph metadata).
| occtl_status_t occtl_graph_metadata_keys | ( | const occtl_graph_t * | graph, |
| occtl_metadata_key_view_t * | out_keys, | ||
| size_t | cap, | ||
| size_t * | out_count | ||
| ) |
Lists graph-level metadata keys.
Uses the two-call buffer pattern: pass out_keys as NULL with cap 0 to learn the key count, then call again with an array of at least that many entries. Returned key pointers borrow from the graph's internal metadata storage and are not necessarily NUL-terminated; use key_len.
| [in] | graph | Borrows it. Must be non-NULL. |
| [out] | out_keys | Borrows it (caller-allocated). Length cap; may be NULL to query count. |
| [in] | cap | Capacity of out_keys in elements. |
| [out] | out_count | Borrows it. Must be non-NULL. Receives total count. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_BUFFER_TOO_SMALL | out_keys is non-NULL and cap is too small. |
\par Thread Safety Yes (read-only on graph metadata).
| occtl_status_t occtl_graph_metadata_set | ( | occtl_graph_t * | graph, |
| const char * | key, | ||
| size_t | keyLen, | ||
| const char * | value, | ||
| size_t | valueLen | ||
| ) |
Sets UTF-8 metadata on the graph itself.
Graph metadata is for document/model-level attributes such as author, source format, exchange notes, or mesh-model metadata. It is stored in the graph metadata storage, survives graph clone and native graph snapshots, and is not attached to any particular node. key and value are byte buffers; neither needs to be NUL-terminated. A key must be non-empty.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | key | Metadata key bytes. Borrowed; copied internally. Must be non-NULL and non-empty. |
| [in] | keyLen | Length of key in bytes. |
| [in] | value | Metadata value bytes. Borrowed; copied internally. May be NULL only when valueLen is 0. |
| [in] | valueLen | Length of value in bytes. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL; key is NULL/empty; or value is NULL when valueLen > 0. |
\par Thread Safety No (mutates graph metadata).
| occtl_status_t occtl_graph_metadata_unset | ( | occtl_graph_t * | graph, |
| const char * | key, | ||
| size_t | keyLen | ||
| ) |
Removes one graph-level metadata key.
Idempotent: removing a missing key is a successful no-op.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | key | Metadata key bytes. Borrowed; must be non-NULL and non-empty. |
| [in] | keyLen | Length of key in bytes. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL, or key is NULL/empty. |
\par Thread Safety No (mutates graph metadata).
| occtl_status_t occtl_graph_name_get | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | target, | ||
| char * | buf, | ||
| size_t | bufSize, | ||
| size_t * | out_required | ||
| ) |
Retrieves the name of a target node (two-call buffer pattern).
Call once with buf == NULL to learn the required buffer size in out_required, then call again with a buffer of at least that size. The written string is NUL-terminated; out_required includes the NUL terminator.
If a node has no name set, the written string is empty (just the NUL terminator) and *out_required is 1.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | target | Node ID to query. Must be valid and active. |
| [out] | buf | Owns it (caller-allocated). May be NULL to query required size. |
| [in] | bufSize | Size of buf in bytes. |
| [out] | out_required | Borrows it. Must be non-NULL. Receives the required buffer size (including NUL). |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_required is NULL. |
| OCCTL_BUFFER_TOO_SMALL | buf is non-NULL and bufSize is too small; out_required receives the needed size. |
| OCCTL_NOT_FOUND | target is invalid or removed. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_graph_name_nodes | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t * | out_nodes, | ||
| size_t | cap, | ||
| size_t * | out_count | ||
| ) |
Lists nodes that have an explicit name entry.
Two-call buffer pattern: pass out_nodes as NULL with cap 0 to learn the count, then call again with an array of at least that many elements. Retrieve each name with occtl_graph_name_get.
| [in] | graph | Borrows it. Must be non-NULL. |
| [out] | out_nodes | Borrows it. Length cap; may be NULL to query count. |
| [in] | cap | Capacity of out_nodes in elements. |
| [out] | out_count | Borrows it. Must be non-NULL. Receives total count. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_BUFFER_TOO_SMALL | out_nodes is non-NULL and cap is too small. |
\par Thread Safety Yes (read-only on graph metadata).
| occtl_status_t occtl_graph_name_set | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | target, | ||
| const char * | name, | ||
| size_t | nameLen | ||
| ) |
Sets a human-readable name on a target node.
name is a byte buffer of length nameLen; it need not be NUL-terminated. The internal copy is NUL-terminated.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | target | Node ID to name. Must be valid and active. |
| [in] | name | Byte buffer containing the name. Borrowed; copied internally. May be NULL only when nameLen is 0. |
| [in] | nameLen | Length of name in bytes. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL, or name is NULL when nameLen > 0. |
| OCCTL_NOT_FOUND | target is invalid or removed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_graph_node_count | ( | const occtl_graph_t * | graph, |
| size_t * | out_count | ||
| ) |
Returns the total number of active nodes across all kinds.
| [in] | graph | Graph pointer. Must be non-NULL. |
| [out] | out_count | Borrows it (caller-allocated slot). Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
\par Thread Safety Yes (read-only).
| occtl_status_t occtl_graph_node_id_from_uid | ( | const occtl_graph_t * | graph, |
| occtl_uid_t | uid, | ||
| occtl_node_id_t * | out_node_id | ||
| ) |
Resolves a persistent UID to its current NodeId.
UIDs survive node removal and any future compaction operation; call this after any operation that may have reindexed nodes. Returns OCCTL_NOT_FOUND if the entity has been removed.
| [in] | graph | Must be non-NULL. |
| [in] | uid | UID to resolve. An all-zero (invalid) UID always returns OCCTL_NOT_FOUND. |
| [out] | out_node_id | Borrows it (caller-allocated slot). Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_node_id is NULL. |
| OCCTL_NOT_FOUND | The UID refers to a removed entity, or the UID is all-zero (invalid). |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_graph_node_kind | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | id, | ||
| occtl_node_kind_t * | out_kind | ||
| ) |
Returns the kind of a node ID.
No bit manipulation is exposed to the caller; treat occtl_node_id_t as opaque and query its kind through this function.
| [in] | graph | Must be non-NULL. |
| [in] | id | Node ID to inspect. |
| [out] | out_kind | Borrows it (caller-allocated slot). Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_kind is NULL. |
| OCCTL_NOT_FOUND | The node has been removed, or id is all-zero (invalid). |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_graph_node_metadata_get | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | target, | ||
| const char * | key, | ||
| size_t | keyLen, | ||
| char * | buf, | ||
| size_t | bufSize, | ||
| size_t * | out_required | ||
| ) |
Retrieves UTF-8 metadata from a target node (two-call buffer pattern).
Call once with buf == NULL to learn the required buffer size in out_required, then call again with a buffer of at least that size. The written value is NUL-terminated; out_required includes the NUL terminator.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | target | Node ID to query. Must be valid and active. |
| [in] | key | Metadata key bytes. Borrowed; must be non-NULL and non-empty. |
| [in] | keyLen | Length of key in bytes. |
| [out] | buf | Owns it (caller-allocated). May be NULL to query required size. |
| [in] | bufSize | Size of buf in bytes. |
| [out] | out_required | Borrows it. Must be non-NULL. Receives required size including NUL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_required is NULL, or key is NULL/empty. |
| OCCTL_NOT_FOUND | target is invalid / removed, or key is not set on target. |
| OCCTL_BUFFER_TOO_SMALL | buf is non-NULL and bufSize is too small. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_graph_node_metadata_keys | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | target, | ||
| occtl_metadata_key_view_t * | out_keys, | ||
| size_t | cap, | ||
| size_t * | out_count | ||
| ) |
Lists metadata keys stored on a target node.
Uses the two-call buffer pattern: pass out_keys as NULL with cap 0 to learn the key count, then call again with an array of at least that many entries. Returned key pointers borrow from the graph's internal metadata storage and are not necessarily NUL-terminated; use key_len.
A valid target with no metadata keys returns OCCTL_OK and count 0.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | target | Node ID to query. Must be valid and active. |
| [out] | out_keys | Borrows it (caller-allocated). Length cap; may be NULL to query count. |
| [in] | cap | Capacity of out_keys in elements. |
| [out] | out_count | Borrows it. Must be non-NULL. Receives total count. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_NOT_FOUND | target is invalid or removed. |
| OCCTL_BUFFER_TOO_SMALL | out_keys is non-NULL and cap is too small. |
\par Thread Safety Yes (read-only on graph metadata).
| occtl_status_t occtl_graph_node_metadata_nodes | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t * | out_nodes, | ||
| size_t | cap, | ||
| size_t * | out_count | ||
| ) |
Lists nodes that have at least one metadata key.
Two-call buffer pattern: pass out_nodes as NULL with cap 0 to learn the count, then call again with an array of at least that many elements. Retrieve each node's keys with occtl_graph_node_metadata_keys and each value with occtl_graph_node_metadata_get.
| [in] | graph | Borrows it. Must be non-NULL. |
| [out] | out_nodes | Borrows it. Length cap; may be NULL to query count. |
| [in] | cap | Capacity of out_nodes in elements. |
| [out] | out_count | Borrows it. Must be non-NULL. Receives total count. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_BUFFER_TOO_SMALL | out_nodes is non-NULL and cap is too small. |
\par Thread Safety Yes (read-only on graph metadata).
| occtl_status_t occtl_graph_node_metadata_set | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | target, | ||
| const char * | key, | ||
| size_t | keyLen, | ||
| const char * | value, | ||
| size_t | valueLen | ||
| ) |
Sets UTF-8 metadata on a target node.
key and value are byte buffers; neither needs to be NUL-terminated. A key must be non-empty. A zero-length value is allowed and stores an empty string. Metadata is stored as graph-owned metadata and follows graph compact / clone remapping.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | target | Node ID to annotate. Must be valid and active. |
| [in] | key | Metadata key bytes. Borrowed; copied internally. Must be non-NULL and non-empty. |
| [in] | keyLen | Length of key in bytes. |
| [in] | value | Metadata value bytes. Borrowed; copied internally. May be NULL only when valueLen is 0. |
| [in] | valueLen | Length of value in bytes. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL; key is NULL/empty; or value is NULL when valueLen > 0. |
| OCCTL_NOT_FOUND | target is invalid or removed. |
\par Thread Safety No (mutates graph metadata).
| occtl_status_t occtl_graph_node_metadata_unset | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | target, | ||
| const char * | key, | ||
| size_t | keyLen | ||
| ) |
Removes one metadata key from a target node.
Idempotent: removing a missing key is a successful no-op.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | target | Node ID to modify. Must be valid and active. |
| [in] | key | Metadata key bytes. Borrowed; must be non-NULL and non-empty. |
| [in] | keyLen | Length of key in bytes. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL, or key is NULL/empty. |
| OCCTL_NOT_FOUND | target is invalid or removed. |
\par Thread Safety No (mutates graph metadata).
| occtl_status_t occtl_graph_occurrence_count | ( | const occtl_graph_t * | graph, |
| size_t * | out_count | ||
| ) |
Returns the number of active (non-removed) solids in the graph.
| [in] | graph | Graph pointer. Must be non-NULL. |
| [out] | out_count | Borrows it (caller-allocated slot). Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
\par Thread Safety Yes (read-only).
| occtl_status_t occtl_graph_occurrence_iter_create | ( | const occtl_graph_t * | graph, |
| occtl_node_iter_t ** | out_iter | ||
| ) |
Creates an iterator over all active solids.
Iterator borrows from graph; release with occtl_node_iter_free before mutating or freeing the graph. Iteration order is implementation-defined but stable for a given graph state.
| [in] | graph | Must be non-NULL. |
| [out] | out_iter | Owns it. Must be non-NULL. On success receives a new iterator; on failure set to NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_iter is NULL. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_graph_product_count | ( | const occtl_graph_t * | graph, |
| size_t * | out_count | ||
| ) |
Returns the number of active (non-removed) solids in the graph.
| [in] | graph | Graph pointer. Must be non-NULL. |
| [out] | out_count | Borrows it (caller-allocated slot). Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
\par Thread Safety Yes (read-only).
| occtl_status_t occtl_graph_product_iter_create | ( | const occtl_graph_t * | graph, |
| occtl_node_iter_t ** | out_iter | ||
| ) |
Creates an iterator over all active solids.
Iterator borrows from graph; release with occtl_node_iter_free before mutating or freeing the graph. Iteration order is implementation-defined but stable for a given graph state.
| [in] | graph | Must be non-NULL. |
| [out] | out_iter | Owns it. Must be non-NULL. On success receives a new iterator; on failure set to NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_iter is NULL. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_graph_ref_id_from_ref_uid | ( | const occtl_graph_t * | graph, |
| occtl_ref_uid_t | ref_uid, | ||
| occtl_ref_id_t * | out_ref_id | ||
| ) |
Resolves a persistent RefUID to its current RefId.
RefUIDs survive graph compaction; call this after operations that may have reindexed reference entries. Returns OCCTL_NOT_FOUND if the reference has been removed or if ref_uid is invalid.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | ref_uid | RefUID to resolve. |
| [out] | out_ref_id | Borrows it (caller-allocated slot). Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_ref_id is NULL. |
| OCCTL_NOT_FOUND | ref_uid is invalid or not active. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_graph_ref_kind | ( | const occtl_graph_t * | graph, |
| occtl_ref_id_t | id, | ||
| occtl_ref_kind_t * | out_kind | ||
| ) |
Returns the kind of a ref ID.
| [in] | graph | Must be non-NULL. |
| [in] | id | Ref ID to inspect. |
| [out] | out_kind | Borrows it (caller-allocated slot). Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_kind is NULL. |
| OCCTL_NOT_FOUND | The reference has been removed, or id is all-zero (invalid). |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_graph_ref_uid_from_ref_id | ( | const occtl_graph_t * | graph, |
| occtl_ref_id_t | ref_id, | ||
| occtl_ref_uid_t * | out_ref_uid | ||
| ) |
Returns the persistent RefUID for a RefId.
The RefUID survives compaction and can be stored for later resolution. If the reference is later removed the RefUID becomes unresolvable.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | ref_id | RefId to inspect. |
| [out] | out_ref_uid | Borrows it (caller-allocated slot). Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_ref_uid is NULL. |
| OCCTL_NOT_FOUND | ref_id is invalid or removed. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_graph_ref_uid_kind | ( | const occtl_graph_t * | graph, |
| occtl_ref_uid_t | ref_uid, | ||
| occtl_ref_kind_t * | out_kind | ||
| ) |
Returns the kind embedded in a RefUID.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | ref_uid | RefUID to inspect. |
| [out] | out_kind | Borrows it (caller-allocated slot). Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_kind is NULL. |
| OCCTL_NOT_FOUND | ref_uid is invalid or not active. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_graph_ref_uid_table | ( | const occtl_graph_t * | graph, |
| occtl_ref_uid_t * | out_ref_uids, | ||
| occtl_ref_id_t * | out_refs, | ||
| size_t | cap, | ||
| size_t * | out_count | ||
| ) |
Dumps the (RefUID -> RefId) mapping for every active reference in graph.
Two-call buffer pattern: pass out_ref_uids and out_refs as NULL to query out_count, then call again with both arrays of at least that size. Returned arrays are parallel: entry i is (out_ref_uids[i], out_refs[i]).
| [in] | graph | Borrows it. Must be non-NULL. |
| [out] | out_ref_uids | Owns it (caller-allocated). Length cap; may be NULL only on the sizing call. |
| [out] | out_refs | Owns it (caller-allocated). Length cap; may be NULL only on the sizing call. |
| [in] | cap | Capacity of both output arrays. |
| [out] | out_count | Borrows it. Must be non-NULL. Receives total count. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL, or only one output array is NULL on a refill call. |
| OCCTL_BUFFER_TOO_SMALL | Output arrays are non-NULL and cap is smaller than out_count. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_graph_rep_id_from_rep_uid | ( | const occtl_graph_t * | graph, |
| occtl_rep_uid_t | rep_uid, | ||
| occtl_rep_id_t * | out_rep_id | ||
| ) |
Resolves a persistent RepUID to its current RepId.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | rep_uid | RepUID to resolve. |
| [out] | out_rep_id | Borrows it (caller-allocated slot). Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_rep_id is NULL. |
| OCCTL_NOT_FOUND | rep_uid is invalid or not active. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_graph_rep_kind | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | id, | ||
| occtl_rep_kind_t * | out_kind | ||
| ) |
Returns the kind of a rep ID.
| [in] | graph | Must be non-NULL. |
| [in] | id | Rep ID to inspect. |
| [out] | out_kind | Borrows it (caller-allocated slot). Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_kind is NULL. |
| OCCTL_NOT_FOUND | The representation has been removed, or id is all-zero (invalid). |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_graph_rep_uid_from_rep_id | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | rep_id, | ||
| occtl_rep_uid_t * | out_rep_uid | ||
| ) |
Returns the persistent RepUID for a RepId.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | rep_id | RepId to inspect. |
| [out] | out_rep_uid | Borrows it (caller-allocated slot). Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_rep_uid is NULL. |
| OCCTL_NOT_FOUND | rep_id is invalid or removed. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_graph_root_product_iter_create | ( | const occtl_graph_t * | graph, |
| occtl_node_iter_t ** | out_iter | ||
| ) |
Creates an iterator over all root products (products not referenced by any active occurrence).
Creates an iterator over all active solids.
Iterator borrows from graph; release with occtl_node_iter_free before mutating or freeing the graph. Iteration order is implementation-defined but stable for a given graph state.
| [in] | graph | Must be non-NULL. |
| [out] | out_iter | Owns it. Must be non-NULL. On success receives a new iterator; on failure set to NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_iter is NULL. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_graph_shell_count | ( | const occtl_graph_t * | graph, |
| size_t * | out_count | ||
| ) |
Returns the number of active (non-removed) solids in the graph.
| [in] | graph | Graph pointer. Must be non-NULL. |
| [out] | out_count | Borrows it (caller-allocated slot). Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
\par Thread Safety Yes (read-only).
| occtl_status_t occtl_graph_shell_iter_create | ( | const occtl_graph_t * | graph, |
| occtl_node_iter_t ** | out_iter | ||
| ) |
Creates an iterator over all active solids.
Iterator borrows from graph; release with occtl_node_iter_free before mutating or freeing the graph. Iteration order is implementation-defined but stable for a given graph state.
| [in] | graph | Must be non-NULL. |
| [out] | out_iter | Owns it. Must be non-NULL. On success receives a new iterator; on failure set to NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_iter is NULL. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_graph_solid_count | ( | const occtl_graph_t * | graph, |
| size_t * | out_count | ||
| ) |
Returns the number of active (non-removed) solids in the graph.
| [in] | graph | Graph pointer. Must be non-NULL. |
| [out] | out_count | Borrows it (caller-allocated slot). Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
\par Thread Safety Yes (read-only).
| occtl_status_t occtl_graph_solid_iter_create | ( | const occtl_graph_t * | graph, |
| occtl_node_iter_t ** | out_iter | ||
| ) |
Creates an iterator over all active solids.
Iterator borrows from graph; release with occtl_node_iter_free before mutating or freeing the graph. Iteration order is implementation-defined but stable for a given graph state.
| [in] | graph | Must be non-NULL. |
| [out] | out_iter | Owns it. Must be non-NULL. On success receives a new iterator; on failure set to NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_iter is NULL. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_graph_tag_add | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | target, | ||
| const char * | tag, | ||
| size_t | tagLen | ||
| ) |
Adds a UTF-8 tag to a target node.
Tags are byte strings; they do not need to be NUL-terminated. A tag must be non-empty. Tags are stored as graph-owned metadata and follow graph compact / clone remapping.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | target | Node ID to annotate. Must be valid and active. |
| [in] | tag | Tag bytes. Borrowed; copied internally. Must be non-NULL and non-empty. |
| [in] | tagLen | Length of tag in bytes. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL, or tag is NULL/empty. |
| OCCTL_NOT_FOUND | target is invalid or removed. |
\par Thread Safety No (mutates graph tags).
| occtl_status_t occtl_graph_tag_has | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | target, | ||
| const char * | tag, | ||
| size_t | tagLen, | ||
| int32_t * | out_has_tag | ||
| ) |
Tests whether a target node carries a UTF-8 tag.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | target | Node ID to query. Must be valid and active. |
| [in] | tag | Tag bytes. Borrowed; must be non-NULL and non-empty. |
| [in] | tagLen | Length of tag in bytes. |
| [out] | out_has_tag | Borrows it. Must be non-NULL. Receives 0 or 1. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_has_tag is NULL, or tag is NULL/empty. |
| OCCTL_NOT_FOUND | target is invalid or removed. |
\par Thread Safety Yes (read-only on graph tags).
| occtl_status_t occtl_graph_tag_list | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | target, | ||
| occtl_tag_view_t * | out_tags, | ||
| size_t | cap, | ||
| size_t * | out_count | ||
| ) |
Lists tags stored on a target node.
Uses the two-call buffer pattern: pass out_tags as NULL with cap 0 to learn the tag count, then call again with an array of at least that many entries. Returned tag pointers borrow from the graph's internal tag storage and are not necessarily NUL-terminated; use tag_len.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | target | Node ID to query. Must be valid and active. |
| [out] | out_tags | Borrows it (caller-allocated). Length cap; may be NULL to query count. |
| [in] | cap | Capacity of out_tags in elements. |
| [out] | out_count | Borrows it. Must be non-NULL. Receives total count. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_NOT_FOUND | target is invalid or removed. |
| OCCTL_BUFFER_TOO_SMALL | out_tags is non-NULL and cap is too small. |
\par Thread Safety Yes (read-only on graph tags).
| occtl_status_t occtl_graph_tag_nodes | ( | const occtl_graph_t * | graph, |
| const char * | tag, | ||
| size_t | tagLen, | ||
| occtl_node_id_t * | out_nodes, | ||
| size_t | cap, | ||
| size_t * | out_count | ||
| ) |
Lists nodes carrying tags.
Pass tag == NULL and tagLen == 0 to list nodes that have at least one tag. Pass a non-empty tag to list nodes carrying that exact tag.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | tag | Optional tag bytes. Borrowed; must be non-NULL when tagLen is non-zero. |
| [in] | tagLen | Length of tag in bytes. |
| [out] | out_nodes | Borrows it. Length cap; may be NULL to query count. |
| [in] | cap | Capacity of out_nodes in elements. |
| [out] | out_count | Borrows it. Must be non-NULL. Receives total count. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL, tag is NULL with non-zero tagLen, or tag is non-NULL with zero tagLen. |
| OCCTL_BUFFER_TOO_SMALL | out_nodes is non-NULL and cap is too small. |
\par Thread Safety Yes (read-only on graph tags).
| occtl_status_t occtl_graph_tag_remove | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | target, | ||
| const char * | tag, | ||
| size_t | tagLen | ||
| ) |
Removes a UTF-8 tag from a target node.
Idempotent: removing a missing tag is a successful no-op.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | target | Node ID to modify. Must be valid and active. |
| [in] | tag | Tag bytes. Borrowed; must be non-NULL and non-empty. |
| [in] | tagLen | Length of tag in bytes. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL, or tag is NULL/empty. |
| OCCTL_NOT_FOUND | target is invalid or removed. |
\par Thread Safety No (mutates graph tags).
| occtl_status_t occtl_graph_uid_from_node_id | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | id, | ||
| occtl_uid_t * | out_uid | ||
| ) |
Returns the persistent UID for a NodeId.
The UID survives node removal and any future compaction operation and can be stored for later resolution. If the node is later removed the UID becomes permanently unresolvable.
| [in] | graph | Must be non-NULL. |
| [in] | id | Node ID. An all-zero (invalid) NodeId always returns OCCTL_NOT_FOUND. |
| [out] | out_uid | Borrows it (caller-allocated slot). Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_uid is NULL. |
| OCCTL_NOT_FOUND | The NodeId refers to a removed entity, or the NodeId is all-zero (invalid). |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_graph_uid_kind | ( | const occtl_graph_t * | graph, |
| occtl_uid_t | uid, | ||
| occtl_node_kind_t * | out_kind | ||
| ) |
Returns the kind embedded in a UID.
| [in] | graph | Must be non-NULL. |
| [in] | uid | UID to inspect. |
| [out] | out_kind | Borrows it (caller-allocated slot). Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_kind is NULL. |
| OCCTL_NOT_FOUND | The UID is all-zero (invalid) or the entity has been removed. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_graph_uid_table | ( | const occtl_graph_t * | graph, |
| occtl_uid_t * | out_uids, | ||
| occtl_node_id_t * | out_nodes, | ||
| size_t | cap, | ||
| size_t * | out_count | ||
| ) |
Dumps the (UID → NodeId) mapping for every active node in graph.
Two-call buffer (§10.1): pass out_uids and out_nodes as NULL, any cap, to size the dump; reissue with both arrays of length at least out_count (the value the sizing call returned). The resulting parallel arrays form the wire-format-stable handshake that survives a Compact / save / load cycle.
Iteration order is implementation-defined but stable for a given graph state.
| [in] | graph | Must be non-NULL. |
| [out] | out_uids | Borrows it. Length cap; may be NULL on the sizing call. |
| [out] | out_nodes | Borrows it. Length cap; may be NULL on the sizing call. Must be the same length as out_uids on the refill call. |
| [in] | cap | Capacity of both arrays. Ignored when both arrays are NULL (sizing call). |
| [out] | out_count | Borrows it. Receives the total number of (UID, NodeId) pairs in the graph. |
| OCCTL_OK | Success — either sizing or full fill. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_BUFFER_TOO_SMALL | cap < out_count and at least one of the arrays is non-NULL. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_graph_units_get | ( | const occtl_graph_t * | graph, |
| double * | out_length_unit_to_meter, | ||
| char * | name_buf, | ||
| size_t | name_buf_size, | ||
| size_t * | out_name_required | ||
| ) |
Retrieves graph-level length-unit metadata (two-call buffer pattern).
Call once with name_buf == NULL to learn the required buffer size in out_name_required, then call again with a buffer of at least that size. The written unit name is NUL-terminated; out_name_required includes the NUL terminator.
| [in] | graph | Borrows it. Must be non-NULL. |
| [out] | out_length_unit_to_meter | Borrows it. Must be non-NULL. Receives the scale factor from one model length unit to meters. |
| [out] | name_buf | Owns it (caller-allocated). May be NULL to query required size. |
| [in] | name_buf_size | Size of name_buf in bytes. |
| [out] | out_name_required | Borrows it. Must be non-NULL. Receives required size including NUL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, out_length_unit_to_meter, or out_name_required is NULL. |
| OCCTL_BUFFER_TOO_SMALL | name_buf is non-NULL and name_buf_size is too small. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_graph_units_set | ( | occtl_graph_t * | graph, |
| double | length_unit_to_meter, | ||
| const char * | name, | ||
| size_t | nameLen | ||
| ) |
Sets graph-level length-unit metadata.
name is a byte buffer of length nameLen; it need not be NUL-terminated. The internal copy is NUL-terminated. A zero-length name is allowed and means "unnamed unit"; an unset graph reports a default unit of 1.0 meter named m.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | length_unit_to_meter | Scale factor from one model length unit to meters; must be finite and strictly positive. |
| [in] | name | Unit name bytes. Borrowed; copied internally. May be NULL only when nameLen is 0. |
| [in] | nameLen | Length of name in bytes. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL; length_unit_to_meter is non-finite / non-positive; or name is NULL when nameLen > 0. |
\par Thread Safety No (mutates graph metadata).
| occtl_status_t occtl_graph_vertex_count | ( | const occtl_graph_t * | graph, |
| size_t * | out_count | ||
| ) |
Returns the number of active (non-removed) solids in the graph.
| [in] | graph | Graph pointer. Must be non-NULL. |
| [out] | out_count | Borrows it (caller-allocated slot). Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
\par Thread Safety Yes (read-only).
| occtl_status_t occtl_graph_vertex_iter_create | ( | const occtl_graph_t * | graph, |
| occtl_node_iter_t ** | out_iter | ||
| ) |
Creates an iterator over all active solids.
Iterator borrows from graph; release with occtl_node_iter_free before mutating or freeing the graph. Iteration order is implementation-defined but stable for a given graph state.
| [in] | graph | Must be non-NULL. |
| [out] | out_iter | Owns it. Must be non-NULL. On success receives a new iterator; on failure set to NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_iter is NULL. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_graph_wire_count | ( | const occtl_graph_t * | graph, |
| size_t * | out_count | ||
| ) |
Returns the number of active (non-removed) solids in the graph.
| [in] | graph | Graph pointer. Must be non-NULL. |
| [out] | out_count | Borrows it (caller-allocated slot). Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
\par Thread Safety Yes (read-only).
| occtl_status_t occtl_graph_wire_iter_create | ( | const occtl_graph_t * | graph, |
| occtl_node_iter_t ** | out_iter | ||
| ) |
Creates an iterator over all active solids.
Iterator borrows from graph; release with occtl_node_iter_free before mutating or freeing the graph. Iteration order is implementation-defined but stable for a given graph state.
| [in] | graph | Must be non-NULL. |
| [out] | out_iter | Owns it. Must be non-NULL. On success receives a new iterator; on failure set to NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_iter is NULL. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_joint_create | ( | occtl_graph_t * | graph, |
| const occtl_joint_info_t * | info, | ||
| occtl_joint_id_t * | out_joint | ||
| ) |
Creates an assembly joint record.
The joint is copied into graph-owned metadata. Endpoint nodes may be products, occurrences, or topology nodes; metadata follows graph clone / compact remapping and removes joints whose endpoint is removed without replacement.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | info | Borrows it. Must be non-NULL with a recognised struct_version and NULL p_next. |
| [out] | out_joint | Borrows it. Must be non-NULL. Receives the new graph-local joint ID. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, info, or out_joint is NULL, or an info field is malformed. |
| OCCTL_VERSION_MISMATCH | info->struct_version is unsupported. |
| OCCTL_NOT_FOUND | An endpoint node is invalid or removed. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph metadata).
| occtl_status_t occtl_joint_get | ( | const occtl_graph_t * | graph, |
| occtl_joint_id_t | joint, | ||
| occtl_joint_info_t * | out_info | ||
| ) |
Retrieves an assembly joint record.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | joint | Joint ID to query. Must be valid in graph. |
| [out] | out_info | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_info is NULL, or joint is the invalid sentinel. |
| OCCTL_NOT_FOUND | joint is not present in graph. |
\par Thread Safety Yes (read-only on graph).
| void occtl_joint_info_init | ( | occtl_joint_info_t * | info | ) |
Initialises info to default values via OCCTL_JOINT_INFO_INIT.
NULL-tolerant.
| [out] | info | Borrows it. May be NULL (no-op). |
\par Thread Safety Yes.
| occtl_status_t occtl_joint_list | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | node, | ||
| occtl_joint_id_t * | out_joints, | ||
| size_t | cap, | ||
| size_t * | out_count | ||
| ) |
Lists assembly joints (two-call buffer pattern).
Pass OCCTL_NODE_ID_INVALID as node to list every joint in the graph. Otherwise, only joints whose first or second endpoint is node are listed. Call once with out_joints == NULL to learn the required count, then call again with an array of at least that size.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | node | Endpoint filter, or OCCTL_NODE_ID_INVALID for all. |
| [out] | out_joints | Owns it (caller-allocated). May be NULL to query required count. |
| [in] | cap | Capacity of out_joints in elements. |
| [out] | out_count | Borrows it. Must be non-NULL. Receives total count. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_NOT_FOUND | node is non-zero and invalid or removed. |
| OCCTL_BUFFER_TOO_SMALL | out_joints is non-NULL and cap is too small. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_joint_remove | ( | occtl_graph_t * | graph, |
| occtl_joint_id_t | joint | ||
| ) |
Removes an assembly joint record.
Idempotent: removing a missing joint is a successful no-op.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | joint | Joint ID to remove. Must not be the invalid sentinel. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL, or joint is invalid. |
\par Thread Safety No (mutates graph metadata).
| void occtl_node_iter_free | ( | occtl_node_iter_t * | iter | ) |
Releases an iterator. NULL-tolerant; idempotent.
After this call iter must not be passed to occtl_node_iter_next.
| [in] | iter | Iterator to release. May be NULL. |
\par Thread Safety No.
| occtl_status_t occtl_node_iter_next | ( | occtl_node_iter_t * | iter, |
| occtl_node_id_t * | out_id | ||
| ) |
Advances the iterator and returns the next node ID.
On a successful step writes the next ID to out_id and returns OCCTL_OK. When the iterator is exhausted writes OCCTL_NODE_ID_INVALID to out_id and returns OCCTL_NOT_FOUND; subsequent calls remain OCCTL_NOT_FOUND (idempotent end).
| [in,out] | iter | Borrows it. Must be non-NULL. Advanced in place. |
| [out] | out_id | Borrows it (caller-allocated slot). Must be non-NULL. |
| OCCTL_OK | On a successful step; out_id receives the ID. |
| OCCTL_NOT_FOUND | Iterator is exhausted; out_id set to invalid. |
| OCCTL_INVALID_ARGUMENT | iter or out_id is NULL. |
\par Thread Safety No (mutates iterator state).
| occtl_status_t occtl_ref_uid_from_bytes | ( | const uint8_t * | in_bytes, |
| occtl_ref_uid_t * | out_ref_uid | ||
| ) |
Decodes a fixed-width wire-format RefUID.
Rejects payloads whose reserved bytes are non-zero with OCCTL_FORMAT_ERROR; those bytes are reserved for a future wider identity encoding.
| [in] | in_bytes | Borrows it. Must point to at least OCCTL_REF_UID_WIRE_SIZE readable bytes. |
| [out] | out_ref_uid | Borrows it (caller-allocated slot). Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | in_bytes or out_ref_uid is NULL. |
| OCCTL_FORMAT_ERROR | Reserved bytes are non-zero. |
\par Thread Safety Yes.
| occtl_status_t occtl_ref_uid_to_bytes | ( | occtl_ref_uid_t | ref_uid, |
| uint8_t * | out_bytes | ||
| ) |
Encodes a RefUID into its fixed-width wire format.
| [in] | ref_uid | RefUID to encode (may be OCCTL_REF_UID_INVALID). |
| [out] | out_bytes | Owns it (caller-allocated). Must point to at least OCCTL_REF_UID_WIRE_SIZE writable bytes. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | out_bytes is NULL. |
\par Thread Safety Yes.
| occtl_status_t occtl_rep_uid_from_bytes | ( | const uint8_t * | in_bytes, |
| occtl_rep_uid_t * | out_rep_uid | ||
| ) |
Decodes a fixed-width wire-format RepUID.
| [in] | in_bytes | Borrows it. Must point to at least OCCTL_REP_UID_WIRE_SIZE readable bytes. |
| [out] | out_rep_uid | Borrows it (caller-allocated slot). Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | in_bytes or out_rep_uid is NULL. |
| OCCTL_FORMAT_ERROR | Reserved bytes are non-zero. |
\par Thread Safety Yes.
| occtl_status_t occtl_rep_uid_to_bytes | ( | occtl_rep_uid_t | rep_uid, |
| uint8_t * | out_bytes | ||
| ) |
Encodes a RepUID into its fixed-width wire format.
| [in] | rep_uid | RepUID to encode (may be OCCTL_REP_UID_INVALID). |
| [out] | out_bytes | Owns it (caller-allocated). Must point to at least OCCTL_REP_UID_WIRE_SIZE writable bytes. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | out_bytes is NULL. |
\par Thread Safety Yes.
| void occtl_shell_view_init | ( | occtl_shell_view_t * | view | ) |
Initialises view to default values matching OCCTL_EDGE_VIEW_INIT.
NULL-tolerant.
| [out] | view | Borrows it. May be NULL (no-op). |
\par Thread Safety Yes.
| void occtl_solid_view_init | ( | occtl_solid_view_t * | view | ) |
Initialises view to default values matching OCCTL_EDGE_VIEW_INIT.
NULL-tolerant.
| [out] | view | Borrows it. May be NULL (no-op). |
\par Thread Safety Yes.
| occtl_status_t occtl_topo_coedge_edge_of | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | coedge, | ||
| occtl_node_id_t * | out_edge | ||
| ) |
Returns the parent edge of a coedge.
| [in] | graph | Must be non-NULL. |
| [in] | coedge | CoEdge node ID. |
| [out] | out_edge | Borrows it. Receives the parent edge NodeId. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_edge is NULL. |
| OCCTL_NOT_FOUND | coedge is invalid, removed, or not a coedge. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_coedge_face_of | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | coedge, | ||
| occtl_node_id_t * | out_face | ||
| ) |
Returns the parent face of a coedge.
| [in] | graph | Must be non-NULL. |
| [in] | coedge | CoEdge node ID. |
| [out] | out_face | Borrows it. Receives the parent face NodeId. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_face is NULL. |
| OCCTL_NOT_FOUND | coedge is invalid, removed, or not a coedge. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_coedge_has_pcurve | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | coedge, | ||
| int32_t * | out_has_pcurve | ||
| ) |
Returns whether a coedge has a pcurve.
| [in] | graph | Must be non-NULL. |
| [in] | coedge | CoEdge node ID. |
| [out] | out_has_pcurve | Borrows it. Set to 1 if pcurve present, 0 otherwise. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_has_pcurve is NULL. |
| OCCTL_NOT_FOUND | coedge is invalid, removed, or not a coedge. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_coedge_is_reversed | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | coedge, | ||
| int32_t * | out_is_reversed | ||
| ) |
Returns whether a coedge is reversed (senses its parent edge in the opposite direction).
| [in] | graph | Must be non-NULL. |
| [in] | coedge | CoEdge node ID. |
| [out] | out_is_reversed | Borrows it. Set to 1 if reversed, 0 otherwise. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_is_reversed is NULL. |
| OCCTL_NOT_FOUND | coedge is invalid, removed, or not a coedge. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_coedge_is_seam | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | coedge, | ||
| int32_t * | out_is_seam | ||
| ) |
Returns whether a coedge is a seam (closed-surface) edge.
| [in] | graph | Must be non-NULL. |
| [in] | coedge | CoEdge node ID. |
| [out] | out_is_seam | Borrows it. Set to 1 if seam, 0 otherwise. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_is_seam is NULL. |
| OCCTL_NOT_FOUND | coedge is invalid, removed, or not a coedge. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_coedge_pcurve_eval | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | coedge, | ||
| double | u, | ||
| occtl_point2_t * | out_uv | ||
| ) |
Evaluates the PCurve UV point on a coedge at parameter u.
| [in] | graph | Must be non-NULL. |
| [in] | coedge | CoEdge node ID. |
| [in] | u | PCurve parameter. |
| [out] | out_uv | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_uv is NULL. |
| OCCTL_NOT_FOUND | coedge is invalid, removed, or not a coedge. |
| OCCTL_WRONG_KIND | coedge is not a coedge. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_coedge_pcurve_eval_d1 | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | coedge, | ||
| double | u, | ||
| occtl_point2_t * | out_uv, | ||
| occtl_vector2_t * | out_d1 | ||
| ) |
Evaluates the PCurve UV point and first derivative on a coedge at parameter u.
| [in] | graph | Must be non-NULL. |
| [in] | coedge | CoEdge node ID. |
| [in] | u | PCurve parameter. |
| [out] | out_uv | Borrows it. Must be non-NULL. |
| [out] | out_d1 | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or an out-param is NULL. |
| OCCTL_NOT_FOUND | coedge is invalid or removed. |
| OCCTL_WRONG_KIND | coedge is not a coedge. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_coedge_pcurve_eval_d2 | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | coedge, | ||
| double | u, | ||
| occtl_point2_t * | out_uv, | ||
| occtl_vector2_t * | out_d1, | ||
| occtl_vector2_t * | out_d2 | ||
| ) |
Evaluates the PCurve UV point and first two derivatives on a coedge at parameter u.
| [in] | graph | Must be non-NULL. |
| [in] | coedge | CoEdge node ID. |
| [in] | u | PCurve parameter. |
| [out] | out_uv | Borrows it. Must be non-NULL. |
| [out] | out_d1 | Borrows it. Must be non-NULL. |
| [out] | out_d2 | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or an out-param is NULL. |
| OCCTL_NOT_FOUND | coedge is invalid or removed. |
| OCCTL_WRONG_KIND | coedge is not a coedge. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_coedge_pcurve_eval_d3 | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | coedge, | ||
| double | u, | ||
| occtl_point2_t * | out_uv, | ||
| occtl_vector2_t * | out_d1, | ||
| occtl_vector2_t * | out_d2, | ||
| occtl_vector2_t * | out_d3 | ||
| ) |
Evaluates the PCurve UV point and first three derivatives on a coedge at parameter u.
| [in] | graph | Must be non-NULL. |
| [in] | coedge | CoEdge node ID. |
| [in] | u | PCurve parameter. |
| [out] | out_uv | Borrows it. Must be non-NULL. |
| [out] | out_d1 | Borrows it. Must be non-NULL. |
| [out] | out_d2 | Borrows it. Must be non-NULL. |
| [out] | out_d3 | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or an out-param is NULL. |
| OCCTL_NOT_FOUND | coedge is invalid or removed. |
| OCCTL_WRONG_KIND | coedge is not a coedge. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_coedge_pcurve_eval_dn | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | coedge, | ||
| double | u, | ||
| uint32_t | n, | ||
| occtl_vector2_t * | out_dn | ||
| ) |
Evaluates the Nth derivative vector on a coedge pcurve at parameter u.
| [in] | graph | Must be non-NULL. |
| [in] | coedge | CoEdge node ID. |
| [in] | u | PCurve parameter. |
| [in] | n | Derivative order (0 = point position as vector). |
| [out] | out_dn | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_dn is NULL. |
| OCCTL_NOT_FOUND | coedge is invalid or removed. |
| OCCTL_WRONG_KIND | coedge is not a coedge. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_coedge_pcurve_parameter | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | coedge, | ||
| occtl_node_id_t | vertex, | ||
| double * | out_parameter | ||
| ) |
Parameter of vertex on the pcurve carried by coedge.
| [in] | graph | Must be non-NULL. |
| [in] | coedge | CoEdge node ID. |
| [in] | vertex | Vertex node ID. |
| [out] | out_parameter | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_parameter is NULL. |
| OCCTL_NOT_FOUND | coedge or vertex is invalid or removed. |
| OCCTL_WRONG_KIND | coedge is not a coedge or vertex is not a vertex. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_coedge_range | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | coedge, | ||
| double * | out_first, | ||
| double * | out_last | ||
| ) |
Returns the parametric range of a coedge.
| [in] | graph | Must be non-NULL. |
| [in] | coedge | CoEdge node ID. |
| [out] | out_first | Borrows it. Must be non-NULL. |
| [out] | out_last | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or any out-param is NULL. |
| OCCTL_NOT_FOUND | coedge is invalid, removed, or not a coedge. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_coedge_seam_pair | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | coedge, | ||
| occtl_node_id_t * | out_pair | ||
| ) |
Returns the paired coedge for a seam edge.
For non-seam coedges sets out_pair to OCCTL_NODE_ID_INVALID and returns OCCTL_OK.
| [in] | graph | Must be non-NULL. |
| [in] | coedge | CoEdge node ID. |
| [out] | out_pair | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success (including non-seam case). |
| OCCTL_INVALID_ARGUMENT | graph or out_pair is NULL. |
| OCCTL_NOT_FOUND | coedge is invalid, removed, or not a coedge. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_coedge_uv_points | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | coedge, | ||
| occtl_point2_t * | out_uv_start, | ||
| occtl_point2_t * | out_uv_end | ||
| ) |
Returns the UV points at the start and end of a coedge on its parent face surface.
| [in] | graph | Must be non-NULL. |
| [in] | coedge | CoEdge node ID. |
| [out] | out_uv_start | Borrows it. May be NULL. |
| [out] | out_uv_end | Borrows it. May be NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL, or any color channel in color is non-finite. |
| OCCTL_NOT_FOUND | coedge is invalid, removed, or not a coedge. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_coedge_view | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | coedge, | ||
| occtl_coedge_view_t * | view | ||
| ) |
Fills view with the current scalar state of coedge.
view's struct_version must match a known version constant; only fields up to that version are written.
| [in] | graph | Must be non-NULL. |
| [in] | coedge | Coedge node id. |
| [out] | view | Borrows it (caller-allocated). Must be non-NULL and initialised via occtl_coedge_view_init or OCCTL_COEDGE_VIEW_INIT. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or view is NULL, or view->p_next is non-NULL. |
| OCCTL_NOT_FOUND | coedge is invalid or removed. |
| OCCTL_WRONG_KIND | coedge is not a coedge. |
| OCCTL_VERSION_MISMATCH | view's struct_version is not a supported value. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_coedges_of_wire_iter_create | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | wire, | ||
| occtl_node_iter_t ** | out_iter | ||
| ) |
Creates an iterator over the coedges of a wire.
Yielded IDs are OCCTL_KIND_COEDGE. Iteration order is implementation-defined.
| [in] | graph | Must be non-NULL. |
| [in] | wire | Wire node ID. |
| [out] | out_iter | Owns it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_iter is NULL. |
| OCCTL_NOT_FOUND | wire is invalid or removed. |
| OCCTL_WRONG_KIND | wire is not a wire. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_compound_child_count | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | compound, | ||
| uint32_t * | out_count | ||
| ) |
Returns the number of children (direct references) in a compound.
| [in] | graph | Must be non-NULL. |
| [in] | compound | Compound node ID. |
| [out] | out_count | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_NOT_FOUND | compound is invalid or removed. |
| OCCTL_WRONG_KIND | compound is not a compound. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_compound_view | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | compound, | ||
| occtl_compound_view_t * | view | ||
| ) |
Fills view with the current scalar state of compound.
view's struct_version must match a known version constant; only fields up to that version are written.
| [in] | graph | Must be non-NULL. |
| [in] | compound | Compound node id. |
| [out] | view | Borrows it (caller-allocated). Must be non-NULL and initialised via occtl_compound_view_init or OCCTL_COMPOUND_VIEW_INIT. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or view is NULL, or view->p_next is non-NULL. |
| OCCTL_NOT_FOUND | compound is invalid or removed. |
| OCCTL_WRONG_KIND | compound is not a compound. |
| OCCTL_VERSION_MISMATCH | view's struct_version is not a supported value. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_compsolid_solid_count | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | compsolid, | ||
| uint32_t * | out_count | ||
| ) |
Returns the number of solids in a compsolid.
| [in] | graph | Must be non-NULL. |
| [in] | compsolid | CompSolid node ID. |
| [out] | out_count | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_NOT_FOUND | compsolid is invalid or removed. |
| OCCTL_WRONG_KIND | compsolid is not a compsolid. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_edge_curve_kind | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | edge, | ||
| occtl_curve_kind_t * | out_kind | ||
| ) |
Returns the OCCT curve kind carried by an edge's 3D curve.
Edges without a 3D curve return OCCTL_CURVE_KIND_UNDEFINED.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | edge | Edge node ID. |
| [out] | out_kind | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_kind is NULL. |
| OCCTL_NOT_FOUND | edge is invalid or removed. |
| OCCTL_WRONG_KIND | edge is not an edge. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_edge_end_vertex | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | edge, | ||
| occtl_node_id_t * | out_vertex | ||
| ) |
Returns the end vertex of an edge.
| [in] | graph | Must be non-NULL. |
| [in] | edge | Edge node ID. |
| [out] | out_vertex | Borrows it. Receives the end vertex NodeId. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_vertex is NULL. |
| OCCTL_NOT_FOUND | edge is invalid, removed, or not an edge. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_edge_eval | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | edge, | ||
| double | u, | ||
| occtl_point3_t * | out_p | ||
| ) |
Evaluates the 3D point on an edge at parameter u.
| [in] | graph | Must be non-NULL. |
| [in] | edge | Edge node ID. |
| [in] | u | Curve parameter. |
| [out] | out_p | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_p is NULL. |
| OCCTL_NOT_FOUND | edge is invalid, removed, or not an edge. |
| OCCTL_WRONG_KIND | edge is not an edge. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_edge_eval_d1 | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | edge, | ||
| double | u, | ||
| occtl_point3_t * | out_p, | ||
| occtl_vector3_t * | out_d1 | ||
| ) |
Evaluates the 3D point and first derivative on an edge at parameter u.
| [in] | graph | Must be non-NULL. |
| [in] | edge | Edge node ID. |
| [in] | u | Curve parameter. |
| [out] | out_p | Borrows it. Must be non-NULL. |
| [out] | out_d1 | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, out_p, or out_d1 is NULL. |
| OCCTL_NOT_FOUND | edge is invalid, removed, or not an edge. |
| OCCTL_WRONG_KIND | edge is not an edge. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_edge_eval_d2 | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | edge, | ||
| double | u, | ||
| occtl_point3_t * | out_p, | ||
| occtl_vector3_t * | out_d1, | ||
| occtl_vector3_t * | out_d2 | ||
| ) |
Evaluates the 3D point, first derivative, and second derivative on an edge at parameter u.
| [in] | graph | Must be non-NULL. |
| [in] | edge | Edge node ID. |
| [in] | u | Curve parameter. |
| [out] | out_p | Borrows it. Must be non-NULL. |
| [out] | out_d1 | Borrows it. Must be non-NULL. |
| [out] | out_d2 | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL or an out-param is NULL. |
| OCCTL_NOT_FOUND | edge is invalid or removed. |
| OCCTL_WRONG_KIND | edge is not an edge. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_edge_eval_d3 | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | edge, | ||
| double | u, | ||
| occtl_point3_t * | out_p, | ||
| occtl_vector3_t * | out_d1, | ||
| occtl_vector3_t * | out_d2, | ||
| occtl_vector3_t * | out_d3 | ||
| ) |
Evaluates the 3D point, first derivative, second derivative, and third derivative on an edge at parameter u.
| [in] | graph | Must be non-NULL. |
| [in] | edge | Edge node ID. |
| [in] | u | Curve parameter. |
| [out] | out_p | Borrows it. Must be non-NULL. |
| [out] | out_d1 | Borrows it. Must be non-NULL. |
| [out] | out_d2 | Borrows it. Must be non-NULL. |
| [out] | out_d3 | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL or an out-param is NULL. |
| OCCTL_NOT_FOUND | edge is invalid or removed. |
| OCCTL_WRONG_KIND | edge is not an edge. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_edge_eval_dn | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | edge, | ||
| double | u, | ||
| uint32_t | n, | ||
| occtl_vector3_t * | out_dn | ||
| ) |
Evaluates the Nth derivative vector on an edge at parameter u.
| [in] | graph | Must be non-NULL. |
| [in] | edge | Edge node ID. |
| [in] | u | Curve parameter. |
| [in] | n | Derivative order (0 = point position as vector). |
| [out] | out_dn | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_dn is NULL. |
| OCCTL_NOT_FOUND | edge is invalid or removed. |
| OCCTL_WRONG_KIND | edge is not an edge. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_edge_face_count | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | edge, | ||
| uint32_t * | out_count | ||
| ) |
Returns the number of faces referencing an edge.
| [in] | graph | Must be non-NULL. |
| [in] | edge | Edge node ID. |
| [out] | out_count | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_NOT_FOUND | edge is invalid, removed, or not an edge. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_edge_has_curve | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | edge, | ||
| int32_t * | out_has_curve | ||
| ) |
Returns whether an edge has a 3D curve.
| [in] | graph | Must be non-NULL. |
| [in] | edge | Edge node ID. |
| [out] | out_has_curve | Borrows it. Set to 1 if the edge has a curve, 0 otherwise. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_has_curve is NULL. |
| OCCTL_NOT_FOUND | edge is invalid, removed, or not an edge. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_edge_is_boundary | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | edge, | ||
| int32_t * | out_is_boundary | ||
| ) |
Returns whether an edge is a boundary edge (belongs to exactly 1 face).
| [in] | graph | Must be non-NULL. |
| [in] | edge | Edge node ID. |
| [out] | out_is_boundary | Borrows it. Set to 1 if boundary, 0 otherwise. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_is_boundary is NULL. |
| OCCTL_NOT_FOUND | edge is invalid, removed, or not an edge. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_edge_is_degenerated | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | edge, | ||
| int32_t * | out_is_degenerated | ||
| ) |
Returns whether an edge is degenerated.
| [in] | graph | Must be non-NULL. |
| [in] | edge | Edge node ID. |
| [out] | out_is_degenerated | Borrows it. Set to 1 if degenerated, 0 otherwise. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_is_degenerated is NULL. |
| OCCTL_NOT_FOUND | edge is invalid, removed, or not an edge. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_edge_is_manifold | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | edge, | ||
| int32_t * | out_is_manifold | ||
| ) |
Returns whether an edge is manifold (shared by at most 2 faces).
| [in] | graph | Must be non-NULL. |
| [in] | edge | Edge node ID. |
| [out] | out_is_manifold | Borrows it. Set to 1 if manifold, 0 otherwise. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_is_manifold is NULL. |
| OCCTL_NOT_FOUND | edge is invalid, removed, or not an edge. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_edge_is_seam_on_face | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | edge, | ||
| occtl_node_id_t | face, | ||
| int32_t * | out_is_seam | ||
| ) |
Returns whether an edge is a seam edge on a given face.
A seam edge bounds the periodic seam of the face — e.g. the join on a cylindrical or spherical face.
| [in] | graph | Must be non-NULL. |
| [in] | edge | Edge node ID. |
| [in] | face | Face node ID. |
| [out] | out_is_seam | Borrows it. Set to 1 if the edge is a seam on the face, 0 otherwise. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_is_seam is NULL. |
| OCCTL_NOT_FOUND | edge or face is invalid or removed. |
| OCCTL_WRONG_KIND | edge is not an edge or face is not a face. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_edge_range | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | edge, | ||
| double * | out_first, | ||
| double * | out_last | ||
| ) |
Returns the parametric range of an edge's 3D curve.
| [in] | graph | Must be non-NULL. |
| [in] | edge | Edge node ID. |
| [out] | out_first | Borrows it. Must be non-NULL. |
| [out] | out_last | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, out_first, or out_last is NULL. |
| OCCTL_NOT_FOUND | edge is invalid, removed, or not an edge. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_edge_same_parameter | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | edge, | ||
| int32_t * | out_has_same_parameter | ||
| ) |
Returns whether an edge has the same parameterisation on every face it bounds.
| [in] | graph | Must be non-NULL. |
| [in] | edge | Edge node ID. |
| [out] | out_has_same_parameter | Borrows it. Set to 1 if same-parameter, 0 otherwise. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_has_same_parameter is NULL. |
| OCCTL_NOT_FOUND | edge is invalid, removed, or not an edge. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_edge_same_range | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | edge, | ||
| int32_t * | out_has_same_range | ||
| ) |
Returns whether an edge has the same range in 3D and on its pcurves.
| [in] | graph | Must be non-NULL. |
| [in] | edge | Edge node ID. |
| [out] | out_has_same_range | Borrows it. Set to 1 if same-range, 0 otherwise. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_has_same_range is NULL. |
| OCCTL_NOT_FOUND | edge is invalid, removed, or not an edge. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_edge_start_vertex | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | edge, | ||
| occtl_node_id_t * | out_vertex | ||
| ) |
Returns the start vertex of an edge.
| [in] | graph | Must be non-NULL. |
| [in] | edge | Edge node ID. |
| [out] | out_vertex | Borrows it. Receives the start vertex NodeId. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_vertex is NULL. |
| OCCTL_NOT_FOUND | edge is invalid, removed, or not an edge. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_edge_tolerance | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | edge, | ||
| double * | out_tolerance | ||
| ) |
Returns the tolerance of an edge.
| [in] | graph | Must be non-NULL. |
| [in] | edge | Edge node ID. |
| [out] | out_tolerance | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_tolerance is NULL. |
| OCCTL_NOT_FOUND | edge is invalid, removed, or not an edge. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_edge_vertex_count | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | edge, | ||
| uint32_t * | out_count | ||
| ) |
Returns the number of vertices on an edge.
| [in] | graph | Must be non-NULL. |
| [in] | edge | Edge node ID. |
| [out] | out_count | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_NOT_FOUND | edge is invalid, removed, or not an edge. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_edge_view | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | edge, | ||
| occtl_edge_view_t * | view | ||
| ) |
Fills view with the current scalar state of edge.
view's struct_version must match a known version constant; only fields up to that version are written. The fill is atomic with respect to the C-call boundary but races with concurrent graph mutation.
| [in] | graph | Must be non-NULL. |
| [in] | edge | Edge node id. |
| [out] | view | Borrows it (caller-allocated). Must be non-NULL and initialised via occtl_edge_view_init or OCCTL_EDGE_VIEW_INIT. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or view is NULL, or view->p_next is non-NULL. |
| OCCTL_NOT_FOUND | edge is invalid or removed. |
| OCCTL_WRONG_KIND | edge is not an edge. |
| OCCTL_VERSION_MISMATCH | view's struct_version is not a supported value. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_edges_of_wire_iter_create | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | wire, | ||
| occtl_node_iter_t ** | out_iter | ||
| ) |
Creates an iterator over the distinct edges referenced by a wire.
Yielded IDs are OCCTL_KIND_EDGE. Iteration order is implementation-defined.
| [in] | graph | Must be non-NULL. |
| [in] | wire | Wire node ID. |
| [out] | out_iter | Owns it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_iter is NULL. |
| OCCTL_NOT_FOUND | wire is invalid or removed. |
| OCCTL_WRONG_KIND | wire is not a wire. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_face_eval | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | face, | ||
| double | u, | ||
| double | v, | ||
| occtl_point3_t * | out_p | ||
| ) |
Evaluates the 3D point on a face at UV parameters (u, v).
| [in] | graph | Must be non-NULL. |
| [in] | face | Face node ID. |
| [in] | u | U parameter. |
| [in] | v | V parameter. |
| [out] | out_p | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_p is NULL. |
| OCCTL_NOT_FOUND | face is invalid, removed, or not a face. |
| OCCTL_WRONG_KIND | face is not a face. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_face_eval_d1 | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | face, | ||
| double | u, | ||
| double | v, | ||
| occtl_point3_t * | out_p, | ||
| occtl_vector3_t * | out_d1u, | ||
| occtl_vector3_t * | out_d1v | ||
| ) |
Evaluates the 3D point and first partial derivatives (D1U, D1V) on a face at UV parameters (u, v).
The surface normal can be computed from the derivatives as cross(out_d1u, out_d1v).normalized().
| [in] | graph | Must be non-NULL. |
| [in] | face | Face node ID. |
| [in] | u | U parameter. |
| [in] | v | V parameter. |
| [out] | out_p | Borrows it. Must be non-NULL. |
| [out] | out_d1u | Borrows it. Must be non-NULL. |
| [out] | out_d1v | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or an out-param is NULL. |
| OCCTL_NOT_FOUND | face is invalid or removed. |
| OCCTL_WRONG_KIND | face is not a face. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_face_eval_d2 | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | face, | ||
| double | u, | ||
| double | v, | ||
| occtl_point3_t * | out_p, | ||
| occtl_vector3_t * | out_d1u, | ||
| occtl_vector3_t * | out_d1v, | ||
| occtl_vector3_t * | out_d2u, | ||
| occtl_vector3_t * | out_d2v, | ||
| occtl_vector3_t * | out_d2uv | ||
| ) |
Evaluates the 3D point and first and second partial derivatives on a face at UV parameters (u, v).
| [in] | graph | Must be non-NULL. |
| [in] | face | Face node ID. |
| [in] | u | U parameter. |
| [in] | v | V parameter. |
| [out] | out_p | Borrows it. Must be non-NULL. |
| [out] | out_d1u | Borrows it. Must be non-NULL. |
| [out] | out_d1v | Borrows it. Must be non-NULL. |
| [out] | out_d2u | Borrows it. Must be non-NULL. |
| [out] | out_d2v | Borrows it. Must be non-NULL. |
| [out] | out_d2uv | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL or an out-param is NULL. |
| OCCTL_NOT_FOUND | face is invalid or removed. |
| OCCTL_WRONG_KIND | face is not a face. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_face_eval_d3 | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | face, | ||
| double | u, | ||
| double | v, | ||
| occtl_point3_t * | out_p, | ||
| occtl_vector3_t * | out_d1u, | ||
| occtl_vector3_t * | out_d1v, | ||
| occtl_vector3_t * | out_d2u, | ||
| occtl_vector3_t * | out_d2v, | ||
| occtl_vector3_t * | out_d2uv, | ||
| occtl_vector3_t * | out_d3u, | ||
| occtl_vector3_t * | out_d3v, | ||
| occtl_vector3_t * | out_d3uuv, | ||
| occtl_vector3_t * | out_d3uvv | ||
| ) |
Evaluates the 3D point and first, second, and third partial derivatives on a face at UV parameters (u, v).
| [in] | graph | Must be non-NULL. |
| [in] | face | Face node ID. |
| [in] | u | U parameter. |
| [in] | v | V parameter. |
| [out] | out_p | Borrows it. Must be non-NULL. |
| [out] | out_d1u | Borrows it. Must be non-NULL. |
| [out] | out_d1v | Borrows it. Must be non-NULL. |
| [out] | out_d2u | Borrows it. Must be non-NULL. |
| [out] | out_d2v | Borrows it. Must be non-NULL. |
| [out] | out_d2uv | Borrows it. Must be non-NULL. |
| [out] | out_d3u | Borrows it. Must be non-NULL. |
| [out] | out_d3v | Borrows it. Must be non-NULL. |
| [out] | out_d3uuv | Borrows it. Must be non-NULL. |
| [out] | out_d3uvv | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL or an out-param is NULL. |
| OCCTL_NOT_FOUND | face is invalid or removed. |
| OCCTL_WRONG_KIND | face is not a face. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_face_eval_dn | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | face, | ||
| double | u, | ||
| double | v, | ||
| uint32_t | nu, | ||
| uint32_t | nv, | ||
| occtl_vector3_t * | out_dn | ||
| ) |
Evaluates the (Nu,Nv)th cross derivative vector on a face at UV parameters (u, v).
| [in] | graph | Must be non-NULL. |
| [in] | face | Face node ID. |
| [in] | u | U parameter. |
| [in] | v | V parameter. |
| [in] | nu | U derivative order. |
| [in] | nv | V derivative order. |
| [out] | out_dn | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_dn is NULL. |
| OCCTL_NOT_FOUND | face is invalid or removed. |
| OCCTL_WRONG_KIND | face is not a face. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_face_has_surface | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | face, | ||
| int32_t * | out_has_surface | ||
| ) |
Returns whether a face has a surface.
| [in] | graph | Must be non-NULL. |
| [in] | face | Face node ID. |
| [out] | out_has_surface | Borrows it. Set to 1 if the face has a surface, 0 otherwise. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_has_surface is NULL. |
| OCCTL_NOT_FOUND | face is invalid, removed, or not a face. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_face_has_triangulation | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | face, | ||
| int32_t * | out_has_triangulation | ||
| ) |
Returns whether a face has a triangulation.
| [in] | graph | Must be non-NULL. |
| [in] | face | Face node ID. |
| [out] | out_has_triangulation | Borrows it. Set to 1 if triangulation present, 0 otherwise. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_has_triangulation is NULL. |
| OCCTL_NOT_FOUND | face is invalid, removed, or not a face. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_face_natural_restriction | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | face, | ||
| int32_t * | out_has_natural_restriction | ||
| ) |
Returns whether a face has natural restriction (inherent bounds from its surface).
| [in] | graph | Must be non-NULL. |
| [in] | face | Face node ID. |
| [out] | out_has_natural_restriction | Borrows it. Set to 1 if natural restriction, 0 otherwise. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_has_natural_restriction is NULL. |
| OCCTL_NOT_FOUND | face is invalid, removed, or not a face. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_face_outer_wire | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | face, | ||
| occtl_node_id_t * | out_wire | ||
| ) |
Returns the outer wire of a face.
| [in] | graph | Must be non-NULL. |
| [in] | face | Face node ID. |
| [out] | out_wire | Borrows it. Receives the outer wire NodeId. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_wire is NULL. |
| OCCTL_NOT_FOUND | face is invalid, removed, or not a face, or the face has no outer wire. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_face_surface_kind | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | face, | ||
| occtl_surface_kind_t * | out_kind | ||
| ) |
Returns the OCCT surface kind carried by a face.
Faces without a surface return OCCTL_SURFACE_KIND_UNDEFINED.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | face | Face node ID. |
| [out] | out_kind | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_kind is NULL. |
| OCCTL_NOT_FOUND | face is invalid or removed. |
| OCCTL_WRONG_KIND | face is not a face. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_face_tolerance | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | face, | ||
| double * | out_tolerance | ||
| ) |
Returns the tolerance of a face.
| [in] | graph | Must be non-NULL. |
| [in] | face | Face node ID. |
| [out] | out_tolerance | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_tolerance is NULL. |
| OCCTL_NOT_FOUND | face is invalid, removed, or not a face. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_face_uv_bounds | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | face, | ||
| double * | out_umin, | ||
| double * | out_umax, | ||
| double * | out_vmin, | ||
| double * | out_vmax | ||
| ) |
Returns the UV parameter bounds of a face.
| [in] | graph | Must be non-NULL. |
| [in] | face | Face node ID. |
| [out] | out_umin | Borrows it. Must be non-NULL. |
| [out] | out_umax | Borrows it. Must be non-NULL. |
| [out] | out_vmin | Borrows it. Must be non-NULL. |
| [out] | out_vmax | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or any out-param is NULL. |
| OCCTL_NOT_FOUND | face is invalid, removed, or not a face. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_face_view | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | face, | ||
| occtl_face_view_t * | view | ||
| ) |
Fills view with the current scalar state of face.
view's struct_version must match a known version constant; only fields up to that version are written.
| [in] | graph | Must be non-NULL. |
| [in] | face | Face node id. |
| [out] | view | Borrows it (caller-allocated). Must be non-NULL and initialised via occtl_face_view_init or OCCTL_FACE_VIEW_INIT. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or view is NULL, or view->p_next is non-NULL. |
| OCCTL_NOT_FOUND | face is invalid or removed. |
| OCCTL_WRONG_KIND | face is not a face. |
| OCCTL_VERSION_MISMATCH | view's struct_version is not a supported value. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_face_wire_count | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | face, | ||
| uint32_t * | out_count | ||
| ) |
Returns the number of wires on a face.
| [in] | graph | Must be non-NULL. |
| [in] | face | Face node ID. |
| [out] | out_count | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_NOT_FOUND | face is invalid, removed, or not a face. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_faces_of_shell_iter_create | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | shell, | ||
| occtl_node_iter_t ** | out_iter | ||
| ) |
Creates an iterator over the faces of a shell.
Yielded IDs are OCCTL_KIND_FACE. Iteration order is implementation-defined.
| [in] | graph | Must be non-NULL. |
| [in] | shell | Shell node ID. |
| [out] | out_iter | Owns it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_iter is NULL. |
| OCCTL_NOT_FOUND | shell is invalid or removed. |
| OCCTL_WRONG_KIND | shell is not a shell. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_for_each_related | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | node, | ||
| occtl_node_visitor_t | visitor, | ||
| void * | user_data | ||
| ) |
Iterates over nodes related to node and calls visitor for each.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | node | Root node. |
| [in] | visitor | Callback invoked for each related node. |
| [in,out] | user_data | Passed through. May be NULL. |
| OCCTL_OK | On completion. |
| OCCTL_INVALID_ARGUMENT | graph or visitor is NULL. |
| OCCTL_NOT_FOUND | node is invalid or removed. \par Thread Safety Yes (read-only, allocates internal iterator). |
| occtl_status_t occtl_topo_link_product | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | product, | ||
| occtl_node_id_t | root, | ||
| occtl_transform_t | placement | ||
| ) |
Links an existing product to a topology root with a placement.
Creates a new occurrence whose child is the topology root and adds it as the product's shape root. The product must have been created by occtl_topo_make_product.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | product | Product node ID. Must be valid and active. |
| [in] | root | Topology root node ID. Must be valid and active. |
| [in] | placement | Placement transform for the occurrence. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL, or placement contains non-finite values. |
| OCCTL_NOT_FOUND | product or root is invalid or removed. |
| OCCTL_WRONG_KIND | product is not a product. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_link_product_occurrence | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | product, | ||
| occtl_node_id_t | root, | ||
| occtl_transform_t | placement, | ||
| occtl_node_id_t * | out_occurrence | ||
| ) |
Links an existing product to a topology root and returns the new occurrence.
This is the binding-friendly variant of occtl_topo_link_product. It performs the same mutation but also reports the created occurrence node so callers do not need to scan the product's occurrence list to find it.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | product | Product node ID. Must be valid and active. |
| [in] | root | Topology root node ID. Must be valid and active. |
| [in] | placement | Placement transform for the occurrence. |
| [out] | out_occurrence | Borrows it. Must be non-NULL. Receives the created occurrence node. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_occurrence is NULL, or placement contains non-finite values. |
| OCCTL_NOT_FOUND | product or root is invalid or removed. |
| OCCTL_WRONG_KIND | product is not a product. |
| OCCTL_ERROR | OCCT failed to create the occurrence. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_link_products | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | parentProduct, | ||
| occtl_node_id_t | childProduct, | ||
| occtl_transform_t | placement, | ||
| occtl_node_id_t | parentOccurrence | ||
| ) |
Links two products via a parent-child occurrence.
The child product is instantiated as an occurrence within the parent product. The optional parentOccurrence parameter allows nesting the new child under an existing occurrence chain.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | parentProduct | Parent product node ID. Must be valid and active. |
| [in] | childProduct | Child product node ID. Must be valid and active. |
| [in] | placement | Placement transform for the child occurrence. |
| [in] | parentOccurrence | Existing parent occurrence, or all-zero for root-level placement. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_NOT_FOUND | A product NodeId is invalid or removed. |
| OCCTL_WRONG_KIND | A NodeId is not a product. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_link_products_occurrence | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | parentProduct, | ||
| occtl_node_id_t | childProduct, | ||
| occtl_transform_t | placement, | ||
| occtl_node_id_t | parentOccurrence, | ||
| occtl_node_id_t * | out_occurrence | ||
| ) |
Links two products and returns the new occurrence node.
This is the binding-friendly variant of occtl_topo_link_products. It performs the same assembly mutation but also reports the created occurrence node for immediate naming, tagging, transforms, or joint creation.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | parentProduct | Parent product node ID. Must be valid and active. |
| [in] | childProduct | Child product node ID. Must be valid and active. |
| [in] | placement | Placement transform for the child occurrence. |
| [in] | parentOccurrence | Existing parent occurrence, or all-zero for root-level placement. |
| [out] | out_occurrence | Borrows it. Must be non-NULL. Receives the created occurrence node. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_occurrence is NULL, or placement contains non-finite values. |
| OCCTL_NOT_FOUND | A product NodeId is invalid or removed. |
| OCCTL_WRONG_KIND | A NodeId is not a product. |
| OCCTL_ERROR | OCCT failed to create the occurrence. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_make_product | ( | occtl_graph_t * | graph, |
| const occtl_topo_make_product_info_t * | info, | ||
| occtl_node_id_t * | out_product | ||
| ) |
Creates a product in the graph.
The product is an assembly root. When info->root is a valid (non-zero) NodeId the product wraps that topology root via a placement; otherwise an empty product with no shape root is created.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | info | Borrows it. Must be non-NULL. |
| [out] | out_product | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, info, or out_product is NULL; info->p_next is non-NULL; or info->placement contains non-finite values. |
| OCCTL_VERSION_MISMATCH | info->struct_version is unsupported. |
| OCCTL_NOT_FOUND | info->root is non-zero and invalid or removed. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| void occtl_topo_make_product_info_init | ( | occtl_topo_make_product_info_t * | info | ) |
Initialises info to default values via OCCTL_TOPO_MAKE_PRODUCT_INFO_INIT.
NULL-tolerant.
| [out] | info | Borrows it. May be NULL (no-op). |
\par Thread Safety Yes.
| occtl_status_t occtl_topo_occurrence_set_transform | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | occurrence, | ||
| occtl_transform_t | transform | ||
| ) |
Sets the local placement carried by an occurrence node.
The placement is graph-stored on the unique active occurrence reference that owns occurrence; the occurrence definition and child product/root are not copied. If the occurrence definition has more than one active reference, use the generic reference-location editor instead.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | occurrence | Occurrence node ID to modify. |
| [in] | transform | New local placement. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL, or transform contains non-finite values, or occurrence has more than one active reference. |
| OCCTL_NOT_FOUND | occurrence is invalid, removed, or has no active occurrence reference. |
| OCCTL_WRONG_KIND | occurrence is not an occurrence node. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_occurrence_transform | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | occurrence, | ||
| occtl_transform_t * | out_transform | ||
| ) |
Retrieves the local placement carried by an occurrence node.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | occurrence | Occurrence node ID to query. |
| [out] | out_transform | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_transform is NULL. |
| OCCTL_NOT_FOUND | occurrence is invalid, removed, or has no active occurrence reference. |
| OCCTL_WRONG_KIND | occurrence is not an occurrence node. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_occurrence_world_transform | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | root, | ||
| occtl_node_id_t | occurrence, | ||
| occtl_transform_t * | out_transform | ||
| ) |
Retrieves an occurrence's accumulated transform from a traversal root.
The helper walks downward from root using BRepGraph's child explorer and returns the accumulated placement for the first path that reaches occurrence. Pass a root Product for assembly-world placement.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | root | Traversal root. Must be valid and active. |
| [in] | occurrence | Occurrence node ID to locate below root. |
| [out] | out_transform | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_transform is NULL. |
| OCCTL_NOT_FOUND | root / occurrence is invalid or occurrence is not reachable from root. |
| OCCTL_WRONG_KIND | occurrence is not an occurrence node. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_occurrences_of_product_iter_create | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | product, | ||
| occtl_node_iter_t ** | out_iter | ||
| ) |
Creates an iterator over the occurrences of a product.
Yielded IDs are OCCTL_KIND_OCCURRENCE. Iteration order is implementation-defined.
| [in] | graph | Must be non-NULL. |
| [in] | product | Product node ID. |
| [out] | out_iter | Owns it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_iter is NULL. |
| OCCTL_NOT_FOUND | product is invalid or removed. |
| OCCTL_WRONG_KIND | product is not a product. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_product_occurrence_count | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | product, | ||
| uint32_t * | out_count | ||
| ) |
Returns the number of occurrences of a product.
| [in] | graph | Must be non-NULL. |
| [in] | product | Product node ID. |
| [out] | out_count | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_NOT_FOUND | product is invalid, removed, or not a product. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_remove_occurrence | ( | occtl_graph_t * | graph, |
| occtl_ref_id_t | occurrence_ref | ||
| ) |
Removes an occurrence reference from the graph.
Detaches a child usage from its parent product. The referenced child definition (product or topology root) is not removed unless it has no other active usages.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | occurrence_ref | Occurrence reference to remove. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_NOT_FOUND | occurrence_ref is invalid or removed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_shell_face_count | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | shell, | ||
| uint32_t * | out_count | ||
| ) |
Returns the number of faces in a shell.
| [in] | graph | Must be non-NULL. |
| [in] | shell | Shell node ID. |
| [out] | out_count | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_NOT_FOUND | shell is invalid, removed, or not a shell. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_shell_is_closed | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | shell, | ||
| int32_t * | out_is_closed | ||
| ) |
Returns whether a shell is topologically closed (watertight).
| [in] | graph | Must be non-NULL. |
| [in] | shell | Shell node ID. |
| [out] | out_is_closed | Borrows it. Set to 1 if closed, 0 otherwise. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_is_closed is NULL. |
| OCCTL_NOT_FOUND | shell is invalid, removed, or not a shell. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_shell_view | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | shell, | ||
| occtl_shell_view_t * | view | ||
| ) |
Fills view with the current scalar state of shell.
view's struct_version must match a known version constant; only fields up to that version are written.
| [in] | graph | Must be non-NULL. |
| [in] | shell | Shell node id. |
| [out] | view | Borrows it (caller-allocated). Must be non-NULL and initialised via occtl_shell_view_init or OCCTL_SHELL_VIEW_INIT. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or view is NULL, or view->p_next is non-NULL. |
| OCCTL_NOT_FOUND | shell is invalid or removed. |
| OCCTL_WRONG_KIND | shell is not a shell. |
| OCCTL_VERSION_MISMATCH | view's struct_version is not a supported value. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_shells_of_solid_iter_create | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | solid, | ||
| occtl_node_iter_t ** | out_iter | ||
| ) |
Creates an iterator over the shells of a solid.
Yielded IDs are OCCTL_KIND_SHELL. Iteration order is implementation-defined.
| [in] | graph | Must be non-NULL. |
| [in] | solid | Solid node ID. |
| [out] | out_iter | Owns it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_iter is NULL. |
| OCCTL_NOT_FOUND | solid is invalid or removed. |
| OCCTL_WRONG_KIND | solid is not a solid. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_solid_shell_count | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | solid, | ||
| uint32_t * | out_count | ||
| ) |
Returns the number of shells in a solid.
| [in] | graph | Must be non-NULL. |
| [in] | solid | Solid node ID. |
| [out] | out_count | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_NOT_FOUND | solid is invalid, removed, or not a solid. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_solid_view | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | solid, | ||
| occtl_solid_view_t * | view | ||
| ) |
Fills view with the current scalar state of solid.
view's struct_version must match a known version constant; only fields up to that version are written.
| [in] | graph | Must be non-NULL. |
| [in] | solid | Solid node id. |
| [out] | view | Borrows it (caller-allocated). Must be non-NULL and initialised via occtl_solid_view_init or OCCTL_SOLID_VIEW_INIT. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or view is NULL, or view->p_next is non-NULL. |
| OCCTL_NOT_FOUND | solid is invalid or removed. |
| OCCTL_WRONG_KIND | solid is not a solid. |
| OCCTL_VERSION_MISMATCH | view's struct_version is not a supported value. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_vertex_edge_count | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | vertex, | ||
| uint32_t * | out_count | ||
| ) |
Returns the number of edges that reference a vertex.
| [in] | graph | Must be non-NULL. |
| [in] | vertex | Vertex node ID. |
| [out] | out_count | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_NOT_FOUND | vertex is invalid, removed, or not a vertex. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_vertex_parameter | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | vertex, | ||
| occtl_node_id_t | edge, | ||
| double * | out_parameter | ||
| ) |
Parameter of a vertex on a given edge.
| [in] | graph | Must be non-NULL. |
| [in] | vertex | Vertex node ID. |
| [in] | edge | Edge node ID. |
| [out] | out_parameter | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_parameter is NULL. |
| OCCTL_NOT_FOUND | vertex or edge is invalid or removed. |
| OCCTL_WRONG_KIND | vertex is not a vertex or edge is not an edge. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_vertex_parameters | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | vertex, | ||
| occtl_node_id_t | face, | ||
| occtl_point2_t * | out_uv | ||
| ) |
UV parameters of a vertex on a given face.
| [in] | graph | Must be non-NULL. |
| [in] | vertex | Vertex node ID. |
| [in] | face | Face node ID. |
| [out] | out_uv | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_uv is NULL. |
| OCCTL_NOT_FOUND | vertex or face is invalid or removed. |
| OCCTL_WRONG_KIND | vertex is not a vertex or face is not a face. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_vertex_point | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | vertex, | ||
| occtl_point3_t * | out_point | ||
| ) |
Returns the 3D point of a vertex.
| [in] | graph | Must be non-NULL. |
| [in] | vertex | Vertex node ID. Must be a valid, active vertex. |
| [out] | out_point | Borrows it (caller-allocated slot). Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_point is NULL. |
| OCCTL_NOT_FOUND | vertex is invalid, removed, or not a vertex. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_vertex_tolerance | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | vertex, | ||
| double * | out_tolerance | ||
| ) |
Returns the tolerance of a vertex.
| [in] | graph | Must be non-NULL. |
| [in] | vertex | Vertex node ID. |
| [out] | out_tolerance | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_tolerance is NULL. |
| OCCTL_NOT_FOUND | vertex is invalid, removed, or not a vertex. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_vertex_view | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | vertex, | ||
| occtl_vertex_view_t * | view | ||
| ) |
Fills view with the current scalar state of vertex.
view's struct_version must match a known version constant; only fields up to that version are written.
| [in] | graph | Must be non-NULL. |
| [in] | vertex | Vertex node id. |
| [out] | view | Borrows it (caller-allocated). Must be non-NULL and initialised via occtl_vertex_view_init or OCCTL_VERTEX_VIEW_INIT. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or view is NULL, or view->p_next is non-NULL. |
| OCCTL_NOT_FOUND | vertex is invalid or removed. |
| OCCTL_WRONG_KIND | vertex is not a vertex. |
| OCCTL_VERSION_MISMATCH | view's struct_version is not a supported value. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_vertices_of_edge_iter_create | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | edge, | ||
| occtl_node_iter_t ** | out_iter | ||
| ) |
Creates an iterator over the vertices of an edge.
Yielded order is: start vertex, end vertex, then internal vertex IDs in their stored order. This pinned order lets callers distinguish roles by position in the yield sequence.
| [in] | graph | Must be non-NULL. |
| [in] | edge | Edge node ID. |
| [out] | out_iter | Owns it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_iter is NULL. |
| OCCTL_NOT_FOUND | edge is invalid or removed. |
| OCCTL_WRONG_KIND | edge is not an edge. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_wire_coedge_count | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | wire, | ||
| uint32_t * | out_count | ||
| ) |
Returns the number of coedges in a wire.
| [in] | graph | Must be non-NULL. |
| [in] | wire | Wire node ID. |
| [out] | out_count | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_NOT_FOUND | wire is invalid, removed, or not a wire. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_wire_distinct_edge_count | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | wire, | ||
| uint32_t * | out_count | ||
| ) |
Returns the number of distinct edges in a wire.
| [in] | graph | Must be non-NULL. |
| [in] | wire | Wire node ID. |
| [out] | out_count | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_NOT_FOUND | wire is invalid, removed, or not a wire. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_wire_edge_count | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | wire, | ||
| uint32_t * | out_count | ||
| ) |
Returns the number of edges in a wire.
| [in] | graph | Must be non-NULL. |
| [in] | wire | Wire node ID. |
| [out] | out_count | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_NOT_FOUND | wire is invalid, removed, or not a wire. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_wire_explorer_create | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | wire, | ||
| occtl_node_iter_t ** | out_iter | ||
| ) |
Creates an iterator over the coedges of a wire in geometric traversal order.
The wire explorer follows coedges in endpoint-chaining order, unlike occtl_topo_coedges_of_wire_iter_create which visits coedge definitions in stored order. The traversal auto-chains open endpoints and wraps around a closed wire.
Yielded IDs are OCCTL_KIND_COEDGE.
| [in] | graph | Must be non-NULL. |
| [in] | wire | Wire node ID. |
| [out] | out_iter | Owns it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_iter is NULL. |
| OCCTL_NOT_FOUND | wire is invalid or removed. |
| OCCTL_WRONG_KIND | wire is not a wire. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_wire_face_of | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | wire, | ||
| occtl_node_id_t * | out_face | ||
| ) |
Returns the face a wire belongs to.
| [in] | graph | Must be non-NULL. |
| [in] | wire | Wire node ID. |
| [out] | out_face | Borrows it. Receives the parent face NodeId. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_face is NULL. |
| OCCTL_NOT_FOUND | wire is invalid, removed, or not a wire, or the wire is free (not owned by any face). |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_wire_is_closed | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | wire, | ||
| int32_t * | out_is_closed | ||
| ) |
Returns whether a wire is topologically closed.
| [in] | graph | Must be non-NULL. |
| [in] | wire | Wire node ID. |
| [out] | out_is_closed | Borrows it. Set to 1 if closed, 0 otherwise. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_is_closed is NULL. |
| OCCTL_NOT_FOUND | wire is invalid, removed, or not a wire. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_wire_is_outer | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | wire, | ||
| int32_t * | out_is_outer | ||
| ) |
Returns whether a wire is the outer wire of its parent face.
| [in] | graph | Must be non-NULL. |
| [in] | wire | Wire node ID. |
| [out] | out_is_outer | Borrows it. Set to 1 if outer, 0 otherwise. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_is_outer is NULL. |
| OCCTL_NOT_FOUND | wire is invalid, removed, or not a wire. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_wire_view | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | wire, | ||
| occtl_wire_view_t * | view | ||
| ) |
Fills view with the current scalar state of wire.
view's struct_version must match a known version constant; only fields up to that version are written.
| [in] | graph | Must be non-NULL. |
| [in] | wire | Wire node id. |
| [out] | view | Borrows it (caller-allocated). Must be non-NULL and initialised via occtl_wire_view_init or OCCTL_WIRE_VIEW_INIT. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or view is NULL, or view->p_next is non-NULL. |
| OCCTL_NOT_FOUND | wire is invalid or removed. |
| OCCTL_WRONG_KIND | wire is not a wire. |
| OCCTL_VERSION_MISMATCH | view's struct_version is not a supported value. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_wires_of_face_iter_create | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | face, | ||
| occtl_node_iter_t ** | out_iter | ||
| ) |
Creates an iterator over the wires of a face.
Yielded IDs are OCCTL_KIND_WIRE. Iteration order is implementation-defined.
| [in] | graph | Must be non-NULL. |
| [in] | face | Face node ID. |
| [out] | out_iter | Owns it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_iter is NULL. |
| OCCTL_NOT_FOUND | face is invalid or removed. |
| OCCTL_WRONG_KIND | face is not a face. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes (read-only on graph).
| void occtl_vertex_view_init | ( | occtl_vertex_view_t * | view | ) |
Initialises view to default values matching OCCTL_EDGE_VIEW_INIT.
NULL-tolerant.
| [out] | view | Borrows it. May be NULL (no-op). |
\par Thread Safety Yes.
| void occtl_wire_view_init | ( | occtl_wire_view_t * | view | ) |
Initialises view to default values matching OCCTL_EDGE_VIEW_INIT.
NULL-tolerant.
| [out] | view | Borrows it. May be NULL (no-op). |
\par Thread Safety Yes.