1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-07 18:30:55 +03:00

0024492: The command bopargcheck produces wrong results for cases.

New features:
- class BOPDS_InterfVZ has been added.
Purpose: The class BOPDS_InterfVZ is is to store the information about
the interference of the type vertex/solid.

- class BOPDS_InterfEZ has been added.
Purpose: The class BOPDS_InterfEZ is is to store the information about
the interference of the type edge/solid.

- class BOPDS_InterfFZ has been added.
Purpose: The class BOPDS_InterfFZ is is to store the information about
the interference of the type face/solid.

- class BOPDS_InterfFZ has been added.
Purpose: The class BOPDS_InterfZZ is is to store the information about
the interference of the type solid/solid.

- class BOPDS_DS
-methods
inline BOPDS_VectorOfInterfVZ& BOPDS_DS::InterfVZ()
Purpose: Returns the collection of interferences Vertex/Solid

inline BOPDS_VectorOfInterfEZ& BOPDS_DS::InterfEZ()
Purpose: Returns the collection of interferences Edge/Solid

inline BOPDS_VectorOfInterfFZ& BOPDS_DS::InterfFZ()
Purpose: Returns the collection of interferences Face/Solid

inline BOPDS_VectorOfInterfZZ& BOPDS_DS::InterfZZ()
Purpose: Returns the collection of interferences Solid/Solid

inline Standard_Integer BOPDS_DS::NbInterfTypes()
Purpose: Returns the number of types of the interferences
have been added.

- class BOPDS_Tools
-method
inline Standard_Boolean BOPDS_Tools::IsInterfering
  (const TopAbs_ShapeEnum theT)
has been added.
Purpose: Returns true if the type <theT> can be participant of  an interference

- class BOPDS_ShapeInfo
-method
inline Standard_Boolean BOPDS_ShapeInfo::IsInterfering()const
has been added.
Purpose: Returns true if the object can be participant of  an interference

- class BOPDS_ShapeInfo
-methods
void BOPAlgo_CheckerSI::PerformVZ()
Purpose: Computes Vertex/Solid interferences

void BOPAlgo_CheckerSI::PerformEZ()
Purpose: Computes Edge/Solid interferences

void BOPAlgo_CheckerSI::PerformFZ()
Purpose: Computes Face/Solid interferences

void BOPAlgo_CheckerSI::PerformZZ()
Purpose: Computes Solid/Solid interferences
have been added

Changes:
- class BOPDS_DS
- method:
Standard_Boolean BOPDS_DS::HasInterfShapeSubShapes
  (const Standard_Integer theI1,
   const Standard_Integer theI2,
   const Standard_Boolean theFlag)const
has been modified.
Purpose:
  Returns true if the shape with index theI1 is interfered  with
    - at least one sub-shape of the shape with index theI2  (theFlag=true)
    --all sub-shapes of the shape with index theI2 (theFlag=false)

- class BOPDS_Tools
- method:
inline Standard_Integer BOPDS_Tools::TypeToInteger
 (const TopAbs_ShapeEnum aType1,
 const TopAbs_ShapeEnum aType2)
The method has been extended to treat */Solid interfertences.

- class BOPDS_Iterator
- constructors:
BOPDS_Iterator::BOPDS_Iterator();
BOPDS_Iterator::BOPDS_Iterator
  (const Handle(NCollection_BaseAllocator)& theAllocator);
- method:
void BOPDS_Iterator::Prepare();
The constant number of types of the interferences has been changed by
the call: BOPDS_DS::NbInterfTypes();

- class BOPDS_IteratorSI
- method:
void BOPDS_IteratorSI::UpdateByLevelOfCheck(const Standard_Integer theLevel)
The constant number of types of the interferences has been changed by
the call: BOPDS_DS::NbInterfTypes();

- method:
void BOPDS_IteratorSI::Intersect()
The method has been extended to treat */Solid interfertences.

- class BOPAlgo_CheckerSI
- constructor:
BOPAlgo_CheckerSI::BOPAlgo_CheckerSI()
The constant number of types of the interferences has been changed by
the call: BOPDS_DS::NbInterfTypes();

- method:
void BOPAlgo_CheckerSI::SetLevelOfCheck(const Standard_Integer theLevel)
The constant number of types of the interferences has been changed by
the call: BOPDS_DS::NbInterfTypes();

- methods:
void BOPAlgo_CheckerSI::Perform()
void BOPAlgo_CheckerSI::PostTreat()
The methods have been extended to treat */Solid interfertences.

- class BOPAlgo_ArgumentAnalyzer
- method:
void BOPAlgo_ArgumentAnalyzer::TestSelfInterferences()
The method has been extended to treat */Solid interfertences.

Added test case bugs/modalg_5/bug24492
This commit is contained in:
pkv 2013-12-26 15:43:44 +04:00 committed by bugmaster
parent 859f26ae84
commit ceaa5e27eb
22 changed files with 997 additions and 159 deletions

View File

@ -296,21 +296,21 @@ void BOPAlgo_ArgumentAnalyzer::TestTypes()
} }
} }
} }
//=======================================================================
// ================================================================================ //function : TestSelfInterferences
// function: TestSelfInterferences //purpose :
// purpose: //=======================================================================
// ================================================================================
void BOPAlgo_ArgumentAnalyzer::TestSelfInterferences() void BOPAlgo_ArgumentAnalyzer::TestSelfInterferences()
{ {
Standard_Integer ii = 0, j; Standard_Integer ii=0, j;
Standard_Boolean bSelfInt; Standard_Boolean bSelfInt;
for(ii = 0; ii < 2; ii++) { for(ii = 0; ii < 2; ii++) {
const TopoDS_Shape& aS = (ii == 0) ? myShape1 : myShape2; const TopoDS_Shape& aS = (ii == 0) ? myShape1 : myShape2;
if(aS.IsNull()) if(aS.IsNull()) {
continue; continue;
}
Standard_Boolean bIsEmpty = (ii == 0) ? myEmpty1 : myEmpty2; Standard_Boolean bIsEmpty = (ii == 0) ? myEmpty1 : myEmpty2;
if (bIsEmpty) { if (bIsEmpty) {
@ -319,6 +319,7 @@ void BOPAlgo_ArgumentAnalyzer::TestSelfInterferences()
BOPAlgo_CheckerSI aChecker; BOPAlgo_CheckerSI aChecker;
BOPCol_ListOfShape anArgs; BOPCol_ListOfShape anArgs;
//
anArgs.Append(aS); anArgs.Append(aS);
aChecker.SetArguments(anArgs); aChecker.SetArguments(anArgs);
// //
@ -332,20 +333,57 @@ void BOPAlgo_ArgumentAnalyzer::TestSelfInterferences()
BOPDS_VectorOfInterfVF& aVFs=theDS->InterfVF(); BOPDS_VectorOfInterfVF& aVFs=theDS->InterfVF();
BOPDS_VectorOfInterfEF& aEFs=theDS->InterfEF(); BOPDS_VectorOfInterfEF& aEFs=theDS->InterfEF();
BOPDS_VectorOfInterfFF& aFFs=theDS->InterfFF(); BOPDS_VectorOfInterfFF& aFFs=theDS->InterfFF();
BOPDS_VectorOfInterfVZ& aVZs=theDS->InterfVZ();
BOPDS_VectorOfInterfEZ& aEZs=theDS->InterfEZ();
BOPDS_VectorOfInterfFZ& aFZs=theDS->InterfFZ();
BOPDS_VectorOfInterfZZ& aZZs=theDS->InterfZZ();
// //
Standard_Integer aNb[6] = {aVVs.Extent(), aVEs.Extent(), aEEs.Extent(), const Standard_Integer aNbTypeInt=10;
aVFs.Extent(), aEFs.Extent(), aFFs.Extent()}; Standard_Integer aTypeInt, i, nI1, nI2;
Standard_Integer aNb[aNbTypeInt] = {
aVVs.Extent(), aVEs.Extent(), aEEs.Extent(),
aVFs.Extent(), aEFs.Extent(), aFFs.Extent(),
aVZs.Extent(), aEZs.Extent(), aFZs.Extent(), aZZs.Extent()};
BOPDS_Interf* aInt=NULL;
// //
for (Standard_Integer aTypeInt = 0; aTypeInt < 6; ++aTypeInt) { for (aTypeInt = 0; aTypeInt < aNbTypeInt; ++aTypeInt) {
for (Standard_Integer i = 0; i < aNb[aTypeInt]; ++i) { for (i = 0; i < aNb[aTypeInt]; ++i) {
BOPDS_Interf* aInt = (aTypeInt==0) ? (BOPDS_Interf*)(&aVVs(i)) : switch(aTypeInt) {
((aTypeInt==1) ? (BOPDS_Interf*)(&aVEs(i)) : case 0:
((aTypeInt==2) ? (BOPDS_Interf*)(&aEEs(i)) : aInt=(BOPDS_Interf*)(&aVVs(i));
((aTypeInt==3) ? (BOPDS_Interf*)(&aVFs(i)) : break;
((aTypeInt==4) ? (BOPDS_Interf*)(&aEFs(i)) : (BOPDS_Interf*)(&aFFs(i)))))); case 1:
aInt=(BOPDS_Interf*)(&aVEs(i));
break;
case 2:
aInt=(BOPDS_Interf*)(&aEEs(i));
break;
case 3:
aInt=(BOPDS_Interf*)(&aVFs(i));
break;
case 4:
aInt=(BOPDS_Interf*)(&aEFs(i));
break;
case 5:
aInt=(BOPDS_Interf*)(&aFFs(i));
break;
case 6:
aInt=(BOPDS_Interf*)(&aVZs(i));
break;
case 7:
aInt=(BOPDS_Interf*)(&aEZs(i));
break;
case 8:
aInt=(BOPDS_Interf*)(&aFZs(i));
break;
case 9:
aInt=(BOPDS_Interf*)(&aZZs(i));
break;
default:
aInt=NULL;
}
// //
Standard_Integer nI1 = aInt->Index1(); aInt->Indices(nI1, nI2);
Standard_Integer nI2 = aInt->Index2();
if (nI1 == nI2) { if (nI1 == nI2) {
continue; continue;
} }
@ -398,6 +436,7 @@ void BOPAlgo_ArgumentAnalyzer::TestSelfInterferences()
myResult.Append(aResult); myResult.Append(aResult);
} }
} }
//
if (iErr) { if (iErr) {
BOPAlgo_CheckResult aResult; BOPAlgo_CheckResult aResult;
if(ii == 0) { if(ii == 0) {
@ -412,9 +451,7 @@ void BOPAlgo_ArgumentAnalyzer::TestSelfInterferences()
myResult.Append(aResult); myResult.Append(aResult);
} }
} }
} }
// ================================================================================ // ================================================================================
// function: TestSmallEdge // function: TestSmallEdge
// purpose: // purpose:
@ -520,7 +557,6 @@ void BOPAlgo_ArgumentAnalyzer::TestSmallEdge()
} }
} }
} }
// ================================================================================ // ================================================================================
// function: TestRebuildFace // function: TestRebuildFace
// purpose: // purpose:

