Skip to content

Commit 5d9cc9a

Browse files
committed
Final SWIG update before occt-790
1 parent 685a61e commit 5d9cc9a

File tree

11 files changed

+9000
-127
lines changed

11 files changed

+9000
-127
lines changed

src/SWIG_files/wrapper/BRepTools.i

+62-51
Original file line numberDiff line numberDiff line change
@@ -973,36 +973,37 @@ Parameter theProgress the range of progress indicator to fill in.
973973
static Standard_Boolean Write(const TopoDS_Shape & theShape, Standard_CString theFile, const Standard_Boolean theWithTriangles, const Standard_Boolean theWithNormals, const TopTools_FormatVersion theVersion, const Message_ProgressRange & theProgress = Message_ProgressRange());
974974

975975

976-
%feature("autodoc", "Serializes TopoDS_Shape to string. If full_precision is False, the default precision of std::stringstream is used which regularly causes rounding.") WriteToString;
977-
%extend{
978-
static std::string WriteToString(const TopoDS_Shape & shape, bool full_precision = true) {
979-
std::stringstream s;
980-
if(full_precision) {
981-
s.precision(17);
982-
s.setf(std::ios::scientific);
983-
}
984-
BRepTools::Write(shape, s);
985-
return s.str();}
986-
};
987-
%feature("autodoc", "Deserializes TopoDS_Shape from string. Create and return a new TopoDS_Shape each time the method is called.") ReadFromString;
988-
%extend{
989-
static TopoDS_Shape ReadFromString(const std::string & src) {
990-
std::istringstream s(std::move(src));
991-
TopoDS_Shape shape;
992-
BRep_Builder b;
993-
BRepTools::Read(shape, s, b);
994-
return shape;
995-
}
996-
};
997-
%feature("autodoc", "Deserializes TopoDS_Shape from string. Take a TopoDS_Shape instance by reference to prevent memory increase.") ReadFromString;
998-
%extend{
999-
static void ReadFromString(const std::string & src, TopoDS_Shape& shape) {
1000-
std::istringstream s(std::move(src));
1001-
BRep_Builder b;
1002-
BRepTools::Read(shape, s, b);
1003-
}
1004-
};
1005-
};
976+
%feature("autodoc", "Serializes TopoDS_Shape to string. If full_precision is False, the default precision of std::stringstream is used which regularly causes rounding.") WriteToString;
977+
%extend{
978+
static std::string WriteToString(const TopoDS_Shape & shape, bool full_precision = true) {
979+
std::stringstream s;
980+
if(full_precision) {
981+
s.precision(17);
982+
s.setf(std::ios::scientific);
983+
}
984+
BRepTools::Write(shape, s);
985+
return s.str();}
986+
};
987+
%feature("autodoc", "Deserializes TopoDS_Shape from string. Create and return a new TopoDS_Shape each time the method is called.") ReadFromString;
988+
%extend{
989+
static TopoDS_Shape ReadFromString(const std::string & src) {
990+
std::istringstream s(std::move(src));
991+
TopoDS_Shape shape;
992+
BRep_Builder b;
993+
BRepTools::Read(shape, s, b);
994+
return shape;
995+
}
996+
};
997+
%feature("autodoc", "Deserializes TopoDS_Shape from string. Take a TopoDS_Shape instance by reference to prevent memory increase.") ReadFromString;
998+
%extend{
999+
static void ReadFromString(const std::string & src, TopoDS_Shape& shape) {
1000+
std::istringstream s(std::move(src));
1001+
BRep_Builder b;
1002+
BRepTools::Read(shape, s, b);
1003+
}
1004+
};
1005+
1006+
};
10061007

10071008

