0021024: EDF 1537 GEOM: IDs of the subshapes of a shape

This commit is contained in:
vsr 2011-10-18 14:27:26 +00:00
parent 539612ab98
commit 8d3e1257a9
4 changed files with 223 additions and 10 deletions

View File

@ -95,12 +95,14 @@
#include <TopTools_DataMapOfIntegerShape.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TopTools_DataMapOfShapeInteger.hxx>
static
void UpdateCandidates(const Standard_Integer ,
const Standard_Integer ,
NMTTools_IndexedDataMapOfIndexedMapOfInteger& );
//=======================================================================
//function : FillImagesFaces
//purpose :
@ -153,6 +155,19 @@ static
aLSpIn.Clear();
//
// 1. In Parts
//modified by NIZNHY-PKV Fri Oct 14 13:58:00 2011f
BOPTools_ListOfPaveBlock aLPBIn;
//
pPF->RealSplitsInFace(nF, aLPBIn);
//
aItPB.Initialize(aLPBIn);
for (; aItPB.More(); aItPB.Next()) {
const BOPTools_PaveBlock& aPB1=aItPB.Value();
nSpIn=aPB1.Edge();
const TopoDS_Shape& aSpIn=aDS.Shape(nSpIn);
aLSpIn.Append(aSpIn);
}
/*
for (j=1; j<=aNbCBP; ++j) {
NMTTools_ListOfCommonBlock& aLCB=aCBP(j);
aItCB.Initialize(aLCB);
@ -168,6 +183,8 @@ static
}
}
}
*/
//modified by NIZNHY-PKV Fri Oct 14 13:58:08 2011t
//
// 2. Section Parts
for (j=1; j<=aNbFFs; ++j) {
@ -584,19 +601,73 @@ static
// 2. Find Chains
NMTTools_IndexedDataMapOfShapeIndexedMapOfShape aMC;
//
NMTTools_Tools::FindChains(aLCS, aMC);
NMTTools_Tools::FindChains(aLCS, aMC);
//
//modified by NIZNHY-PKV Wed Oct 12 13:33:59 2011f
Standard_Boolean bIsImage;
Standard_Integer aIx, aIxMin, aNbMSDF, k, aNbMFj;
TopoDS_Shape aFOld, aFSDmin;
TopTools_IndexedMapOfShape aMFj;
TopTools_DataMapOfShapeInteger aDMSI;
//
aItF1.Initialize(myShapes);
for (j=1; aItF1.More(); aItF1.Next(), ++j) {
const TopoDS_Shape& aSj=aItF1.Value();
aMFj.Clear();
TopExp::MapShapes(aSj, TopAbs_FACE, aMFj);
aNbMFj=aMFj.Extent();
for (k=1; k<=aNbMFj; ++k) {
const TopoDS_Shape& aFk=aMFj(k);
if (!aDMSI.IsBound(aFk)) {
aDMSI.Bind(aFk, j);
}
}
}
//
//modified by NIZNHY-PKV Wed Oct 12 13:34:01 2011t
//
// 3. Fill the map of SDF mySameDomainFaces
aNbC=aMC.Extent();
for (i=1; i<=aNbC; ++i) {
const TopoDS_Shape& aF=aMC.FindKey(i);
// const TopoDS_Shape& aF=aMC.FindKey(i);
const TopTools_IndexedMapOfShape& aMSDF=aMC(i);
//
//modified by NIZNHY-PKV Wed Oct 12 13:25:16 2011f
aNbMSDF=aMSDF.Extent();
for (j=1; j<=aNbMSDF; ++j) {
const TopoDS_Shape& aFSD=aMSDF(j);
bIsImage=mySplitFaces.IsImage(aFSD);
aFOld=aFSD;
if (bIsImage) {
aFOld=mySplitFaces.ImageFrom(aFSD);
}
//
aIx=aDMSI.Find(aFOld);
if (j==1) {
aIxMin=aIx;
aFSDmin=aFSD;
continue;
}
else {
if (aIx<aIxMin) {
aIxMin=aIx;
aFSDmin=aFSD;
}
}
}
//
for (j=1; j<=aNbMSDF; ++j) {
const TopoDS_Shape& aFSD=aMSDF(j);
mySameDomainShapes.Add(aFSD, aFSDmin);
}
/*
aNbFF=aMSDF.Extent();
for (j=1; j<=aNbFF; ++j) {
const TopoDS_Shape& aFSD=aMSDF(j);
mySameDomainShapes.Add(aFSD, aF);
}
*/
//modified by NIZNHY-PKV Wed Oct 12 13:25:18 2011t
}
//
}

