//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-
// File: GEOMAlgo_Builder_2.cxx
// Author: Peter KURNEV
#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 :
//=======================================================================
- void GEOMAlgo_Builder::FillImagesFaces()
+void GEOMAlgo_Builder::FillImagesFaces()
{
myErrorStatus=0;
//
// function: FillIn2DParts
// purpose:
//=======================================================================
- void GEOMAlgo_Builder::FillIn2DParts()
+void GEOMAlgo_Builder::FillIn2DParts()
{
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
NMTTools_PaveFiller* pPF=myPaveFiller;
aLSpIn.Clear();
//
// 1. In Parts
- 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();
- const TopoDS_Shape& aSpIn=aDS.Shape(nSpIn);
- if (aMFence.Add(aSpIn)){
- aLSpIn.Append(aSpIn);
- }
- }
- }
+ 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);
}
//
// 2. Section Parts
// function: BuildSplitFaces
// purpose:
//=======================================================================
- void GEOMAlgo_Builder::BuildSplitFaces()
+void GEOMAlgo_Builder::BuildSplitFaces()
{
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
NMTTools_PaveFiller* pPF=myPaveFiller;
// function: FillSameDomainFaces
// purpose:
//=======================================================================
- void GEOMAlgo_Builder::FillSameDomainFaces()
+void GEOMAlgo_Builder::FillSameDomainFaces()
{
Standard_Boolean bIsSDF, bHasImage1, bHasImage2, bForward;
Standard_Integer i, j, aNbFF, nF1, nF2, aNbPBInOn, aNbC, aNbSE;
// 2. Find Chains
NMTTools_IndexedDataMapOfShapeIndexedMapOfShape aMC;
//
- NMTTools_Tools::FindChains(aLCS, aMC);
+ NMTTools_Tools::FindChains(aLCS, aMC);
+ //
+ 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);
+ }
+ }
+ }
//
// 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);
//
- aNbFF=aMSDF.Extent();
- for (j=1; j<=aNbFF; ++j) {
+ 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, aF);
+ mySameDomainShapes.Add(aFSD, aFSDmin);
}
}
//
// function: FillImagesFaces1
// purpose:
//=======================================================================
- void GEOMAlgo_Builder::FillImagesFaces1()
+void GEOMAlgo_Builder::FillImagesFaces1()
{
Standard_Integer i, aNb, iSense, aNbLFx;
TopoDS_Face aF, aFSp, aFSD;
// function: FillInternalVertices
// purpose:
//=======================================================================
- void GEOMAlgo_Builder::FillInternalVertices()
+void GEOMAlgo_Builder::FillInternalVertices()
{
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
NMTTools_PaveFiller* pPF=myPaveFiller;
NMTDS_InterfPool* pIP=pPF->IP();
IntTools_Context& aCtx= pPF->ChangeContext();
//
- /*BOPTools_CArray1OfSSInterference& aFFs=*/pIP->SSInterferences();
BOPTools_CArray1OfVSInterference& aVFs=pIP->VSInterferences();
BOPTools_CArray1OfESInterference& aEFs=pIP->ESInterferences();
const NMTTools_IndexedDataMapOfIndexedMapOfInteger& aMAV=pPF->AloneVertices();