View File

@ -50,6 +50,21 @@ is
is protected; is protected;
---Purpose: Provides post-tratment actions ---Purpose: Provides post-tratment actions
PerformVZ(me:out)
is virtual protected;
--Purpose: Computes Vertex/Solid interferences
PerformEZ(me:out)
is virtual protected;
--Purpose: Computes Edge/Solid interferences
PerformFZ(me:out)
is virtual protected;
--Purpose: Computes Face/Solid interferences
PerformZZ(me:out)
is virtual protected;
--Purpose: Computes Solid/Solid interferences
fields fields
myLevelOfCheck: Integer from Standard is protected; myLevelOfCheck: Integer from Standard is protected;

View File

@ -44,9 +44,9 @@
//======================================================================= //=======================================================================
BOPAlgo_CheckerSI::BOPAlgo_CheckerSI() BOPAlgo_CheckerSI::BOPAlgo_CheckerSI()
: :
BOPAlgo_PaveFiller(), BOPAlgo_PaveFiller()
myLevelOfCheck(5)
{ {
myLevelOfCheck=BOPDS_DS::NbInterfTypes()-1;
} }
//======================================================================= //=======================================================================
//function : ~ //function : ~
@ -61,7 +61,10 @@ BOPAlgo_CheckerSI::~BOPAlgo_CheckerSI()
//======================================================================= //=======================================================================
void BOPAlgo_CheckerSI::SetLevelOfCheck(const Standard_Integer theLevel) void BOPAlgo_CheckerSI::SetLevelOfCheck(const Standard_Integer theLevel)
{ {
if (theLevel >= 0 && theLevel <= 5) { Standard_Integer aNbLists;
//
aNbLists=BOPDS_DS::NbInterfTypes();
if (theLevel >= 0 && theLevel < aNbLists) {
myLevelOfCheck = theLevel; myLevelOfCheck = theLevel;
} }
} }
@ -104,7 +107,7 @@ void BOPAlgo_CheckerSI::Init()
//======================================================================= //=======================================================================
void BOPAlgo_CheckerSI::Perform() void BOPAlgo_CheckerSI::Perform()
{ {
//modified by NIZNHY-PKV Thu Sep 19 08:14:52 2013f
try { try {
OCC_CATCH_SIGNALS OCC_CATCH_SIGNALS
// //
@ -113,19 +116,31 @@ void BOPAlgo_CheckerSI::Perform()
return; return;
} }
// //
PerformVZ();
if (myErrorStatus) {
return;
}
//
PerformEZ();
if (myErrorStatus) {
return;
}
//
PerformFZ();
if (myErrorStatus) {
return;
}
//
PerformZZ();
if (myErrorStatus) {
return;
}
//
PostTreat(); PostTreat();
} }
catch (Standard_Failure) { catch (Standard_Failure) {
} }
/*
BOPAlgo_PaveFiller::Perform();
if (myErrorStatus) {
return;
}
//
PostTreat();
*/
//modified by NIZNHY-PKV Thu Sep 19 08:14:56 2013t
} }
//======================================================================= //=======================================================================
//function : PostTreat //function : PostTreat
@ -237,4 +252,49 @@ void BOPAlgo_CheckerSI::PostTreat()
aPK.SetIds(n1, n2); aPK.SetIds(n1, n2);
aMPK.Add(aPK); aMPK.Add(aPK);
} }
//
//
// 6
BOPDS_VectorOfInterfVZ& aVZs=myDS->InterfVZ();
aNb=aVZs.Extent();
for (i=0; i!=aNb; ++i) {
//
const BOPDS_InterfVZ& aVZ=aVZs(i);
aVZ.Indices(n1, n2);
aPK.SetIds(n1, n2);
aMPK.Add(aPK);
}
//
// 7
BOPDS_VectorOfInterfEZ& aEZs=myDS->InterfEZ();
aNb=aEZs.Extent();
for (i=0; i!=aNb; ++i) {
//
const BOPDS_InterfEZ& aEZ=aEZs(i);
aEZ.Indices(n1, n2);
aPK.SetIds(n1, n2);
aMPK.Add(aPK);
}
//
// 8
BOPDS_VectorOfInterfFZ& aFZs=myDS->InterfFZ();
aNb=aFZs.Extent();
for (i=0; i!=aNb; ++i) {
//
const BOPDS_InterfFZ& aFZ=aFZs(i);
aFZ.Indices(n1, n2);
aPK.SetIds(n1, n2);
aMPK.Add(aPK);
}
//
// 9
BOPDS_VectorOfInterfZZ& aZZs=myDS->InterfZZ();
aNb=aZZs.Extent();
for (i=0; i!=aNb; ++i) {
//
const BOPDS_InterfZZ& aZZ=aZZs(i);
aZZ.Indices(n1, n2);
aPK.SetIds(n1, n2);
aMPK.Add(aPK);
}
} }

View File

