mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-27 16:50:32 +05:00
GetInPlace fix for bugs 22995 and 22374
This commit is contained in:
parent
0c2020178a
commit
191621acbe
@ -167,6 +167,8 @@ const GEOMAlgo_DataMapOfShapeMapOfShape& GEOMAlgo_GetInPlace::ShapesOn()const
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void GEOMAlgo_GetInPlace::Clear()
|
void GEOMAlgo_GetInPlace::Clear()
|
||||||
{
|
{
|
||||||
|
TopoDS_Shape aS;
|
||||||
|
//
|
||||||
myErrorStatus=0;
|
myErrorStatus=0;
|
||||||
myWarningStatus=0;
|
myWarningStatus=0;
|
||||||
//
|
//
|
||||||
@ -174,7 +176,10 @@ void GEOMAlgo_GetInPlace::Clear()
|
|||||||
myIterator.Clear();
|
myIterator.Clear();
|
||||||
myShapesIn.Clear();
|
myShapesIn.Clear();
|
||||||
myShapesOn.Clear();
|
myShapesOn.Clear();
|
||||||
|
myShapesInclusive.Clear();
|
||||||
myMapShapePnt.Clear();
|
myMapShapePnt.Clear();
|
||||||
|
myChecked.Clear();
|
||||||
|
myResult= aS;
|
||||||
}
|
}
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Perform
|
//function : Perform
|
||||||
@ -209,7 +214,8 @@ void GEOMAlgo_GetInPlace::Perform()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
FillEdgesOn();
|
FillEdgesOn(myArgument);
|
||||||
|
FillEdgesOn(myShapeWhere);
|
||||||
if (myErrorStatus) {
|
if (myErrorStatus) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -229,7 +235,8 @@ void GEOMAlgo_GetInPlace::Perform()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
FillFacesOn();
|
FillFacesOn(myArgument);
|
||||||
|
FillFacesOn(myShapeWhere);
|
||||||
if (myErrorStatus) {
|
if (myErrorStatus) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -244,7 +251,8 @@ void GEOMAlgo_GetInPlace::Perform()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
FillSolidsOn();
|
FillSolidsOn(myArgument);
|
||||||
|
FillSolidsOn(myShapeWhere);
|
||||||
if (myErrorStatus) {
|
if (myErrorStatus) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -259,7 +267,10 @@ void GEOMAlgo_GetInPlace::Perform()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
FillImages();
|
myImages.Clear();
|
||||||
|
FillImages(myShapeWhere, Standard_True);
|
||||||
|
FillImages(myArgument, Standard_False);
|
||||||
|
|
||||||
if (myErrorStatus) {
|
if (myErrorStatus) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -318,10 +329,7 @@ void GEOMAlgo_GetInPlace::Intersect()
|
|||||||
//
|
//
|
||||||
const TopoDS_Shape& aS1=aMS1(i);
|
const TopoDS_Shape& aS1=aMS1(i);
|
||||||
BRepBndLib::Add(aS1, aBox1);
|
BRepBndLib::Add(aS1, aBox1);
|
||||||
//modified by NIZNHY-PKV Fri Jun 10 08:20:03 2011f
|
|
||||||
//aBox1.SetGap(myTolerance);
|
|
||||||
aBox1.Enlarge(myTolerance);
|
aBox1.Enlarge(myTolerance);
|
||||||
//modified by NIZNHY-PKV Fri Jun 10 08:20:06 2011t
|
|
||||||
//
|
//
|
||||||
aTreeFiller.Add(i, aBox1);
|
aTreeFiller.Add(i, aBox1);
|
||||||
}
|
}
|
||||||
@ -335,10 +343,7 @@ void GEOMAlgo_GetInPlace::Intersect()
|
|||||||
//
|
//
|
||||||
const TopoDS_Shape& aS2=aMS2(j);
|
const TopoDS_Shape& aS2=aMS2(j);
|
||||||
BRepBndLib::Add(aS2, aBox2);
|
BRepBndLib::Add(aS2, aBox2);
|
||||||
//modified by NIZNHY-PKV Fri Jun 10 08:20:23 2011f
|
|
||||||
//aBox2.SetGap(myTolerance);
|
|
||||||
aBox2.Enlarge(myTolerance);
|
aBox2.Enlarge(myTolerance);
|
||||||
//modified by NIZNHY-PKV Fri Jun 10 08:20:25 2011t
|
|
||||||
//
|
//
|
||||||
aSelector.Clear();
|
aSelector.Clear();
|
||||||
aSelector.SetBox(aBox2);
|
aSelector.SetBox(aBox2);
|
||||||
@ -395,20 +400,21 @@ void GEOMAlgo_GetInPlace::PerformVV()
|
|||||||
const TopoDS_Shape& aV2=aCS.Shape2();
|
const TopoDS_Shape& aV2=aCS.Shape2();
|
||||||
//
|
//
|
||||||
FillShapesOn(aV1, aV2);
|
FillShapesOn(aV1, aV2);
|
||||||
|
FillShapesOn(aV2, aV1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : FillEdgesOn
|
//function : FillEdgesOn
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void GEOMAlgo_GetInPlace::FillEdgesOn()
|
void GEOMAlgo_GetInPlace::FillEdgesOn(const TopoDS_Shape &theShape)
|
||||||
{
|
{
|
||||||
Standard_Integer i, aNbE;
|
Standard_Integer i, aNbE;
|
||||||
TopoDS_Iterator aIt;
|
TopoDS_Iterator aIt;
|
||||||
TopTools_IndexedMapOfShape aME;
|
TopTools_IndexedMapOfShape aME;
|
||||||
TopTools_MapIteratorOfMapOfShape aItMS;
|
TopTools_MapIteratorOfMapOfShape aItMS;
|
||||||
//
|
//
|
||||||
TopExp::MapShapes(myArgument, TopAbs_EDGE, aME);
|
TopExp::MapShapes(theShape, TopAbs_EDGE, aME);
|
||||||
aNbE=aME.Extent();
|
aNbE=aME.Extent();
|
||||||
for (i=1; i<=aNbE; ++i) {
|
for (i=1; i<=aNbE; ++i) {
|
||||||
const TopoDS_Edge& aE1=*((TopoDS_Edge*)&aME(i));
|
const TopoDS_Edge& aE1=*((TopoDS_Edge*)&aME(i));
|
||||||
@ -471,10 +477,6 @@ void GEOMAlgo_GetInPlace::PerformVE()
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void GEOMAlgo_GetInPlace::PerformEE()
|
void GEOMAlgo_GetInPlace::PerformEE()
|
||||||
{
|
{
|
||||||
Standard_Boolean bHasOn, bHasIn, bFound;
|
|
||||||
TopoDS_Iterator aIt;
|
|
||||||
TopTools_MapOfShape aMSX;
|
|
||||||
//
|
|
||||||
myErrorStatus=0;
|
myErrorStatus=0;
|
||||||
myWarningStatus=0;
|
myWarningStatus=0;
|
||||||
//
|
//
|
||||||
@ -483,35 +485,58 @@ void GEOMAlgo_GetInPlace::PerformEE()
|
|||||||
const GEOMAlgo_CoupleOfShapes& aCS=myIterator.Value();
|
const GEOMAlgo_CoupleOfShapes& aCS=myIterator.Value();
|
||||||
const TopoDS_Shape& aE1=aCS.Shape1();
|
const TopoDS_Shape& aE1=aCS.Shape1();
|
||||||
const TopoDS_Shape& aE2=aCS.Shape2();
|
const TopoDS_Shape& aE2=aCS.Shape2();
|
||||||
//
|
|
||||||
bHasOn=myShapesOn.IsBound(aE1);
|
PerformEE(aE1, aE2);
|
||||||
bHasIn=myShapesIn.IsBound(aE1);
|
|
||||||
const TopTools_MapOfShape& aMSOn=(bHasOn) ? myShapesOn.Find(aE1) : aMSX;
|
|
||||||
const TopTools_MapOfShape& aMSIn=(bHasIn) ? myShapesIn.Find(aE1) : aMSX;
|
|
||||||
//
|
|
||||||
bFound=Standard_True;
|
|
||||||
aIt.Initialize(aE2);
|
|
||||||
for (; aIt.More(); aIt.Next()) {
|
|
||||||
const TopoDS_Shape& aV2=aIt.Value();
|
|
||||||
if (!(aMSOn.Contains(aV2) || aMSIn.Contains(aV2))) {
|
|
||||||
bFound=!bFound;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!bFound) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
//
|
|
||||||
bFound=CheckCoincidence(aE1, aE2);
|
|
||||||
if (myErrorStatus) {
|
if (myErrorStatus) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (bFound) {
|
|
||||||
FillShapesIn(aE1, aE2);
|
PerformEE(aE2, aE1);
|
||||||
|
|
||||||
|
if (myErrorStatus) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
//function : PerformEE
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_GetInPlace::PerformEE(const TopoDS_Shape &theE1,
|
||||||
|
const TopoDS_Shape &theE2)
|
||||||
|
{
|
||||||
|
Standard_Boolean bHasOn, bHasIn, bFound;
|
||||||
|
TopoDS_Iterator aIt;
|
||||||
|
TopTools_MapOfShape aMSX;
|
||||||
|
//
|
||||||
|
bHasOn=myShapesOn.IsBound(theE1);
|
||||||
|
bHasIn=myShapesIn.IsBound(theE1);
|
||||||
|
const TopTools_MapOfShape& aMSOn=(bHasOn) ? myShapesOn.Find(theE1) : aMSX;
|
||||||
|
const TopTools_MapOfShape& aMSIn=(bHasIn) ? myShapesIn.Find(theE1) : aMSX;
|
||||||
|
//
|
||||||
|
bFound=Standard_True;
|
||||||
|
aIt.Initialize(theE2);
|
||||||
|
for (; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape& aV2=aIt.Value();
|
||||||
|
if (!(aMSOn.Contains(aV2) || aMSIn.Contains(aV2))) {
|
||||||
|
bFound=!bFound;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!bFound) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
bFound=CheckCoincidence(theE1, theE2);
|
||||||
|
if (myErrorStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (bFound) {
|
||||||
|
FillShapesIn(theE1, theE2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
//function : PerformVF
|
//function : PerformVF
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -569,14 +594,14 @@ void GEOMAlgo_GetInPlace::PerformVF()
|
|||||||
//function : FillFacesOn
|
//function : FillFacesOn
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void GEOMAlgo_GetInPlace::FillFacesOn()
|
void GEOMAlgo_GetInPlace::FillFacesOn(const TopoDS_Shape &theShape)
|
||||||
{
|
{
|
||||||
Standard_Integer i, j, aNbF, aNbE;
|
Standard_Integer i, j, aNbF, aNbE;
|
||||||
TopoDS_Iterator aIt;
|
TopoDS_Iterator aIt;
|
||||||
TopTools_IndexedMapOfShape aMF, aME;
|
TopTools_IndexedMapOfShape aMF, aME;
|
||||||
TopTools_MapIteratorOfMapOfShape aItMS;
|
TopTools_MapIteratorOfMapOfShape aItMS;
|
||||||
//
|
//
|
||||||
TopExp::MapShapes(myArgument, TopAbs_FACE, aMF);
|
TopExp::MapShapes(theShape, TopAbs_FACE, aMF);
|
||||||
aNbF=aMF.Extent();
|
aNbF=aMF.Extent();
|
||||||
for (i=1; i<=aNbF; ++i) {
|
for (i=1; i<=aNbF; ++i) {
|
||||||
const TopoDS_Face& aF1=*((TopoDS_Face*)&aMF(i));
|
const TopoDS_Face& aF1=*((TopoDS_Face*)&aMF(i));
|
||||||
@ -668,11 +693,6 @@ void GEOMAlgo_GetInPlace::PerformEF()
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void GEOMAlgo_GetInPlace::PerformFF()
|
void GEOMAlgo_GetInPlace::PerformFF()
|
||||||
{
|
{
|
||||||
Standard_Boolean bFound, bHasOnF, bHasInF;
|
|
||||||
Standard_Integer i, aNbS2;
|
|
||||||
TopTools_MapOfShape aMSX;
|
|
||||||
TopTools_IndexedMapOfShape aMS2;
|
|
||||||
//
|
|
||||||
myErrorStatus=0;
|
myErrorStatus=0;
|
||||||
myWarningStatus=0;
|
myWarningStatus=0;
|
||||||
//
|
//
|
||||||
@ -681,52 +701,75 @@ void GEOMAlgo_GetInPlace::PerformFF()
|
|||||||
const GEOMAlgo_CoupleOfShapes& aCS=myIterator.Value();
|
const GEOMAlgo_CoupleOfShapes& aCS=myIterator.Value();
|
||||||
const TopoDS_Shape& aF1=aCS.Shape1();
|
const TopoDS_Shape& aF1=aCS.Shape1();
|
||||||
const TopoDS_Shape& aF2=aCS.Shape2();
|
const TopoDS_Shape& aF2=aCS.Shape2();
|
||||||
//
|
|
||||||
bHasOnF=myShapesOn.IsBound(aF1);
|
PerformFF(aF1, aF2);
|
||||||
const TopTools_MapOfShape& aMSOnF=(bHasOnF) ? myShapesOn.Find(aF1) : aMSX;
|
|
||||||
//
|
|
||||||
bHasInF=myShapesIn.IsBound(aF1);
|
|
||||||
const TopTools_MapOfShape& aMSInF=(bHasInF) ? myShapesIn.Find(aF1) : aMSX;
|
|
||||||
//
|
|
||||||
aMS2.Clear();
|
|
||||||
MapBRepShapes(aF2, aMS2);
|
|
||||||
//
|
|
||||||
bFound=Standard_False;
|
|
||||||
aNbS2=aMS2.Extent();
|
|
||||||
for (i=1; i<=aNbS2; ++i) {
|
|
||||||
const TopoDS_Shape& aS2=aMS2(i);
|
|
||||||
if (aS2.IsSame(aF2)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
bFound=(aMSOnF.Contains(aS2) || aMSInF.Contains(aS2));
|
|
||||||
if (!bFound) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!bFound) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
//
|
|
||||||
bFound=CheckCoincidence(aF1, aF2);
|
|
||||||
if (myErrorStatus) {
|
if (myErrorStatus) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (bFound) {
|
|
||||||
FillShapesIn(aF1, aF2);
|
PerformFF(aF2, aF1);
|
||||||
|
|
||||||
|
if (myErrorStatus) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
//function : PerformFF
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_GetInPlace::PerformFF(const TopoDS_Shape &theF1,
|
||||||
|
const TopoDS_Shape &theF2)
|
||||||
|
{
|
||||||
|
Standard_Boolean bFound, bHasOnF, bHasInF;
|
||||||
|
Standard_Integer i, aNbS2;
|
||||||
|
TopTools_MapOfShape aMSX;
|
||||||
|
TopTools_IndexedMapOfShape aMS2;
|
||||||
|
//
|
||||||
|
bHasOnF=myShapesOn.IsBound(theF1);
|
||||||
|
const TopTools_MapOfShape& aMSOnF=(bHasOnF) ? myShapesOn.Find(theF1) : aMSX;
|
||||||
|
//
|
||||||
|
bHasInF=myShapesIn.IsBound(theF1);
|
||||||
|
const TopTools_MapOfShape& aMSInF=(bHasInF) ? myShapesIn.Find(theF1) : aMSX;
|
||||||
|
//
|
||||||
|
MapBRepShapes(theF2, aMS2);
|
||||||
|
//
|
||||||
|
bFound=Standard_False;
|
||||||
|
aNbS2=aMS2.Extent();
|
||||||
|
for (i=1; i<=aNbS2; ++i) {
|
||||||
|
const TopoDS_Shape& aS2=aMS2(i);
|
||||||
|
if (aS2.IsSame(theF2)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
bFound=(aMSOnF.Contains(aS2) || aMSInF.Contains(aS2));
|
||||||
|
if (!bFound) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!bFound) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
bFound=CheckCoincidence(theF1, theF2);
|
||||||
|
if (myErrorStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (bFound) {
|
||||||
|
FillShapesIn(theF1, theF2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
//function : FillSolidsOn
|
//function : FillSolidsOn
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void GEOMAlgo_GetInPlace::FillSolidsOn()
|
void GEOMAlgo_GetInPlace::FillSolidsOn(const TopoDS_Shape &theShape)
|
||||||
{
|
{
|
||||||
Standard_Integer i, j, aNbS, aNbF;
|
Standard_Integer i, j, aNbS, aNbF;
|
||||||
TopTools_IndexedMapOfShape aMS, aMF;
|
TopTools_IndexedMapOfShape aMS, aMF;
|
||||||
TopTools_MapIteratorOfMapOfShape aItMS;
|
TopTools_MapIteratorOfMapOfShape aItMS;
|
||||||
//
|
//
|
||||||
TopExp::MapShapes(myArgument, TopAbs_SOLID, aMS);
|
TopExp::MapShapes(theShape, TopAbs_SOLID, aMS);
|
||||||
//
|
//
|
||||||
aNbS=aMS.Extent();
|
aNbS=aMS.Extent();
|
||||||
for (i=1; i<=aNbS; ++i) {
|
for (i=1; i<=aNbS; ++i) {
|
||||||
@ -798,11 +841,6 @@ void GEOMAlgo_GetInPlace::PerformZF()
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void GEOMAlgo_GetInPlace::PerformZZ()
|
void GEOMAlgo_GetInPlace::PerformZZ()
|
||||||
{
|
{
|
||||||
Standard_Boolean bFound, bHasOn, bHasIn;
|
|
||||||
Standard_Integer i, aNbS2, iCntOn, iCntIn, iCntOut;
|
|
||||||
TopTools_MapOfShape aMSX;
|
|
||||||
TopTools_IndexedMapOfShape aMS2;
|
|
||||||
//
|
|
||||||
myErrorStatus=0;
|
myErrorStatus=0;
|
||||||
myWarningStatus=0;
|
myWarningStatus=0;
|
||||||
//
|
//
|
||||||
@ -811,274 +849,256 @@ void GEOMAlgo_GetInPlace::PerformZZ()
|
|||||||
const GEOMAlgo_CoupleOfShapes& aCS=myIterator.Value();
|
const GEOMAlgo_CoupleOfShapes& aCS=myIterator.Value();
|
||||||
const TopoDS_Shape& aSo1=aCS.Shape1();
|
const TopoDS_Shape& aSo1=aCS.Shape1();
|
||||||
const TopoDS_Shape& aSo2=aCS.Shape2();
|
const TopoDS_Shape& aSo2=aCS.Shape2();
|
||||||
//
|
|
||||||
bHasOn=myShapesOn.IsBound(aSo1);
|
PerformZZ(aSo1, aSo2);
|
||||||
const TopTools_MapOfShape& aMSOn=(bHasOn) ? myShapesOn.Find(aSo1) : aMSX;
|
|
||||||
//
|
if (myErrorStatus) {
|
||||||
bHasIn=myShapesIn.IsBound(aSo1);
|
return;
|
||||||
const TopTools_MapOfShape& aMSIn=(bHasIn) ? myShapesIn.Find(aSo1) : aMSX;
|
|
||||||
//
|
|
||||||
aMS2.Clear();
|
|
||||||
TopExp::MapShapes(aSo2, TopAbs_FACE, aMS2);
|
|
||||||
//
|
|
||||||
iCntIn=0;
|
|
||||||
iCntOn=0;
|
|
||||||
iCntOut=0;
|
|
||||||
bFound=Standard_False;
|
|
||||||
aNbS2=aMS2.Extent();
|
|
||||||
for (i=1; i<=aNbS2; ++i) {
|
|
||||||
const TopoDS_Shape& aF2=aMS2(i);
|
|
||||||
//
|
|
||||||
if (aMSIn.Contains(aF2)) {
|
|
||||||
++iCntIn;
|
|
||||||
bFound=Standard_True;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else if (!aMSOn.Contains(aF2)) {
|
|
||||||
++iCntOut;
|
|
||||||
bFound=Standard_False;// out
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
++iCntOn; //on
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//
|
|
||||||
if (!bFound && iCntOut) {
|
PerformZZ(aSo2, aSo1);
|
||||||
continue;
|
|
||||||
}
|
if (myErrorStatus) {
|
||||||
//
|
return;
|
||||||
if (!iCntIn) {
|
|
||||||
bFound=CheckCoincidence(aSo1, aSo2);
|
|
||||||
if (myErrorStatus) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (bFound) {
|
|
||||||
FillShapesIn(aSo1, aSo2);
|
|
||||||
}
|
}
|
||||||
}// for (; myIterator.More(); myIterator.Next()) {
|
}// for (; myIterator.More(); myIterator.Next()) {
|
||||||
}
|
}
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
//function : PerformZZ
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_GetInPlace::PerformZZ(const TopoDS_Shape &theSo1,
|
||||||
|
const TopoDS_Shape &theSo2)
|
||||||
|
{
|
||||||
|
Standard_Boolean bFound, bHasOn, bHasIn;
|
||||||
|
Standard_Integer i, aNbS2, iCntOn, iCntIn, iCntOut;
|
||||||
|
TopTools_MapOfShape aMSX;
|
||||||
|
TopTools_IndexedMapOfShape aMS2;
|
||||||
|
//
|
||||||
|
bHasOn=myShapesOn.IsBound(theSo1);
|
||||||
|
const TopTools_MapOfShape& aMSOn=(bHasOn) ? myShapesOn.Find(theSo1) : aMSX;
|
||||||
|
//
|
||||||
|
bHasIn=myShapesIn.IsBound(theSo1);
|
||||||
|
const TopTools_MapOfShape& aMSIn=(bHasIn) ? myShapesIn.Find(theSo1) : aMSX;
|
||||||
|
//
|
||||||
|
TopExp::MapShapes(theSo2, TopAbs_FACE, aMS2);
|
||||||
|
//
|
||||||
|
iCntIn=0;
|
||||||
|
iCntOn=0;
|
||||||
|
iCntOut=0;
|
||||||
|
bFound=Standard_False;
|
||||||
|
aNbS2=aMS2.Extent();
|
||||||
|
for (i=1; i<=aNbS2; ++i) {
|
||||||
|
const TopoDS_Shape& aF2=aMS2(i);
|
||||||
|
//
|
||||||
|
if (aMSIn.Contains(aF2)) {
|
||||||
|
++iCntIn;
|
||||||
|
bFound=Standard_True;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if (!aMSOn.Contains(aF2)) {
|
||||||
|
++iCntOut;
|
||||||
|
bFound=Standard_False;// out
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
++iCntOn; //on
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
if (!bFound && iCntOut) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
if (!iCntIn) {
|
||||||
|
bFound=CheckCoincidence(theSo1, theSo2);
|
||||||
|
if (myErrorStatus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (bFound) {
|
||||||
|
FillShapesIn(theSo1, theSo2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
//function : FillImages
|
//function : FillImages
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void GEOMAlgo_GetInPlace::FillImages()
|
void GEOMAlgo_GetInPlace::FillImages(const TopoDS_Shape &theShape,
|
||||||
|
const Standard_Boolean IsWhere)
|
||||||
{
|
{
|
||||||
Standard_Integer i, aNbS, aNbSx, aNbSi;
|
|
||||||
TopAbs_ShapeEnum aType;
|
|
||||||
TopoDS_Iterator aIt;
|
|
||||||
TopTools_ListOfShape aLSx;
|
|
||||||
TopTools_ListIteratorOfListOfShape aItLS;
|
|
||||||
TopTools_IndexedMapOfShape aMS;
|
|
||||||
TopTools_MapIteratorOfMapOfShape aItMS;
|
|
||||||
//
|
//
|
||||||
myErrorStatus=0;
|
myErrorStatus=0;
|
||||||
myWarningStatus=0;
|
myWarningStatus=0;
|
||||||
//
|
//
|
||||||
myImages.Clear();
|
|
||||||
//
|
|
||||||
// 1. Vertices
|
// 1. Vertices
|
||||||
aMS.Clear();
|
FillImgSimple(theShape, TopAbs_VERTEX, IsWhere);
|
||||||
TopExp::MapShapes(myArgument, TopAbs_VERTEX, aMS);
|
|
||||||
aNbS=aMS.Extent();
|
|
||||||
for (i=1; i<=aNbS; ++i) {
|
|
||||||
const TopoDS_Shape& aV=aMS(i);
|
|
||||||
if (myShapesOn.IsBound(aV)) {
|
|
||||||
const TopTools_MapOfShape& aMSx=myShapesOn.Find(aV);
|
|
||||||
aNbSx=aMSx.Extent();
|
|
||||||
//
|
|
||||||
aLSx.Clear();
|
|
||||||
aItMS.Initialize(aMSx);
|
|
||||||
for (; aItMS.More(); aItMS.Next()) {
|
|
||||||
const TopoDS_Shape& aVx=aItMS.Key();
|
|
||||||
aLSx.Append(aVx);
|
|
||||||
}
|
|
||||||
//
|
|
||||||
myImages.Bind(aV, aLSx);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//
|
//
|
||||||
// 2. Edges
|
// 2. Edges
|
||||||
aMS.Clear();
|
FillImgSimple(theShape, TopAbs_EDGE, IsWhere);
|
||||||
TopExp::MapShapes(myArgument, TopAbs_EDGE, aMS);
|
|
||||||
aNbS=aMS.Extent();
|
|
||||||
for (i=1; i<=aNbS; ++i) {
|
|
||||||
const TopoDS_Shape& aE=aMS(i);
|
|
||||||
if (myShapesIn.IsBound(aE)) {
|
|
||||||
const TopTools_MapOfShape& aMSx=myShapesIn.Find(aE);
|
|
||||||
aNbSx=aMSx.Extent();
|
|
||||||
//
|
|
||||||
aLSx.Clear();
|
|
||||||
aItMS.Initialize(aMSx);
|
|
||||||
for (; aItMS.More(); aItMS.Next()) {
|
|
||||||
const TopoDS_Shape& aEx=aItMS.Key();
|
|
||||||
aType=aEx.ShapeType();
|
|
||||||
if (aType==TopAbs_EDGE){
|
|
||||||
aLSx.Append(aEx);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//
|
|
||||||
myImages.Bind(aE, aLSx);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//
|
//
|
||||||
// 3. Wires
|
// 3. Wires
|
||||||
aMS.Clear();
|
FillImgComplex(theShape, TopAbs_WIRE, IsWhere);
|
||||||
TopExp::MapShapes(myArgument, TopAbs_WIRE, aMS);
|
|
||||||
aNbS=aMS.Extent();
|
|
||||||
for (i=1; i<=aNbS; ++i) {
|
|
||||||
const TopoDS_Shape& aW=aMS(i);
|
|
||||||
aLSx.Clear();
|
|
||||||
aIt.Initialize(aW);
|
|
||||||
for(; aIt.More(); aIt.Next()) {
|
|
||||||
const TopoDS_Shape& aE=aIt.Value();
|
|
||||||
if (myImages.IsBound(aE)) {
|
|
||||||
const TopTools_ListOfShape& aLSi=myImages.Find(aE);
|
|
||||||
aNbSi=aLSi.Extent();
|
|
||||||
//
|
|
||||||
aItLS.Initialize(aLSi);
|
|
||||||
for (; aItLS.More(); aItLS.Next()) {
|
|
||||||
const TopoDS_Shape& aEi=aItLS.Value();
|
|
||||||
aLSx.Append(aEi);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
myImages.Bind(aW, aLSx);
|
|
||||||
}
|
|
||||||
//
|
//
|
||||||
// 4. Faces
|
// 4. Faces
|
||||||
aMS.Clear();
|
FillImgSimple(theShape, TopAbs_FACE, IsWhere);
|
||||||
TopExp::MapShapes(myArgument, TopAbs_FACE, aMS);
|
|
||||||
aNbS=aMS.Extent();
|
|
||||||
for (i=1; i<=aNbS; ++i) {
|
|
||||||
const TopoDS_Shape& aF=aMS(i);
|
|
||||||
if (myShapesIn.IsBound(aF)) {
|
|
||||||
const TopTools_MapOfShape& aMSx=myShapesIn.Find(aF);
|
|
||||||
aNbSx=aMSx.Extent();
|
|
||||||
//
|
|
||||||
aLSx.Clear();
|
|
||||||
aItMS.Initialize(aMSx);
|
|
||||||
for (; aItMS.More(); aItMS.Next()) {
|
|
||||||
const TopoDS_Shape& aFx=aItMS.Key();
|
|
||||||
aType=aFx.ShapeType();
|
|
||||||
if (aType==TopAbs_FACE){
|
|
||||||
aLSx.Append(aFx);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//
|
|
||||||
myImages.Bind(aF, aLSx);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//
|
//
|
||||||
// 5. Shells
|
// 5. Shells
|
||||||
aMS.Clear();
|
FillImgComplex(theShape, TopAbs_SHELL, IsWhere);
|
||||||
TopExp::MapShapes(myArgument, TopAbs_SHELL, aMS);
|
|
||||||
aNbS=aMS.Extent();
|
|
||||||
for (i=1; i<=aNbS; ++i) {
|
|
||||||
const TopoDS_Shape& aSh=aMS(i);
|
|
||||||
aLSx.Clear();
|
|
||||||
aIt.Initialize(aSh);
|
|
||||||
for(; aIt.More(); aIt.Next()) {
|
|
||||||
const TopoDS_Shape& aF=aIt.Value();
|
|
||||||
if (myImages.IsBound(aF)) {
|
|
||||||
const TopTools_ListOfShape& aLSi=myImages.Find(aF);
|
|
||||||
aNbSi=aLSi.Extent();
|
|
||||||
//
|
|
||||||
aItLS.Initialize(aLSi);
|
|
||||||
for (; aItLS.More(); aItLS.Next()) {
|
|
||||||
const TopoDS_Shape& aFi=aItLS.Value();
|
|
||||||
aLSx.Append(aFi);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
myImages.Bind(aSh, aLSx);
|
|
||||||
}
|
|
||||||
//
|
//
|
||||||
// 6. Solids
|
// 6. Solids
|
||||||
aMS.Clear();
|
FillImgSimple(theShape, TopAbs_SOLID, IsWhere);
|
||||||
TopExp::MapShapes(myArgument, TopAbs_SOLID, aMS);
|
|
||||||
aNbS=aMS.Extent();
|
|
||||||
for (i=1; i<=aNbS; ++i) {
|
|
||||||
const TopoDS_Shape& aZ=aMS(i);
|
|
||||||
if (myShapesIn.IsBound(aZ)) {
|
|
||||||
const TopTools_MapOfShape& aMSx=myShapesIn.Find(aZ);
|
|
||||||
aNbSx=aMSx.Extent();
|
|
||||||
//
|
|
||||||
aLSx.Clear();
|
|
||||||
aItMS.Initialize(aMSx);
|
|
||||||
for (; aItMS.More(); aItMS.Next()) {
|
|
||||||
const TopoDS_Shape& aZx=aItMS.Key();
|
|
||||||
aType=aZx.ShapeType();
|
|
||||||
if (aType==TopAbs_SOLID){
|
|
||||||
aLSx.Append(aZx);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//
|
|
||||||
myImages.Bind(aZ, aLSx);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//
|
//
|
||||||
// 7. CompSolids
|
// 7. CompSolids
|
||||||
aMS.Clear();
|
FillImgComplex(theShape, TopAbs_COMPSOLID, IsWhere);
|
||||||
TopExp::MapShapes(myArgument, TopAbs_COMPSOLID, aMS);
|
|
||||||
aNbS=aMS.Extent();
|
|
||||||
for (i=1; i<=aNbS; ++i) {
|
|
||||||
const TopoDS_Shape& aCs=aMS(i);
|
|
||||||
aLSx.Clear();
|
|
||||||
aIt.Initialize(aCs);
|
|
||||||
for(; aIt.More(); aIt.Next()) {
|
|
||||||
const TopoDS_Shape& aZ=aIt.Value();
|
|
||||||
if (myImages.IsBound(aZ)) {
|
|
||||||
const TopTools_ListOfShape& aLSi=myImages.Find(aZ);
|
|
||||||
aNbSi=aLSi.Extent();
|
|
||||||
//
|
|
||||||
aItLS.Initialize(aLSi);
|
|
||||||
for (; aItLS.More(); aItLS.Next()) {
|
|
||||||
const TopoDS_Shape& aZi=aItLS.Value();
|
|
||||||
aLSx.Append(aZi);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
myImages.Bind(aCs, aLSx);
|
|
||||||
}
|
|
||||||
//
|
//
|
||||||
// 8. Compounds
|
// 8. Compounds
|
||||||
aType=myArgument.ShapeType();
|
const TopAbs_ShapeEnum aType = theShape.ShapeType();
|
||||||
if (aType==TopAbs_COMPOUND) {
|
|
||||||
FillImagesCompound(myArgument);
|
if (aType == TopAbs_COMPOUND) {
|
||||||
|
FillImgComplex(theShape, IsWhere);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : FillImagesCompound
|
//function : FillImgSimple
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void GEOMAlgo_GetInPlace::FillImagesCompound(const TopoDS_Shape& aS)
|
void GEOMAlgo_GetInPlace::FillImgSimple
|
||||||
|
(const TopoDS_Shape &theShape,
|
||||||
|
const TopAbs_ShapeEnum theSubShapeType,
|
||||||
|
const Standard_Boolean IsWhere)
|
||||||
{
|
{
|
||||||
TopAbs_ShapeEnum aType;
|
TopTools_IndexedMapOfShape aMS;
|
||||||
TopoDS_Iterator aIt;
|
|
||||||
TopTools_ListOfShape aLSx;
|
TopExp::MapShapes(theShape, theSubShapeType, aMS);
|
||||||
TopTools_ListIteratorOfListOfShape aItLS;
|
|
||||||
//
|
Standard_Integer i;
|
||||||
aIt.Initialize(aS);
|
const Standard_Integer aNbS = aMS.Extent();
|
||||||
for(; aIt.More(); aIt.Next()) {
|
const GEOMAlgo_DataMapOfShapeMapOfShape &aShapesInOn =
|
||||||
const TopoDS_Shape& aSx=aIt.Value();
|
(theSubShapeType == TopAbs_VERTEX ? myShapesOn : myShapesIn);
|
||||||
aType=aSx.ShapeType();
|
|
||||||
//
|
for (i = 1; i <= aNbS; i++) {
|
||||||
if (aType==TopAbs_COMPOUND) {
|
const TopoDS_Shape& aS = aMS(i);
|
||||||
FillImagesCompound(aSx);
|
|
||||||
|
if (aShapesInOn.IsBound(aS)) {
|
||||||
|
const TopTools_MapOfShape& aMSx = aShapesInOn.Find(aS);
|
||||||
|
TopTools_ListOfShape aLSx;
|
||||||
|
TopTools_MapIteratorOfMapOfShape aItMS(aMSx);
|
||||||
|
|
||||||
|
for (; aItMS.More(); aItMS.Next()) {
|
||||||
|
const TopoDS_Shape& aSx = aItMS.Key();
|
||||||
|
TopAbs_ShapeEnum aType = aSx.ShapeType();
|
||||||
|
|
||||||
|
if (aType == theSubShapeType){
|
||||||
|
aLSx.Append(aSx);
|
||||||
|
|
||||||
|
if (IsWhere) {
|
||||||
|
myShapesInclusive.Bind(aSx, aS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
myImages.Bind(aS, aLSx);
|
||||||
}
|
}
|
||||||
//
|
}
|
||||||
if (myImages.IsBound(aSx)) {
|
}
|
||||||
const TopTools_ListOfShape& aLSi=myImages.Find(aSx);
|
|
||||||
aItLS.Initialize(aLSi);
|
//=======================================================================
|
||||||
|
//function : FillImgComplex
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_GetInPlace::FillImgComplex(const TopoDS_Shape &theShape,
|
||||||
|
const Standard_Boolean IsWhere)
|
||||||
|
{
|
||||||
|
TopTools_MapOfShape aMapRemaining;
|
||||||
|
TopoDS_Iterator aIt(theShape);
|
||||||
|
TopTools_ListOfShape aLSx;
|
||||||
|
TopTools_MapOfShape aMSx;
|
||||||
|
|
||||||
|
for(; aIt.More(); aIt.Next()) {
|
||||||
|
const TopoDS_Shape &aSubS = aIt.Value();
|
||||||
|
TopAbs_ShapeEnum aType = aSubS.ShapeType();
|
||||||
|
|
||||||
|
if (aType == TopAbs_COMPOUND) {
|
||||||
|
// Recursively treat compounds.
|
||||||
|
FillImgComplex(aSubS, IsWhere);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (myImages.IsBound(aSubS)) {
|
||||||
|
const TopTools_ListOfShape& aLSi = myImages.Find(aSubS);
|
||||||
|
TopTools_ListIteratorOfListOfShape aItLS(aLSi);
|
||||||
|
|
||||||
for (; aItLS.More(); aItLS.Next()) {
|
for (; aItLS.More(); aItLS.Next()) {
|
||||||
const TopoDS_Shape& aSi=aItLS.Value();
|
const TopoDS_Shape &aSubSi = aItLS.Value();
|
||||||
aLSx.Append(aSi);
|
|
||||||
|
if (aMSx.Add(aSubSi)) {
|
||||||
|
aLSx.Append(aSubSi);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (!IsWhere) {
|
||||||
|
aMapRemaining.Add(aSubS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(IsWhere || aMapRemaining.IsEmpty())) {
|
||||||
|
// Find the whole from parts.
|
||||||
|
while (!aMapRemaining.IsEmpty()) {
|
||||||
|
TopTools_MapIteratorOfMapOfShape anIter(aMapRemaining);
|
||||||
|
const TopoDS_Shape &aShape = anIter.Key();
|
||||||
|
|
||||||
|
if (myShapesInclusive.IsBound(aShape)) {
|
||||||
|
// This "what" shape is inclusive to the "where" shape.
|
||||||
|
// Get the other inclusive shapes.
|
||||||
|
const TopoDS_Shape &aSWhere = myShapesInclusive.Find(aShape);
|
||||||
|
|
||||||
|
if (myImages.IsBound(aSWhere)) {
|
||||||
|
// Remove inclusive shapes from aMapRemaining.
|
||||||
|
const TopTools_ListOfShape& aLWhat = myImages.Find(aSWhere);
|
||||||
|
TopTools_ListIteratorOfListOfShape aItLS(aLWhat);
|
||||||
|
|
||||||
|
for (; aItLS.More(); aItLS.Next()) {
|
||||||
|
const TopoDS_Shape &aSWhat = aItLS.Value();
|
||||||
|
|
||||||
|
aMapRemaining.Remove(aSWhat);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add "whole" shape to the list of images.
|
||||||
|
if (aMSx.Add(aSWhere)) {
|
||||||
|
aLSx.Append(aSWhere);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// This "what" shape is not inclusive to the "where" shape. Skip it.
|
||||||
|
aMapRemaining.Remove(aShape);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
myImages.Bind(aS, aLSx);
|
|
||||||
|
myImages.Bind(theShape, aLSx);
|
||||||
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : FillImgComplex
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_GetInPlace::FillImgComplex
|
||||||
|
(const TopoDS_Shape &theShape,
|
||||||
|
const TopAbs_ShapeEnum theSubShapeType,
|
||||||
|
const Standard_Boolean IsWhere)
|
||||||
|
{
|
||||||
|
TopTools_IndexedMapOfShape aMS;
|
||||||
|
|
||||||
|
TopExp::MapShapes(theShape, theSubShapeType, aMS);
|
||||||
|
|
||||||
|
Standard_Integer i;
|
||||||
|
const Standard_Integer aNbS = aMS.Extent();
|
||||||
|
|
||||||
|
for (i=1; i<=aNbS; ++i) {
|
||||||
|
const TopoDS_Shape &aS = aMS(i);
|
||||||
|
|
||||||
|
FillImgComplex(aS, IsWhere);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -1117,6 +1137,7 @@ void GEOMAlgo_GetInPlace::FillShapesOn(const TopoDS_Shape& aS1,
|
|||||||
myShapesOn.Bind(aS1, aMS);
|
myShapesOn.Bind(aS1, aMS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : MapBRepShapes
|
//function : MapBRepShapes
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -1148,3 +1169,35 @@ void MapBRepShapes(const TopoDS_Shape& aS,
|
|||||||
MapBRepShapes(aSx, aM);
|
MapBRepShapes(aSx, aM);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : Result
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
const TopoDS_Shape &GEOMAlgo_GetInPlace::Result()
|
||||||
|
{
|
||||||
|
TopoDS_Shape aDummy;
|
||||||
|
//
|
||||||
|
myResult = aDummy;
|
||||||
|
//
|
||||||
|
Standard_Boolean bFound;
|
||||||
|
TopoDS_Compound aC;
|
||||||
|
BRep_Builder aBB;
|
||||||
|
TopTools_ListIteratorOfListOfShape aItLS;
|
||||||
|
//
|
||||||
|
bFound=myImages.IsBound(myArgument);
|
||||||
|
if (!bFound) {
|
||||||
|
return myResult;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aBB.MakeCompound(aC);
|
||||||
|
//
|
||||||
|
const TopTools_ListOfShape& aLS=myImages.Find(myArgument);
|
||||||
|
aItLS.Initialize(aLS);
|
||||||
|
for (; aItLS.More(); aItLS.Next()) {
|
||||||
|
const TopoDS_Shape& aSD=aItLS.Value();
|
||||||
|
aBB.Add(aC, aSD);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
myResult = aC;
|
||||||
|
return myResult;
|
||||||
|
}
|
||||||
|
@ -43,6 +43,8 @@
|
|||||||
#include <GEOMAlgo_GluerAlgo.hxx>
|
#include <GEOMAlgo_GluerAlgo.hxx>
|
||||||
#include <GEOMAlgo_Algo.hxx>
|
#include <GEOMAlgo_Algo.hxx>
|
||||||
#include <GEOMAlgo_DataMapOfShapePnt.hxx>
|
#include <GEOMAlgo_DataMapOfShapePnt.hxx>
|
||||||
|
#include <TopTools_DataMapOfShapeInteger.hxx>
|
||||||
|
#include <TopTools_DataMapOfShapeShape.hxx>
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -206,7 +208,7 @@ class GEOMAlgo_GetInPlace : public GEOMAlgo_GluerAlgo,
|
|||||||
/**
|
/**
|
||||||
* Returns state of the search.
|
* Returns state of the search.
|
||||||
* @return
|
* @return
|
||||||
* Standard_True if the argument is found.
|
* Standard_True if the whole argument is found.
|
||||||
*/
|
*/
|
||||||
Standard_EXPORT
|
Standard_EXPORT
|
||||||
Standard_Boolean IsFound() const;
|
Standard_Boolean IsFound() const;
|
||||||
@ -244,6 +246,23 @@ class GEOMAlgo_GetInPlace : public GEOMAlgo_GluerAlgo,
|
|||||||
*/
|
*/
|
||||||
Standard_EXPORT
|
Standard_EXPORT
|
||||||
const GEOMAlgo_DataMapOfShapeMapOfShape& ShapesOn() const;
|
const GEOMAlgo_DataMapOfShapeMapOfShape& ShapesOn() const;
|
||||||
|
//
|
||||||
|
/**
|
||||||
|
* Returns the result that includes parts of the whole and whole from parts.
|
||||||
|
*
|
||||||
|
* The Result is the parts (taken from myShapeWhere) that correspond to
|
||||||
|
* myArgument (the whole one or its part). To check if the whole myArgument
|
||||||
|
* is found in myShapeWhere it is possible to use the method IsFound.
|
||||||
|
*
|
||||||
|
* The Result is a compound.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* - the compound of the parts from myShapeWhere
|
||||||
|
* that correspond to the myArgument if success.
|
||||||
|
* - NULL shape otherwise
|
||||||
|
*/
|
||||||
|
Standard_EXPORT
|
||||||
|
const TopoDS_Shape &Result();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Standard_EXPORT
|
Standard_EXPORT
|
||||||
@ -258,6 +277,8 @@ protected:
|
|||||||
Standard_EXPORT
|
Standard_EXPORT
|
||||||
void PerformEE() ;
|
void PerformEE() ;
|
||||||
|
|
||||||
|
void PerformEE(const TopoDS_Shape &theE1, const TopoDS_Shape &theE2);
|
||||||
|
|
||||||
Standard_EXPORT
|
Standard_EXPORT
|
||||||
void PerformVF() ;
|
void PerformVF() ;
|
||||||
|
|
||||||
@ -267,14 +288,16 @@ protected:
|
|||||||
Standard_EXPORT
|
Standard_EXPORT
|
||||||
void PerformFF() ;
|
void PerformFF() ;
|
||||||
|
|
||||||
Standard_EXPORT
|
void PerformFF(const TopoDS_Shape &theF1, const TopoDS_Shape &theF2);
|
||||||
void FillEdgesOn() ;
|
|
||||||
|
|
||||||
Standard_EXPORT
|
Standard_EXPORT
|
||||||
void FillFacesOn() ;
|
void FillEdgesOn(const TopoDS_Shape &theShape);
|
||||||
|
|
||||||
Standard_EXPORT
|
Standard_EXPORT
|
||||||
void FillSolidsOn() ;
|
void FillFacesOn(const TopoDS_Shape &theShape);
|
||||||
|
|
||||||
|
Standard_EXPORT
|
||||||
|
void FillSolidsOn(const TopoDS_Shape &theShape);
|
||||||
|
|
||||||
Standard_EXPORT
|
Standard_EXPORT
|
||||||
void PerformZF() ;
|
void PerformZF() ;
|
||||||
@ -282,18 +305,26 @@ protected:
|
|||||||
Standard_EXPORT
|
Standard_EXPORT
|
||||||
void PerformZZ() ;
|
void PerformZZ() ;
|
||||||
|
|
||||||
Standard_EXPORT
|
void PerformZZ(const TopoDS_Shape &theSo1, const TopoDS_Shape &theSo2);
|
||||||
void FillImages() ;
|
|
||||||
|
|
||||||
Standard_EXPORT
|
Standard_EXPORT
|
||||||
void FillImagesCompound(const TopoDS_Shape& theS) ;
|
void FillImages(const TopoDS_Shape &theShape,
|
||||||
|
const Standard_Boolean IsWhere);
|
||||||
|
|
||||||
|
void FillImgSimple(const TopoDS_Shape &theShape,
|
||||||
|
const TopAbs_ShapeEnum theSubShapeType,
|
||||||
|
const Standard_Boolean IsWhere);
|
||||||
|
|
||||||
|
void FillImgComplex(const TopoDS_Shape &theShape,
|
||||||
|
const Standard_Boolean IsWhere);
|
||||||
|
|
||||||
|
void FillImgComplex(const TopoDS_Shape &theShape,
|
||||||
|
const TopAbs_ShapeEnum theSubShapeType,
|
||||||
|
const Standard_Boolean IsWhere);
|
||||||
|
|
||||||
Standard_EXPORT
|
Standard_EXPORT
|
||||||
void CheckGProps() ;
|
void CheckGProps() ;
|
||||||
|
|
||||||
Standard_EXPORT
|
|
||||||
void CheckGProps(const TopoDS_Shape& theS) ;
|
|
||||||
|
|
||||||
Standard_EXPORT
|
Standard_EXPORT
|
||||||
void FillShapesIn(const TopoDS_Shape& theS1,
|
void FillShapesIn(const TopoDS_Shape& theS1,
|
||||||
const TopoDS_Shape& theS2) ;
|
const TopoDS_Shape& theS2) ;
|
||||||
@ -306,15 +337,29 @@ protected:
|
|||||||
Standard_Boolean CheckCoincidence(const TopoDS_Shape& theS1,
|
Standard_Boolean CheckCoincidence(const TopoDS_Shape& theS1,
|
||||||
const TopoDS_Shape& theS2);
|
const TopoDS_Shape& theS2);
|
||||||
|
|
||||||
|
Standard_EXPORT
|
||||||
|
Standard_Integer CheckGProps(const TopoDS_Shape& theS);
|
||||||
|
|
||||||
|
Standard_Boolean CompareGProps
|
||||||
|
(const TopoDS_Shape &theShape1,
|
||||||
|
const TopTools_ListOfShape &theListShape2) const;
|
||||||
|
|
||||||
|
Standard_EXPORT
|
||||||
|
void UpdateChecked(const TopoDS_Shape& theS1,
|
||||||
|
const Standard_Integer theFlag);
|
||||||
|
//
|
||||||
TopoDS_Shape myShapeWhere;
|
TopoDS_Shape myShapeWhere;
|
||||||
GEOMAlgo_GetInPlaceIterator myIterator;
|
GEOMAlgo_GetInPlaceIterator myIterator;
|
||||||
GEOMAlgo_DataMapOfShapeMapOfShape myShapesIn;
|
GEOMAlgo_DataMapOfShapeMapOfShape myShapesIn;
|
||||||
GEOMAlgo_DataMapOfShapeMapOfShape myShapesOn;
|
GEOMAlgo_DataMapOfShapeMapOfShape myShapesOn;
|
||||||
|
TopTools_DataMapOfShapeShape myShapesInclusive;
|
||||||
Standard_Real myTolMass;
|
Standard_Real myTolMass;
|
||||||
Standard_Real myTolCG;
|
Standard_Real myTolCG;
|
||||||
Standard_Boolean myFound;
|
Standard_Boolean myFound;
|
||||||
GEOMAlgo_DataMapOfShapePnt myMapShapePnt;
|
GEOMAlgo_DataMapOfShapePnt myMapShapePnt;
|
||||||
|
TopTools_DataMapOfShapeInteger myChecked;
|
||||||
|
//
|
||||||
|
TopoDS_Shape myResult;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
};
|
};
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
#include <BRep_Builder.hxx>
|
#include <BRep_Builder.hxx>
|
||||||
|
|
||||||
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
#include <TopTools_ListIteratorOfListOfShape.hxx>
|
||||||
|
#include <TopTools_MapIteratorOfMapOfShape.hxx>
|
||||||
#include <TopTools_ListOfShape.hxx>
|
#include <TopTools_ListOfShape.hxx>
|
||||||
#include <TopTools_IndexedMapOfShape.hxx>
|
#include <TopTools_IndexedMapOfShape.hxx>
|
||||||
|
|
||||||
@ -59,98 +60,198 @@ static
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void GEOMAlgo_GetInPlace::CheckGProps()
|
void GEOMAlgo_GetInPlace::CheckGProps()
|
||||||
{
|
{
|
||||||
myFound=Standard_False;
|
myFound=Standard_True;
|
||||||
CheckGProps(myArgument);
|
CheckGProps(myArgument);
|
||||||
}
|
}
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : CheckGProps
|
//function : CheckGProps
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
void GEOMAlgo_GetInPlace::CheckGProps(const TopoDS_Shape& aS1)
|
Standard_Integer GEOMAlgo_GetInPlace::CheckGProps(const TopoDS_Shape& theS)
|
||||||
{
|
{
|
||||||
Standard_Boolean bOnlyClosed;
|
TopAbs_ShapeEnum aType = theS.ShapeType();
|
||||||
Standard_Integer iDim, aNbS2;
|
|
||||||
Standard_Real aMass1, aMass2, aD2, aTolCG2, dM;
|
if (aType == TopAbs_COMPOUND) {
|
||||||
TopAbs_ShapeEnum aType1;
|
TopoDS_Iterator anIt(theS);
|
||||||
gp_Pnt aCG1, aCG2;
|
TopTools_MapOfShape aMapInc;
|
||||||
TopoDS_Iterator aIt;
|
|
||||||
TopoDS_Compound aC2;
|
for(; anIt.More(); anIt.Next()) {
|
||||||
BRep_Builder aBB;
|
const TopoDS_Shape &aS1x = anIt.Value();
|
||||||
TopTools_ListIteratorOfListOfShape aItLS;
|
|
||||||
//
|
aType = aS1x.ShapeType();
|
||||||
myErrorStatus=0;
|
|
||||||
//
|
if (aType != TopAbs_COMPOUND && myShapesInclusive.IsBound(aS1x)) {
|
||||||
aType1=aS1.ShapeType();
|
// This is a part of a whole.
|
||||||
if (aType1==TopAbs_COMPOUND) {
|
aMapInc.Add(aS1x);
|
||||||
aIt.Initialize(aS1);
|
} else {
|
||||||
for(; aIt.More(); aIt.Next()) {
|
// Check this subshape.
|
||||||
const TopoDS_Shape& aS1x=aIt.Value();
|
const Standard_Integer iFound = CheckGProps(aS1x);
|
||||||
CheckGProps(aS1x);
|
|
||||||
if (!myFound) {
|
if (!iFound) {
|
||||||
return;
|
UpdateChecked(theS, 0);
|
||||||
|
myFound = Standard_False;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Treat parts of a whole.
|
||||||
|
while (!aMapInc.IsEmpty()) {
|
||||||
|
TopTools_MapIteratorOfMapOfShape aMapIt(aMapInc);
|
||||||
|
const TopoDS_Shape &aWhole = myShapesInclusive.Find(aMapIt.Key());
|
||||||
|
|
||||||
|
if (!myImages.IsBound(aWhole)) {
|
||||||
|
// Should not be.
|
||||||
|
UpdateChecked(theS, 0);
|
||||||
|
myFound = Standard_False;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
const TopTools_ListOfShape& aLS1 = myImages.Find(aWhole);
|
||||||
|
|
||||||
|
if (aLS1.IsEmpty()) {
|
||||||
|
// Empty list of parts. Should not be.
|
||||||
|
UpdateChecked(theS, 0);
|
||||||
|
myFound = Standard_False;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
TopTools_ListIteratorOfListOfShape aItS1x(aLS1);
|
||||||
|
|
||||||
|
for (; aItS1x.More(); aItS1x.Next()) {
|
||||||
|
const TopoDS_Shape &aS1x = aItS1x.Value();
|
||||||
|
|
||||||
|
if (!aMapInc.Remove(aS1x)) {
|
||||||
|
// There is no aS1x in theS. Should not be.
|
||||||
|
UpdateChecked(theS, 0);
|
||||||
|
myFound = Standard_False;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Compare a shape with an image.
|
||||||
|
if (!CompareGProps(aWhole, aLS1)) {
|
||||||
|
// Image doesn't correspond to the shape.
|
||||||
|
UpdateChecked(theS, 0);
|
||||||
|
myFound = Standard_False;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return myFound ? 1 : 0;
|
||||||
}
|
}
|
||||||
//
|
|
||||||
iDim=Dimension(aType1);
|
// Check the simple shape.
|
||||||
//
|
if (!myImages.IsBound(theS)) {
|
||||||
if (!myImages.IsBound(aS1)) {
|
|
||||||
// it should not be.
|
// it should not be.
|
||||||
return;
|
UpdateChecked(theS, 0);
|
||||||
|
myFound = Standard_False;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
const TopTools_ListOfShape& aLS2=myImages.Find(aS1);
|
//
|
||||||
aNbS2=aLS2.Extent();
|
const TopTools_ListOfShape &aLS2 = myImages.Find(theS);
|
||||||
if (!aNbS2) {
|
|
||||||
|
if (aLS2.IsEmpty()) {
|
||||||
// it should not be.
|
// it should not be.
|
||||||
return;
|
UpdateChecked(theS, 0);
|
||||||
|
myFound = Standard_False;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Compare a shape with an image.
|
||||||
|
if (!CompareGProps(theS, aLS2)) {
|
||||||
|
// Image doesn't correspond to the shape.
|
||||||
|
UpdateChecked(theS, 0);
|
||||||
|
myFound = Standard_False;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
UpdateChecked(theS, 1);
|
||||||
//
|
//
|
||||||
aBB.MakeCompound(aC2);
|
return 1;
|
||||||
aItLS.Initialize(aLS2);
|
}
|
||||||
for (; aItLS.More(); aItLS.Next()) {
|
|
||||||
const TopoDS_Shape& aS2x=aItLS.Value();
|
//=======================================================================
|
||||||
aBB.Add(aC2, aS2x);
|
//function : CompareGProps
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Boolean GEOMAlgo_GetInPlace::CompareGProps
|
||||||
|
(const TopoDS_Shape &theShape1,
|
||||||
|
const TopTools_ListOfShape &theListShape2) const
|
||||||
|
{
|
||||||
|
Standard_Boolean aResult = Standard_True;
|
||||||
|
TopoDS_Compound aComp2;
|
||||||
|
BRep_Builder aBuilder;
|
||||||
|
TopTools_ListIteratorOfListOfShape anIt(theListShape2);
|
||||||
|
|
||||||
|
aBuilder.MakeCompound(aComp2);
|
||||||
|
|
||||||
|
for (; anIt.More(); anIt.Next()) {
|
||||||
|
const TopoDS_Shape &aShape2 = anIt.Value();
|
||||||
|
|
||||||
|
aBuilder.Add(aComp2, aShape2);
|
||||||
}
|
}
|
||||||
//-------------------------
|
|
||||||
GProp_GProps aG1, aG2;
|
// Compute General Properties.
|
||||||
//
|
GProp_GProps aG1;
|
||||||
aTolCG2=myTolCG*myTolCG;
|
GProp_GProps aG2;
|
||||||
bOnlyClosed=Standard_False;
|
const Standard_Real aTolCG2 = myTolCG*myTolCG;
|
||||||
//
|
Standard_Boolean bOnlyClosed = Standard_False;
|
||||||
if (iDim==0) {
|
const TopAbs_ShapeEnum aType = theShape1.ShapeType();
|
||||||
PointProperties(aS1, aG1);
|
const Standard_Integer iDim = Dimension(aType);
|
||||||
PointProperties(aC2, aG2);
|
|
||||||
|
if (iDim == 0) {
|
||||||
|
PointProperties(theShape1, aG1);
|
||||||
|
PointProperties(aComp2, aG2);
|
||||||
}
|
}
|
||||||
else if (iDim==1) {
|
else if (iDim == 1) {
|
||||||
BRepGProp::LinearProperties(aS1, aG1);
|
BRepGProp::LinearProperties(theShape1, aG1);
|
||||||
BRepGProp::LinearProperties(aC2, aG2);
|
BRepGProp::LinearProperties(aComp2, aG2);
|
||||||
}
|
}
|
||||||
else if (iDim==2) {
|
else if (iDim == 2) {
|
||||||
BRepGProp::SurfaceProperties(aS1, aG1);
|
BRepGProp::SurfaceProperties(theShape1, aG1);
|
||||||
BRepGProp::SurfaceProperties(aC2, aG2);
|
BRepGProp::SurfaceProperties(aComp2, aG2);
|
||||||
}
|
}
|
||||||
else if (iDim==3) {
|
else if (iDim == 3) {
|
||||||
BRepGProp::VolumeProperties(aS1, aG1, bOnlyClosed);
|
BRepGProp::VolumeProperties(theShape1, aG1, bOnlyClosed);
|
||||||
BRepGProp::VolumeProperties(aC2, aG2, bOnlyClosed);
|
BRepGProp::VolumeProperties(aComp2, aG2, bOnlyClosed);
|
||||||
|
} else {
|
||||||
|
return Standard_False;
|
||||||
}
|
}
|
||||||
//
|
|
||||||
aMass1=aG1.Mass();
|
// Compare properties.
|
||||||
aMass2=aG2.Mass();
|
const Standard_Real aMass1 = aG1.Mass();
|
||||||
aCG1=aG1.CentreOfMass();
|
const Standard_Real aMass2 = aG2.Mass();
|
||||||
aCG2=aG2.CentreOfMass();
|
const gp_Pnt aCG1 = aG1.CentreOfMass();
|
||||||
//
|
const gp_Pnt aCG2 = aG2.CentreOfMass();
|
||||||
dM=fabs(aMass1-aMass2);
|
Standard_Real aDM = fabs(aMass1 - aMass2);
|
||||||
|
const Standard_Real aD2 = aCG1.SquareDistance(aCG2);
|
||||||
|
|
||||||
if (aMass1 > myTolMass) {
|
if (aMass1 > myTolMass) {
|
||||||
dM=dM/aMass1;
|
aDM /= aMass1;
|
||||||
}
|
}
|
||||||
//
|
|
||||||
aD2=aCG1.SquareDistance(aCG2);
|
if ((aDM > myTolMass) || (aD2 > aTolCG2)) {
|
||||||
//
|
aResult = Standard_False;
|
||||||
if ((dM > myTolMass) || (aD2 > aTolCG2)) {
|
}
|
||||||
myFound=Standard_False;
|
|
||||||
return;
|
return aResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : UpdateChecked
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void GEOMAlgo_GetInPlace::UpdateChecked(const TopoDS_Shape& theS1,
|
||||||
|
const Standard_Integer theFlag)
|
||||||
|
{
|
||||||
|
if (myChecked.IsBound(theS1)) {
|
||||||
|
Standard_Integer& iChecked=myChecked.ChangeFind(theS1);
|
||||||
|
iChecked=theFlag;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
myChecked.Bind(theS1, theFlag);
|
||||||
}
|
}
|
||||||
myFound=Standard_True;
|
|
||||||
}
|
}
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Dimension
|
//function : Dimension
|
||||||
|
@ -75,6 +75,16 @@ void GEOMAlgo_GetInPlaceIterator::AppendPair(const GEOMAlgo_CoupleOfShapes& theC
|
|||||||
iX=TypeToInteger(aType1, aType2);
|
iX=TypeToInteger(aType1, aType2);
|
||||||
if (iX>=0) {
|
if (iX>=0) {
|
||||||
myLists[iX].Append(theCS);
|
myLists[iX].Append(theCS);
|
||||||
|
} else {
|
||||||
|
// Add inverted pair of shapes.
|
||||||
|
iX=TypeToInteger(aType2, aType1);
|
||||||
|
|
||||||
|
if (iX>=0) {
|
||||||
|
GEOMAlgo_CoupleOfShapes aCSInv;
|
||||||
|
|
||||||
|
aCSInv.SetShapes(aS2, aS1);
|
||||||
|
myLists[iX].Append(aCSInv);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
@ -3890,7 +3890,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace (Handle(GEOM_Object)
|
|||||||
min_l = fabs(aXmax - aXmin);
|
min_l = fabs(aXmax - aXmin);
|
||||||
if( min_l < fabs(aYmax - aYmin) ) min_l = fabs(aYmax - aYmin);
|
if( min_l < fabs(aYmax - aYmin) ) min_l = fabs(aYmax - aYmin);
|
||||||
if( min_l < fabs(aZmax - aZmin) ) min_l = fabs(aZmax - aZmin);
|
if( min_l < fabs(aZmax - aZmin) ) min_l = fabs(aZmax - aZmin);
|
||||||
min_l /= dl_l;
|
|
||||||
// Mantis issue 0020908 BEGIN
|
// Mantis issue 0020908 BEGIN
|
||||||
if (!Exp_Edge.More()) {
|
if (!Exp_Edge.More()) {
|
||||||
min_l = Precision::Confusion();
|
min_l = Precision::Confusion();
|
||||||
@ -3907,6 +3907,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace (Handle(GEOM_Object)
|
|||||||
if ( aProps.Mass() < min_l ) min_l = aProps.Mass();
|
if ( aProps.Mass() < min_l ) min_l = aProps.Mass();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
min_l *= dl_l;
|
||||||
|
|
||||||
// Compute tolerances
|
// Compute tolerances
|
||||||
Tol_0D = dl_l;
|
Tol_0D = dl_l;
|
||||||
@ -3948,34 +3949,23 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace (Handle(GEOM_Object)
|
|||||||
// return NULL;
|
// return NULL;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
const TopTools_DataMapOfShapeListOfShape& aDMSLS = aGIP.Images();
|
// Add direct result.
|
||||||
if (!aDMSLS.IsBound(aWhat)) {
|
TopTools_ListOfShape aLSA;
|
||||||
SetErrorCode(NOT_FOUND_ANY);
|
const TopoDS_Shape &aShapeResult = aGIP.Result();
|
||||||
return NULL;
|
TopTools_MapOfShape aMFence;
|
||||||
}
|
|
||||||
//
|
if (aShapeResult.IsNull() == Standard_False) {
|
||||||
// pkvf
|
TopoDS_Iterator anIt(aShapeResult);
|
||||||
TopTools_ListOfShape aLSA;
|
|
||||||
//
|
for (; anIt.More(); anIt.Next()) {
|
||||||
{
|
const TopoDS_Shape &aPart = anIt.Value();
|
||||||
TopTools_MapOfShape aMFence;
|
|
||||||
TopTools_ListIteratorOfListOfShape aIt;
|
if(aWhereIndices.Contains(aPart) && aMFence.Add(aPart)) {
|
||||||
//
|
aLSA.Append(aPart);
|
||||||
const TopTools_ListOfShape& aLS = aDMSLS.Find(aWhat);
|
|
||||||
aIt.Initialize(aLS);
|
|
||||||
for (;aIt.More(); aIt.Next()) {
|
|
||||||
const TopoDS_Shape& aSA=aIt.Value();
|
|
||||||
if(aMFence.Add(aSA)) {
|
|
||||||
aLSA.Append(aSA);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//
|
|
||||||
// the list of shapes aLSA contains the shapes
|
|
||||||
// of the Shape For Search that corresponds
|
|
||||||
// to the Argument aWhat
|
|
||||||
//const TopTools_ListOfShape& aLSA = aDMSLS.Find(aWhat);
|
|
||||||
//pkvt
|
|
||||||
if (aLSA.Extent() == 0) {
|
if (aLSA.Extent() == 0) {
|
||||||
SetErrorCode(NOT_FOUND_ANY); // Not found any Results
|
SetErrorCode(NOT_FOUND_ANY); // Not found any Results
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user