File indexing completed on 2025-01-18 10:03:05
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #ifndef _BOPTools_AlgoTools_HeaderFile
0019 #define _BOPTools_AlgoTools_HeaderFile
0020
0021 #include <Standard.hxx>
0022 #include <Standard_DefineAlloc.hxx>
0023 #include <Standard_Handle.hxx>
0024
0025 #include <Standard_Boolean.hxx>
0026 #include <Standard_Integer.hxx>
0027 #include <Standard_Real.hxx>
0028 #include <BOPTools_ListOfCoupleOfShape.hxx>
0029 #include <BOPTools_ListOfConnexityBlock.hxx>
0030 #include <NCollection_BaseAllocator.hxx>
0031 #include <TopAbs_State.hxx>
0032 #include <TopAbs_ShapeEnum.hxx>
0033 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
0034 #include <TopTools_IndexedMapOfShape.hxx>
0035 #include <TopTools_MapOfShape.hxx>
0036 #include <TopTools_ListOfListOfShape.hxx>
0037 #include <TopTools_ListOfShape.hxx>
0038 #include <Precision.hxx>
0039 class TopoDS_Vertex;
0040 class gp_Pnt;
0041 class IntTools_Curve;
0042 class TopoDS_Edge;
0043 class TopoDS_Face;
0044 class TopoDS_Shape;
0045 class IntTools_Context;
0046 class TopoDS_Solid;
0047 class IntTools_Range;
0048 class TopoDS_Shell;
0049 class Message_Report;
0050
0051
0052
0053
0054
0055
0056
0057
0058 class BOPTools_AlgoTools
0059 {
0060 public:
0061
0062 DEFINE_STANDARD_ALLOC
0063
0064 public:
0065
0066
0067
0068
0069
0070
0071 static Standard_Real DTolerance() { return 1.e-12; }
0072
0073 public:
0074
0075
0076
0077
0078
0079 Standard_EXPORT static Standard_Integer ComputeVV(const TopoDS_Vertex& theV,
0080 const gp_Pnt& theP,
0081 const Standard_Real theTolP);
0082
0083
0084
0085
0086
0087 Standard_EXPORT static Standard_Integer ComputeVV(const TopoDS_Vertex& theV1,
0088 const TopoDS_Vertex& theV2,
0089 const Standard_Real theFuzz = Precision::Confusion());
0090
0091 public:
0092
0093
0094
0095 Standard_EXPORT static void MakeVertex(const TopTools_ListOfShape& theLV,
0096 TopoDS_Vertex& theV);
0097
0098
0099 Standard_EXPORT static void MakeNewVertex(const gp_Pnt& aP1,
0100 const Standard_Real aTol,
0101 TopoDS_Vertex& aNewVertex);
0102
0103
0104 Standard_EXPORT static void MakeNewVertex(const TopoDS_Vertex& aV1,
0105 const TopoDS_Vertex& aV2,
0106 TopoDS_Vertex& aNewVertex);
0107
0108
0109
0110 Standard_EXPORT static void MakeNewVertex(const TopoDS_Edge& aE1,
0111 const Standard_Real aP1,
0112 const TopoDS_Edge& aE2,
0113 const Standard_Real aP2,
0114 TopoDS_Vertex& aNewVertex);
0115
0116
0117
0118 Standard_EXPORT static void MakeNewVertex(const TopoDS_Edge& aE1,
0119 const Standard_Real aP1,
0120 const TopoDS_Face& aF2,
0121 TopoDS_Vertex& aNewVertex);
0122
0123
0124 public:
0125
0126
0127
0128
0129 Standard_EXPORT static void UpdateVertex(const IntTools_Curve& aIC,
0130 const Standard_Real aT,
0131 const TopoDS_Vertex& aV);
0132
0133
0134
0135
0136 Standard_EXPORT static void UpdateVertex(const TopoDS_Edge& aE,
0137 const Standard_Real aT,
0138 const TopoDS_Vertex& aV);
0139
0140
0141
0142
0143 Standard_EXPORT static void UpdateVertex(const TopoDS_Vertex& aVF,
0144 const TopoDS_Vertex& aVN);
0145
0146
0147 public:
0148
0149
0150 Standard_EXPORT static void MakeEdge(const IntTools_Curve& theCurve,
0151 const TopoDS_Vertex& theV1,
0152 const Standard_Real theT1,
0153 const TopoDS_Vertex& theV2,
0154 const Standard_Real theT2,
0155 const Standard_Real theTolR3D,
0156 TopoDS_Edge& theE);
0157
0158
0159 Standard_EXPORT static TopoDS_Edge CopyEdge(const TopoDS_Edge& theEdge);
0160
0161
0162
0163 Standard_EXPORT static void MakeSplitEdge(const TopoDS_Edge& aE1,
0164 const TopoDS_Vertex& aV1,
0165 const Standard_Real aP1,
0166 const TopoDS_Vertex& aV2,
0167 const Standard_Real aP2,
0168 TopoDS_Edge& aNewEdge);
0169
0170
0171
0172 Standard_EXPORT static void MakeSectEdge(const IntTools_Curve& aIC,
0173 const TopoDS_Vertex& aV1,
0174 const Standard_Real aP1,
0175 const TopoDS_Vertex& aV2,
0176 const Standard_Real aP2,
0177 TopoDS_Edge& aNewEdge);
0178
0179
0180 public:
0181
0182
0183
0184
0185
0186
0187 Standard_EXPORT static TopAbs_State ComputeState(const gp_Pnt& thePoint,
0188 const TopoDS_Solid& theSolid,
0189 const Standard_Real theTol,
0190 const Handle(IntTools_Context)& theContext);
0191
0192
0193
0194
0195
0196
0197 Standard_EXPORT static TopAbs_State ComputeState(const TopoDS_Vertex& theVertex,
0198 const TopoDS_Solid& theSolid,
0199 const Standard_Real theTol,
0200 const Handle(IntTools_Context)& theContext);
0201
0202
0203
0204
0205
0206
0207 Standard_EXPORT static TopAbs_State ComputeState(const TopoDS_Edge& theEdge,
0208 const TopoDS_Solid& theSolid,
0209 const Standard_Real theTol,
0210 const Handle(IntTools_Context)& theContext);
0211
0212
0213
0214
0215
0216
0217
0218 Standard_EXPORT static TopAbs_State ComputeState(const TopoDS_Face& theFace,
0219 const TopoDS_Solid& theSolid,
0220 const Standard_Real theTol,
0221 const TopTools_IndexedMapOfShape& theBounds,
0222 const Handle(IntTools_Context)& theContext);
0223
0224
0225
0226
0227
0228
0229 Standard_EXPORT static TopAbs_State ComputeStateByOnePoint(const TopoDS_Shape& theShape,
0230 const TopoDS_Solid& theSolid,
0231 const Standard_Real theTol,
0232 const Handle(IntTools_Context)& theContext);
0233
0234
0235 public:
0236
0237
0238
0239
0240
0241 Standard_EXPORT static Standard_Boolean GetFaceOff(const TopoDS_Edge& theEdge,
0242 const TopoDS_Face& theFace,
0243 BOPTools_ListOfCoupleOfShape& theLCEF,
0244 TopoDS_Face& theFaceOff,
0245 const Handle(IntTools_Context)& theContext);
0246
0247
0248
0249
0250
0251
0252
0253
0254
0255 Standard_EXPORT static Standard_Integer IsInternalFace(const TopoDS_Face& theFace,
0256 const TopoDS_Edge& theEdge,
0257 const TopoDS_Face& theFace1,
0258 const TopoDS_Face& theFace2,
0259 const Handle(IntTools_Context)& theContext);
0260
0261
0262
0263
0264
0265
0266
0267
0268 Standard_EXPORT static Standard_Integer IsInternalFace(const TopoDS_Face& theFace,
0269 const TopoDS_Edge& theEdge,
0270 TopTools_ListOfShape& theLF,
0271 const Handle(IntTools_Context)& theContext);
0272
0273
0274
0275
0276
0277
0278 Standard_EXPORT static Standard_Boolean IsInternalFace(const TopoDS_Face& theFace,
0279 const TopoDS_Solid& theSolid,
0280 TopTools_IndexedDataMapOfShapeListOfShape& theMEF,
0281 const Standard_Real theTol,
0282 const Handle(IntTools_Context)& theContext);
0283
0284
0285 public:
0286
0287
0288
0289 Standard_EXPORT static void MakePCurve (const TopoDS_Edge& theE,
0290 const TopoDS_Face& theF1,
0291 const TopoDS_Face& theF2,
0292 const IntTools_Curve& theCurve,
0293 const Standard_Boolean thePC1,
0294 const Standard_Boolean thePC2,
0295 const Handle(IntTools_Context)& theContext = Handle(IntTools_Context)());
0296
0297
0298 public:
0299
0300
0301 Standard_EXPORT static Standard_Boolean IsHole(const TopoDS_Shape& theW,
0302 const TopoDS_Shape& theF);
0303
0304
0305 public:
0306
0307
0308
0309
0310
0311
0312
0313
0314
0315
0316
0317
0318
0319
0320
0321
0322
0323
0324
0325
0326
0327
0328 Standard_EXPORT static Standard_Boolean IsSplitToReverse(const TopoDS_Shape& theSplit,
0329 const TopoDS_Shape& theShape,
0330 const Handle(IntTools_Context)& theContext,
0331 Standard_Integer *theError = NULL);
0332
0333
0334
0335
0336 Standard_EXPORT static Standard_Boolean IsSplitToReverseWithWarn(const TopoDS_Shape& theSplit,
0337 const TopoDS_Shape& theShape,
0338 const Handle(IntTools_Context)& theContext,
0339 const Handle(Message_Report)& theReport = NULL);
0340
0341
0342
0343
0344
0345
0346
0347
0348
0349
0350
0351
0352
0353
0354
0355
0356
0357
0358
0359
0360
0361 Standard_EXPORT static Standard_Boolean IsSplitToReverse(const TopoDS_Face& theSplit,
0362 const TopoDS_Face& theShape,
0363 const Handle(IntTools_Context)& theContext,
0364 Standard_Integer *theError = NULL);
0365
0366
0367
0368
0369
0370
0371
0372
0373
0374
0375
0376
0377
0378
0379
0380
0381
0382
0383
0384
0385
0386 Standard_EXPORT static Standard_Boolean IsSplitToReverse(const TopoDS_Edge& theSplit,
0387 const TopoDS_Edge& theShape,
0388 const Handle(IntTools_Context)& theContext,
0389 Standard_Integer *theError = NULL);
0390
0391
0392
0393
0394
0395
0396
0397 Standard_EXPORT static Standard_Integer Sense(const TopoDS_Face& theF1,
0398 const TopoDS_Face& theF2,
0399 const Handle(IntTools_Context)& theContext);
0400
0401 public:
0402
0403
0404
0405
0406
0407 Standard_EXPORT static void MakeConnexityBlock(TopTools_ListOfShape& theLS,
0408 TopTools_IndexedMapOfShape& theMapAvoid,
0409 TopTools_ListOfShape& theLSCB,
0410 const Handle(NCollection_BaseAllocator)& theAllocator);
0411
0412
0413
0414
0415
0416 Standard_EXPORT static void MakeConnexityBlocks(const TopoDS_Shape& theS,
0417 const TopAbs_ShapeEnum theConnectionType,
0418 const TopAbs_ShapeEnum theElementType,
0419 TopTools_ListOfShape& theLCB);
0420
0421
0422
0423
0424
0425
0426 Standard_EXPORT static void MakeConnexityBlocks(const TopoDS_Shape& theS,
0427 const TopAbs_ShapeEnum theConnectionType,
0428 const TopAbs_ShapeEnum theElementType,
0429 TopTools_ListOfListOfShape& theLCB,
0430 TopTools_IndexedDataMapOfShapeListOfShape& theConnectionMap);
0431
0432
0433
0434
0435 Standard_EXPORT static void MakeConnexityBlocks(const TopTools_ListOfShape& theLS,
0436 const TopAbs_ShapeEnum theConnectionType,
0437 const TopAbs_ShapeEnum theElementType,
0438 BOPTools_ListOfConnexityBlock& theLCB);
0439
0440 public:
0441
0442
0443 Standard_EXPORT static void OrientEdgesOnWire(TopoDS_Shape& theWire);
0444
0445
0446 Standard_EXPORT static void OrientFacesOnShell(TopoDS_Shape& theShell);
0447
0448
0449 public:
0450
0451
0452
0453
0454
0455
0456 Standard_EXPORT static void CorrectTolerances(const TopoDS_Shape& theS,
0457 const TopTools_IndexedMapOfShape& theMapToAvoid,
0458 const Standard_Real theTolMax = 0.0001,
0459 const Standard_Boolean theRunParallel = Standard_False);
0460
0461
0462
0463 Standard_EXPORT static void CorrectCurveOnSurface(const TopoDS_Shape& theS,
0464 const TopTools_IndexedMapOfShape& theMapToAvoid,
0465 const Standard_Real theTolMax = 0.0001,
0466 const Standard_Boolean theRunParallel = Standard_False);
0467
0468
0469
0470 Standard_EXPORT static void CorrectPointOnCurve(const TopoDS_Shape& theS,
0471 const TopTools_IndexedMapOfShape& theMapToAvoid,
0472 const Standard_Real theTolMax = 0.0001,
0473 const Standard_Boolean theRunParallel = Standard_False);
0474
0475
0476 Standard_EXPORT static void CorrectShapeTolerances(const TopoDS_Shape& theS,
0477 const TopTools_IndexedMapOfShape& theMapToAvoid,
0478 const Standard_Boolean theRunParallel = Standard_False);
0479
0480
0481 public:
0482
0483
0484 Standard_EXPORT static Standard_Boolean AreFacesSameDomain(const TopoDS_Face& theF1,
0485 const TopoDS_Face& theF2,
0486 const Handle(IntTools_Context)& theContext,
0487 const Standard_Real theFuzz = Precision::Confusion());
0488
0489 public:
0490
0491
0492
0493
0494
0495 Standard_EXPORT static Standard_Boolean GetEdgeOff(const TopoDS_Edge& theEdge,
0496 const TopoDS_Face& theFace,
0497 TopoDS_Edge& theEdgeOff);
0498
0499
0500
0501
0502
0503 Standard_EXPORT static Standard_Boolean GetEdgeOnFace(const TopoDS_Edge& theEdge,
0504 const TopoDS_Face& theFace,
0505 TopoDS_Edge& theEdgeOnF);
0506
0507
0508 public:
0509
0510
0511
0512 Standard_EXPORT static void CorrectRange(const TopoDS_Edge& aE1,
0513 const TopoDS_Edge& aE2,
0514 const IntTools_Range& aSR,
0515 IntTools_Range& aNewSR);
0516
0517
0518
0519
0520 Standard_EXPORT static void CorrectRange(const TopoDS_Edge& aE,
0521 const TopoDS_Face& aF,
0522 const IntTools_Range& aSR,
0523 IntTools_Range& aNewSR);
0524
0525 public:
0526
0527
0528
0529
0530 Standard_EXPORT static Standard_Boolean IsMicroEdge(const TopoDS_Edge& theEdge,
0531 const Handle(IntTools_Context)& theContext,
0532 const Standard_Boolean theCheckSplittable = Standard_True);
0533
0534 public:
0535
0536
0537 Standard_EXPORT static Standard_Boolean IsInvertedSolid(const TopoDS_Solid& theSolid);
0538
0539 public:
0540
0541
0542 Standard_EXPORT static Standard_Boolean ComputeTolerance(const TopoDS_Face& theFace,
0543 const TopoDS_Edge& theEdge,
0544 Standard_Real& theMaxDist,
0545 Standard_Real& theMaxPar);
0546
0547 public:
0548
0549
0550 Standard_EXPORT static void MakeContainer(const TopAbs_ShapeEnum theType,
0551 TopoDS_Shape& theShape);
0552
0553
0554 Standard_EXPORT static void PointOnEdge(const TopoDS_Edge& aEdge,
0555 const Standard_Real aPrm,
0556 gp_Pnt& aP);
0557
0558
0559
0560 Standard_EXPORT static Standard_Boolean IsBlockInOnFace(const IntTools_Range& aShR,
0561 const TopoDS_Face& aF,
0562 const TopoDS_Edge& aE,
0563 const Handle(IntTools_Context)& aContext);
0564
0565
0566 Standard_EXPORT static void Dimensions (const TopoDS_Shape& theS,
0567 Standard_Integer& theDMin,
0568 Standard_Integer& theDMax);
0569
0570
0571
0572 Standard_EXPORT static Standard_Integer Dimension(const TopoDS_Shape& theS);
0573
0574
0575
0576
0577 Standard_EXPORT static void TreatCompound (const TopoDS_Shape& theS,
0578 TopTools_ListOfShape& theList,
0579 TopTools_MapOfShape* theMap = NULL);
0580
0581
0582 Standard_EXPORT static Standard_Boolean IsOpenShell(const TopoDS_Shell& theShell);
0583
0584 };
0585
0586 #endif