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