@ -0,0 +1,227 @@
// Created by: Peter KURNEV
// Copyright (c) 2010-2012 OPEN CASCADE SAS
// Copyright (c) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (c) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT,
// EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// The content of this file is subject to the Open CASCADE Technology Public
// License Version 6.5 (the "License"). You may not use the content of this file
// except in compliance with the License. Please obtain a copy of the License
// at http://www.opencascade.org and read it completely before using this file.
//
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
//
// The Original Code and all software distributed under the License is
// distributed on an "AS IS" basis, without warranty of any kind, and the
// Initial Developer hereby disclaims all such warranties, including without
// limitation, any warranties of merchantability, fitness for a particular
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
//
#include <BOPAlgo_CheckerSI.ixx>
#include <BOPDS_DS.hxx>
#include <BOPDS_IteratorSI.hxx>
#include <BOPInt_Context.hxx>
#include <BOPDS_Interf.hxx>
#include <TopoDS_Solid.hxx>
#include <BRepClass3d_SolidClassifier.hxx>
#include <TopoDS_Vertex.hxx>
#include <gp_Pnt.hxx>
#include <TopAbs_State.hxx>
#include <BRep_Tool.hxx>
#include <BOPDS_VectorOfInterfVZ.hxx>
//=======================================================================
//function : PerformVZ
//purpose :
//=======================================================================
void BOPAlgo_CheckerSI::PerformVZ()
{
Standard_Boolean bJustAdd;
Standard_Integer iSize, nV, nZ, i;
Standard_Real aTol;
gp_Pnt aPV;
TopAbs_State aState;
//
myErrorStatus=0;
//
myIterator->Initialize(TopAbs_VERTEX, TopAbs_SOLID);
iSize=myIterator->ExpectedLength();
if (!iSize) {
return;
}
//
BOPDS_VectorOfInterfVZ& aVZs=myDS->InterfVZ();
aVZs.SetStartSize(iSize);
aVZs.SetIncrement(iSize);
aVZs.Init();
//
for (; myIterator->More(); myIterator->Next()) {
myIterator->Value(nV, nZ, bJustAdd);
if(bJustAdd) {
continue;
}
//
const BOPDS_ShapeInfo& aSIV=myDS->ShapeInfo(nV);
const BOPDS_ShapeInfo& aSIZ=myDS->ShapeInfo(nZ);
//
const TopoDS_Vertex& aV=*((TopoDS_Vertex*)&aSIV.Shape());
const TopoDS_Solid& aZ=*((TopoDS_Solid*)&aSIZ.Shape());
//
BRepClass3d_SolidClassifier& aSC=myContext->SolidClassifier(aZ);
//
aPV=BRep_Tool::Pnt(aV);
aTol=BRep_Tool::Tolerance(aV);
//
aSC.Perform(aPV, aTol);
//
aState=aSC.State();
if (aState==TopAbs_IN) {
i=aVZs.Append()-1;
BOPDS_InterfVZ& aVZ=aVZs(i);
aVZ.SetIndices(nV, nZ);
//
myDS->AddInterf(nV, nZ);
}
}
//
}
//=======================================================================
//function : PerformEZ
//purpose :
//=======================================================================
void BOPAlgo_CheckerSI::PerformEZ()
{
Standard_Boolean bJustAdd, bHasInterf;
Standard_Integer iSize, nE, nZ, i;
//
myErrorStatus=0;
//
myIterator->Initialize(TopAbs_EDGE, TopAbs_SOLID);
iSize=myIterator->ExpectedLength();
if (!iSize) {
return;
}
//
BOPDS_VectorOfInterfEZ& aEZs=myDS->InterfEZ();
aEZs.SetStartSize(iSize);
aEZs.SetIncrement(iSize);
aEZs.Init();
//
for (; myIterator->More(); myIterator->Next()) {
myIterator->Value(nE, nZ, bJustAdd);
if(bJustAdd) {
continue;
}
//
bHasInterf=myDS->HasInterfShapeSubShapes(nE, nZ);
if (bHasInterf) {
continue;
}
//
bHasInterf=myDS->HasInterfShapeSubShapes(nZ, nE);
if (!bHasInterf) {
continue;
}
//
i=aEZs.Append()-1;
BOPDS_InterfEZ& aEZ=aEZs(i);
aEZ.SetIndices(nE, nZ);
//
myDS->AddInterf(nE, nZ);
}
}
//=======================================================================
//function : PerformFZ
//purpose :
//=======================================================================
void BOPAlgo_CheckerSI::PerformFZ()
{
Standard_Boolean bJustAdd, bHasInterf;
Standard_Integer iSize, nF, nZ, i;
//
myErrorStatus=0;
//
myIterator->Initialize(TopAbs_FACE, TopAbs_SOLID);
iSize=myIterator->ExpectedLength();
if (!iSize) {
return;
}
//
BOPDS_VectorOfInterfFZ& aFZs=myDS->InterfFZ();
aFZs.SetStartSize(iSize);
aFZs.SetIncrement(iSize);
aFZs.Init();
//
for (; myIterator->More(); myIterator->Next()) {
myIterator->Value(nF, nZ, bJustAdd);
if(bJustAdd) {
continue;
}
//
bHasInterf=myDS->HasInterfShapeSubShapes(nF, nZ);
if (bHasInterf) {
continue;
}
//
bHasInterf=myDS->HasInterfShapeSubShapes(nZ, nF);
if (!bHasInterf) {
continue;
}
//
i=aFZs.Append()-1;
BOPDS_InterfFZ& aFZ=aFZs(i);
aFZ.SetIndices(nF, nZ);
//
myDS->AddInterf(nF, nZ);
}
}
//=======================================================================
//function : PerformZZ
//purpose :
//=======================================================================
void BOPAlgo_CheckerSI::PerformZZ()
{
Standard_Boolean bJustAdd, bHasInterf, bFlag;
Standard_Integer iSize, nZ1, nZ, i;
//
myErrorStatus=0;
//
myIterator->Initialize(TopAbs_SOLID, TopAbs_SOLID);
iSize=myIterator->ExpectedLength();
if (!iSize) {
return;
}
//
BOPDS_VectorOfInterfZZ& aZZs=myDS->InterfZZ();
aZZs.SetStartSize(iSize);
aZZs.SetIncrement(iSize);
aZZs.Init();
//
bFlag=Standard_False;
//
for (; myIterator->More(); myIterator->Next()) {
myIterator->Value(nZ1, nZ, bJustAdd);
if(bJustAdd) {
continue;
}
//
bHasInterf=myDS->HasInterfShapeSubShapes(nZ, nZ1, bFlag);
if (!bHasInterf) {
bHasInterf=myDS->HasInterfShapeSubShapes(nZ1, nZ, bFlag);
}
if (!bHasInterf) {
continue;
}
//
i=aZZs.Append()-1;
BOPDS_InterfZZ& aZZ=aZZs(i);
aZZ.SetIndices(nZ1, nZ);
//
myDS->AddInterf(nZ1, nZ);
}
}

View File

@ -13,5 +13,6 @@ BOPAlgo_Builder_4.cxx
BOPAlgo_BOP_1.cxx BOPAlgo_BOP_1.cxx
BOPAlgo_WireSplitter_1.cxx BOPAlgo_WireSplitter_1.cxx
BOPAlgo_ListOfCheckResult.hxx BOPAlgo_ListOfCheckResult.hxx
BOPAlgo_Builder_2Cnt.hxx BOPAlgo_Builder_2Cnt.hxx
BOPAlgo_CheckerSI_1.cxx

View File

@ -95,6 +95,10 @@ is
imported InterfEE from BOPDS; imported InterfEE from BOPDS;
imported InterfEF from BOPDS; imported InterfEF from BOPDS;
imported InterfFF from BOPDS; imported InterfFF from BOPDS;
imported InterfVZ from BOPDS;
imported InterfEZ from BOPDS;
imported InterfFZ from BOPDS;
imported InterfZZ from BOPDS;
-- --
imported VectorOfInterfVV from BOPDS; imported VectorOfInterfVV from BOPDS;
imported VectorOfInterfVE from BOPDS; imported VectorOfInterfVE from BOPDS;
@ -102,6 +106,10 @@ is
imported VectorOfInterfEE from BOPDS; imported VectorOfInterfEE from BOPDS;
imported VectorOfInterfEF from BOPDS; imported VectorOfInterfEF from BOPDS;
imported VectorOfInterfFF from BOPDS; imported VectorOfInterfFF from BOPDS;
imported VectorOfInterfVZ from BOPDS;
imported VectorOfInterfEZ from BOPDS;
imported VectorOfInterfFZ from BOPDS;
imported VectorOfInterfZZ from BOPDS;
-- --
imported VectorOfPoint from BOPDS; imported VectorOfPoint from BOPDS;
imported VectorOfCurve from BOPDS; imported VectorOfCurve from BOPDS;

View File