View File

@ -347,7 +347,7 @@ is
nF :Integer from Standard;
aLCB:out ListOfCommonBlock from NMTTools)
returns Integer from Standard;
PrepareFace(me:out;
nF : Integer from Standard;
aF : out Face from TopoDS);
@ -383,8 +383,14 @@ is
RealSplitsInFace(me:out;
nE1 :Integer from Standard;
nF2 :Integer from Standard;
aLs :out ListOfPaveBlock from BOPTools);
aLs :out ListOfPaveBlock from BOPTools);
--modified by NIZNHY-PKV Mon Oct 17 11:43:23 2011f
RealSplitsInFace(me:out;
nF1 :Integer from Standard;
aLPB :out ListOfPaveBlock from BOPTools);
--modified by NIZNHY-PKV Mon Oct 17 11:43:39 2011t
RealSplitsOnEdge(me:out;
nE1 :Integer from Standard;
nE2 :Integer from Standard;
@ -413,7 +419,6 @@ is
aBC : out Curve from BOPTools);
PutBoundPaveOnCurve (me:out;
aBC :out Curve from BOPTools;
aFF :out SSInterference from BOPTools);
@ -506,11 +511,9 @@ is
aTolR3D: out Real from Standard)
is protected;
--modified by NIZNHY-PKV Thu Sep 15 08:15:08 2011f
PutClosingPaveOnCurve (me:out;
aBC :out Curve from BOPTools;
aFF :out SSInterference from BOPTools);
--modified by NIZNHY-PKV Thu Sep 15 08:15:12 2011t
fields
myDS : PShapesDataStructure from NMTDS is protected;
@ -531,7 +534,5 @@ fields
myDSIt : PIterator from NMTDS is protected;
myCompositeShape : Shape from TopoDS is protected;
myIP : PInterfPool from NMTDS is protected;
--modified by NIZNHY-PKV Wed Feb 09 10:51:50 2011f
myFaceInfo : DataMapOfIntegerFaceInfo from NMTTools is protected;
--modified by NIZNHY-PKV Wed Feb 09 10:51:50 2011t
end PaveFiller;

View File

@ -199,6 +199,8 @@ Standard_EXPORT virtual ~NMTTools_PaveFiller();
Standard_EXPORT void RealSplitsInFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ;
Standard_EXPORT void RealSplitsInFace(const Standard_Integer nF1,BOPTools_ListOfPaveBlock& aLPB) ;
Standard_EXPORT void RealSplitsOnEdge(const Standard_Integer nE1,const Standard_Integer nE2,BOPTools_ListOfPaveBlock& aLs) ;
Standard_EXPORT void RealSplitsOnFace(const Standard_Integer nE1,const Standard_Integer nF2,BOPTools_ListOfPaveBlock& aLs) ;

View File

