OCCT-Light 0.1
C ABI and C++ veneer for multi-language CAD workflows
Loading...
Searching...
No Matches
occtl_viz.h
Go to the documentation of this file.
1// Copyright (c) 2026 Capgemini Engineering Research and Development.
2//
3// This file is part of OCCT-Light software library.
4//
5// This library is free software; you can redistribute it and/or modify it under
6// the terms of the GNU Affero General Public License version 3 as published
7// by the Free Software Foundation, with an option to use any later version.
8// Consult the file LICENSE_AGPL_30.txt included in OCCT-Light distribution
9// for complete text of the license and disclaimer of any warranty.
10//
11// Alternatively, this file may be used under the terms of a commercial
12// license or contractual agreement.
13//
14// SPDX-License-Identifier: AGPL-3.0-or-later
15
30#ifndef OCCTL_VIZ_H
31#define OCCTL_VIZ_H
32
33#include <stddef.h>
34#include <stdint.h>
35
36#include "occtl_core.h"
37#include "occtl_geom.h"
38#include "occtl_topo.h"
39
40#ifdef __cplusplus
41extern "C"
42{
43#endif
44
55typedef struct occtl_viz_driver occtl_viz_driver_t;
56
68typedef struct occtl_viz_viewer occtl_viz_viewer_t;
69
81typedef struct occtl_viz_view occtl_viz_view_t;
82
94typedef struct occtl_viz_presentable occtl_viz_presentable_t;
95
111
134
153
154#define OCCTL_VIZ_DRIVER_OPTIONS_VERSION_1 1u
155#define OCCTL_VIZ_VIEW_OPTIONS_VERSION_1 1u
156
174
178#define OCCTL_VIZ_DRIVER_OPTIONS_INIT {OCCTL_VIZ_DRIVER_OPTIONS_VERSION_1, NULL, 1, 1}
179
199
203#define OCCTL_VIZ_VIEW_OPTIONS_INIT {OCCTL_VIZ_VIEW_OPTIONS_VERSION_1, NULL, 640, 480, NULL, 1}
204
218
219#define OCCTL_VIZ_PICK_RESULT_VERSION_1 1u
220
238
239#define OCCTL_VIZ_PICK_RESULT_INIT \
240 { \
241 OCCTL_VIZ_PICK_RESULT_VERSION_1, NULL, OCCTL_UID_INVALID, OCCTL_NODE_ID_INVALID, \
242 OCCTL_REF_ID_INVALID, OCCTL_VIZ_SELECT_WHOLE, \
243 {{1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0}} \
244 }
245
258
271
284
304OCCTL_API occtl_status_t OCCTL_CALL
306 occtl_viz_driver_t** out_driver);
307
321
339 occtl_viz_viewer_t** out_viewer);
340
354
376 const occtl_viz_view_options_t* options,
377 occtl_viz_view_t** out_view);
378
391
413OCCTL_API occtl_status_t OCCTL_CALL
415 occtl_graph_t* graph,
416 occtl_node_id_t root,
417 occtl_viz_presentable_t** out_presentable);
418
431
446OCCTL_API occtl_status_t OCCTL_CALL
449
463OCCTL_API occtl_status_t OCCTL_CALL
464 occtl_viz_presentable_synchronize(occtl_viz_presentable_t* presentable, int32_t* out_has_changed);
465
478OCCTL_API occtl_status_t OCCTL_CALL
480
496OCCTL_API occtl_status_t OCCTL_CALL
498 const occtl_node_id_t* nodes,
499 size_t n_nodes);
500
513OCCTL_API occtl_status_t OCCTL_CALL
515
530 occtl_viz_presentable_t* presentable);
531
546 occtl_viz_presentable_t* presentable);
547
564 int32_t width,
565 int32_t height);
566
580
594
609 occtl_color_rgba_t color);
610
625 const occtl_viz_camera_t* camera);
626
641 occtl_viz_camera_t* out_camera);
642
657OCCTL_API occtl_status_t OCCTL_CALL
659
675 int32_t dx,
676 int32_t dy);
677
694OCCTL_API occtl_status_t OCCTL_CALL
695 occtl_viz_view_zoom(occtl_viz_view_t* view, int32_t x1, int32_t y1, int32_t x2, int32_t y2);
696
712 int32_t x,
713 int32_t y);
714
730 int32_t x,
731 int32_t y);
732
748OCCTL_API occtl_status_t OCCTL_CALL
750 occtl_viz_presentable_t* presentable,
752
771 int32_t x,
772 int32_t y,
773 int32_t select,
774 occtl_viz_pick_result_t* out_pick);
775
795 uint8_t* out_rgba,
796 size_t cap,
797 size_t* out_count);
798
815 const char* path);
816
817#ifdef __cplusplus
818}
819#endif
820
821#endif /* OCCTL_VIZ_H */
OCCT-Light: core public API.
#define OCCTL_API
Definition occtl_core.h:111
enum occtl_status occtl_status_t
OCCT-Light: geometry primitive types and math utilities.
OCCT-Light: topology module public API.
struct occtl_graph occtl_graph_t
Definition occtl_topo_types.h:152
void occtl_viz_pick_result_init(occtl_viz_pick_result_t *pick)
occtl_status_t occtl_viz_view_zoom(occtl_viz_view_t *view, int32_t x1, int32_t y1, int32_t x2, int32_t y2)
struct occtl_viz_driver_options occtl_viz_driver_options_t
occtl_viz_selection_mode
Definition occtl_viz.h:120
@ OCCTL_VIZ_SELECT_WIRE
Definition occtl_viz.h:125
@ OCCTL_VIZ_SELECT_PRODUCT
Definition occtl_viz.h:129
@ OCCTL_VIZ_SELECT_WHOLE
Definition occtl_viz.h:121
@ OCCTL_VIZ_SELECT_VERTEX
Definition occtl_viz.h:124
@ OCCTL_VIZ_SELECT_COEDGE
Definition occtl_viz.h:128
@ OCCTL_VIZ_SELECT_SHELL
Definition occtl_viz.h:126
@ OCCTL_VIZ_SELECT_COMPSOLID
Definition occtl_viz.h:131
@ OCCTL_VIZ_SELECT_SOLID
Definition occtl_viz.h:127
@ OCCTL_VIZ_SELECT_FACE
Definition occtl_viz.h:122
@ OCCTL_VIZ_SELECT_COMPOUND
Definition occtl_viz.h:130
@ OCCTL_VIZ_SELECT_EDGE
Definition occtl_viz.h:123
void occtl_viz_view_free(occtl_viz_view_t *view)
void occtl_viz_presentable_free(occtl_viz_presentable_t *presentable)
struct occtl_viz_viewer occtl_viz_viewer_t
Definition occtl_viz.h:68
occtl_status_t occtl_viz_presentable_clear_visible_nodes(occtl_viz_presentable_t *presentable)
occtl_status_t occtl_viz_view_display(occtl_viz_view_t *view, occtl_viz_presentable_t *presentable)
occtl_status_t occtl_viz_driver_create(const occtl_viz_driver_options_t *options, occtl_viz_driver_t **out_driver)
occtl_status_t occtl_viz_view_dump_image(occtl_viz_view_t *view, const char *path)
enum occtl_viz_selection_mode occtl_viz_selection_mode_t
enum occtl_viz_display_mode occtl_viz_display_mode_t
struct occtl_viz_camera occtl_viz_camera_t
occtl_status_t occtl_viz_viewer_create(occtl_viz_driver_t *driver, occtl_viz_viewer_t **out_viewer)
occtl_status_t occtl_viz_view_set_camera(occtl_viz_view_t *view, const occtl_viz_camera_t *camera)
occtl_viz_standard_view
Definition occtl_viz.h:143
@ OCCTL_VIZ_VIEW_TOP
Definition occtl_viz.h:148
@ OCCTL_VIZ_VIEW_ISO
Definition occtl_viz.h:150
@ OCCTL_VIZ_VIEW_RIGHT
Definition occtl_viz.h:147
@ OCCTL_VIZ_VIEW_LEFT
Definition occtl_viz.h:146
@ OCCTL_VIZ_VIEW_BOTTOM
Definition occtl_viz.h:149
@ OCCTL_VIZ_VIEW_BACK
Definition occtl_viz.h:145
@ OCCTL_VIZ_VIEW_FRONT
Definition occtl_viz.h:144
occtl_status_t occtl_viz_presentable_create(occtl_viz_viewer_t *viewer, occtl_graph_t *graph, occtl_node_id_t root, occtl_viz_presentable_t **out_presentable)
occtl_status_t occtl_viz_view_set_background(occtl_viz_view_t *view, occtl_color_rgba_t color)
occtl_status_t occtl_viz_view_read_pixels_rgba(occtl_viz_view_t *view, uint8_t *out_rgba, size_t cap, size_t *out_count)
void occtl_viz_driver_free(occtl_viz_driver_t *driver)
occtl_status_t occtl_viz_view_create(occtl_viz_viewer_t *viewer, const occtl_viz_view_options_t *options, occtl_viz_view_t **out_view)
struct occtl_viz_presentable occtl_viz_presentable_t
Definition occtl_viz.h:94
occtl_status_t occtl_viz_view_get_camera(const occtl_viz_view_t *view, occtl_viz_camera_t *out_camera)
occtl_status_t occtl_viz_presentable_synchronize(occtl_viz_presentable_t *presentable, int32_t *out_has_changed)
void occtl_viz_driver_options_init(occtl_viz_driver_options_t *options)
occtl_status_t occtl_viz_view_activate_selection(occtl_viz_view_t *view, occtl_viz_presentable_t *presentable, occtl_viz_selection_mode_t mode)
void occtl_viz_view_options_init(occtl_viz_view_options_t *options)
occtl_status_t occtl_viz_view_pick(occtl_viz_view_t *view, int32_t x, int32_t y, int32_t select, occtl_viz_pick_result_t *out_pick)
occtl_status_t occtl_viz_view_set_standard_view(occtl_viz_view_t *view, occtl_viz_standard_view_t standard_view)
struct occtl_viz_view_options occtl_viz_view_options_t
occtl_status_t occtl_viz_view_fit_all(occtl_viz_view_t *view)
occtl_status_t occtl_viz_presentable_set_display_mode(occtl_viz_presentable_t *presentable, occtl_viz_display_mode_t mode)
void occtl_viz_viewer_free(occtl_viz_viewer_t *viewer)
occtl_status_t occtl_viz_view_orbit_update(occtl_viz_view_t *view, int32_t x, int32_t y)
occtl_status_t occtl_viz_view_orbit_start(occtl_viz_view_t *view, int32_t x, int32_t y)
occtl_status_t occtl_viz_view_resize(occtl_viz_view_t *view, int32_t width, int32_t height)
enum occtl_viz_standard_view occtl_viz_standard_view_t
occtl_viz_display_mode
Definition occtl_viz.h:104
@ OCCTL_VIZ_DISPLAY_WIREFRAME
Definition occtl_viz.h:105
@ OCCTL_VIZ_DISPLAY_SHADED
Definition occtl_viz.h:106
@ OCCTL_VIZ_DISPLAY_MESH_DEBUG
Definition occtl_viz.h:108
@ OCCTL_VIZ_DISPLAY_SHADED_WITH_EDGES
Definition occtl_viz.h:107
occtl_status_t occtl_viz_view_redraw(occtl_viz_view_t *view)
struct occtl_viz_view occtl_viz_view_t
Definition occtl_viz.h:81
struct occtl_viz_pick_result occtl_viz_pick_result_t
occtl_status_t occtl_viz_view_pan(occtl_viz_view_t *view, int32_t dx, int32_t dy)
occtl_status_t occtl_viz_presentable_invalidate(occtl_viz_presentable_t *presentable)
occtl_status_t occtl_viz_presentable_set_visible_nodes(occtl_viz_presentable_t *presentable, const occtl_node_id_t *nodes, size_t n_nodes)
struct occtl_viz_driver occtl_viz_driver_t
Definition occtl_viz.h:55
occtl_status_t occtl_viz_view_erase(occtl_viz_view_t *view, occtl_viz_presentable_t *presentable)
Definition occtl_topo_build.h:2096
Definition occtl_topo_types.h:50
Definition occtl_geom.h:76
Definition occtl_topo_types.h:61
Definition occtl_geom.h:171
Definition occtl_core.h:272
Definition occtl_geom.h:84
Definition occtl_viz.h:213
occtl_vector3_t up
Definition occtl_viz.h:216
occtl_point3_t eye
Definition occtl_viz.h:214
occtl_point3_t center
Definition occtl_viz.h:215
Definition occtl_viz.h:168
int32_t enable_vbo
Definition occtl_viz.h:171
int32_t enable_vsync
Definition occtl_viz.h:172
const void * p_next
Definition occtl_viz.h:170
uint32_t struct_version
Definition occtl_viz.h:169
Definition occtl_viz.h:229
occtl_ref_id_t ref
Definition occtl_viz.h:234
occtl_uid_t uid
Definition occtl_viz.h:232
const void * p_next
Definition occtl_viz.h:231
occtl_viz_selection_mode_t selection_mode
Definition occtl_viz.h:235
occtl_node_id_t node
Definition occtl_viz.h:233
uint32_t struct_version
Definition occtl_viz.h:230
occtl_transform_t usage_transform
Definition occtl_viz.h:236
Definition occtl_viz.h:191
void * native_handle
Definition occtl_viz.h:196
int32_t height
Definition occtl_viz.h:195
const void * p_next
Definition occtl_viz.h:193
int32_t offscreen
Definition occtl_viz.h:197
uint32_t struct_version
Definition occtl_viz.h:192
int32_t width
Definition occtl_viz.h:194