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