@ -687,3 +687,142 @@
}
return 0; //Ok
}
//modified by NIZNHY-PKV Mon Oct 17 12:07:48 2011f
static
void SortPaveBlocks(BOPTools_ListOfPaveBlock &);
static
void SortShell(const Standard_Integer,
BOPTools_PaveBlock *);
static
Standard_Boolean Less(const BOPTools_PaveBlock &,
const BOPTools_PaveBlock &);
//=======================================================================
// function: RealSplitsInFace
// purpose:
//=======================================================================
void NMTTools_PaveFiller::RealSplitsInFace(const Standard_Integer nF,
BOPTools_ListOfPaveBlock& aLPBIn)
{
Standard_Integer j, aNbCBP, nSpIn;
TColStd_MapOfInteger aMFence;
BOPTools_ListOfPaveBlock aLPB;
BOPTools_ListIteratorOfListOfPaveBlock aItPB;
NMTTools_ListIteratorOfListOfCommonBlock aItCB;
//
NMTTools_CommonBlockPool& aCBP=ChangeCommonBlockPool();
//
aNbCBP=aCBP.Extent();
for (j=1; j<=aNbCBP; ++j) {
NMTTools_ListOfCommonBlock& aLCB=aCBP(j);
aItCB.Initialize(aLCB);
for (; aItCB.More(); aItCB.Next()) {
NMTTools_CommonBlock& aCB=aItCB.Value();
if (aCB.IsPaveBlockOnFace(nF)) {
const BOPTools_PaveBlock& aPB1=aCB.PaveBlock1();
nSpIn=aPB1.Edge();
if (aMFence.Add(nSpIn)){
aLPB.Append(aPB1);
}
}
}
}
//
SortPaveBlocks(aLPB);
//
aItPB.Initialize(aLPB);
for (; aItPB.More(); aItPB.Next()) {
const BOPTools_PaveBlock& aPB=aItPB.Value();
aLPBIn.Append(aPB);
}
}
//=======================================================================
// function: SortPaveBlocks
// purpose:
//=======================================================================
void SortPaveBlocks(BOPTools_ListOfPaveBlock &aLPBIn)
{
Standard_Integer i, aNbPBIn;
BOPTools_ListIteratorOfListOfPaveBlock aItPB;
BOPTools_PaveBlock *pPB;
//
aNbPBIn=aLPBIn.Extent();
if (aNbPBIn<2) {
return;
}
//
pPB=new BOPTools_PaveBlock[aNbPBIn];
//
aItPB.Initialize(aLPBIn);
for (i=0; aItPB.More(); aItPB.Next(), ++i) {
const BOPTools_PaveBlock& aPB=aItPB.Value();
pPB[i]=aPB;
}
//
SortShell(aNbPBIn, pPB);
//
aLPBIn.Clear();
for (i=0; i<aNbPBIn; ++i) {
aLPBIn.Append(pPB[i]);
}
//
delete [] (BOPTools_PaveBlock*)pPB;
}
//=======================================================================
//function : SortShell
//purpose :
//=======================================================================
void SortShell(const Standard_Integer n,
BOPTools_PaveBlock *a)
{
Standard_Integer nd, i, j, l, d=1;
BOPTools_PaveBlock x;
//
while(d<=n) {
d*=2;
}
//
while (d) {
d=(d-1)/2;
//
nd=n-d;
for (i=0; i<nd; ++i) {
j=i;
m30:;
l=j+d;
if (Less(a[l], a[j])) {
//if (a[l] < a[j]){
x=a[j];
a[j]=a[l];
a[l]=x;
j-=d;
if (j > -1) goto m30;
}//if (a[l] < a[j]){
}//for (i=0; i<nd; ++i)
}//while (1)
}
//=======================================================================
//function : Less
//purpose :
//=======================================================================
Standard_Boolean Less(const BOPTools_PaveBlock &aPB1,
const BOPTools_PaveBlock &aPB2)
{
Standard_Boolean bRet;
Standard_Integer iE1, iE2;
Standard_Real aT11, aT12, aT21, aT22;
//
iE1=aPB1.OriginalEdge();
iE2=aPB2.OriginalEdge();
if (iE1!=iE2) {
bRet=(iE1<iE2);
return bRet;
}
//
aPB1.Parameters(aT11, aT12);
aPB2.Parameters(aT21, aT22);
bRet=(aT11<aT21);
return bRet;
}
//modified by NIZNHY-PKV Mon Oct 17 11:44:45 2011t