Skip to content

Commit 76e3344

Browse files
committed
Fix TopAbs_Orientation by reference, see issue #1038
1 parent 7c1d0e1 commit 76e3344

File tree

14 files changed

+78
-58
lines changed

14 files changed

+78
-58
lines changed

src/SWIG_files/common/FunctionTransformers.i

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,33 @@ FairCurve_Analysis & function transformation
131131
$1 = &temp;
132132
}
133133

134+
/*
135+
TopAbs_Orientation & function transformation
136+
*/
137+
%typemap(argout) TopAbs_Orientation &OutValue {
138+
PyObject *o, *o2, *o3;
139+
o = PyInt_FromLong(*$1);
140+
if ((!$result) || ($result == Py_None)) {
141+
$result = o;
142+
} else {
143+
if (!PyTuple_Check($result)) {
144+
PyObject *o2 = $result;
145+
$result = PyTuple_New(1);
146+
PyTuple_SetItem($result,0,o2);
147+
}
148+
o3 = PyTuple_New(1);
149+
PyTuple_SetItem(o3,0,o);
150+
o2 = $result;
151+
$result = PySequence_Concat(o2,o3);
152+
Py_DECREF(o2);
153+
Py_DECREF(o3);
154+
}
155+
}
156+
157+
%typemap(in,numinputs=0) TopAbs_Orientation &OutValue(TopAbs_Orientation temp) {
158+
$1 = &temp;
159+
}
160+
134161
%typemap(out) TopoDS_Shape {
135162
TopoDS_Shape* sh = &$1;
136163
PyObject *resultobj = 0;

src/SWIG_files/wrapper/BRepClass.i

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -456,13 +456,12 @@ bool
456456
Parameters
457457
----------
458458
E: BRepClass_Edge
459-
Or: TopAbs_Orientation
460459
461460
Returns
462461
-------
463-
None
462+
Or: TopAbs_Orientation
464463
") CurrentEdge;
465-
void CurrentEdge(BRepClass_Edge & E, TopAbs_Orientation & Or);
464+
void CurrentEdge(BRepClass_Edge & E, TopAbs_Orientation &OutValue);
466465

467466
/****************** InitEdges ******************/
468467
/**** md5 signature: 91bbc4c29d3c5c1c40b8c41a10bba4ae ****/

src/SWIG_files/wrapper/BRepClass.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class BRepClass_FClassifier:
5050
class BRepClass_FaceExplorer:
5151
def __init__(self, F: TopoDS_Face) -> None: ...
5252
def CheckPoint(self, thePoint: gp_Pnt2d) -> bool: ...
53-
def CurrentEdge(self, E: BRepClass_Edge, Or: TopAbs_Orientation) -> None: ...
53+
def CurrentEdge(self, E: BRepClass_Edge) -> TopAbs_Orientation: ...
5454
def InitEdges(self) -> None: ...
5555
def InitWires(self) -> None: ...
5656
def MoreEdges(self) -> bool: ...

src/SWIG_files/wrapper/BRepOffset.i

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2492,14 +2492,13 @@ Parameters
24922492
E: TopoDS_Edge
24932493
F1: TopoDS_Face
24942494
F2: TopoDS_Face
2495-
O1: TopAbs_Orientation
2496-
O2: TopAbs_Orientation
24972495
24982496
Returns
24992497
-------
2500-
None
2498+
O1: TopAbs_Orientation
2499+
O2: TopAbs_Orientation
25012500
") OrientSection;
2502-
static void OrientSection(const TopoDS_Edge & E, const TopoDS_Face & F1, const TopoDS_Face & F2, TopAbs_Orientation & O1, TopAbs_Orientation & O2);
2501+
static void OrientSection(const TopoDS_Edge & E, const TopoDS_Face & F1, const TopoDS_Face & F2, TopAbs_Orientation &OutValue, TopAbs_Orientation &OutValue);
25032502

25042503
/****************** PipeInter ******************/
25052504
/**** md5 signature: 4a2946fb95668689d418fe298066dda2 ****/

src/SWIG_files/wrapper/BRepOffset.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ class BRepOffset_Tool:
295295
@staticmethod
296296
def MapVertexEdges(S: TopoDS_Shape, MVE: TopTools_DataMapOfShapeListOfShape) -> None: ...
297297
@staticmethod
298-
def OrientSection(E: TopoDS_Edge, F1: TopoDS_Face, F2: TopoDS_Face, O1: TopAbs_Orientation, O2: TopAbs_Orientation) -> None: ...
298+
def OrientSection(E: TopoDS_Edge, F1: TopoDS_Face, F2: TopoDS_Face) -> Tuple[TopAbs_Orientation, TopAbs_Orientation]: ...
299299
@staticmethod
300300
def PipeInter(F1: TopoDS_Face, F2: TopoDS_Face, LInt1: TopTools_ListOfShape, LInt2: TopTools_ListOfShape, Side: TopAbs_State) -> None: ...
301301
@staticmethod

src/SWIG_files/wrapper/ChFi3d.i

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -153,14 +153,13 @@ Parameters
153153
S1: BRepAdaptor_Surface
154154
S2: BRepAdaptor_Surface
155155
E: TopoDS_Edge
156-
Or1: TopAbs_Orientation
157-
Or2: TopAbs_Orientation
158156
159157
Returns
160158
-------
161-
int
159+
Or1: TopAbs_Orientation
160+
Or2: TopAbs_Orientation
162161
") ConcaveSide;
163-
static Standard_Integer ConcaveSide(const BRepAdaptor_Surface & S1, const BRepAdaptor_Surface & S2, const TopoDS_Edge & E, TopAbs_Orientation & Or1, TopAbs_Orientation & Or2);
162+
static Standard_Integer ConcaveSide(const BRepAdaptor_Surface & S1, const BRepAdaptor_Surface & S2, const TopoDS_Edge & E, TopAbs_Orientation &OutValue, TopAbs_Orientation &OutValue);
164163

165164
/****************** DefineConnectType ******************/
166165
/**** md5 signature: cff62fae1d6d67c4fc161f59e5544eaa ****/
@@ -207,17 +206,16 @@ bool
207206
208207
Parameters
209208
----------
210-
Or1: TopAbs_Orientation
211-
Or2: TopAbs_Orientation
212209
OrSave1: TopAbs_Orientation
213210
OrSave2: TopAbs_Orientation
214211
ChoixSauv: int
215212
216213
Returns
217214
-------
218-
int
215+
Or1: TopAbs_Orientation
216+
Or2: TopAbs_Orientation
219217
") NextSide;
220-
static Standard_Integer NextSide(TopAbs_Orientation & Or1, TopAbs_Orientation & Or2, const TopAbs_Orientation OrSave1, const TopAbs_Orientation OrSave2, const Standard_Integer ChoixSauv);
218+
static Standard_Integer NextSide(TopAbs_Orientation &OutValue, TopAbs_Orientation &OutValue, const TopAbs_Orientation OrSave1, const TopAbs_Orientation OrSave2, const Standard_Integer ChoixSauv);
221219

222220
/****************** NextSide ******************/
223221
/**** md5 signature: cdb55087e2f58002d8dd06337ade33f1 ****/
@@ -226,15 +224,14 @@ int
226224
227225
Parameters
228226
----------
229-
Or: TopAbs_Orientation
230227
OrSave: TopAbs_Orientation
231228
OrFace: TopAbs_Orientation
232229
233230
Returns
234231
-------
235-
None
232+
Or: TopAbs_Orientation
236233
") NextSide;
237-
static void NextSide(TopAbs_Orientation & Or, const TopAbs_Orientation OrSave, const TopAbs_Orientation OrFace);
234+
static void NextSide(TopAbs_Orientation &OutValue, const TopAbs_Orientation OrSave, const TopAbs_Orientation OrFace);
238235

239236
/****************** SameSide ******************/
240237
/**** md5 signature: cb26ae9b069d0a97c5fa9e8f947264b7 ****/

src/SWIG_files/wrapper/ChFi3d.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,17 @@ ChFi3d_Polynomial = ChFi3d_FilletShape.ChFi3d_Polynomial
3636

3737
class chfi3d:
3838
@staticmethod
39-
def ConcaveSide(S1: BRepAdaptor_Surface, S2: BRepAdaptor_Surface, E: TopoDS_Edge, Or1: TopAbs_Orientation, Or2: TopAbs_Orientation) -> int: ...
39+
def ConcaveSide(S1: BRepAdaptor_Surface, S2: BRepAdaptor_Surface, E: TopoDS_Edge) -> Tuple[int, TopAbs_Orientation, TopAbs_Orientation]: ...
4040
@staticmethod
4141
def DefineConnectType(E: TopoDS_Edge, F1: TopoDS_Face, F2: TopoDS_Face, SinTol: float, CorrectPoint: bool) -> ChFiDS_TypeOfConcavity: ...
4242
@staticmethod
4343
def IsTangentFaces(theEdge: TopoDS_Edge, theFace1: TopoDS_Face, theFace2: TopoDS_Face, Order: Optional[GeomAbs_Shape] = GeomAbs_G1) -> bool: ...
4444
@overload
4545
@staticmethod
46-
def NextSide(Or1: TopAbs_Orientation, Or2: TopAbs_Orientation, OrSave1: TopAbs_Orientation, OrSave2: TopAbs_Orientation, ChoixSauv: int) -> int: ...
46+
def NextSide(OrSave1: TopAbs_Orientation, OrSave2: TopAbs_Orientation, ChoixSauv: int) -> Tuple[int, TopAbs_Orientation, TopAbs_Orientation]: ...
4747
@overload
4848
@staticmethod
49-
def NextSide(Or: TopAbs_Orientation, OrSave: TopAbs_Orientation, OrFace: TopAbs_Orientation) -> None: ...
49+
def NextSide(OrSave: TopAbs_Orientation, OrFace: TopAbs_Orientation) -> TopAbs_Orientation: ...
5050
@staticmethod
5151
def SameSide(Or: TopAbs_Orientation, OrSave1: TopAbs_Orientation, OrSave2: TopAbs_Orientation, OrFace1: TopAbs_Orientation, OrFace2: TopAbs_Orientation) -> bool: ...
5252

src/SWIG_files/wrapper/Geom2dHatch.i

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -435,13 +435,12 @@ None
435435
Parameters
436436
----------
437437
E: Geom2dAdaptor_Curve
438-
Or: TopAbs_Orientation
439438
440439
Returns
441440
-------
442-
None
441+
Or: TopAbs_Orientation
443442
") CurrentEdge;
444-
void CurrentEdge(Geom2dAdaptor_Curve & E, TopAbs_Orientation & Or);
443+
void CurrentEdge(Geom2dAdaptor_Curve & E, TopAbs_Orientation &OutValue);
445444

446445
/****************** Find ******************/
447446
/**** md5 signature: 09042a6b22fc21ef573ed77bf386c9b9 ****/

src/SWIG_files/wrapper/Geom2dHatch.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class Geom2dHatch_Elements:
4646
def ChangeFind(self, K: int) -> Geom2dHatch_Element: ...
4747
def CheckPoint(self, P: gp_Pnt2d) -> bool: ...
4848
def Clear(self) -> None: ...
49-
def CurrentEdge(self, E: Geom2dAdaptor_Curve, Or: TopAbs_Orientation) -> None: ...
49+
def CurrentEdge(self, E: Geom2dAdaptor_Curve) -> TopAbs_Orientation: ...
5050
def Find(self, K: int) -> Geom2dHatch_Element: ...
5151
def InitEdges(self) -> None: ...
5252
def InitWires(self) -> None: ...

src/SWIG_files/wrapper/LocOpe.i

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -450,14 +450,14 @@ Parameters
450450
I: int
451451
From: float
452452
Tol: float
453-
Or: TopAbs_Orientation
454453
455454
Returns
456455
-------
456+
Or: TopAbs_Orientation
457457
IndFrom: int
458458
IndTo: int
459459
") LocalizeAfter;
460-
Standard_Boolean LocalizeAfter(const Standard_Integer I, const Standard_Real From, const Standard_Real Tol, TopAbs_Orientation & Or, Standard_Integer &OutValue, Standard_Integer &OutValue);
460+
Standard_Boolean LocalizeAfter(const Standard_Integer I, const Standard_Real From, const Standard_Real Tol, TopAbs_Orientation &OutValue, Standard_Integer &OutValue, Standard_Integer &OutValue);
461461

462462
/****************** LocalizeAfter ******************/
463463
/**** md5 signature: d56de202f543156481760d3d927eea66 ****/
@@ -469,14 +469,14 @@ Parameters
469469
I: int
470470
FromInd: int
471471
Tol: float
472-
Or: TopAbs_Orientation
473472
474473
Returns
475474
-------
475+
Or: TopAbs_Orientation
476476
IndFrom: int
477477
IndTo: int
478478
") LocalizeAfter;
479-
Standard_Boolean LocalizeAfter(const Standard_Integer I, const Standard_Integer FromInd, const Standard_Real Tol, TopAbs_Orientation & Or, Standard_Integer &OutValue, Standard_Integer &OutValue);
479+
Standard_Boolean LocalizeAfter(const Standard_Integer I, const Standard_Integer FromInd, const Standard_Real Tol, TopAbs_Orientation &OutValue, Standard_Integer &OutValue, Standard_Integer &OutValue);
480480

481481
/****************** LocalizeBefore ******************/
482482
/**** md5 signature: 5b2b6de66ba5a81aeee8506f68cfc270 ****/
@@ -488,14 +488,14 @@ Parameters
488488
I: int
489489
From: float
490490
Tol: float
491-
Or: TopAbs_Orientation
492491
493492
Returns
494493
-------
494+
Or: TopAbs_Orientation
495495
IndFrom: int
496496
IndTo: int
497497
") LocalizeBefore;
498-
Standard_Boolean LocalizeBefore(const Standard_Integer I, const Standard_Real From, const Standard_Real Tol, TopAbs_Orientation & Or, Standard_Integer &OutValue, Standard_Integer &OutValue);
498+
Standard_Boolean LocalizeBefore(const Standard_Integer I, const Standard_Real From, const Standard_Real Tol, TopAbs_Orientation &OutValue, Standard_Integer &OutValue, Standard_Integer &OutValue);
499499

500500
/****************** LocalizeBefore ******************/
501501
/**** md5 signature: 89f05e176ad1cd9828188d9a6ada9149 ****/
@@ -507,14 +507,14 @@ Parameters
507507
I: int
508508
FromInd: int
509509
Tol: float
510-
Or: TopAbs_Orientation
511510
512511
Returns
513512
-------
513+
Or: TopAbs_Orientation
514514
IndFrom: int
515515
IndTo: int
516516
") LocalizeBefore;
517-
Standard_Boolean LocalizeBefore(const Standard_Integer I, const Standard_Integer FromInd, const Standard_Real Tol, TopAbs_Orientation & Or, Standard_Integer &OutValue, Standard_Integer &OutValue);
517+
Standard_Boolean LocalizeBefore(const Standard_Integer I, const Standard_Integer FromInd, const Standard_Real Tol, TopAbs_Orientation &OutValue, Standard_Integer &OutValue, Standard_Integer &OutValue);
518518

519519
/****************** NbPoints ******************/
520520
/**** md5 signature: 8d71e01fa7b21bd925ab1ef4bd70145e ****/
@@ -700,14 +700,14 @@ bool
700700
Parameters
701701
----------
702702
From: float
703-
Or: TopAbs_Orientation
704703
705704
Returns
706705
-------
706+
Or: TopAbs_Orientation
707707
IndFrom: int
708708
IndTo: int
709709
") LocalizeAfter;
710-
Standard_Boolean LocalizeAfter(const Standard_Real From, TopAbs_Orientation & Or, Standard_Integer &OutValue, Standard_Integer &OutValue);
710+
Standard_Boolean LocalizeAfter(const Standard_Real From, TopAbs_Orientation &OutValue, Standard_Integer &OutValue, Standard_Integer &OutValue);
711711

712712
/****************** LocalizeAfter ******************/
713713
/**** md5 signature: dc5b7987079415874eaa183c6149c405 ****/
@@ -717,14 +717,14 @@ IndTo: int
717717
Parameters
718718
----------
719719
FromInd: int
720-
Or: TopAbs_Orientation
721720
722721
Returns
723722
-------
723+
Or: TopAbs_Orientation
724724
IndFrom: int
725725
IndTo: int
726726
") LocalizeAfter;
727-
Standard_Boolean LocalizeAfter(const Standard_Integer FromInd, TopAbs_Orientation & Or, Standard_Integer &OutValue, Standard_Integer &OutValue);
727+
Standard_Boolean LocalizeAfter(const Standard_Integer FromInd, TopAbs_Orientation &OutValue, Standard_Integer &OutValue, Standard_Integer &OutValue);
728728

729729
/****************** LocalizeBefore ******************/
730730
/**** md5 signature: fbf6caaf11561e5474c6e8bcbfa6392a ****/
@@ -734,14 +734,14 @@ IndTo: int
734734
Parameters
735735
----------
736736
From: float
737-
Or: TopAbs_Orientation
738737
739738
Returns
740739
-------
740+
Or: TopAbs_Orientation
741741
IndFrom: int
742742
IndTo: int
743743
") LocalizeBefore;
744-
Standard_Boolean LocalizeBefore(const Standard_Real From, TopAbs_Orientation & Or, Standard_Integer &OutValue, Standard_Integer &OutValue);
744+
Standard_Boolean LocalizeBefore(const Standard_Real From, TopAbs_Orientation &OutValue, Standard_Integer &OutValue, Standard_Integer &OutValue);
745745

746746
/****************** LocalizeBefore ******************/
747747
/**** md5 signature: 977b8e8fd7ae8fde8152e2d971922b09 ****/
@@ -751,14 +751,14 @@ IndTo: int
751751
Parameters
752752
----------
753753
FromInd: int
754-
Or: TopAbs_Orientation
755754
756755
Returns
757756
-------
757+
Or: TopAbs_Orientation
758758
IndFrom: int
759759
IndTo: int
760760
") LocalizeBefore;
761-
Standard_Boolean LocalizeBefore(const Standard_Integer FromInd, TopAbs_Orientation & Or, Standard_Integer &OutValue, Standard_Integer &OutValue);
761+
Standard_Boolean LocalizeBefore(const Standard_Integer FromInd, TopAbs_Orientation &OutValue, Standard_Integer &OutValue, Standard_Integer &OutValue);
762762

763763
/****************** NbPoints ******************/
764764
/**** md5 signature: 1d4bbbd7c4dda4f1e56c00ae994bedbe ****/

0 commit comments

Comments
 (0)