-// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 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
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-
// File: GEOMAlgo_Builder_2.cxx
// Author: Peter KURNEV
const Standard_Integer ,
NMTTools_IndexedDataMapOfIndexedMapOfInteger& );
+//modified by NIZNHY-PKV Thu Feb 16 12:24:52 2012f
+static
+ Standard_Boolean IsClosed(const TopoDS_Edge& ,
+ const TopoDS_Face& );
+//modified by NIZNHY-PKV Thu Feb 16 12:24:56 2012t
//=======================================================================
//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
- //modified by NIZNHY-PKV Fri Oct 14 13:58:00 2011f
BOPTools_ListOfPaveBlock aLPBIn;
//
pPF->RealSplitsInFace(nF, aLPBIn);
const TopoDS_Shape& aSpIn=aDS.Shape(nSpIn);
aLSpIn.Append(aSpIn);
}
- /*
- 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);
- }
- }
- }
- }
- */
- //modified by NIZNHY-PKV Fri Oct 14 13:58:08 2011t
//
// 2. Section Parts
for (j=1; j<=aNbFFs; ++j) {
// function: BuildSplitFaces
// purpose:
//=======================================================================
- void GEOMAlgo_Builder::BuildSplitFaces()
+void GEOMAlgo_Builder::BuildSplitFaces()
{
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
NMTTools_PaveFiller* pPF=myPaveFiller;
NMTDS_InterfPool* pIP=pPF->IP();
BOPTools_CArray1OfSSInterference& aFFs=pIP->SSInterferences();
- IntTools_Context& aCtx= pPF->ChangeContext();
+ const Handle(IntTools_Context)& aCtx= pPF->Context();
//
Standard_Boolean bToReverse, bIsClosed, bIsDegenerated;
Standard_Integer i, aNb, aNbF, nF;
}
//
bIsDegenerated=BRep_Tool::Degenerated(aE);
- bIsClosed=BRep_Tool::IsClosed(aE, aF);
+ //modified by NIZNHY-PKV Wed Mar 07 07:46:09 2012f
+ bIsClosed=IsClosed(aE, aF);
+ //bIsClosed=BRep_Tool::IsClosed(aE, aF);
+ //modified by NIZNHY-PKV Wed Mar 07 07:46:13 2012t
//
const TopTools_ListOfShape& aLIE=myImages.Image(aE);
aIt.Initialize(aLIE);
// 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;
NMTTools_PaveFiller* pPF=myPaveFiller;
NMTDS_InterfPool* pIP=pPF->IP();
BOPTools_CArray1OfSSInterference& aFFs=pIP->SSInterferences();
- IntTools_Context& aCtx= pPF->ChangeContext();
+ const Handle(IntTools_Context)& aCtx= pPF->Context();
//
//
//mySameDomainShapes.Clear();
// 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;
}
}
//
- //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 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);
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
}
//
}
// 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();
+ const Handle(IntTools_Context)& aCtx= pPF->Context();
//
- /*BOPTools_CArray1OfSSInterference& aFFs=*/pIP->SSInterferences();
BOPTools_CArray1OfVSInterference& aVFs=pIP->VSInterferences();
BOPTools_CArray1OfESInterference& aEFs=pIP->ESInterferences();
const NMTTools_IndexedDataMapOfIndexedMapOfInteger& aMAV=pPF->AloneVertices();
for (; aIt.More(); aIt.Next()) {
TopoDS_Face aFx=TopoDS::Face(aIt.Value());
// update classifier
- IntTools_FClass2d& aClsf=aCtx.FClass2d(aFx);
+ IntTools_FClass2d& aClsf=aCtx->FClass2d(aFx);
aClsf.Init(aFx, aTol);
//
- iFlag=aCtx.ComputeVS (aV, aFx, aU1, aU2);
+ iFlag=aCtx->ComputeVS (aV, aFx, aU1, aU2);
if (!iFlag) {
aBB.Add(aFx, aV);
break;
else {
const TopoDS_Face& aFx=TopoDS::Face(aF);
// update classifier
- IntTools_FClass2d& aClsf=aCtx.FClass2d(aFx);
+ IntTools_FClass2d& aClsf=aCtx->FClass2d(aFx);
aClsf.Init(aFx, aTol);
//
- iFlag=aCtx.ComputeVS (aV, aFx, aU1, aU2);
+ iFlag=aCtx->ComputeVS (aV, aFx, aU1, aU2);
if (!iFlag) {
TopoDS_Face aFz;
//
}
}
+//=======================================================================
+//function : IsClosed
+//purpose :
+//=======================================================================
+Standard_Boolean IsClosed(const TopoDS_Edge& aE,
+ const TopoDS_Face& aF)
+{
+ Standard_Boolean bRet;
+ //
+ bRet=BRep_Tool::IsClosed(aE, aF);
+ if (bRet) {
+ Standard_Integer iCnt;
+ TopoDS_Shape aE1;
+ //
+ bRet=!bRet;
+ iCnt=0;
+ TopExp_Explorer aExp(aF, TopAbs_EDGE);
+ for (; aExp.More(); aExp.Next()) {
+ const TopoDS_Shape& aEx=aExp.Current();
+ //
+ if (aEx.IsSame(aE)) {
+ ++iCnt;
+ if (iCnt==1) {
+ aE1=aEx;
+ }
+ else if (iCnt==2){
+ aE1.Reverse();
+ bRet=(aE1==aEx);
+ break;
+ }
+ }
+ }
+ }
+ return bRet;
+}
+
/*
{
TopoDS_Compound aCx;