Skip to content

Commit 100ee7b

Browse files
committed
Implemented in-place operators += -= *= /=
1 parent 02e69a9 commit 100ee7b

16 files changed

Lines changed: 765 additions & 526 deletions

File tree

src/SWIG_files/wrapper/BOPDS.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1572,7 +1572,7 @@ class BOPDS_Pave {
15721572
}
15731573
}
15741574
%pythoncode {
1575-
def __eq__(self,right):
1575+
def __eq__(self, right):
15761576
try:
15771577
return self.__eq_wrapper__(right)
15781578
except:

src/SWIG_files/wrapper/BOPTools.i

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,13 +1428,18 @@ class BOPTools_ShapeSet {
14281428
:rtype: None
14291429
") Subtract;
14301430
void Subtract (const BOPTools_ShapeSet & theSet);
1431-
%feature("compactdefaultargs") operator -=;
1432-
%feature("autodoc", " :param theSet:
1433-
:type theSet: BOPTools_ShapeSet &
1434-
:rtype: None
1435-
") operator -=;
1436-
void operator -= (const BOPTools_ShapeSet & theSet);
1437-
%feature("compactdefaultargs") Clear;
1431+
1432+
%extend{
1433+
void __isub_wrapper__(const BOPTools_ShapeSet other) {
1434+
*self -= other;
1435+
}
1436+
}
1437+
%pythoncode {
1438+
def __isub__(self, right):
1439+
self.__isub_wrapper__(right)
1440+
return self
1441+
}
1442+
%feature("compactdefaultargs") Clear;
14381443
%feature("autodoc", " :rtype: None
14391444
") Clear;
14401445
void Clear ();

src/SWIG_files/wrapper/BRepMesh.i

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,7 +1308,7 @@ class BRepMesh_OrientedEdge {
13081308
}
13091309
}
13101310
%pythoncode {
1311-
def __eq__(self,right):
1311+
def __eq__(self, right):
13121312
try:
13131313
return self.__eq_wrapper__(right)
13141314
except:
@@ -1814,7 +1814,7 @@ class BRepMesh_Triangle {
18141814
}
18151815
}
18161816
%pythoncode {
1817-
def __eq__(self,right):
1817+
def __eq__(self, right):
18181818
try:
18191819
return self.__eq_wrapper__(right)
18201820
except:
@@ -1935,7 +1935,7 @@ class BRepMesh_Vertex {
19351935
}
19361936
}
19371937
%pythoncode {
1938-
def __eq__(self,right):
1938+
def __eq__(self, right):
19391939
try:
19401940
return self.__eq_wrapper__(right)
19411941
except:
@@ -2330,7 +2330,7 @@ class BRepMesh_Edge : public BRepMesh_OrientedEdge {
23302330
}
23312331
}
23322332
%pythoncode {
2333-
def __eq__(self,right):
2333+
def __eq__(self, right):
23342334
try:
23352335
return self.__eq_wrapper__(right)
23362336
except:

src/SWIG_files/wrapper/Geom2d.i

Lines changed: 60 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -380,13 +380,18 @@ class Geom2d_Transformation : public MMgt_TShared {
380380
:rtype: None
381381
") Multiply;
382382
void Multiply (const Handle_Geom2d_Transformation & Other);
383-
%feature("compactdefaultargs") operator *=;
384-
%feature("autodoc", " :param Other:
385-
:type Other: Handle_Geom2d_Transformation &
386-
:rtype: None
387-
") operator *=;
388-
void operator *= (const Handle_Geom2d_Transformation & Other);
389-
%feature("compactdefaultargs") Power;
383+
384+
%extend{
385+
void __imul_wrapper__(const Handle_Geom2d_Transformation other) {
386+
*self *= other;
387+
}
388+
}
389+
%pythoncode {
390+
def __imul__(self, right):
391+
self.__imul_wrapper__(right)
392+
return self
393+
}
394+
%feature("compactdefaultargs") Power;
390395
%feature("autodoc", " * Raised if N < 0 and if the transformation is not inversible
391396
392397
:param N:
@@ -1160,12 +1165,6 @@ class Geom2d_Direction : public Geom2d_Vector {
11601165
:rtype: float
11611166
") Crossed;
11621167
Standard_Real Crossed (const Handle_Geom2d_Vector & Other);
1163-
%feature("compactdefaultargs") operator ^;
1164-
%feature("autodoc", " :param Other:
1165-
:type Other: Handle_Geom2d_Vector &
1166-
:rtype: float
1167-
") operator ^;
1168-
Standard_Real operator ^ (const Handle_Geom2d_Vector & Other);
11691168
%feature("compactdefaultargs") Transform;
11701169
%feature("autodoc", " * Applies the transformation T to this unit vector, then normalizes it.
11711170
@@ -1785,13 +1784,18 @@ class Geom2d_VectorWithMagnitude : public Geom2d_Vector {
17851784
:rtype: None
17861785
") Add;
17871786
void Add (const Handle_Geom2d_Vector & Other);
1788-
%feature("compactdefaultargs") operator +=;
1789-
%feature("autodoc", " :param Other:
1790-
:type Other: Handle_Geom2d_Vector &
1791-
:rtype: None
1792-
") operator +=;
1793-
void operator += (const Handle_Geom2d_Vector & Other);
1794-
%feature("compactdefaultargs") Added;
1787+
1788+
%extend{
1789+
void __iadd_wrapper__(const Handle_Geom2d_Vector other) {
1790+
*self += other;
1791+
}
1792+
}
1793+
%pythoncode {
1794+
def __iadd__(self, right):
1795+
self.__iadd_wrapper__(right)
1796+
return self
1797+
}
1798+
%feature("compactdefaultargs") Added;
17951799
%feature("autodoc", " * Adds the vector Other to <self>.
17961800
17971801
:param Other:
@@ -1813,12 +1817,6 @@ class Geom2d_VectorWithMagnitude : public Geom2d_Vector {
18131817
:rtype: float
18141818
") Crossed;
18151819
Standard_Real Crossed (const Handle_Geom2d_Vector & Other);
1816-
%feature("compactdefaultargs") operator ^;
1817-
%feature("autodoc", " :param Other:
1818-
:type Other: Handle_Geom2d_Vector &
1819-
:rtype: float
1820-
") operator ^;
1821-
Standard_Real operator ^ (const Handle_Geom2d_Vector & Other);
18221820
%feature("compactdefaultargs") Divide;
18231821
%feature("autodoc", " * Divides <self> by a scalar.
18241822
@@ -1827,13 +1825,18 @@ class Geom2d_VectorWithMagnitude : public Geom2d_Vector {
18271825
:rtype: None
18281826
") Divide;
18291827
void Divide (const Standard_Real Scalar);
1830-
%feature("compactdefaultargs") operator /=;
1831-
%feature("autodoc", " :param Scalar:
1832-
:type Scalar: float
1833-
:rtype: None
1834-
") operator /=;
1835-
void operator /= (const Standard_Real Scalar);
1836-
%feature("compactdefaultargs") Divided;
1828+
1829+
%extend{
1830+
void __itruediv_wrapper__(const Standard_Real other) {
1831+
*self /= other;
1832+
}
1833+
}
1834+
%pythoncode {
1835+
def __itruediv__(self, right):
1836+
self.__itruediv_wrapper__(right)
1837+
return self
1838+
}
1839+
%feature("compactdefaultargs") Divided;
18371840
%feature("autodoc", " * Divides <self> by a scalar. A new vector is returned.
18381841
18391842
:param Scalar:
@@ -1863,13 +1866,18 @@ class Geom2d_VectorWithMagnitude : public Geom2d_Vector {
18631866
:rtype: None
18641867
") Multiply;
18651868
void Multiply (const Standard_Real Scalar);
1866-
%feature("compactdefaultargs") operator *=;
1867-
%feature("autodoc", " :param Scalar:
1868-
:type Scalar: float
1869-
:rtype: None
1870-
") operator *=;
1871-
void operator *= (const Standard_Real Scalar);
1872-
%feature("compactdefaultargs") Normalize;
1869+
1870+
%extend{
1871+
void __imul_wrapper__(const Standard_Real other) {
1872+
*self *= other;
1873+
}
1874+
}
1875+
%pythoncode {
1876+
def __imul__(self, right):
1877+
self.__imul_wrapper__(right)
1878+
return self
1879+
}
1880+
%feature("compactdefaultargs") Normalize;
18731881
%feature("autodoc", " * Normalizes <self>. //! Raised if the magnitude of the vector is lower or equal to Resolution from package gp.
18741882
18751883
:rtype: None
@@ -1889,13 +1897,18 @@ class Geom2d_VectorWithMagnitude : public Geom2d_Vector {
18891897
:rtype: None
18901898
") Subtract;
18911899
void Subtract (const Handle_Geom2d_Vector & Other);
1892-
%feature("compactdefaultargs") operator -=;
1893-
%feature("autodoc", " :param Other:
1894-
:type Other: Handle_Geom2d_Vector &
1895-
:rtype: None
1896-
") operator -=;
1897-
void operator -= (const Handle_Geom2d_Vector & Other);
1898-
%feature("compactdefaultargs") Subtracted;
1900+
1901+
%extend{
1902+
void __isub_wrapper__(const Handle_Geom2d_Vector other) {
1903+
*self -= other;
1904+
}
1905+
}
1906+
%pythoncode {
1907+
def __isub__(self, right):
1908+
self.__isub_wrapper__(right)
1909+
return self
1910+
}
1911+
%feature("compactdefaultargs") Subtracted;
18991912
%feature("autodoc", " * Subtracts the vector Other to <self>. A new vector is returned.
19001913
19011914
:param Other:

src/SWIG_files/wrapper/Graphic3d.i

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5462,7 +5462,7 @@ class Graphic3d_MaterialAspect {
54625462
}
54635463
}
54645464
%pythoncode {
5465-
def __ne__(self,right):
5465+
def __ne__(self, right):
54665466
try:
54675467
return self.__ne_wrapper__(right)
54685468
except:
@@ -5484,7 +5484,7 @@ class Graphic3d_MaterialAspect {
54845484
}
54855485
}
54865486
%pythoncode {
5487-
def __eq__(self,right):
5487+
def __eq__(self, right):
54885488
try:
54895489
return self.__eq_wrapper__(right)
54905490
except:

src/SWIG_files/wrapper/Intf.i

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ class Intf_SectionLine {
414414
}
415415
}
416416
%pythoncode {
417-
def __eq__(self,right):
417+
def __eq__(self, right):
418418
try:
419419
return self.__eq_wrapper__(right)
420420
except:
@@ -594,7 +594,7 @@ class Intf_SectionPoint {
594594
}
595595
}
596596
%pythoncode {
597-
def __eq__(self,right):
597+
def __eq__(self, right):
598598
try:
599599
return self.__eq_wrapper__(right)
600600
except:
@@ -1224,7 +1224,7 @@ class Intf_TangentZone {
12241224
}
12251225
}
12261226
%pythoncode {
1227-
def __eq__(self,right):
1227+
def __eq__(self, right):
12281228
try:
12291229
return self.__eq_wrapper__(right)
12301230
except:

src/SWIG_files/wrapper/MAT2d.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ class MAT2d_BiInt {
214214
}
215215
}
216216
%pythoncode {
217-
def __eq__(self,right):
217+
def __eq__(self, right):
218218
try:
219219
return self.__eq_wrapper__(right)
220220
except:

src/SWIG_files/wrapper/Quantity.i

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,7 +1249,7 @@ class Quantity_Color {
12491249
}
12501250
}
12511251
%pythoncode {
1252-
def __ne__(self,right):
1252+
def __ne__(self, right):
12531253
try:
12541254
return self.__ne_wrapper__(right)
12551255
except:
@@ -1271,7 +1271,7 @@ class Quantity_Color {
12711271
}
12721272
}
12731273
%pythoncode {
1274-
def __eq__(self,right):
1274+
def __eq__(self, right):
12751275
try:
12761276
return self.__eq_wrapper__(right)
12771277
except:
@@ -1691,7 +1691,7 @@ class Quantity_Date {
16911691
}
16921692
}
16931693
%pythoncode {
1694-
def __eq__(self,right):
1694+
def __eq__(self, right):
16951695
try:
16961696
return self.__eq_wrapper__(right)
16971697
except:
@@ -2026,7 +2026,7 @@ class Quantity_Period {
20262026
}
20272027
}
20282028
%pythoncode {
2029-
def __eq__(self,right):
2029+
def __eq__(self, right):
20302030
try:
20312031
return self.__eq_wrapper__(right)
20322032
except:

src/SWIG_files/wrapper/Standard.i

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ class Standard_GUID {
343343
}
344344
}
345345
%pythoncode {
346-
def __eq__(self,right):
346+
def __eq__(self, right):
347347
try:
348348
return self.__eq_wrapper__(right)
349349
except:
@@ -363,7 +363,7 @@ class Standard_GUID {
363363
}
364364
}
365365
%pythoncode {
366-
def __ne__(self,right):
366+
def __ne__(self, right):
367367
try:
368368
return self.__ne_wrapper__(right)
369369
except:
@@ -641,7 +641,7 @@ class Standard_Storable {
641641
}
642642
}
643643
%pythoncode {
644-
def __eq__(self,right):
644+
def __eq__(self, right):
645645
try:
646646
return self.__eq_wrapper__(right)
647647
except:

0 commit comments

Comments
 (0)