10081009
%extend BRepTools {
@@ -2602,27 +2603,37 @@ Writes the triangulation on the stream <OS> in a format that can be read back by
26022603
void WriteTriangulation(std::ostream &OutValue, const Standard_Boolean Compact = Standard_True, const Message_ProgressRange & theProgress = Message_ProgressRange());
26032604

26042605

2605-
%feature("autodoc", "Serializes TopoDS_Shape to string. If full_precision is False, the default precision of std::stringstream is used which regularly causes rounding.") WriteToString;
2606-
%extend{
2607-
static std::string WriteToString(const TopoDS_Shape & shape, bool full_precision = true) {
2608-
std::stringstream s;
2609-
if(full_precision) {
2610-
s.precision(17);
2611-
s.setf(std::ios::scientific);
2612-
}
2613-
BRepTools::Write(shape, s);
2614-
return s.str();}
2615-
};
2616-
%feature("autodoc", "Deserializes TopoDS_Shape from string") ReadFromString;
2617-
%extend{
2618-
static TopoDS_Shape ReadFromString(const std::string & src) {
2619-
std::stringstream s(src);
2620-
TopoDS_Shape shape;
2621-
BRep_Builder b;
2622-
BRepTools::Read(shape, s, b);
2623-
return shape;}
2624-
};
2625-
};
2606+
%feature("autodoc", "Serializes TopoDS_Shape to string. If full_precision is False, the default precision of std::stringstream is used which regularly causes rounding.") WriteToString;
2607+
%extend{
2608+
static std::string WriteToString(const TopoDS_Shape & shape, bool full_precision = true) {
2609+
std::stringstream s;
2610+
if(full_precision) {
2611+
s.precision(17);
2612+
s.setf(std::ios::scientific);
2613+
}
2614+
BRepTools::Write(shape, s);
2615+
return s.str();}
2616+
};
2617+
%feature("autodoc", "Deserializes TopoDS_Shape from string. Create and return a new TopoDS_Shape each time the method is called.") ReadFromString;
2618+
%extend{
2619+
static TopoDS_Shape ReadFromString(const std::string & src) {
2620+
std::istringstream s(std::move(src));
2621+
TopoDS_Shape shape;
2622+
BRep_Builder b;
2623+
BRepTools::Read(shape, s, b);
2624+
return shape;
2625+
}
2626+
};
2627+
%feature("autodoc", "Deserializes TopoDS_Shape from string. Take a TopoDS_Shape instance by reference to prevent memory increase.") ReadFromString;
2628+
%extend{
2629+
static void ReadFromString(const std::string & src, TopoDS_Shape& shape) {
2630+
std::istringstream s(std::move(src));
2631+
BRep_Builder b;
2632+
BRepTools::Read(shape, s, b);
2633+
}
2634+
};
2635+
2636+
};
26262637

26272638

