File indexing completed on 2025-01-18 10:03:04
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #ifndef _BOPAlgo_PaveFiller_HeaderFile
0019 #define _BOPAlgo_PaveFiller_HeaderFile
0020
0021 #include <Standard.hxx>
0022 #include <Standard_DefineAlloc.hxx>
0023 #include <Standard_Handle.hxx>
0024
0025 #include <BOPAlgo_Algo.hxx>
0026 #include <BOPAlgo_GlueEnum.hxx>
0027 #include <BOPAlgo_SectionAttribute.hxx>
0028 #include <BOPDS_DataMapOfPaveBlockListOfPaveBlock.hxx>
0029 #include <BOPDS_IndexedDataMapOfPaveBlockListOfInteger.hxx>
0030 #include <BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks.hxx>
0031 #include <BOPDS_IndexedMapOfPaveBlock.hxx>
0032 #include <BOPDS_ListOfPaveBlock.hxx>
0033 #include <BOPDS_MapOfPair.hxx>
0034 #include <BOPDS_MapOfPaveBlock.hxx>
0035 #include <BOPDS_PDS.hxx>
0036 #include <BOPDS_PIterator.hxx>
0037 #include <BOPDS_VectorOfCurve.hxx>
0038 #include <BOPTools_BoxTree.hxx>
0039 #include <IntSurf_ListOfPntOn2S.hxx>
0040 #include <IntTools_ShrunkRange.hxx>
0041 #include <NCollection_BaseAllocator.hxx>
0042 #include <Standard_Integer.hxx>
0043 #include <Standard_Real.hxx>
0044 #include <TColStd_DataMapOfIntegerInteger.hxx>
0045 #include <TColStd_DataMapOfIntegerListOfInteger.hxx>
0046 #include <TColStd_DataMapOfIntegerReal.hxx>
0047 #include <TColStd_ListOfInteger.hxx>
0048 #include <TColStd_MapOfInteger.hxx>
0049 #include <TopAbs_ShapeEnum.hxx>
0050 #include <TopTools_DataMapOfShapeInteger.hxx>
0051 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
0052 #include <TopTools_IndexedMapOfShape.hxx>
0053 #include <TopTools_ListOfShape.hxx>
0054 class IntTools_Context;
0055 class BOPDS_PaveBlock;
0056 class gp_Pnt;
0057 class BOPDS_Curve;
0058 class TopoDS_Vertex;
0059 class TopoDS_Edge;
0060 class TopoDS_Face;
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106 class BOPAlgo_PaveFiller : public BOPAlgo_Algo
0107 {
0108 public:
0109
0110 DEFINE_STANDARD_ALLOC
0111
0112
0113 Standard_EXPORT BOPAlgo_PaveFiller();
0114
0115 Standard_EXPORT virtual ~BOPAlgo_PaveFiller();
0116
0117 Standard_EXPORT BOPAlgo_PaveFiller(const Handle(NCollection_BaseAllocator)& theAllocator);
0118
0119 Standard_EXPORT const BOPDS_DS& DS();
0120
0121 Standard_EXPORT BOPDS_PDS PDS();
0122
0123 Standard_EXPORT const BOPDS_PIterator& Iterator();
0124
0125
0126 void SetArguments (const TopTools_ListOfShape& theLS)
0127 {
0128 myArguments = theLS;
0129 }
0130
0131
0132 void AddArgument(const TopoDS_Shape& theShape)
0133 {
0134 myArguments.Append(theShape);
0135 }
0136
0137
0138 const TopTools_ListOfShape& Arguments() const
0139 {
0140 return myArguments;
0141 }
0142
0143 Standard_EXPORT const Handle(IntTools_Context)& Context();
0144
0145 Standard_EXPORT void SetSectionAttribute (const BOPAlgo_SectionAttribute& theSecAttr);
0146
0147
0148
0149
0150 Standard_EXPORT void SetNonDestructive(const Standard_Boolean theFlag);
0151
0152
0153
0154
0155 Standard_EXPORT Standard_Boolean NonDestructive() const;
0156
0157 Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
0158
0159
0160
0161
0162 Standard_EXPORT void SetGlue(const BOPAlgo_GlueEnum theGlue);
0163
0164
0165 Standard_EXPORT BOPAlgo_GlueEnum Glue() const;
0166
0167
0168 void SetAvoidBuildPCurve(const Standard_Boolean theValue)
0169 {
0170 myAvoidBuildPCurve = theValue;
0171 }
0172
0173
0174 Standard_Boolean IsAvoidBuildPCurve() const
0175 {
0176 return myAvoidBuildPCurve;
0177 }
0178
0179 protected:
0180
0181 typedef NCollection_DataMap
0182 <Handle(BOPDS_PaveBlock),
0183 Bnd_Box> BOPAlgo_DataMapOfPaveBlockBndBox;
0184
0185 typedef NCollection_DataMap
0186 <Handle(BOPDS_PaveBlock),
0187 TColStd_ListOfInteger> BOPAlgo_DataMapOfPaveBlockListOfInteger;
0188
0189 typedef NCollection_DataMap
0190 <Standard_Integer,
0191 BOPDS_MapOfPaveBlock> BOPAlgo_DataMapOfIntegerMapOfPaveBlock;
0192
0193
0194
0195 Standard_EXPORT void SetNonDestructive();
0196
0197 Standard_EXPORT void SetIsPrimary(const Standard_Boolean theFlag);
0198
0199 Standard_EXPORT Standard_Boolean IsPrimary() const;
0200
0201 Standard_EXPORT virtual void PerformInternal(const Message_ProgressRange& theRange);
0202
0203 Standard_EXPORT virtual void Clear() Standard_OVERRIDE;
0204
0205 Standard_EXPORT virtual void Init(const Message_ProgressRange& theRange);
0206
0207 Standard_EXPORT void Prepare(const Message_ProgressRange& theRange);
0208
0209 Standard_EXPORT virtual void PerformVV(const Message_ProgressRange& theRange);
0210
0211 Standard_EXPORT virtual void PerformVE(const Message_ProgressRange& theRange);
0212
0213
0214 Standard_EXPORT void IntersectVE(const BOPDS_IndexedDataMapOfPaveBlockListOfInteger& theVEPairs,
0215 const Message_ProgressRange& theRange,
0216 const Standard_Boolean bAddInterfs = Standard_True);
0217
0218
0219
0220
0221
0222
0223
0224
0225
0226 Standard_EXPORT void SplitPaveBlocks(const TColStd_MapOfInteger& theMEdges,
0227 const Standard_Boolean theAddInterfs);
0228
0229 Standard_EXPORT virtual void PerformVF(const Message_ProgressRange& theRange);
0230
0231 Standard_EXPORT virtual void PerformEE(const Message_ProgressRange& theRange);
0232
0233 Standard_EXPORT virtual void PerformEF(const Message_ProgressRange& theRange);
0234
0235 Standard_EXPORT virtual void PerformFF(const Message_ProgressRange& theRange);
0236
0237 Standard_EXPORT void TreatVerticesEE();
0238
0239 Standard_EXPORT void MakeSDVerticesFF(const TColStd_DataMapOfIntegerListOfInteger& aDMVLV,
0240 TColStd_DataMapOfIntegerInteger& theDMNewSD);
0241
0242 Standard_EXPORT void MakeSplitEdges(const Message_ProgressRange& theRange);
0243
0244 Standard_EXPORT void MakeBlocks(const Message_ProgressRange& theRange);
0245
0246 Standard_EXPORT void MakePCurves(const Message_ProgressRange& theRange);
0247
0248 Standard_EXPORT Standard_Integer MakeSDVertices(const TColStd_ListOfInteger& theVertIndices,
0249 const Standard_Boolean theAddInterfs = 1);
0250
0251 Standard_EXPORT void ProcessDE(const Message_ProgressRange& theRange);
0252
0253 Standard_EXPORT void FillShrunkData (Handle(BOPDS_PaveBlock)& thePB);
0254
0255 Standard_EXPORT void FillShrunkData (const TopAbs_ShapeEnum theType1,
0256 const TopAbs_ShapeEnum theType2);
0257
0258
0259
0260
0261 Standard_EXPORT void AnalyzeShrunkData(const Handle(BOPDS_PaveBlock)& thePB,
0262 const IntTools_ShrunkRange& theSR);
0263
0264
0265 Standard_EXPORT void PerformNewVertices(BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMVCPB,
0266 const Handle(NCollection_BaseAllocator)& theAllocator,
0267 const Message_ProgressRange& theRange,
0268 const Standard_Boolean theIsEEIntersection = Standard_True);
0269
0270 Standard_EXPORT Standard_Boolean CheckFacePaves (const TopoDS_Vertex& theVnew,
0271 const TColStd_MapOfInteger& theMIF);
0272
0273 Standard_EXPORT static Standard_Boolean CheckFacePaves (const Standard_Integer theN,
0274 const TColStd_MapOfInteger& theMIFOn,
0275 const TColStd_MapOfInteger& theMIFIn);
0276
0277 Standard_EXPORT Standard_Boolean IsExistingVertex (const gp_Pnt& theP,
0278 const Standard_Real theTol,
0279 const TColStd_MapOfInteger& theMVOn) const;
0280
0281
0282
0283
0284
0285 Standard_EXPORT void PutPavesOnCurve(const TColStd_MapOfInteger& theMVOnIn,
0286 const TColStd_MapOfInteger& theMVCommon,
0287 BOPDS_Curve& theNC,
0288 const TColStd_MapOfInteger& theMI,
0289 const TColStd_MapOfInteger& theMVEF,
0290 TColStd_DataMapOfIntegerReal& theMVTol,
0291 TColStd_DataMapOfIntegerListOfInteger& theDMVLV);
0292
0293 Standard_EXPORT void FilterPavesOnCurves(const BOPDS_VectorOfCurve& theVNC,
0294 TColStd_DataMapOfIntegerReal& theMVTol);
0295
0296
0297
0298
0299
0300
0301
0302
0303
0304 Standard_EXPORT Standard_Boolean ExtendedTolerance (const Standard_Integer nV,
0305 const TColStd_MapOfInteger& aMI,
0306 Standard_Real& aTolVExt,
0307 const Standard_Integer aType = 0);
0308
0309 Standard_EXPORT void PutBoundPaveOnCurve(const TopoDS_Face& theF1,
0310 const TopoDS_Face& theF2,
0311 BOPDS_Curve& theNC,
0312 TColStd_ListOfInteger& theLBV);
0313
0314
0315
0316
0317 Standard_EXPORT Standard_Boolean IsExistingPaveBlock
0318 (const Handle(BOPDS_PaveBlock)& thePB, const BOPDS_Curve& theNC,
0319 const Standard_Real theTolR3D,
0320 const BOPDS_IndexedMapOfPaveBlock& theMPB,
0321 BOPTools_BoxTree& thePBTree,
0322 const BOPDS_MapOfPaveBlock& theMPBCommon,
0323 Handle(BOPDS_PaveBlock)& thePBOut, Standard_Real& theTolNew);
0324
0325
0326
0327
0328 Standard_EXPORT Standard_Boolean IsExistingPaveBlock(const Handle(BOPDS_PaveBlock)& thePB,
0329 const BOPDS_Curve& theNC,
0330 const TColStd_ListOfInteger& theLSE,
0331 Standard_Integer& theNEOut,
0332 Standard_Real& theTolNew);
0333
0334
0335 Standard_EXPORT void PostTreatFF (BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMSCPB,
0336 BOPDS_DataMapOfPaveBlockListOfPaveBlock& theDMExEdges,
0337 TColStd_DataMapOfIntegerInteger& theDMNewSD,
0338 const BOPDS_IndexedMapOfPaveBlock& theMicroPB,
0339 const TopTools_IndexedMapOfShape& theVertsOnRejectedPB,
0340 const Handle(NCollection_BaseAllocator)& theAllocator,
0341 const Message_ProgressRange& theRange);
0342
0343 Standard_EXPORT void FindPaveBlocks (const Standard_Integer theV,
0344 const Standard_Integer theF,
0345 BOPDS_ListOfPaveBlock& theLPB);
0346
0347 Standard_EXPORT void FillPaves (const Standard_Integer theV,
0348 const Standard_Integer theE,
0349 const Standard_Integer theF,
0350 const BOPDS_ListOfPaveBlock& theLPB,
0351 const Handle(BOPDS_PaveBlock)& thePB);
0352
0353 Standard_EXPORT void MakeSplitEdge (const Standard_Integer theV, const Standard_Integer theF);
0354
0355 Standard_EXPORT void GetEFPnts (const Standard_Integer nF1,
0356 const Standard_Integer nF2,
0357 IntSurf_ListOfPntOn2S& aListOfPnts);
0358
0359
0360
0361 Standard_EXPORT void PutEFPavesOnCurve (const BOPDS_VectorOfCurve& theVC,
0362 const Standard_Integer theIndex,
0363 const TColStd_MapOfInteger& theMI,
0364 const TColStd_MapOfInteger& theMVEF,
0365 TColStd_DataMapOfIntegerReal& theMVTol,
0366 TColStd_DataMapOfIntegerListOfInteger& aDMVLV);
0367
0368
0369
0370 Standard_EXPORT void PutStickPavesOnCurve (const TopoDS_Face& aF1,
0371 const TopoDS_Face& aF2,
0372 const TColStd_MapOfInteger& theMI,
0373 const BOPDS_VectorOfCurve& theVC,
0374 const Standard_Integer theIndex,
0375 const TColStd_MapOfInteger& theMVStick,
0376 TColStd_DataMapOfIntegerReal& theMVTol,
0377 TColStd_DataMapOfIntegerListOfInteger& aDMVLV);
0378
0379
0380
0381
0382
0383
0384 Standard_EXPORT void GetStickVertices (const Standard_Integer nF1,
0385 const Standard_Integer nF2,
0386 TColStd_MapOfInteger& theMVStick,
0387 TColStd_MapOfInteger& theMVEF,
0388 TColStd_MapOfInteger& theMI);
0389
0390
0391
0392
0393 Standard_EXPORT void GetFullShapeMap (const Standard_Integer nF, TColStd_MapOfInteger& theMI);
0394
0395
0396
0397
0398
0399 Standard_EXPORT void RemoveUsedVertices (const BOPDS_VectorOfCurve& theVC, TColStd_MapOfInteger& theMV);
0400
0401
0402
0403
0404
0405
0406
0407 Standard_EXPORT void PutPaveOnCurve (const Standard_Integer nV,
0408 const Standard_Real theTolR3D,
0409 const BOPDS_Curve& theNC,
0410 const TColStd_MapOfInteger& theMI,
0411 TColStd_DataMapOfIntegerReal& theMVTol,
0412 TColStd_DataMapOfIntegerListOfInteger& aDMVLV,
0413 const Standard_Integer aType = 0);
0414
0415
0416
0417
0418 Standard_EXPORT void ProcessExistingPaveBlocks (const Standard_Integer theInt,
0419 const Standard_Integer theCur,
0420 const Standard_Integer nF1,
0421 const Standard_Integer nF2,
0422 const TopoDS_Edge& theES,
0423 const BOPDS_IndexedMapOfPaveBlock& theMPBOnIn,
0424 BOPTools_BoxTree& thePBTree,
0425 BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMSCPB,
0426 TopTools_DataMapOfShapeInteger& theMVI,
0427 BOPDS_ListOfPaveBlock& theLPBC,
0428 BOPAlgo_DataMapOfPaveBlockListOfInteger& thePBFacesMap,
0429 BOPDS_MapOfPaveBlock& theMPB);
0430
0431
0432
0433 Standard_EXPORT void ProcessExistingPaveBlocks (const Standard_Integer theInt,
0434 const Standard_Integer nF1,
0435 const Standard_Integer nF2,
0436 const BOPDS_IndexedMapOfPaveBlock& theMPBOnIn,
0437 BOPTools_BoxTree& thePBTree,
0438 const TColStd_DataMapOfIntegerListOfInteger& theDMBV,
0439 BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMSCPB,
0440 TopTools_DataMapOfShapeInteger& theMVI,
0441 BOPAlgo_DataMapOfPaveBlockListOfInteger& thePBFacesMap,
0442 BOPDS_MapOfPaveBlock& theMPB);
0443
0444
0445
0446
0447
0448 Standard_EXPORT void UpdateExistingPaveBlocks(const Handle(BOPDS_PaveBlock)& thePB,
0449 BOPDS_ListOfPaveBlock& theLPB,
0450 const BOPAlgo_DataMapOfPaveBlockListOfInteger& thePBFacesMap);
0451
0452
0453 Standard_EXPORT void TreatNewVertices(const BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMVCPB,
0454 TopTools_IndexedDataMapOfShapeListOfShape& theImages);
0455
0456
0457
0458
0459 Standard_EXPORT void PutClosingPaveOnCurve (BOPDS_Curve& aNC);
0460
0461
0462
0463 Standard_EXPORT void PreparePostTreatFF (const Standard_Integer aInt,
0464 const Standard_Integer aCur,
0465 const Handle(BOPDS_PaveBlock)& aPB,
0466 BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& aMSCPB,
0467 TopTools_DataMapOfShapeInteger& aMVI,
0468 BOPDS_ListOfPaveBlock& aLPB);
0469
0470
0471 Standard_EXPORT void UpdateFaceInfo(BOPDS_DataMapOfPaveBlockListOfPaveBlock& theDME,
0472 const TColStd_DataMapOfIntegerInteger& theDMV,
0473 const BOPAlgo_DataMapOfPaveBlockListOfInteger& thePBFacesMap);
0474
0475
0476
0477
0478 Standard_EXPORT Standard_Boolean ForceInterfVE(const Standard_Integer nV,
0479 Handle(BOPDS_PaveBlock)& aPB,
0480 TColStd_MapOfInteger& theMEdges);
0481
0482
0483
0484 Standard_EXPORT Standard_Boolean ForceInterfVF (const Standard_Integer nV, const Standard_Integer nF);
0485
0486
0487
0488
0489 Standard_EXPORT Standard_Boolean CheckPlanes (const Standard_Integer nF1, const Standard_Integer nF2) const;
0490
0491
0492
0493
0494 Standard_EXPORT Standard_Integer SplitEdge (const Standard_Integer nE,
0495 const Standard_Integer nV1,
0496 const Standard_Real aT1,
0497 const Standard_Integer nV2,
0498 const Standard_Real aT2);
0499
0500
0501
0502
0503 Standard_EXPORT void UpdatePaveBlocks(const TColStd_DataMapOfIntegerInteger& aDMNewSD);
0504
0505
0506
0507
0508 Standard_EXPORT Standard_Integer UpdateVertex(const Standard_Integer nV,
0509 const Standard_Real aTolNew);
0510
0511 Standard_EXPORT void UpdatePaveBlocksWithSDVertices();
0512
0513 Standard_EXPORT void UpdateCommonBlocksWithSDVertices();
0514
0515 Standard_EXPORT void UpdateBlocksWithSharedVertices();
0516
0517 Standard_EXPORT void UpdateInterfsWithSDVertices();
0518
0519 Standard_EXPORT Standard_Boolean EstimatePaveOnCurve(const Standard_Integer nV,
0520 const BOPDS_Curve& theNC,
0521 const Standard_Real theTolR3D);
0522
0523 Standard_EXPORT void UpdateEdgeTolerance(const Standard_Integer nE,
0524 const Standard_Real aTolNew);
0525
0526 Standard_EXPORT void RemovePaveBlocks(const TColStd_MapOfInteger& theEdges);
0527
0528 Standard_EXPORT void CorrectToleranceOfSE();
0529
0530
0531
0532
0533 Standard_EXPORT void ReduceIntersectionRange(const Standard_Integer theV1,
0534 const Standard_Integer theV2,
0535 const Standard_Integer theE,
0536 const Standard_Integer theF,
0537 Standard_Real& theTS1,
0538 Standard_Real& theTS2);
0539
0540
0541
0542
0543
0544
0545
0546
0547
0548
0549 Standard_EXPORT Standard_Boolean GetPBBox(const TopoDS_Edge& theE,
0550 const Handle(BOPDS_PaveBlock)& thePB,
0551 BOPAlgo_DataMapOfPaveBlockBndBox& thePBBox,
0552 Standard_Real& theFirst,
0553 Standard_Real& theLast,
0554 Standard_Real& theSFirst,
0555 Standard_Real& theSLast,
0556 Bnd_Box& theBox);
0557
0558
0559
0560
0561
0562
0563
0564 Standard_EXPORT void PutSEInOtherFaces(const Message_ProgressRange& theRange);
0565
0566
0567
0568
0569
0570
0571
0572
0573
0574 Standard_EXPORT void CheckSelfInterference();
0575
0576
0577 Standard_EXPORT void AddIntersectionFailedWarning(const TopoDS_Shape& theS1,
0578 const TopoDS_Shape& theS2);
0579
0580
0581 Standard_EXPORT void RepeatIntersection(const Message_ProgressRange& theRange);
0582
0583
0584 Standard_EXPORT void UpdateVerticesOfCB();
0585
0586
0587
0588 Standard_EXPORT void ForceInterfEE(const Message_ProgressRange& theRange);
0589
0590
0591
0592 Standard_EXPORT void ForceInterfEF(const Message_ProgressRange& theRange);
0593
0594
0595
0596 Standard_EXPORT void ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB,
0597 const Message_ProgressRange& theRange,
0598 const Standard_Boolean theAddInterf);
0599
0600
0601
0602
0603
0604
0605
0606
0607
0608
0609
0610
0611
0612 Standard_EXPORT void RemoveMicroSectionEdges(BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMSCPB,
0613 BOPDS_IndexedMapOfPaveBlock& theMicroPB);
0614
0615
0616 Standard_EXPORT void RemoveMicroEdges();
0617
0618
0619 struct EdgeRangeDistance
0620 {
0621 Standard_Real First;
0622 Standard_Real Last;
0623 Standard_Real Distance;
0624
0625 EdgeRangeDistance (const Standard_Real theFirst = 0.0,
0626 const Standard_Real theLast = 0.0,
0627 const Standard_Real theDistance = RealLast())
0628 : First (theFirst), Last (theLast), Distance (theDistance)
0629 {}
0630 };
0631
0632 protected:
0633
0634
0635 Standard_EXPORT void fillPIConstants(const Standard_Real theWhole, BOPAlgo_PISteps& theSteps) const Standard_OVERRIDE;
0636
0637 Standard_EXPORT void fillPISteps(BOPAlgo_PISteps& theSteps) const Standard_OVERRIDE;
0638
0639 protected:
0640
0641 TopTools_ListOfShape myArguments;
0642 BOPDS_PDS myDS;
0643 BOPDS_PIterator myIterator;
0644 Handle(IntTools_Context) myContext;
0645 BOPAlgo_SectionAttribute mySectionAttribute;
0646 Standard_Boolean myNonDestructive;
0647 Standard_Boolean myIsPrimary;
0648 Standard_Boolean myAvoidBuildPCurve;
0649 BOPAlgo_GlueEnum myGlue;
0650
0651 BOPAlgo_DataMapOfIntegerMapOfPaveBlock myFPBDone;
0652 TColStd_MapOfInteger myIncreasedSS;
0653 TColStd_MapOfInteger myVertsToAvoidExtension;
0654
0655
0656
0657
0658 NCollection_DataMap <BOPDS_Pair,
0659 NCollection_List<EdgeRangeDistance>>
0660 myDistances;
0661
0662
0663 };
0664
0665 #endif