1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-06 18:26:22 +03:00

0024628: Intersection result is unfixed

The map for collecting pave blocks of two faces has been replaced with indexed map
to ensure the constant order of pave blocks when checking section curves for existents.

Test case for issue CR24628
This commit is contained in:
emv 2014-03-06 15:02:08 +04:00 committed by abv
parent b92f35729a
commit decdfc9499
5 changed files with 47 additions and 30 deletions

View File

@ -49,6 +49,7 @@ uses
Curve from BOPDS, Curve from BOPDS,
IndexedDataMapOfShapeCoupleOfPaveBlocks from BOPDS, IndexedDataMapOfShapeCoupleOfPaveBlocks from BOPDS,
MapOfPaveBlock from BOPDS, MapOfPaveBlock from BOPDS,
IndexedMapOfPaveBlock from BOPDS,
ListOfPaveBlock from BOPDS, ListOfPaveBlock from BOPDS,
ListOfPave from BOPDS, ListOfPave from BOPDS,
ListOfPntOn2S from IntSurf, ListOfPntOn2S from IntSurf,
@ -214,7 +215,7 @@ is
thePB:PaveBlock from BOPDS; thePB:PaveBlock from BOPDS;
theNC:Curve from BOPDS; theNC:Curve from BOPDS;
theTolR3D:Real from Standard; theTolR3D:Real from Standard;
theMPB:MapOfPaveBlock from BOPDS; theMPB:IndexedMapOfPaveBlock from BOPDS;
thePBOut:out PaveBlock from BOPDS) thePBOut:out PaveBlock from BOPDS)
returns Boolean from Standard returns Boolean from Standard
is protected; is protected;
@ -333,7 +334,7 @@ is
ProcessExistingPaveBlocks(me:out; ProcessExistingPaveBlocks(me:out;
theInt : Integer from Standard; theInt : Integer from Standard;
theMPBOnIn : MapOfPaveBlock from BOPDS; theMPBOnIn : IndexedMapOfPaveBlock from BOPDS;
theMSCPB : out IndexedDataMapOfShapeCoupleOfPaveBlocks from BOPDS; theMSCPB : out IndexedDataMapOfShapeCoupleOfPaveBlocks from BOPDS;
theMVI : out DataMapOfShapeInteger from BOPCol; theMVI : out DataMapOfShapeInteger from BOPCol;
theMVB : MapOfInteger from BOPCol; theMVB : MapOfInteger from BOPCol;

View File

@ -284,8 +284,8 @@ void BOPAlgo_PaveFiller::MakeBlocks()
BOPCol_MapOfInteger aMVOnIn(100, aAllocator), aMF(100, aAllocator), BOPCol_MapOfInteger aMVOnIn(100, aAllocator), aMF(100, aAllocator),
aMVStick(100,aAllocator), aMVEF(100, aAllocator), aMVStick(100,aAllocator), aMVEF(100, aAllocator),
aMVB(100, aAllocator), aMI(100, aAllocator); aMVB(100, aAllocator), aMI(100, aAllocator);
BOPDS_MapOfPaveBlock aMPBOnIn(100, aAllocator), BOPDS_IndexedMapOfPaveBlock aMPBOnIn(100, aAllocator);
aMPBAdd(100, aAllocator); BOPDS_MapOfPaveBlock aMPBAdd(100, aAllocator);
BOPDS_ListOfPaveBlock aLPB(aAllocator); BOPDS_ListOfPaveBlock aLPB(aAllocator);
BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks aMSCPB(100, aAllocator); BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks aMSCPB(100, aAllocator);
BOPCol_DataMapOfShapeInteger aMVI(100, aAllocator); BOPCol_DataMapOfShapeInteger aMVI(100, aAllocator);
@ -965,15 +965,14 @@ void BOPAlgo_PaveFiller::UpdateFaceInfo(BOPDS_DataMapOfPaveBlockListOfPaveBlock&
(const Handle(BOPDS_PaveBlock)& thePB, (const Handle(BOPDS_PaveBlock)& thePB,
const BOPDS_Curve& theNC, const BOPDS_Curve& theNC,
const Standard_Real theTolR3D, const Standard_Real theTolR3D,
const BOPDS_MapOfPaveBlock& theMPBOnIn, const BOPDS_IndexedMapOfPaveBlock& theMPBOnIn,
Handle(BOPDS_PaveBlock&) aPBOut) Handle(BOPDS_PaveBlock&) aPBOut)
{ {
Standard_Boolean bRet; Standard_Boolean bRet;
Standard_Real aT1, aT2, aTm, aTx; Standard_Real aT1, aT2, aTm, aTx;
Standard_Integer nSp, iFlag1, iFlag2, nV11, nV12, nV21, nV22; Standard_Integer nSp, iFlag1, iFlag2, nV11, nV12, nV21, nV22, i, aNbPB;
gp_Pnt aP1, aPm, aP2; gp_Pnt aP1, aPm, aP2;
Bnd_Box aBoxP1, aBoxPm, aBoxP2; Bnd_Box aBoxP1, aBoxPm, aBoxP2;
BOPDS_MapIteratorOfMapOfPaveBlock aIt;
// //
bRet=Standard_False; bRet=Standard_False;
const IntTools_Curve& aIC=theNC.Curve(); const IntTools_Curve& aIC=theNC.Curve();
@ -994,9 +993,9 @@ void BOPAlgo_PaveFiller::UpdateFaceInfo(BOPDS_DataMapOfPaveBlockListOfPaveBlock&
aBoxP2.Add(aP2); aBoxP2.Add(aP2);
aBoxP2.Enlarge(theTolR3D); aBoxP2.Enlarge(theTolR3D);
// //
aIt.Initialize(theMPBOnIn); aNbPB = theMPBOnIn.Extent();
for (; aIt.More(); aIt.Next()) { for (i = 1; i <= aNbPB; ++i) {
const Handle(BOPDS_PaveBlock)& aPB=aIt.Value(); const Handle(BOPDS_PaveBlock)& aPB = theMPBOnIn(i);
aPB->Indices(nV21, nV22); aPB->Indices(nV21, nV22);
nSp=aPB->Edge(); nSp=aPB->Edge();
const BOPDS_ShapeInfo& aSISp=myDS->ChangeShapeInfo(nSp); const BOPDS_ShapeInfo& aSISp=myDS->ChangeShapeInfo(nSp);
@ -1616,16 +1615,15 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC,
//======================================================================= //=======================================================================
void BOPAlgo_PaveFiller::ProcessExistingPaveBlocks void BOPAlgo_PaveFiller::ProcessExistingPaveBlocks
(const Standard_Integer theInt, (const Standard_Integer theInt,
const BOPDS_MapOfPaveBlock& aMPBOnIn, const BOPDS_IndexedMapOfPaveBlock& aMPBOnIn,
BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& aMSCPB, BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& aMSCPB,
BOPCol_DataMapOfShapeInteger& aMVI, BOPCol_DataMapOfShapeInteger& aMVI,
const BOPCol_MapOfInteger& aMVB, const BOPCol_MapOfInteger& aMVB,
BOPDS_MapOfPaveBlock& aMPB) BOPDS_MapOfPaveBlock& aMPB)
{ {
Standard_Integer nV, nE, iFlag; Standard_Integer nV, nE, iFlag, i, aNbPB;
Standard_Real aT; Standard_Real aT;
BOPCol_MapIteratorOfMapOfInteger aItB; BOPCol_MapIteratorOfMapOfInteger aItB;
BOPDS_MapIteratorOfMapOfPaveBlock aItPB;
// //
BOPDS_VectorOfInterfFF& aFFs=myDS->InterfFF(); BOPDS_VectorOfInterfFF& aFFs=myDS->InterfFF();
BOPDS_InterfFF& aFF = aFFs(theInt); BOPDS_InterfFF& aFF = aFFs(theInt);
@ -1641,9 +1639,9 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC,
continue; continue;
} }
// //
aItPB.Initialize(aMPBOnIn); aNbPB = aMPBOnIn.Extent();
for (; aItPB.More(); aItPB.Next()) { for (i = 1; i <= aNbPB; ++i) {
const Handle(BOPDS_PaveBlock)& aPB = aItPB.Value(); const Handle(BOPDS_PaveBlock)& aPB = aMPBOnIn(i);
if (aPB->Pave1().Index() == nV || aPB->Pave2().Index() == nV) { if (aPB->Pave1().Index() == nV || aPB->Pave2().Index() == nV) {
continue; continue;
} }

View File

@ -396,7 +396,7 @@ is
theF1:Integer from Standard; theF1:Integer from Standard;
theF2:Integer from Standard; theF2:Integer from Standard;
theMI:out MapOfInteger from BOPCol; theMI:out MapOfInteger from BOPCol;
aMPB: out MapOfPaveBlock from BOPDS); aMPB: out IndexedMapOfPaveBlock from BOPDS);
---Purpose: ---Purpose:
--- Returns the indices of vertices and pave blocks --- Returns the indices of vertices and pave blocks
--- that are On/In for the faces with indices theF1, theF2 --- that are On/In for the faces with indices theF1, theF2

View File

@ -38,6 +38,8 @@
#include <BOPDS_PassKey.hxx> #include <BOPDS_PassKey.hxx>
#include <BOPDS_DataMapOfPassKeyListOfPaveBlock.hxx> #include <BOPDS_DataMapOfPassKeyListOfPaveBlock.hxx>
#include <BOPDS_PassKey.hxx> #include <BOPDS_PassKey.hxx>
#include <BOPDS_MapOfPave.hxx>
#include <BOPDS_MapOfPaveBlock.hxx>
#include <Geom_Curve.hxx> #include <Geom_Curve.hxx>
#include <BRep_Builder.hxx> #include <BRep_Builder.hxx>
@ -45,7 +47,6 @@
#include <IntTools_Tools.hxx> #include <IntTools_Tools.hxx>
#include <BOPTools_AlgoTools.hxx> #include <BOPTools_AlgoTools.hxx>
#include <GeomAPI_ProjectPointOnCurve.hxx> #include <GeomAPI_ProjectPointOnCurve.hxx>
#include <BOPDS_MapOfPave.hxx>
// //
static static
@ -1426,25 +1427,24 @@ void BOPDS_DS::VerticesOnIn
(const Standard_Integer nF1, (const Standard_Integer nF1,
const Standard_Integer nF2, const Standard_Integer nF2,
BOPCol_MapOfInteger& aMI, BOPCol_MapOfInteger& aMI,
BOPDS_MapOfPaveBlock& aMPB)const BOPDS_IndexedMapOfPaveBlock& aMPB)const
{ {
Standard_Integer i, nV, nV1, nV2; Standard_Integer i, j, nV, nV1, nV2, aNbPB;
BOPCol_MapIteratorOfMapOfInteger aIt; BOPCol_MapIteratorOfMapOfInteger aIt;
BOPDS_IndexedMapOfPaveBlock* pMPB[4]; BOPDS_IndexedMapOfPaveBlock pMPB[4];
BOPDS_MapIteratorOfMapOfPaveBlock aItMPB;
// //
const BOPDS_FaceInfo& aFI1=FaceInfo(nF1); const BOPDS_FaceInfo& aFI1=FaceInfo(nF1);
const BOPDS_FaceInfo& aFI2=FaceInfo(nF2); const BOPDS_FaceInfo& aFI2=FaceInfo(nF2);
// //
pMPB[0]=(BOPDS_IndexedMapOfPaveBlock*)&aFI1.PaveBlocksOn(); pMPB[0]=aFI1.PaveBlocksOn();
pMPB[1]=(BOPDS_IndexedMapOfPaveBlock*)&aFI1.PaveBlocksIn(); pMPB[1]=aFI1.PaveBlocksIn();
pMPB[2]=(BOPDS_IndexedMapOfPaveBlock*)&aFI2.PaveBlocksOn(); pMPB[2]=aFI2.PaveBlocksOn();
pMPB[3]=(BOPDS_IndexedMapOfPaveBlock*)&aFI2.PaveBlocksIn(); pMPB[3]=aFI2.PaveBlocksIn();
// //
for (i=0; i<4; ++i) { for (i=0; i<4; ++i) {
aItMPB.Initialize(*pMPB[i]); aNbPB = pMPB[i].Extent();
for (; aItMPB.More(); aItMPB.Next()) { for (j = 1; j <= aNbPB; ++j) {
const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value(); const Handle(BOPDS_PaveBlock)& aPB = pMPB[i](j);
aMPB.Add(aPB); aMPB.Add(aPB);
aPB->Indices(nV1, nV2); aPB->Indices(nV1, nV2);
aMI.Add(nV1); aMI.Add(nV1);

View File

@ -0,0 +1,18 @@
puts "========="
puts "OCC24628"
puts "========="
puts ""
#################################################################################
# Intersection result is unfixed
#################################################################################
restore [locate_data_file bug24628_shell2.brep] shell
restore [locate_data_file bug24628_shellcut2.brep] cut
bsection result shell cut
set nb_v_good 15
set nb_e_good 14
set 2dviewer 1