Skip to content

Commit 7205f01

Browse files
committed
Work around private copy constructor on older versions of occt
1 parent bf4b592 commit 7205f01

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/ifcgeom/IfcGeomFunctions.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
#endif
158158

159159
namespace {
160-
TopTools_ListOfShape copy_operand(const TopTools_ListOfShape& l) {
160+
void copy_operand(const TopTools_ListOfShape& l, TopTools_ListOfShape& r) {
161161
#if OCC_VERSION_HEX < 0x70000
162162
TopTools_ListOfShape r;
163163
TopTools_ListIteratorOfListOfShape it(l);
@@ -169,7 +169,7 @@ namespace {
169169
// On OCCT 7.0 and higher BRepAlgoAPI_BuilderAlgo::SetNonDestructive(true) is
170170
// called. Not entirely sure on the behaviour before 7.0, so overcautiously
171171
// create copies.
172-
return l;
172+
r.Assign(l);
173173
#endif
174174
}
175175

@@ -3381,7 +3381,7 @@ bool IfcGeom::Kernel::boolean_operation(const TopoDS_Shape& a, const TopoDS_Shap
33813381
bool IfcGeom::Kernel::boolean_operation(const TopoDS_Shape& a, const TopTools_ListOfShape& b_, BOPAlgo_Operation op, TopoDS_Shape& result, double fuzziness) {
33823382
bool success = false;
33833383
BRepAlgoAPI_BooleanOperation* builder;
3384-
TopTools_ListOfShape b;
3384+
TopTools_ListOfShape B, b;
33853385
if (op == BOPAlgo_CUT) {
33863386
builder = new BRepAlgoAPI_Cut();
33873387
bounding_box_overlap(getValue(GV_PRECISION), a, b_, b);
@@ -3420,7 +3420,8 @@ bool IfcGeom::Kernel::boolean_operation(const TopoDS_Shape& a, const TopTools_Li
34203420
#endif
34213421
builder->SetFuzzyValue(fuzz);
34223422
builder->SetArguments(s1s);
3423-
builder->SetTools(copy_operand(b));
3423+
copy_operand(b, B);
3424+
builder->SetTools(B);
34243425
builder->Build();
34253426
if (builder->IsDone()) {
34263427
TopoDS_Shape r = *builder;

0 commit comments

Comments
 (0)