26282639
%extend BRepTools_ShapeSet {

src/SWIG_files/wrapper/BRepTools.pyi

+6
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,13 @@ class breptools:
126126
@overload
127127
@staticmethod
128128
def Write(theShape: TopoDS_Shape, theFile: str, theWithTriangles: bool, theWithNormals: bool, theVersion: TopTools_FormatVersion, theProgress: Optional[Message_ProgressRange] = Message_ProgressRange()) -> bool: ...
129+
129130
@staticmethod
130131
def WriteToString(sh: TopoDS_Shape) -> str: ...
131132
@staticmethod
132133
def ReadFromString(s: str) -> TopoDS_Shape: ...
134+
@staticmethod
135+
def ReadFromString(s: str, topods_shape: TopoDS_Shape) -> None: ...
133136

134137
class BRepTools_History(Standard_Transient):
135138
@overload
@@ -247,10 +250,13 @@ class BRepTools_ShapeSet(TopTools_ShapeSet):
247250
def WritePolygon3D(self, Compact: Optional[bool] = True, theProgress: Optional[Message_ProgressRange] = Message_ProgressRange()) -> str: ...
248251
def WritePolygonOnTriangulation(self, Compact: Optional[bool] = True, theProgress: Optional[Message_ProgressRange] = Message_ProgressRange()) -> str: ...
249252
def WriteTriangulation(self, Compact: Optional[bool] = True, theProgress: Optional[Message_ProgressRange] = Message_ProgressRange()) -> str: ...
253+
250254
@staticmethod
251255
def WriteToString(sh: TopoDS_Shape) -> str: ...
252256
@staticmethod
253257
def ReadFromString(s: str) -> TopoDS_Shape: ...
258+
@staticmethod
259+
def ReadFromString(s: str, topods_shape: TopoDS_Shape) -> None: ...
254260

255261
class BRepTools_Substitution:
256262
def __init__(self) -> None: ...

src/SWIG_files/wrapper/BVH.i

-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ typedef typename BVH ::VectorType<T , 2>::Type BVH_VecNt;
124124
/****** BVH_AxisSelector<T,2>::MainAxis ******/
125125
/****** md5 signature: 3eeb73485373349ee6e5770c410c7405 ******/
126126
%feature("compactdefaultargs") MainAxis;
127-
%rename BVH::MainAxis bvh_MainAxis;
128127
%feature("autodoc", "
129128
Parameters
130129
----------

src/SWIG_files/wrapper/ChFi3d.i

+8-11
Original file line numberDiff line numberDiff line change
@@ -147,18 +147,17 @@ Parameters
147147
S1: BRepAdaptor_Surface
148148
S2: BRepAdaptor_Surface
149149
E: TopoDS_Edge
150-
Or1: TopAbs_Orientation
151-
Or2: TopAbs_Orientation
152150
153151
Return
154152
-------
155-
int
153+
Or1: TopAbs_Orientation
154+
Or2: TopAbs_Orientation
156155
157156
Description
158157
-----------
159158
Returns Reversed in Or1 and(or) Or2 if the concave edge defined by the interior of faces F1 and F2, in the neighbourhood of their boundary E is of the edge opposite to the normal of their surface support. The orientation of faces is not taken into consideration in the calculation. The function returns 0 if the calculation fails (tangence), if not, it returns the number of choice of the fillet or chamfer corresponding to the orientations calculated and to the tangent to the guide line read in E.
160159
") ConcaveSide;
161-
static Standard_Integer ConcaveSide(const BRepAdaptor_Surface & S1, const BRepAdaptor_Surface & S2, const TopoDS_Edge & E, TopAbs_Orientation & Or1, TopAbs_Orientation & Or2);
160+
static Standard_Integer ConcaveSide(const BRepAdaptor_Surface & S1, const BRepAdaptor_Surface & S2, const TopoDS_Edge & E, TopAbs_Orientation &OutValue, TopAbs_Orientation &OutValue);
162161

163162
/****** ChFi3d::DefineConnectType ******/
164163
/****** md5 signature: cff62fae1d6d67c4fc161f59e5544eaa ******/
@@ -209,41 +208,39 @@ Returns true if theEdge between theFace1 and theFace2 is tangent.
209208
%feature("autodoc", "
210209
Parameters
211210
----------
212-
Or1: TopAbs_Orientation
213-
Or2: TopAbs_Orientation
214211
OrSave1: TopAbs_Orientation
215212
OrSave2: TopAbs_Orientation
216213
ChoixSauv: int
217214
218215
Return
219216
-------
220-
int
217+
Or1: TopAbs_Orientation
218+
Or2: TopAbs_Orientation
221219
222220
Description
223221
-----------
224222
Same as ConcaveSide, but the orientations are logically deduced from the result of the call of ConcaveSide on the first pair of faces of the fillet or chamnfer.
225223
") NextSide;
226-
static Standard_Integer NextSide(TopAbs_Orientation & Or1, TopAbs_Orientation & Or2, const TopAbs_Orientation OrSave1, const TopAbs_Orientation OrSave2, const Standard_Integer ChoixSauv);
224+
static Standard_Integer NextSide(TopAbs_Orientation &OutValue, TopAbs_Orientation &OutValue, const TopAbs_Orientation OrSave1, const TopAbs_Orientation OrSave2, const Standard_Integer ChoixSauv);
227225

228226
/****** ChFi3d::NextSide ******/
229227
/****** md5 signature: cdb55087e2f58002d8dd06337ade33f1 ******/
230228
%feature("compactdefaultargs") NextSide;
231229
%feature("autodoc", "
232230
Parameters
233231
----------
234-
Or: TopAbs_Orientation
235232
OrSave: TopAbs_Orientation
236233
OrFace: TopAbs_Orientation
237234
238235
Return
239236
-------
240-
None
237+
Or: TopAbs_Orientation
241238
242239
Description
243240
-----------
244241
Same as the other NextSide, but the calculation is done on an edge only.
245242
") NextSide;
246-
static void NextSide(TopAbs_Orientation & Or, const TopAbs_Orientation OrSave, const TopAbs_Orientation OrFace);
243+
static void NextSide(TopAbs_Orientation &OutValue, const TopAbs_Orientation OrSave, const TopAbs_Orientation OrFace);
247244

248245
/****** ChFi3d::SameSide ******/
249246
/****** md5 signature: cb26ae9b069d0a97c5fa9e8f947264b7 ******/

src/SWIG_files/wrapper/ChFi3d.pyi

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ ChFi3d_Polynomial = ChFi3d_FilletShape.ChFi3d_Polynomial
2828

2929
class chfi3d:
3030
@staticmethod
31-
def ConcaveSide(S1: BRepAdaptor_Surface, S2: BRepAdaptor_Surface, E: TopoDS_Edge, Or1: TopAbs_Orientation, Or2: TopAbs_Orientation) -> int: ...
31+
def ConcaveSide(S1: BRepAdaptor_Surface, S2: BRepAdaptor_Surface, E: TopoDS_Edge) -> Tuple[int, TopAbs_Orientation, TopAbs_Orientation]: ...
3232
@staticmethod
3333
def DefineConnectType(E: TopoDS_Edge, F1: TopoDS_Face, F2: TopoDS_Face, SinTol: float, CorrectPoint: bool) -> ChFiDS_TypeOfConcavity: ...
3434
@staticmethod
3535
def IsTangentFaces(theEdge: TopoDS_Edge, theFace1: TopoDS_Face, theFace2: TopoDS_Face, Order: Optional[GeomAbs_Shape] = GeomAbs_G1) -> bool: ...
3636
@overload
3737
@staticmethod
38-
def NextSide(Or1: TopAbs_Orientation, Or2: TopAbs_Orientation, OrSave1: TopAbs_Orientation, OrSave2: TopAbs_Orientation, ChoixSauv: int) -> int: ...
38+
def NextSide(OrSave1: TopAbs_Orientation, OrSave2: TopAbs_Orientation, ChoixSauv: int) -> Tuple[int, TopAbs_Orientation, TopAbs_Orientation]: ...
3939
@overload
4040
@staticmethod
41-
def NextSide(Or: TopAbs_Orientation, OrSave: TopAbs_Orientation, OrFace: TopAbs_Orientation) -> None: ...
41+
def NextSide(OrSave: TopAbs_Orientation, OrFace: TopAbs_Orientation) -> TopAbs_Orientation: ...
4242
@staticmethod
4343
def SameSide(Or: TopAbs_Orientation, OrSave1: TopAbs_Orientation, OrSave2: TopAbs_Orientation, OrFace1: TopAbs_Orientation, OrFace2: TopAbs_Orientation) -> bool: ...
4444

src/SWIG_files/wrapper/Graphic3d.i

+6
Original file line numberDiff line numberDiff line change
@@ -1665,12 +1665,14 @@ Graphic3d_VTA_TOPFIRSTLINE = Graphic3d_VerticalTextAlignment.Graphic3d_VTA_TOPFI
16651665
%wrap_handle(Graphic3d_AspectLine3d)
16661666
%wrap_handle(Graphic3d_AspectMarker3d)
16671667
%wrap_handle(Graphic3d_AspectText3d)
1668+
%wrap_handle(Graphic3d_AttribBuffer)
16681669
%wrap_handle(Graphic3d_CView)
16691670
%wrap_handle(Graphic3d_MediaTextureSet)
16701671
%wrap_handle(Graphic3d_TextureEnv)
16711672
%wrap_handle(Graphic3d_TextureMap)
16721673
%wrap_handle(Graphic3d_TransformPersScaledAbove)
16731674
%wrap_handle(Graphic3d_CubeMap)
1675+
%wrap_handle(Graphic3d_MutableIndexBuffer)
16741676
%wrap_handle(Graphic3d_Texture1D)
16751677
%wrap_handle(Graphic3d_Texture2D)
16761678
%wrap_handle(Graphic3d_Texture3D)
@@ -22207,6 +22209,8 @@ Invalidate specified sub-range of data (as byte offsets).
2220722209
};
2220822210

2220922211

22212+
%make_alias(Graphic3d_AttribBuffer)
22213+
2221022214
%extend Graphic3d_AttribBuffer {
2221122215
%pythoncode {
2221222216
__repr__ = _dumps_object
@@ -25237,6 +25241,8 @@ Invalidate specified sub-range of data (as byte offsets).
2523725241
};
2523825242

2523925243

25244+
%make_alias(Graphic3d_MutableIndexBuffer)
25245+
2524025246
%extend Graphic3d_MutableIndexBuffer {
2524125247
%pythoncode {
2524225248
__repr__ = _dumps_object

src/SWIG_files/wrapper/STEPControl.i

+20-1
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,25 @@ Loads a file and returns the read status Zero for a Model which compies with the
782782
") ReadFile;
783783
virtual IFSelect_ReturnStatus ReadFile(Standard_CString filename);
784784

785+
/****** STEPControl_Reader::ReadFile ******/
786+
/****** md5 signature: 653d10ed20f94341a4bff4dc0daf4326 ******/
787+
%feature("compactdefaultargs") ReadFile;
788+
%feature("autodoc", "
789+
Parameters
790+
----------
791+
filename: str
792+
theParams: DESTEP_Parameters
793+
794+
Return
795+
-------
796+
IFSelect_ReturnStatus
797+
798+
Description
799+
-----------
800+
Loads a file and returns the read status Zero for a Model which compies with the Controller.
801+
") ReadFile;
802+
IFSelect_ReturnStatus ReadFile(Standard_CString filename, const DESTEP_Parameters & theParams);
803+
785804
/****** STEPControl_Reader::ReadStream ******/
786805
/****** md5 signature: 468612e1b7574162a37279817cf6848c ******/
787806
%feature("compactdefaultargs") ReadStream;
@@ -799,7 +818,7 @@ Description
799818
-----------
800819
Loads a file from stream and returns the read status.
801820
") ReadStream;
802-
IFSelect_ReturnStatus ReadStream(Standard_CString theName, std::istream & theIStream);
821+
virtual IFSelect_ReturnStatus ReadStream(Standard_CString theName, std::istream & theIStream);
803822

804823
/****** STEPControl_Reader::SetSystemLengthUnit ******/
805824
/****** md5 signature: 510dfa5f705479dabe69cd18ff63f186 ******/

src/SWIG_files/wrapper/STEPControl.pyi

-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ class STEPControl_Reader(XSControl_Reader):
8181
def NbRootsForTransfer(self) -> int: ...
8282
@overload
8383
def ReadFile(self, filename: str) -> IFSelect_ReturnStatus: ...
84-
@overload
8584
def ReadStream(self, theName: str, theIStream: str) -> IFSelect_ReturnStatus: ...
8685
def SetSystemLengthUnit(self, theLengthUnit: float) -> None: ...
8786
def StepModel(self) -> StepData_StepModel: ...

0 commit comments

Comments
 (0)