@ -66,7 +66,11 @@ uses
VectorOfInterfVF from BOPDS, VectorOfInterfVF from BOPDS,
VectorOfInterfEE from BOPDS, VectorOfInterfEE from BOPDS,
VectorOfInterfEF from BOPDS, VectorOfInterfEF from BOPDS,
VectorOfInterfFF from BOPDS VectorOfInterfFF from BOPDS,
VectorOfInterfVZ from BOPDS,
VectorOfInterfEZ from BOPDS,
VectorOfInterfFZ from BOPDS,
VectorOfInterfZZ from BOPDS
--raises --raises
@ -483,6 +487,45 @@ is
--- Selector/Modifier --- Selector/Modifier
--- Returns the collection of interferences Face/Face --- Returns the collection of interferences Face/Face
InterfVZ(me:out)
returns VectorOfInterfVZ from BOPDS;
---C++: return &
---C++: inline
---Purpose:
--- Selector/Modifier
--- Returns the collection of interferences Vertex/Solid
InterfEZ(me:out)
returns VectorOfInterfEZ from BOPDS;
---C++: return &
---C++: inline
---Purpose:
--- Selector/Modifier
--- Returns the collection of interferences Edge/Solid
InterfFZ(me:out)
returns VectorOfInterfFZ from BOPDS;
---C++: return &
---C++: inline
---Purpose:
--- Selector/Modifier
--- Returns the collection of interferences Face/Solid
InterfZZ(me:out)
returns VectorOfInterfZZ from BOPDS;
---C++: return &
---C++: inline
---Purpose:
--- Selector/Modifier
--- Returns the collection of interferences Solid/Solid
NbInterfTypes(myclass)
returns Integer from Standard;
---C++: inline
---Purpose:
-- Returns the number of types of the interferences
--
AddInterf(me:out; AddInterf(me:out;
theI1:Integer from Standard; theI1:Integer from Standard;
theI2:Integer from Standard); theI2:Integer from Standard);
@ -513,12 +556,15 @@ is
HasInterfShapeSubShapes(me; HasInterfShapeSubShapes(me;
theI1:Integer from Standard; theI1:Integer from Standard;
theI2:Integer from Standard) theI2:Integer from Standard;
theFlag: Boolean from Standard=Standard_True)
returns Boolean from Standard; returns Boolean from Standard;
---Purpose: ---Purpose:
--- Query --- Query
--- Returns true if the shape with index theI1 is interfered --- Returns true if the shape with index theI1 is interfered
--- with any of sub-shapes of the shapes with index theI2 --- with
-- any sub-shape of the shape with index theI2 (theFlag=true)
-- all sub-shapes of the shape with index theI2 (theFlag=false)
HasInterfSubShapes(me; HasInterfSubShapes(me;
theI1:Integer from Standard; theI1:Integer from Standard;
@ -589,6 +635,9 @@ is
---Purpose: ---Purpose:
--- Computes bouding box <theBox> for the solid with DS-index <theIndex> --- Computes bouding box <theBox> for the solid with DS-index <theIndex>
--- ---
fields fields
myAllocator : BaseAllocator from BOPCol is protected; myAllocator : BaseAllocator from BOPCol is protected;
myArguments : ListOfShape from BOPCol is protected; myArguments : ListOfShape from BOPCol is protected;
@ -614,5 +663,8 @@ fields
myInterfEE : VectorOfInterfEE from BOPDS is protected; myInterfEE : VectorOfInterfEE from BOPDS is protected;
myInterfEF : VectorOfInterfEF from BOPDS is protected; myInterfEF : VectorOfInterfEF from BOPDS is protected;
myInterfFF : VectorOfInterfFF from BOPDS is protected; myInterfFF : VectorOfInterfFF from BOPDS is protected;
myInterfVZ : VectorOfInterfVZ from BOPDS is protected;
myInterfEZ : VectorOfInterfEZ from BOPDS is protected;
myInterfFZ : VectorOfInterfFZ from BOPDS is protected;
myInterfZZ : VectorOfInterfZZ from BOPDS is protected;
end DS; end DS;

View File

@ -85,7 +85,11 @@ BOPDS_DS::BOPDS_DS()
myInterfVF(myAllocator), myInterfVF(myAllocator),
myInterfEE(myAllocator), myInterfEE(myAllocator),
myInterfEF(myAllocator), myInterfEF(myAllocator),
myInterfFF(myAllocator) myInterfFF(myAllocator),
myInterfVZ(myAllocator),
myInterfEZ(myAllocator),
myInterfFZ(myAllocator),
myInterfZZ(myAllocator)
{ {
myNbShapes=0; myNbShapes=0;
myNbSourceShapes=0; myNbSourceShapes=0;
@ -111,7 +115,11 @@ BOPDS_DS::BOPDS_DS(const Handle(NCollection_BaseAllocator)& theAllocator)
myInterfVF(myAllocator), myInterfVF(myAllocator),
myInterfEE(myAllocator), myInterfEE(myAllocator),
myInterfEF(myAllocator), myInterfEF(myAllocator),
myInterfFF(myAllocator) myInterfFF(myAllocator),
myInterfVZ(myAllocator),
myInterfEZ(myAllocator),
myInterfFZ(myAllocator),
myInterfZZ(myAllocator)
{ {
myNbShapes=0; myNbShapes=0;
myNbSourceShapes=0; myNbSourceShapes=0;
@ -148,6 +156,10 @@ void BOPDS_DS::Clear()
myInterfEE.Clear(); myInterfEE.Clear();
myInterfEF.Clear(); myInterfEF.Clear();
myInterfFF.Clear(); myInterfFF.Clear();
myInterfVZ.Clear();
myInterfEZ.Clear();
myInterfFZ.Clear();
myInterfZZ.Clear();
} }
//======================================================================= //=======================================================================
//function : SetArguments //function : SetArguments
@ -307,6 +319,7 @@ Standard_Integer BOPDS_DS::Index(const TopoDS_Shape& theS)const
void BOPDS_DS::Init() void BOPDS_DS::Init()
{ {
Standard_Integer i1, i2, j, aI, aNb, aNbS, aNbE, aNbSx, nV, nW, nE, aNbF; Standard_Integer i1, i2, j, aI, aNb, aNbS, aNbE, aNbSx, nV, nW, nE, aNbF;
Standard_Integer n1, n2, n3;
Standard_Real aTol; Standard_Real aTol;
TopAbs_ShapeEnum aTS; TopAbs_ShapeEnum aTS;
BOPCol_ListIteratorOfListOfInteger aIt1, aIt2, aIt3; BOPCol_ListIteratorOfListOfInteger aIt1, aIt2, aIt3;
@ -527,10 +540,52 @@ void BOPDS_DS::Init()
BOPDS_ShapeInfo& aSI=ChangeShapeInfo(j); BOPDS_ShapeInfo& aSI=ChangeShapeInfo(j);
// //
aTS=aSI.ShapeType(); aTS=aSI.ShapeType();
if (aTS==TopAbs_SOLID) { if (aTS!=TopAbs_SOLID) {
Bnd_Box& aBox=aSI.ChangeBox(); continue;
BuildBndBoxSolid(j, aBox);
} }
Bnd_Box& aBox=aSI.ChangeBox();
BuildBndBoxSolid(j, aBox);
//
//
// update sub-shapes by BRep comprising ones
aMI.Clear();
BOPCol_ListOfInteger& aLI1=aSI.ChangeSubShapes();
//
aIt1.Initialize(aLI1);
for (; aIt1.More(); aIt1.Next()) {
n1=aIt1.Value();
BOPDS_ShapeInfo& aSI1=ChangeShapeInfo(n1);
if (aSI1.ShapeType()!=TopAbs_SHELL) {
continue;
}
//
const BOPCol_ListOfInteger& aLI2=aSI1.SubShapes();
aIt2.Initialize(aLI2);
for (; aIt2.More(); aIt2.Next()) {
n2=aIt2.Value();
BOPDS_ShapeInfo& aSI2=ChangeShapeInfo(n2);
if (aSI2.ShapeType()!=TopAbs_FACE) {
continue;
}
//
aMI.Add(n2);
//
const BOPCol_ListOfInteger& aLI3=aSI2.SubShapes();
aIt3.Initialize(aLI3);
for (; aIt3.More(); aIt3.Next()) {
n3=aIt3.Value();
aMI.Add(n3);
}
}
}
//
aLI1.Clear();
aItMI.Initialize(aMI);
for (; aItMI.More(); aItMI.Next()) {
n1=aItMI.Value();
aLI1.Append(n1);
}
aMI.Clear();
}//for (j=0; j<myNbSourceShapes; ++j) { }//for (j=0; j<myNbSourceShapes; ++j) {
// //
aMI.Clear(); aMI.Clear();
@ -615,13 +670,14 @@ Standard_Boolean BOPDS_DS::HasInterf(const Standard_Integer theI) const
// //
return bRet; return bRet;
} }
//======================================================================= //=======================================================================
//function : HasInterfShapeSubShapes //function : HasInterfShapeSubShapes
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean BOPDS_DS::HasInterfShapeSubShapes(const Standard_Integer theI1, Standard_Boolean BOPDS_DS::HasInterfShapeSubShapes
const Standard_Integer theI2)const (const Standard_Integer theI1,
const Standard_Integer theI2,
const Standard_Boolean theFlag)const
{ {
Standard_Boolean bRet; Standard_Boolean bRet;
Standard_Integer n2; Standard_Integer n2;
@ -634,13 +690,19 @@ Standard_Boolean BOPDS_DS::HasInterfShapeSubShapes(const Standard_Integer theI1,
for (; aIt.More(); aIt.Next()) { for (; aIt.More(); aIt.Next()) {
n2=aIt.Value(); n2=aIt.Value();
bRet=HasInterf(theI1, n2); bRet=HasInterf(theI1, n2);
if(bRet) { if (theFlag) {
break; if(bRet) {
break;
}
}
else {
if(!bRet) {
break;
}
} }
} }
return bRet; return bRet;
} }
//======================================================================= //=======================================================================
//function : HasInterfSubShapes //function : HasInterfSubShapes
//purpose : //purpose :

View File

@ -17,7 +17,7 @@
//function : InterfVV //function : InterfVV
//purpose : //purpose :
//======================================================================= //=======================================================================
inline BOPDS_VectorOfInterfVV& BOPDS_DS::InterfVV() inline BOPDS_VectorOfInterfVV& BOPDS_DS::InterfVV()
{ {
return myInterfVV; return myInterfVV;
} }
@ -25,7 +25,7 @@
//function : InterfVE //function : InterfVE
//purpose : //purpose :
//======================================================================= //=======================================================================
inline BOPDS_VectorOfInterfVE& BOPDS_DS::InterfVE() inline BOPDS_VectorOfInterfVE& BOPDS_DS::InterfVE()
{ {
return myInterfVE; return myInterfVE;
} }
@ -33,14 +33,14 @@
//function : InterfVF //function : InterfVF
//purpose : //purpose :
//======================================================================= //=======================================================================
inline BOPDS_VectorOfInterfVF& BOPDS_DS::InterfVF() inline BOPDS_VectorOfInterfVF& BOPDS_DS::InterfVF()
{ {
return myInterfVF; return myInterfVF;
}//======================================================================= }//=======================================================================
//function : InterfEE //function : InterfEE
//purpose : //purpose :
//======================================================================= //=======================================================================
inline BOPDS_VectorOfInterfEE& BOPDS_DS::InterfEE() inline BOPDS_VectorOfInterfEE& BOPDS_DS::InterfEE()
{ {
return myInterfEE; return myInterfEE;
} }
@ -48,7 +48,7 @@
//function : InterfEF //function : InterfEF
//purpose : //purpose :
//======================================================================= //=======================================================================
inline BOPDS_VectorOfInterfEF& BOPDS_DS::InterfEF() inline BOPDS_VectorOfInterfEF& BOPDS_DS::InterfEF()
{ {
return myInterfEF; return myInterfEF;
} }
@ -56,16 +56,56 @@
//function : InterfFF //function : InterfFF
//purpose : //purpose :
//======================================================================= //=======================================================================
inline BOPDS_VectorOfInterfFF& BOPDS_DS::InterfFF() inline BOPDS_VectorOfInterfFF& BOPDS_DS::InterfFF()
{ {
return myInterfFF; return myInterfFF;
} }
//======================================================================= //=======================================================================
//function : InterfVZ
//purpose :
//=======================================================================
inline BOPDS_VectorOfInterfVZ& BOPDS_DS::InterfVZ()
{
return myInterfVZ;
}
//=======================================================================
//function : InterfEZ
//purpose :
//=======================================================================
inline BOPDS_VectorOfInterfEZ& BOPDS_DS::InterfEZ()
{
return myInterfEZ;
}
//=======================================================================
//function : InterfFZ
//purpose :
//=======================================================================
inline BOPDS_VectorOfInterfFZ& BOPDS_DS::InterfFZ()
{
return myInterfFZ;
}
//=======================================================================
//function : InterfZZ
//purpose :
//=======================================================================
inline BOPDS_VectorOfInterfZZ& BOPDS_DS::InterfZZ()
{
return myInterfZZ;
}
//=======================================================================
//function : NbInterfTypes
//purpose :
//=======================================================================
inline Standard_Integer BOPDS_DS::NbInterfTypes()
{
return 10;
}
//=======================================================================
//function : AddInterf //function : AddInterf
//purpose : //purpose :
//======================================================================= //=======================================================================
inline void BOPDS_DS::AddInterf(const Standard_Integer theI1, inline void BOPDS_DS::AddInterf(const Standard_Integer theI1,
const Standard_Integer theI2) const Standard_Integer theI2)
{ {
BOPDS_PassKey aPK; BOPDS_PassKey aPK;
// //
@ -76,8 +116,9 @@
//function : HasInterf //function : HasInterf
//purpose : //purpose :
//======================================================================= //=======================================================================
inline Standard_Boolean BOPDS_DS::HasInterf(const Standard_Integer theI1, inline Standard_Boolean BOPDS_DS::HasInterf
const Standard_Integer theI2)const (const Standard_Integer theI1,
const Standard_Integer theI2)const
{ {
BOPDS_PassKey aPK; BOPDS_PassKey aPK;
// //
@ -88,7 +129,7 @@
//function : Interferences //function : Interferences
//purpose : //purpose :
//======================================================================= //=======================================================================
inline const BOPDS_MapOfPassKey& BOPDS_DS::Interferences()const inline const BOPDS_MapOfPassKey& BOPDS_DS::Interferences()const
{ {
return myInterfTB; return myInterfTB;
} }

View File

@ -662,4 +662,137 @@ class BOPDS_InterfFF : public BOPDS_Interf {
BOPDS_VectorOfPoint myPoints; BOPDS_VectorOfPoint myPoints;
}; };
/**
* The class BOPDS_InterfVZ is is to store the information about
* the interference of the type vertex/solid.
*/
//=======================================================================
//function : BOPDS_InterfVZ
//purpose :
//=======================================================================
class BOPDS_InterfVZ : public BOPDS_Interf {
public:
//
/**
* Constructor
*/
BOPDS_InterfVZ() : BOPDS_Interf() {
};
//
/**
* Constructor
* @param theAllocator
* allocator to manage the memory
*/
BOPDS_InterfVZ(const Handle(NCollection_BaseAllocator)& theAllocator)
: BOPDS_Interf(theAllocator) {
};
//
/**
* Destructor
*/
virtual ~BOPDS_InterfVZ() {
};
//
};
/**
* The class BOPDS_InterfEZ is is to store the information about
* the interference of the type edge/solid.
*/
//=======================================================================
//function : BOPDS_InterfEZ
//purpose :
//=======================================================================
class BOPDS_InterfEZ : public BOPDS_Interf {
public:
//
/**
* Constructor
*/
BOPDS_InterfEZ() : BOPDS_Interf() {
};
//
/**
* Constructor
* @param theAllocator
* allocator to manage the memory
*/
BOPDS_InterfEZ(const Handle(NCollection_BaseAllocator)& theAllocator)
: BOPDS_Interf(theAllocator) {
};
//
/**
* Destructor
*/
virtual ~BOPDS_InterfEZ() {
};
//
};
/**
* The class BOPDS_InterfFZ is is to store the information about
* the interference of the type face/solid.
*/
//=======================================================================
//function : BOPDS_InterfFZ
//purpose :
//=======================================================================
class BOPDS_InterfFZ : public BOPDS_Interf {
public:
//
/**
* Constructor
*/
BOPDS_InterfFZ() : BOPDS_Interf() {
};
//
/**
* Constructor
* @param theAllocator
* allocator to manage the memory
*/
BOPDS_InterfFZ(const Handle(NCollection_BaseAllocator)& theAllocator)
: BOPDS_Interf(theAllocator) {
};
//
/**
* Destructor
*/
virtual ~BOPDS_InterfFZ() {
};
//
};
/**
* The class BOPDS_InterfZZ is is to store the information about
* the interference of the type solid/solid.
*/
//=======================================================================
//function : BOPDS_InterfZZ
//purpose :
//=======================================================================
class BOPDS_InterfZZ : public BOPDS_Interf {
public:
//
/**
* Constructor
*/
BOPDS_InterfZZ() : BOPDS_Interf() {
};
//
/**
* Constructor
* @param theAllocator
* allocator to manage the memory
*/
BOPDS_InterfZZ(const Handle(NCollection_BaseAllocator)& theAllocator)
: BOPDS_Interf(theAllocator) {
};
//
/**
* Destructor
*/
virtual ~BOPDS_InterfZZ() {
};
//
};
#endif #endif

View File

@ -43,21 +43,22 @@
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
BOPDS_Iterator::BOPDS_Iterator() BOPDS_Iterator::BOPDS_Iterator()
: :
myAllocator(NCollection_BaseAllocator::CommonBaseAllocator()) myAllocator(NCollection_BaseAllocator::CommonBaseAllocator())
{ {
myDS=NULL; myDS=NULL;
myLength=0; myLength=0;
// //
myLists.SetStartSize(6); myLists.SetStartSize(BOPDS_DS::NbInterfTypes());
myLists.Init(); myLists.Init();
} }
//======================================================================= //=======================================================================
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
BOPDS_Iterator::BOPDS_Iterator(const Handle(NCollection_BaseAllocator)& theAllocator) BOPDS_Iterator::BOPDS_Iterator
(const Handle(NCollection_BaseAllocator)& theAllocator)
: :
myAllocator(theAllocator), myAllocator(theAllocator),
myLists(theAllocator) myLists(theAllocator)
@ -65,21 +66,21 @@
myDS=NULL; myDS=NULL;
myLength=0; myLength=0;
// //
myLists.SetStartSize(6); myLists.SetStartSize(BOPDS_DS::NbInterfTypes());
myLists.Init(); myLists.Init();
} }
//======================================================================= //=======================================================================
//function : ~ //function : ~
//purpose : //purpose :
//======================================================================= //=======================================================================
BOPDS_Iterator::~BOPDS_Iterator() BOPDS_Iterator::~BOPDS_Iterator()
{ {
} }
//======================================================================= //=======================================================================
// function: SetDS // function: SetDS
// purpose: // purpose:
//======================================================================= //=======================================================================
void BOPDS_Iterator::SetDS(const BOPDS_PDS& aDS) void BOPDS_Iterator::SetDS(const BOPDS_PDS& aDS)
{ {
myDS=aDS; myDS=aDS;
} }
@ -87,7 +88,7 @@
// function: DS // function: DS
// purpose: // purpose:
//======================================================================= //=======================================================================
const BOPDS_DS& BOPDS_Iterator::DS()const const BOPDS_DS& BOPDS_Iterator::DS()const
{ {
return *myDS; return *myDS;
} }
@ -95,7 +96,7 @@
// function: ExpectedLength // function: ExpectedLength
// purpose: // purpose:
//======================================================================= //=======================================================================
Standard_Integer BOPDS_Iterator::ExpectedLength() const Standard_Integer BOPDS_Iterator::ExpectedLength() const
{ {
return myLength; return myLength;
} }
@ -103,7 +104,7 @@
// function: BlockLength // function: BlockLength
// purpose: // purpose:
//======================================================================= //=======================================================================
Standard_Integer BOPDS_Iterator::BlockLength() const Standard_Integer BOPDS_Iterator::BlockLength() const
{ {
Standard_Integer aNbIIs; Standard_Integer aNbIIs;
Standard_Real aCfPredict=.5; Standard_Real aCfPredict=.5;
@ -121,8 +122,8 @@
// function: Initialize // function: Initialize
// purpose: // purpose:
//======================================================================= //=======================================================================
void BOPDS_Iterator::Initialize(const TopAbs_ShapeEnum aType1, void BOPDS_Iterator::Initialize(const TopAbs_ShapeEnum aType1,
const TopAbs_ShapeEnum aType2) const TopAbs_ShapeEnum aType2)
{ {
Standard_Integer iX; Standard_Integer iX;
// //
@ -137,7 +138,7 @@
// function: More // function: More
// purpose: // purpose:
//======================================================================= //=======================================================================
Standard_Boolean BOPDS_Iterator::More()const Standard_Boolean BOPDS_Iterator::More()const
{ {
return myIterator.More(); return myIterator.More();
} }
@ -145,7 +146,7 @@
// function: Next // function: Next
// purpose: // purpose:
//======================================================================= //=======================================================================
void BOPDS_Iterator::Next() void BOPDS_Iterator::Next()
{ {
myIterator.Next(); myIterator.Next();
} }
@ -153,9 +154,9 @@
// function: Value // function: Value
// purpose: // purpose:
//======================================================================= //=======================================================================
void BOPDS_Iterator::Value(Standard_Integer& theI1, void BOPDS_Iterator::Value(Standard_Integer& theI1,
Standard_Integer& theI2, Standard_Integer& theI2,
Standard_Boolean& theWithSubShape) const Standard_Boolean& theWithSubShape) const
{ {
Standard_Integer iT1, iT2, n1, n2; Standard_Integer iT1, iT2, n1, n2;
// //
@ -179,12 +180,13 @@
// function: Prepare // function: Prepare
// purpose: // purpose:
//======================================================================= //=======================================================================
void BOPDS_Iterator::Prepare() void BOPDS_Iterator::Prepare()
{ {
Standard_Integer i; Standard_Integer i, aNbInterfTypes;
// //
aNbInterfTypes=BOPDS_DS::NbInterfTypes();
myLength=0; myLength=0;
for (i=0; i<6; ++i) { for (i=0; i<aNbInterfTypes; ++i) {
myLists(i).Clear(); myLists(i).Clear();
} }
// //
@ -197,7 +199,7 @@
// function: Intersect // function: Intersect
// purpose: // purpose:
//======================================================================= //=======================================================================
void BOPDS_Iterator::Intersect() void BOPDS_Iterator::Intersect()
{ {
Standard_Boolean bFlag; Standard_Boolean bFlag;
Standard_Integer aNb, i, aNbB, aNbR, iTi, iTj; Standard_Integer aNb, i, aNbB, aNbR, iTi, iTj;

View File

@ -44,7 +44,7 @@
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
BOPDS_IteratorSI::BOPDS_IteratorSI() BOPDS_IteratorSI::BOPDS_IteratorSI()
: :
BOPDS_Iterator() BOPDS_Iterator()
{ {
@ -53,7 +53,8 @@
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
BOPDS_IteratorSI::BOPDS_IteratorSI(const Handle(NCollection_BaseAllocator)& theAllocator) BOPDS_IteratorSI::BOPDS_IteratorSI
(const Handle(NCollection_BaseAllocator)& theAllocator)
: :
BOPDS_Iterator(theAllocator) BOPDS_Iterator(theAllocator)
{ {
@ -62,17 +63,30 @@
//function : ~ //function : ~
//purpose : //purpose :
//======================================================================= //=======================================================================
BOPDS_IteratorSI::~BOPDS_IteratorSI() BOPDS_IteratorSI::~BOPDS_IteratorSI()
{ {
} }
//======================================================================= //=======================================================================
// function: UpdateByLevelOfCheck
// purpose:
//=======================================================================
void BOPDS_IteratorSI::UpdateByLevelOfCheck(const Standard_Integer theLevel)
{
Standard_Integer i, aNbInterfTypes;
//
aNbInterfTypes=BOPDS_DS::NbInterfTypes();
for (i=theLevel+1; i<aNbInterfTypes; ++i) {
myLists(i).Clear();
}
}
//=======================================================================
// function: Intersect // function: Intersect
// purpose: // purpose:
//======================================================================= //=======================================================================
void BOPDS_IteratorSI::Intersect() void BOPDS_IteratorSI::Intersect()
{ {
Standard_Boolean bFlag; Standard_Boolean bFlag;
Standard_Integer aNbS, i, aNbB;//, iFlag, aNbLV, aNbA Standard_Integer aNbS, i, aNbB;
Standard_Integer aNbSD, iX, j, iDS, jB, k;; Standard_Integer aNbSD, iX, j, iDS, jB, k;;
TopAbs_ShapeEnum aTi, aTj; TopAbs_ShapeEnum aTi, aTj;
Handle(NCollection_IncAllocator) aAllocator; Handle(NCollection_IncAllocator) aAllocator;
@ -98,29 +112,31 @@
for (i=0; i<aNbS; ++i) { for (i=0; i<aNbS; ++i) {
const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i); const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
// //
if (aSI.HasBRep()) { if (!aSI.IsInterfering()) {
const TopoDS_Shape& aSi=aSI.Shape(); continue;
aTi=aSI.ShapeType();
if (aTi!=TopAbs_VERTEX) {
const BOPCol_ListOfInteger& aLA=aSI.SubShapes();
aIt.Initialize(aLA);
for (; aIt.More(); aIt.Next()) {
iX=aIt.Value();
aPKXB.Clear();
aPKXB.SetIds(i, iX);
aMPA.Add(aPKXB);
}
}
//
aPKXB.Clear();
aPKXB.SetIds(i, i);
aMPA.Add(aPKXB);
//
const Bnd_Box& aBoxEx=aSI.Box();
//
aMSI.Bind(aSi, i);
aMSB.Add(aSi, aBoxEx);
} }
//
const TopoDS_Shape& aSi=aSI.Shape();
aTi=aSI.ShapeType();
if (aTi!=TopAbs_VERTEX) {
const BOPCol_ListOfInteger& aLA=aSI.SubShapes();
aIt.Initialize(aLA);
for (; aIt.More(); aIt.Next()) {
iX=aIt.Value();
aPKXB.Clear();
aPKXB.SetIds(i, iX);
aMPA.Add(aPKXB);
}
}
//
aPKXB.Clear();
aPKXB.SetIds(i, i);
aMPA.Add(aPKXB);
//
const Bnd_Box& aBoxEx=aSI.Box();
//
aMSI.Bind(aSi, i);
aMSB.Add(aSi, aBoxEx);
} // for (i=0; i<aNbS; ++i) { } // for (i=0; i<aNbS; ++i) {
// //
// aMII // aMII
@ -140,7 +156,7 @@
for (i=0; i<aNbS; ++i) { for (i=0; i<aNbS; ++i) {
const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i); const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
aTi=aSI.ShapeType(); aTi=aSI.ShapeType();
if (!aSI.HasBRep()){ if (!aSI.IsInterfering()){
continue; continue;
} }
// //
@ -193,16 +209,3 @@
aAllocator.Nullify(); aAllocator.Nullify();
//-----------------------------------------------------scope_1 t //-----------------------------------------------------scope_1 t
} }
//=======================================================================
// function: UpdateByLevelOfCheck
// purpose:
//=======================================================================
void BOPDS_IteratorSI::UpdateByLevelOfCheck(const Standard_Integer theLevel)
{
Standard_Integer i;
//
for (i=theLevel+1; i<6; ++i) {
myLists(i).Clear();
}
}

View File

@ -144,6 +144,13 @@ is
---Purpose: ---Purpose:
--- Query --- Query
--- Returns true if the shape has boundary representation --- Returns true if the shape has boundary representation
IsInterfering(me)
returns Boolean from Standard;
---C++: inline
---Purpose:
--- Returns true if the shape can be participant of
--- an interference
-- --
--- Flag --- Flag
-- --

View File

@ -12,11 +12,13 @@
// Alternatively, this file may be used under the terms of Open CASCADE // Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement. // commercial license or contractual agreement.
#include <BOPDS_Tools.hxx>
//======================================================================= //=======================================================================
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
inline BOPDS_ShapeInfo::BOPDS_ShapeInfo() inline BOPDS_ShapeInfo::BOPDS_ShapeInfo()
: :
myType(TopAbs_SHAPE), myType(TopAbs_SHAPE),
@ -28,7 +30,8 @@
//function : //function :
//purpose : //purpose :
//======================================================================= //=======================================================================
inline BOPDS_ShapeInfo::BOPDS_ShapeInfo(const Handle(NCollection_BaseAllocator)& theAllocator) inline BOPDS_ShapeInfo::BOPDS_ShapeInfo
(const Handle(NCollection_BaseAllocator)& theAllocator)
: :
myType(TopAbs_SHAPE), myType(TopAbs_SHAPE),
mySubShapes(theAllocator), mySubShapes(theAllocator),
@ -40,14 +43,14 @@
//function : ~ //function : ~
//purpose : //purpose :
//======================================================================= //=======================================================================
inline BOPDS_ShapeInfo::~BOPDS_ShapeInfo() inline BOPDS_ShapeInfo::~BOPDS_ShapeInfo()
{ {
} }
//======================================================================= //=======================================================================
//function : SetShape //function : SetShape
//purpose : //purpose :
//======================================================================= //=======================================================================
inline void BOPDS_ShapeInfo::SetShape(const TopoDS_Shape& theS) inline void BOPDS_ShapeInfo::SetShape(const TopoDS_Shape& theS)
{ {
myShape=theS; myShape=theS;
} }
@ -55,7 +58,7 @@
//function : Shape //function : Shape
//purpose : //purpose :
//======================================================================= //=======================================================================
inline const TopoDS_Shape& BOPDS_ShapeInfo::Shape()const inline const TopoDS_Shape& BOPDS_ShapeInfo::Shape()const
{ {
return myShape; return myShape;
} }
@ -63,7 +66,7 @@
//function : SetShapeType //function : SetShapeType
//purpose : //purpose :
//======================================================================= //=======================================================================
inline void BOPDS_ShapeInfo::SetShapeType(const TopAbs_ShapeEnum theType) inline void BOPDS_ShapeInfo::SetShapeType(const TopAbs_ShapeEnum theType)
{ {
myType=theType; myType=theType;
} }
@ -71,7 +74,7 @@
//function : ShapeType //function : ShapeType
//purpose : //purpose :
//======================================================================= //=======================================================================
inline TopAbs_ShapeEnum BOPDS_ShapeInfo::ShapeType()const inline TopAbs_ShapeEnum BOPDS_ShapeInfo::ShapeType()const
{ {
return myType; return myType;
} }
@ -79,7 +82,7 @@
//function : SetBox //function : SetBox
//purpose : //purpose :
//======================================================================= //=======================================================================
inline void BOPDS_ShapeInfo::SetBox(const Bnd_Box& theBox) inline void BOPDS_ShapeInfo::SetBox(const Bnd_Box& theBox)
{ {
myBox=theBox; myBox=theBox;
} }
@ -87,7 +90,7 @@
//function : Box //function : Box
//purpose : //purpose :
//======================================================================= //=======================================================================
inline const Bnd_Box& BOPDS_ShapeInfo::Box()const inline const Bnd_Box& BOPDS_ShapeInfo::Box()const
{ {
return myBox; return myBox;
} }
@ -95,7 +98,7 @@
//function : ChangeBox //function : ChangeBox
//purpose : //purpose :
//======================================================================= //=======================================================================
inline Bnd_Box& BOPDS_ShapeInfo::ChangeBox() inline Bnd_Box& BOPDS_ShapeInfo::ChangeBox()
{ {
return myBox; return myBox;
} }
@ -104,7 +107,7 @@
//function : SubShapes //function : SubShapes
//purpose : //purpose :
//======================================================================= //=======================================================================
inline const BOPCol_ListOfInteger& BOPDS_ShapeInfo::SubShapes()const inline const BOPCol_ListOfInteger& BOPDS_ShapeInfo::SubShapes()const
{ {
return mySubShapes; return mySubShapes;
} }
@ -112,7 +115,7 @@
//function : ChangeSubShapes //function : ChangeSubShapes
//purpose : //purpose :
//======================================================================= //=======================================================================
inline BOPCol_ListOfInteger& BOPDS_ShapeInfo::ChangeSubShapes() inline BOPCol_ListOfInteger& BOPDS_ShapeInfo::ChangeSubShapes()
{ {
return mySubShapes; return mySubShapes;
} }
@ -120,7 +123,8 @@
//function : HasSubShape //function : HasSubShape
//purpose : //purpose :
//======================================================================= //=======================================================================
inline Standard_Boolean BOPDS_ShapeInfo::HasSubShape(const Standard_Integer theI)const inline Standard_Boolean BOPDS_ShapeInfo::HasSubShape
(const Standard_Integer theI)const
{ {
Standard_Boolean bRet; Standard_Boolean bRet;
BOPCol_ListIteratorOfListOfInteger aIt; BOPCol_ListIteratorOfListOfInteger aIt;
@ -139,7 +143,7 @@
//function : HasReference //function : HasReference
//purpose : //purpose :
//======================================================================= //=======================================================================
inline Standard_Boolean BOPDS_ShapeInfo::HasReference()const inline Standard_Boolean BOPDS_ShapeInfo::HasReference()const
{ {
return (myReference>=0); return (myReference>=0);
} }
@ -147,7 +151,7 @@
//function : SetReference //function : SetReference
//purpose : //purpose :
//======================================================================= //=======================================================================
inline void BOPDS_ShapeInfo::SetReference(const Standard_Integer theI) inline void BOPDS_ShapeInfo::SetReference(const Standard_Integer theI)
{ {
myReference=theI; myReference=theI;
} }
@ -155,7 +159,7 @@
//function : Reference //function : Reference
//purpose : //purpose :
//======================================================================= //=======================================================================
inline Standard_Integer BOPDS_ShapeInfo::Reference()const inline Standard_Integer BOPDS_ShapeInfo::Reference()const
{ {
return myReference; return myReference;
} }
@ -163,17 +167,23 @@
//function : HasBRep //function : HasBRep
//purpose : //purpose :
//======================================================================= //=======================================================================
inline Standard_Boolean BOPDS_ShapeInfo::HasBRep()const inline Standard_Boolean BOPDS_ShapeInfo::HasBRep()const
{ {
return (myType==TopAbs_VERTEX || return (BOPDS_Tools::HasBRep(myType));
myType==TopAbs_EDGE || }
myType==TopAbs_FACE); //=======================================================================
//function : IsInterfering
//purpose :
//=======================================================================
inline Standard_Boolean BOPDS_ShapeInfo::IsInterfering()const
{
return (HasBRep() || myType==TopAbs_SOLID);
} }
//======================================================================= //=======================================================================
//function : HasFlag //function : HasFlag
//purpose : //purpose :
//======================================================================= //=======================================================================
inline Standard_Boolean BOPDS_ShapeInfo::HasFlag()const inline Standard_Boolean BOPDS_ShapeInfo::HasFlag()const
{ {
return (myFlag>=0); return (myFlag>=0);
} }
@ -181,7 +191,8 @@
//function : HasFlag //function : HasFlag
//purpose : //purpose :
//======================================================================= //=======================================================================
inline Standard_Boolean BOPDS_ShapeInfo::HasFlag(Standard_Integer& theFlag)const inline Standard_Boolean BOPDS_ShapeInfo::HasFlag
(Standard_Integer& theFlag)const
{ {
theFlag=myFlag; theFlag=myFlag;
return (myFlag>=0); return (myFlag>=0);
@ -190,7 +201,7 @@
//function : SetFlag //function : SetFlag
//purpose : //purpose :
//======================================================================= //=======================================================================
inline void BOPDS_ShapeInfo::SetFlag(const Standard_Integer theFlag) inline void BOPDS_ShapeInfo::SetFlag(const Standard_Integer theFlag)
{ {
myFlag=theFlag; myFlag=theFlag;
} }
@ -198,7 +209,7 @@
//function : Flag //function : Flag
//purpose : //purpose :
//======================================================================= //=======================================================================
inline Standard_Integer BOPDS_ShapeInfo::Flag()const inline Standard_Integer BOPDS_ShapeInfo::Flag()const
{ {
return myFlag; return myFlag;
} }

View File

@ -51,4 +51,12 @@ is
--- Returns true if the type <theT> correspond --- Returns true if the type <theT> correspond
--- to a shape having boundary representation --- to a shape having boundary representation
IsInterfering(myclass;
theT: ShapeEnum from TopAbs)
returns Boolean from Standard;
---C++: inline
---Purpose:
--- Returns true if the type <theT> can be participant of
--- an interference
end Tools; end Tools;

View File

@ -19,7 +19,17 @@
inline Standard_Boolean BOPDS_Tools::HasBRep(const TopAbs_ShapeEnum aTi) inline Standard_Boolean BOPDS_Tools::HasBRep(const TopAbs_ShapeEnum aTi)
{ {
return (aTi==TopAbs_VERTEX || aTi==TopAbs_EDGE || aTi==TopAbs_FACE); return (aTi==TopAbs_VERTEX || aTi==TopAbs_EDGE || aTi==TopAbs_FACE);
}//======================================================================= }
//=======================================================================
// function: IsInterfering
// purpose:
//=======================================================================
inline Standard_Boolean BOPDS_Tools::IsInterfering
(const TopAbs_ShapeEnum aTi)
{
return (BOPDS_Tools::HasBRep(aTi) || aTi==TopAbs_SOLID);
}
//=======================================================================
//function : TypeToInteger //function : TypeToInteger
//purpose : //purpose :
//======================================================================= //=======================================================================
@ -55,6 +65,21 @@ inline Standard_Integer BOPDS_Tools::TypeToInteger(const TopAbs_ShapeEnum aType1
case 44: case 44:
iRet=5; // FF iRet=5; // FF
break; break;
case 72:
case 27:
iRet=6; // VZ
break;
case 62:
case 26:
iRet=7; // EZ
break;
case 42:
case 24:
iRet=8; // FZ
break;
case 22:
iRet=9; // ZZ
break;
default: default:
break; break;
} }

View File

@ -0,0 +1,30 @@
// Created by: Peter KURNEV
// Copyright (c) 1999-2012 OPEN CASCADE SAS
//
// The content of this file is subject to the Open CASCADE Technology Public
// License Version 6.5 (the "License"). You may not use the content of this file
// except in compliance with the License. Please obtain a copy of the License
// at http://www.opencascade.org and read it completely before using this file.
//
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
//
// The Original Code and all software distributed under the License is
// distributed on an "AS IS" basis, without warranty of any kind, and the
// Initial Developer hereby disclaims all such warranties, including without
// limitation, any warranties of merchantability, fitness for a particular
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
#ifndef BOPDS_VectorOfInterfEZ_HeaderFile
#define BOPDS_VectorOfInterfEZ_HeaderFile
#include <BOPCol_Array1.hxx>
#include <BOPDS_Interf.hxx>
#define BOPCol_Array1_Use_Allocator
typedef BOPCol_Array1<BOPDS_InterfEZ> BOPDS_VectorOfInterfEZ;
#undef BOPCol_Array1_Use_Allocator
#endif

View File

@ -0,0 +1,30 @@
// Created by: Peter KURNEV
// Copyright (c) 1999-2012 OPEN CASCADE SAS
//
// The content of this file is subject to the Open CASCADE Technology Public
// License Version 6.5 (the "License"). You may not use the content of this file
// except in compliance with the License. Please obtain a copy of the License
// at http://www.opencascade.org and read it completely before using this file.
//
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
//
// The Original Code and all software distributed under the License is
// distributed on an "AS IS" basis, without warranty of any kind, and the
// Initial Developer hereby disclaims all such warranties, including without
// limitation, any warranties of merchantability, fitness for a particular
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
#ifndef BOPDS_VectorOfInterfFZ_HeaderFile
#define BOPDS_VectorOfInterfFZ_HeaderFile
#include <BOPCol_Array1.hxx>
#include <BOPDS_Interf.hxx>
#define BOPCol_Array1_Use_Allocator
typedef BOPCol_Array1<BOPDS_InterfFZ> BOPDS_VectorOfInterfFZ;
#undef BOPCol_Array1_Use_Allocator
#endif

View File

@ -0,0 +1,30 @@
// Created by: Peter KURNEV
// Copyright (c) 1999-2012 OPEN CASCADE SAS
//
// The content of this file is subject to the Open CASCADE Technology Public
// License Version 6.5 (the "License"). You may not use the content of this file
// except in compliance with the License. Please obtain a copy of the License
// at http://www.opencascade.org and read it completely before using this file.
//
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
//
// The Original Code and all software distributed under the License is
// distributed on an "AS IS" basis, without warranty of any kind, and the
// Initial Developer hereby disclaims all such warranties, including without
// limitation, any warranties of merchantability, fitness for a particular
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
#ifndef BOPDS_VectorOfInterfVZ_HeaderFile
#define BOPDS_VectorOfInterfVZ_HeaderFile
#include <BOPCol_Array1.hxx>
#include <BOPDS_Interf.hxx>
#define BOPCol_Array1_Use_Allocator
typedef BOPCol_Array1<BOPDS_InterfVZ> BOPDS_VectorOfInterfVZ;
#undef BOPCol_Array1_Use_Allocator
#endif

View File

@ -0,0 +1,30 @@
// Created by: Peter KURNEV
// Copyright (c) 1999-2012 OPEN CASCADE SAS
//
// The content of this file is subject to the Open CASCADE Technology Public
// License Version 6.5 (the "License"). You may not use the content of this file
// except in compliance with the License. Please obtain a copy of the License
// at http://www.opencascade.org and read it completely before using this file.
//
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
//
// The Original Code and all software distributed under the License is
// distributed on an "AS IS" basis, without warranty of any kind, and the
// Initial Developer hereby disclaims all such warranties, including without
// limitation, any warranties of merchantability, fitness for a particular
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
#ifndef BOPDS_VectorOfInterfZZ_HeaderFile
#define BOPDS_VectorOfInterfZZ_HeaderFile
#include <BOPCol_Array1.hxx>
#include <BOPDS_Interf.hxx>
#define BOPCol_Array1_Use_Allocator
typedef BOPCol_Array1<BOPDS_InterfZZ> BOPDS_VectorOfInterfZZ;
#undef BOPCol_Array1_Use_Allocator
#endif

View File

@ -34,3 +34,8 @@ BOPDS_IndexedMapOfPaveBlock.hxx
BOPDS_IndexedDataMapOfPaveBlockListOfInteger.hxx BOPDS_IndexedDataMapOfPaveBlockListOfInteger.hxx
BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks.hxx BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks.hxx
BOPDS_DataMapOfPaveBlockCommonBlock.hxx BOPDS_DataMapOfPaveBlockCommonBlock.hxx
BOPDS_VectorOfInterfVZ.hxx
BOPDS_VectorOfInterfEZ.hxx
BOPDS_VectorOfInterfFZ.hxx
BOPDS_VectorOfInterfZZ.hxx

View File

@ -0,0 +1,22 @@
puts "==========="
puts "OCC24492"
puts "==========="
puts ""
##############################################################
# The command bopargcheck produces wrong results for cases
##############################################################
box x1 10 10 10
vertex x2 3 3 3
compound x1 x2 b1
decho off
set info [bopargcheck b1 #f]
decho on
if { [regexp "Faulties for FIRST shape found : 1" $info] != 1 } {
puts "Error : command bopargcheck produces wrong result"
} else {
puts "OK : command bopargcheck produces correct result"
}