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