OCCT-Light 0.1
C ABI and C++ veneer for multi-language CAD workflows
Loading...
Searching...
No Matches
heal.hpp
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
24#ifndef OCCTL_HPP_HEAL_HPP
25#define OCCTL_HPP_HEAL_HPP
26
27#include <occtl-hpp/core.hpp>
28#include <occtl-hpp/topo.hpp>
29#include <occtl/occtl_heal.h>
30
31namespace occtl::heal
32{
33
36
45{
47
48 Options& set_mode(Mode m)
49 {
50 mode = m;
51 return *this;
52 }
53
54 Options& set_tolerance(double t)
55 {
56 tolerance = t;
57 return *this;
58 }
59
60 Options& set_fix_same_parameter(bool v)
61 {
62 fix_same_parameter = v ? 1 : 0;
63 return *this;
64 }
65
66 Options& set_fix_small_edges(bool v)
67 {
68 fix_small_edges = v ? 1 : 0;
69 return *this;
70 }
71
72 Options& set_fix_face_orient(bool v)
73 {
74 fix_face_orient = v ? 1 : 0;
75 return *this;
76 }
77
78 Options& set_fix_missing_seam(bool v)
79 {
80 fix_missing_seam = v ? 1 : 0;
81 return *this;
82 }
83};
84
87{
89
90 UnifySameDomainOptions& set_unify_edges(bool v)
91 {
92 unify_edges = v ? 1 : 0;
93 return *this;
94 }
95
96 UnifySameDomainOptions& set_unify_faces(bool v)
97 {
98 unify_faces = v ? 1 : 0;
99 return *this;
100 }
101
102 UnifySameDomainOptions& set_concat_bspline(bool v)
103 {
104 concat_bspline = v ? 1 : 0;
105 return *this;
106 }
107
108 UnifySameDomainOptions& set_allow_internal_edges(bool v)
109 {
110 allow_internal_edges = v ? 1 : 0;
111 return *this;
112 }
113
114 UnifySameDomainOptions& set_safe_input(bool v)
115 {
116 safe_input = v ? 1 : 0;
117 return *this;
118 }
119
120 UnifySameDomainOptions& set_linear_tolerance(double v)
121 {
123 return *this;
124 }
125
126 UnifySameDomainOptions& set_angular_tolerance(double v)
127 {
129 return *this;
130 }
131};
132
141inline void heal_shape(Graph& theGraph, NodeId theNodeId, const Options& theOptions = Options{})
142{
143 check(::occtl_heal_shape(theGraph.get(), theNodeId.get(), &theOptions));
144}
145
148 NodeId theNodeId,
150{
151 ::occtl_node_id_t aRoot{};
152 check(::occtl_heal_unify_same_domain(theGraph.get(), theNodeId.get(), &theOptions, &aRoot));
153 return NodeId(aRoot);
154}
155
156} // namespace occtl::heal
157
158#endif // OCCTL_HPP_HEAL_HPP
RAII handle for a topology graph. Mirrors occtl_graph_t.
Definition topo.hpp:1444
::occtl_graph_t * get() const noexcept
Borrows-it pointer to the underlying C handle, for direct ABI calls.
Definition topo.hpp:1494
Session-local identity of a graph node. Mirrors occtl_node_id_t.
Definition topo.hpp:52
::occtl_node_id_t get() const noexcept
Borrows-it view of the underlying C value type, for direct ABI calls.
Definition topo.hpp:64
C++ veneer for the core module.
void check(const ::occtl_status_t theStatus)
Throw on non-OK; otherwise a no-op.
Definition core.hpp:85
NodeId unify_same_domain(Graph &theGraph, NodeId theNodeId, const UnifySameDomainOptions &theOptions=UnifySameDomainOptions{})
Unifies same-domain edges/faces and returns the new topology root.
Definition heal.hpp:147
::occtl_heal_mode_t Mode
Healing mode selector.
Definition heal.hpp:35
void heal_shape(Graph &theGraph, NodeId theNodeId, const Options &theOptions=Options{})
Heals the shape referenced by theNodeId and ingests the result as a new topology root into theGraph.
Definition heal.hpp:141
OCCT-Light: shape healing module.
void occtl_heal_unify_same_domain_options_init(occtl_heal_unify_same_domain_options_t *options)
void occtl_heal_options_init(occtl_heal_options_t *options)
enum occtl_heal_mode occtl_heal_mode_t
occtl_status_t occtl_heal_unify_same_domain(occtl_graph_t *graph, occtl_node_id_t node_id, const occtl_heal_unify_same_domain_options_t *options, occtl_node_id_t *out_root)
occtl_status_t occtl_heal_shape(occtl_graph_t *graph, occtl_node_id_t node_id, const occtl_heal_options_t *options)
Versioned options for shape healing.
Definition heal.hpp:45
Versioned options for same-domain unification.
Definition heal.hpp:87
Definition occtl_heal.h:62
double tolerance
Definition occtl_heal.h:66
int32_t fix_same_parameter
Definition occtl_heal.h:67
occtl_heal_mode_t mode
Definition occtl_heal.h:65
int32_t fix_small_edges
Definition occtl_heal.h:68
int32_t fix_face_orient
Definition occtl_heal.h:69
int32_t fix_missing_seam
Definition occtl_heal.h:70
Definition occtl_heal.h:98
double angular_tolerance
Definition occtl_heal.h:107
int32_t unify_faces
Definition occtl_heal.h:102
int32_t allow_internal_edges
Definition occtl_heal.h:104
int32_t concat_bspline
Definition occtl_heal.h:103
int32_t unify_edges
Definition occtl_heal.h:101
double linear_tolerance
Definition occtl_heal.h:106
int32_t safe_input
Definition occtl_heal.h:105
Definition occtl_topo_types.h:50
C++ veneer for the topo module.