File indexing completed on 2026-05-26 08:16:40
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _BRepBuilderAPI_Sewing_HeaderFile
0018 #define _BRepBuilderAPI_Sewing_HeaderFile
0019
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022
0023 #include <TopTools_IndexedDataMapOfShapeShape.hxx>
0024 #include <TopoDS_Shape.hxx>
0025 #include <TopTools_IndexedMapOfShape.hxx>
0026 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
0027 #include <TopTools_DataMapOfShapeShape.hxx>
0028 #include <Standard_Integer.hxx>
0029 #include <TopTools_DataMapOfShapeListOfShape.hxx>
0030 #include <TopTools_MapOfShape.hxx>
0031 #include <Standard_Transient.hxx>
0032 #include <TopTools_ListOfShape.hxx>
0033 #include <TopTools_SequenceOfShape.hxx>
0034 #include <TColStd_IndexedMapOfInteger.hxx>
0035 #include <TColStd_SequenceOfBoolean.hxx>
0036 #include <TColStd_SequenceOfInteger.hxx>
0037 #include <TColStd_Array1OfBoolean.hxx>
0038 #include <TColStd_Array1OfReal.hxx>
0039 #include <TColgp_Array1OfPnt.hxx>
0040 #include <TColStd_SequenceOfReal.hxx>
0041
0042 #include <Message_ProgressRange.hxx>
0043
0044 class BRepTools_ReShape;
0045 class TopoDS_Edge;
0046 class TopoDS_Face;
0047 class Geom_Surface;
0048 class TopLoc_Location;
0049 class Geom2d_Curve;
0050 class Geom_Curve;
0051
0052 class BRepBuilderAPI_Sewing;
0053 DEFINE_STANDARD_HANDLE(BRepBuilderAPI_Sewing, Standard_Transient)
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077 class BRepBuilderAPI_Sewing : public Standard_Transient
0078 {
0079
0080 public:
0081
0082
0083
0084
0085
0086
0087 Standard_EXPORT BRepBuilderAPI_Sewing(const Standard_Real tolerance = 1.0e-06,
0088 const Standard_Boolean option1 = Standard_True,
0089 const Standard_Boolean option2 = Standard_True,
0090 const Standard_Boolean option3 = Standard_True,
0091 const Standard_Boolean option4 = Standard_False);
0092
0093
0094 Standard_EXPORT void Init(const Standard_Real tolerance = 1.0e-06,
0095 const Standard_Boolean option1 = Standard_True,
0096 const Standard_Boolean option2 = Standard_True,
0097 const Standard_Boolean option3 = Standard_True,
0098 const Standard_Boolean option4 = Standard_False);
0099
0100
0101 Standard_EXPORT void Load(const TopoDS_Shape& shape);
0102
0103
0104 Standard_EXPORT void Add(const TopoDS_Shape& shape);
0105
0106
0107
0108 Standard_EXPORT void Perform(const Message_ProgressRange& theProgress = Message_ProgressRange());
0109
0110
0111
0112
0113 Standard_EXPORT const TopoDS_Shape& SewedShape() const;
0114
0115
0116 Standard_EXPORT void SetContext(const Handle(BRepTools_ReShape)& theContext);
0117
0118
0119 Standard_EXPORT const Handle(BRepTools_ReShape)& GetContext() const;
0120
0121
0122 Standard_EXPORT Standard_Integer NbFreeEdges() const;
0123
0124
0125 Standard_EXPORT const TopoDS_Edge& FreeEdge(const Standard_Integer index) const;
0126
0127
0128
0129 Standard_EXPORT Standard_Integer NbMultipleEdges() const;
0130
0131
0132 Standard_EXPORT const TopoDS_Edge& MultipleEdge(const Standard_Integer index) const;
0133
0134
0135 Standard_EXPORT Standard_Integer NbContigousEdges() const;
0136
0137
0138 Standard_EXPORT const TopoDS_Edge& ContigousEdge(const Standard_Integer index) const;
0139
0140
0141 Standard_EXPORT const TopTools_ListOfShape& ContigousEdgeCouple(
0142 const Standard_Integer index) const;
0143
0144
0145 Standard_EXPORT Standard_Boolean IsSectionBound(const TopoDS_Edge& section) const;
0146
0147
0148
0149
0150
0151
0152 Standard_EXPORT const TopoDS_Edge& SectionToBoundary(const TopoDS_Edge& section) const;
0153
0154
0155 Standard_EXPORT Standard_Integer NbDegeneratedShapes() const;
0156
0157
0158 Standard_EXPORT const TopoDS_Shape& DegeneratedShape(const Standard_Integer index) const;
0159
0160
0161 Standard_EXPORT Standard_Boolean IsDegenerated(const TopoDS_Shape& shape) const;
0162
0163
0164 Standard_EXPORT Standard_Boolean IsModified(const TopoDS_Shape& shape) const;
0165
0166
0167 Standard_EXPORT const TopoDS_Shape& Modified(const TopoDS_Shape& shape) const;
0168
0169
0170 Standard_EXPORT Standard_Boolean IsModifiedSubShape(const TopoDS_Shape& shape) const;
0171
0172
0173 Standard_EXPORT TopoDS_Shape ModifiedSubShape(const TopoDS_Shape& shape) const;
0174
0175
0176 Standard_EXPORT void Dump() const;
0177
0178
0179 Standard_EXPORT Standard_Integer NbDeletedFaces() const;
0180
0181
0182 Standard_EXPORT const TopoDS_Face& DeletedFace(const Standard_Integer index) const;
0183
0184
0185 Standard_EXPORT TopoDS_Face WhichFace(const TopoDS_Edge& theEdg,
0186 const Standard_Integer index = 1) const;
0187
0188
0189 Standard_Boolean SameParameterMode() const;
0190
0191
0192 void SetSameParameterMode(const Standard_Boolean SameParameterMode);
0193
0194
0195 Standard_Real Tolerance() const;
0196
0197
0198 void SetTolerance(const Standard_Real theToler);
0199
0200
0201 Standard_Real MinTolerance() const;
0202
0203
0204 void SetMinTolerance(const Standard_Real theMinToler);
0205
0206
0207 Standard_Real MaxTolerance() const;
0208
0209
0210 void SetMaxTolerance(const Standard_Real theMaxToler);
0211
0212
0213 Standard_Boolean FaceMode() const;
0214
0215
0216 void SetFaceMode(const Standard_Boolean theFaceMode);
0217
0218
0219 Standard_Boolean FloatingEdgesMode() const;
0220
0221
0222
0223
0224 void SetFloatingEdgesMode(const Standard_Boolean theFloatingEdgesMode);
0225
0226
0227
0228 Standard_Boolean LocalTolerancesMode() const;
0229
0230
0231
0232
0233 void SetLocalTolerancesMode(const Standard_Boolean theLocalTolerancesMode);
0234
0235
0236 void SetNonManifoldMode(const Standard_Boolean theNonManifoldMode);
0237
0238
0239
0240
0241 Standard_Boolean NonManifoldMode() const;
0242
0243 DEFINE_STANDARD_RTTIEXT(BRepBuilderAPI_Sewing, Standard_Transient)
0244
0245 protected:
0246
0247
0248 Standard_EXPORT void Cutting(const Message_ProgressRange& theProgress = Message_ProgressRange());
0249
0250 Standard_EXPORT void Merging(const Standard_Boolean passage,
0251 const Message_ProgressRange& theProgress = Message_ProgressRange());
0252
0253 Standard_EXPORT Standard_Boolean IsMergedClosed(const TopoDS_Edge& Edge1,
0254 const TopoDS_Edge& Edge2,
0255 const TopoDS_Face& fase) const;
0256
0257 Standard_EXPORT Standard_Boolean FindCandidates(TopTools_SequenceOfShape& seqSections,
0258 TColStd_IndexedMapOfInteger& mapReference,
0259 TColStd_SequenceOfInteger& seqCandidates,
0260 TColStd_SequenceOfBoolean& seqOrientations);
0261
0262 Standard_EXPORT void AnalysisNearestEdges(const TopTools_SequenceOfShape& sequenceSec,
0263 TColStd_SequenceOfInteger& seqIndCandidate,
0264 TColStd_SequenceOfBoolean& seqOrientations,
0265 const Standard_Boolean evalDist = Standard_True);
0266
0267
0268 Standard_EXPORT Standard_Boolean MergedNearestEdges(const TopoDS_Shape& edge,
0269 TopTools_SequenceOfShape& SeqMergedEdge,
0270 TColStd_SequenceOfBoolean& SeqMergedOri);
0271
0272 Standard_EXPORT void EdgeProcessing(
0273 const Message_ProgressRange& theProgress = Message_ProgressRange());
0274
0275
0276 Standard_EXPORT void EdgeRegularity(
0277 const Message_ProgressRange& theProgress = Message_ProgressRange());
0278
0279 Standard_EXPORT void CreateOutputInformations();
0280
0281
0282 Standard_EXPORT virtual Standard_Boolean IsUClosedSurface(const Handle(Geom_Surface)& surf,
0283 const TopoDS_Shape& theEdge,
0284 const TopLoc_Location& theloc) const;
0285
0286
0287 Standard_EXPORT virtual Standard_Boolean IsVClosedSurface(const Handle(Geom_Surface)& surf,
0288 const TopoDS_Shape& theEdge,
0289 const TopLoc_Location& theloc) const;
0290
0291
0292
0293 Standard_EXPORT virtual void FaceAnalysis(
0294 const Message_ProgressRange& theProgress = Message_ProgressRange());
0295
0296
0297 Standard_EXPORT virtual void FindFreeBoundaries();
0298
0299
0300
0301 Standard_EXPORT virtual void VerticesAssembling(
0302 const Message_ProgressRange& theProgress = Message_ProgressRange());
0303
0304
0305 Standard_EXPORT virtual void CreateSewedShape();
0306
0307
0308
0309 Standard_EXPORT virtual void GetFreeWires(TopTools_IndexedMapOfShape& MapFreeEdges,
0310 TopTools_SequenceOfShape& seqWires);
0311
0312
0313 Standard_EXPORT virtual void EvaluateAngulars(TopTools_SequenceOfShape& sequenceSec,
0314 TColStd_Array1OfBoolean& secForward,
0315 TColStd_Array1OfReal& tabAng,
0316 const Standard_Integer indRef) const;
0317
0318
0319 Standard_EXPORT virtual void EvaluateDistances(TopTools_SequenceOfShape& sequenceSec,
0320 TColStd_Array1OfBoolean& secForward,
0321 TColStd_Array1OfReal& tabAng,
0322 TColStd_Array1OfReal& arrLen,
0323 TColStd_Array1OfReal& tabMinDist,
0324 const Standard_Integer indRef) const;
0325
0326
0327 Standard_EXPORT virtual Handle(Geom2d_Curve) SameRange(const Handle(Geom2d_Curve)& CurvePtr,
0328 const Standard_Real FirstOnCurve,
0329 const Standard_Real LastOnCurve,
0330 const Standard_Real RequestedFirst,
0331 const Standard_Real RequestedLast) const;
0332
0333
0334 Standard_EXPORT virtual void SameParameter(const TopoDS_Edge& edge) const;
0335
0336
0337 Standard_EXPORT virtual TopoDS_Edge SameParameterEdge(
0338 const TopoDS_Shape& edge,
0339 const TopTools_SequenceOfShape& seqEdges,
0340 const TColStd_SequenceOfBoolean& seqForward,
0341 TopTools_MapOfShape& mapMerged,
0342 const Handle(BRepTools_ReShape)& locReShape);
0343
0344
0345 Standard_EXPORT virtual TopoDS_Edge SameParameterEdge(
0346 const TopoDS_Edge& edge1,
0347 const TopoDS_Edge& edge2,
0348 const TopTools_ListOfShape& listFaces1,
0349 const TopTools_ListOfShape& listFaces2,
0350 const Standard_Boolean secForward,
0351 Standard_Integer& whichSec,
0352 const Standard_Boolean firstCall = Standard_True);
0353
0354
0355
0356 Standard_EXPORT void ProjectPointsOnCurve(const TColgp_Array1OfPnt& arrPnt,
0357 const Handle(Geom_Curve)& Crv,
0358 const Standard_Real first,
0359 const Standard_Real last,
0360 TColStd_Array1OfReal& arrDist,
0361 TColStd_Array1OfReal& arrPara,
0362 TColgp_Array1OfPnt& arrProj,
0363 const Standard_Boolean isConsiderEnds) const;
0364
0365
0366
0367 Standard_EXPORT virtual void CreateCuttingNodes(const TopTools_IndexedMapOfShape& MapVert,
0368 const TopoDS_Shape& bound,
0369 const TopoDS_Shape& vfirst,
0370 const TopoDS_Shape& vlast,
0371 const TColStd_Array1OfReal& arrDist,
0372 const TColStd_Array1OfReal& arrPara,
0373 const TColgp_Array1OfPnt& arrPnt,
0374 TopTools_SequenceOfShape& seqNode,
0375 TColStd_SequenceOfReal& seqPara);
0376
0377
0378
0379 Standard_EXPORT virtual void CreateSections(const TopoDS_Shape& bound,
0380 const TopTools_SequenceOfShape& seqNode,
0381 const TColStd_SequenceOfReal& seqPara,
0382 TopTools_ListOfShape& listEdge);
0383
0384
0385
0386
0387 Standard_EXPORT virtual void SameParameterShape();
0388
0389 Standard_Real myTolerance;
0390 Standard_Boolean mySewing;
0391 Standard_Boolean myAnalysis;
0392 Standard_Boolean myCutting;
0393 Standard_Boolean myNonmanifold;
0394 TopTools_IndexedDataMapOfShapeShape myOldShapes;
0395 TopoDS_Shape mySewedShape;
0396 TopTools_IndexedMapOfShape myDegenerated;
0397 TopTools_IndexedMapOfShape myFreeEdges;
0398 TopTools_IndexedMapOfShape myMultipleEdges;
0399 TopTools_IndexedDataMapOfShapeListOfShape myContigousEdges;
0400 TopTools_DataMapOfShapeShape myContigSecBound;
0401 Standard_Integer myNbShapes;
0402 Standard_Integer myNbVertices;
0403 Standard_Integer myNbEdges;
0404 TopTools_IndexedDataMapOfShapeListOfShape myBoundFaces;
0405 TopTools_DataMapOfShapeListOfShape myBoundSections;
0406 TopTools_DataMapOfShapeShape mySectionBound;
0407 TopTools_IndexedDataMapOfShapeShape myVertexNode;
0408 TopTools_IndexedDataMapOfShapeShape myVertexNodeFree;
0409 TopTools_DataMapOfShapeListOfShape myNodeSections;
0410 TopTools_DataMapOfShapeListOfShape myCuttingNode;
0411 TopTools_IndexedMapOfShape myLittleFace;
0412 TopoDS_Shape myShape;
0413 Handle(BRepTools_ReShape) myReShape;
0414
0415 private:
0416 Standard_Boolean myFaceMode;
0417 Standard_Boolean myFloatingEdgesMode;
0418 Standard_Boolean mySameParameterMode;
0419 Standard_Boolean myLocalToleranceMode;
0420 Standard_Real myMinTolerance;
0421 Standard_Real myMaxTolerance;
0422 TopTools_MapOfShape myMergedEdges;
0423 };
0424
0425 #include <BRepBuilderAPI_Sewing.lxx>
0426
0427 #endif