Back to index

salome-geom  6.5.0
Public Member Functions | Protected Member Functions | Protected Attributes
NMTTools_PaveFiller Class Reference

#include <NMTTools_PaveFiller.hxx>

Inheritance diagram for NMTTools_PaveFiller:
Inheritance graph
[legend]
Collaboration diagram for NMTTools_PaveFiller:
Collaboration graph
[legend]

List of all members.

Public Member Functions

Standard_EXPORT NMTTools_PaveFiller ()
virtual Standard_EXPORT ~NMTTools_PaveFiller ()
Standard_EXPORT void SetCompositeShape (const TopoDS_Shape &aS)
Standard_EXPORT const
TopoDS_Shape & 
CompositeShape () const
Standard_EXPORT
NMTDS_PShapesDataStructure 
DS ()
Standard_EXPORT NMTDS_PIterator DSIt ()
Standard_EXPORT NMTDS_PInterfPool IP ()
virtual Standard_EXPORT void Perform ()
Standard_EXPORT Standard_Boolean IsDone () const
Standard_EXPORT const
Handle_IntTools_Context & 
Context () const
Standard_EXPORT const
BOPTools_PavePool & 
PavePool () const
Standard_EXPORT BOPTools_PavePool & ChangePavePool ()
Standard_EXPORT const
NMTTools_CommonBlockPool
CommonBlockPool () const
Standard_EXPORT
NMTTools_CommonBlockPool
ChangeCommonBlockPool ()
Standard_EXPORT const
BOPTools_SplitShapesPool & 
SplitShapesPool () const
Standard_EXPORT
BOPTools_SplitShapesPool & 
ChangeSplitShapesPool ()
Standard_EXPORT Standard_Integer FindSDVertex (const Standard_Integer nV) const
Standard_EXPORT Standard_Integer SplitsInFace (const Standard_Integer aBid, const Standard_Integer nF1, const Standard_Integer nF2, TColStd_ListOfInteger &aLs)
Standard_EXPORT Standard_Integer SplitsInFace (const Standard_Integer nE1, const Standard_Integer nF2, TColStd_ListOfInteger &aLs)
Standard_EXPORT Standard_Integer SplitsOnEdge (const Standard_Integer nE1, const Standard_Integer nE2, TColStd_ListOfInteger &aLs)
Standard_EXPORT Standard_Integer SplitsOnFace (const Standard_Integer nE1, const Standard_Integer nF2, TColStd_ListOfInteger &aLs)
Standard_EXPORT Standard_Integer SplitsOnFace (const Standard_Integer aBid, const Standard_Integer nF1, const Standard_Integer nF2, TColStd_ListOfInteger &aLs)
Standard_EXPORT Standard_Integer SplitsInFace (const Standard_Integer aBid, const Standard_Integer nF1, const Standard_Integer nF2, BOPTools_ListOfPaveBlock &aLs)
Standard_EXPORT Standard_Integer SplitsInFace (const Standard_Integer nE1, const Standard_Integer nF2, BOPTools_ListOfPaveBlock &aLs)
Standard_EXPORT Standard_Integer SplitsOnEdge (const Standard_Integer nE1, const Standard_Integer nE2, BOPTools_ListOfPaveBlock &aLs)
Standard_EXPORT Standard_Integer SplitsOnFace (const Standard_Integer nE1, const Standard_Integer nF2, BOPTools_ListOfPaveBlock &aLs)
Standard_EXPORT Standard_Integer SplitsOnFace (const Standard_Integer aBid, const Standard_Integer nF1, const Standard_Integer nF2, BOPTools_ListOfPaveBlock &aLs)
Standard_EXPORT Standard_Integer SplitsFace (const Standard_Integer nF2, BOPTools_ListOfPaveBlock &aLs)
Standard_EXPORT Standard_Integer SplitsFace (const Standard_Integer nF2, TColStd_ListOfInteger &aLs)
Standard_EXPORT Standard_Integer CommonBlocksFace (const Standard_Integer nF, NMTTools_ListOfCommonBlock &aLCB)
Standard_EXPORT void PrepareFace (const Standard_Integer nF, TopoDS_Face &aF)
Standard_EXPORT const
BOPTools_PaveBlock & 
RealPaveBlock (const BOPTools_PaveBlock &aPB)
Standard_EXPORT const
BOPTools_PaveBlock & 
RealPaveBlock (const BOPTools_PaveBlock &aPB, TColStd_ListOfInteger &aLB, Standard_Integer &aIsCommonBlock)
Standard_EXPORT void RealSplitsFace (const Standard_Integer nF2, BOPTools_ListOfPaveBlock &aLs)
Standard_EXPORT Standard_Boolean HasRealSplitsInOnFace (const Standard_Integer nF1, const Standard_Integer nF2)
Standard_EXPORT void RealSplitsInFace (const Standard_Integer aBid, const Standard_Integer nF1, const Standard_Integer nF2, BOPTools_ListOfPaveBlock &aLs)
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)
Standard_EXPORT void RealSplitsOnFace (const Standard_Integer aBid, const Standard_Integer nF1, const Standard_Integer nF2, BOPTools_ListOfPaveBlock &aLs)
Standard_EXPORT void PrepareSetForFace (const Standard_Integer nF1, const Standard_Integer nF2, const BOPTools_ListOfPaveBlock &aLPB, BOPTools_PaveSet &aPSF)
Standard_EXPORT void PutPaveOnCurve (const BOPTools_PaveSet &aPSF, const Standard_Real aTol, BOPTools_Curve &aBC)
Standard_EXPORT void PutBoundPaveOnCurve (BOPTools_Curve &aBC, BOPTools_SSInterference &aFF)
Standard_EXPORT void PutBoundPaveOnCurve (const gp_Pnt &aP, const Standard_Real aT, BOPTools_Curve &aBC, BOPTools_SSInterference &aFF)
Standard_EXPORT Standard_Boolean FindPave (const gp_Pnt &aP, const Standard_Real aTpV, const BOPTools_PaveSet &aPS, BOPTools_Pave &aPV)
Standard_EXPORT Standard_Integer CheckIntermediatePoint (const BOPTools_PaveBlock &aPB, const BOPTools_PaveBlock &aPBR, const Standard_Real aTol)
Standard_EXPORT Standard_Boolean IsExistingPaveBlock (const BOPTools_PaveBlock &aPB, const BOPTools_ListOfPaveBlock &aLPB, const Standard_Real aTol)
Standard_EXPORT void MakePCurves ()
Standard_EXPORT const
NMTTools_IndexedDataMapOfIndexedMapOfInteger
AloneVertices () const
Standard_EXPORT Standard_Boolean IsExistingPaveBlock (const BOPTools_PaveBlock &aPB, const TopTools_ListOfShape &aLPB, const Standard_Real aTol)
Standard_EXPORT Standard_Boolean CheckCoincidence (const BOPTools_PaveBlock &aPB, const BOPTools_ListOfPaveBlock &aLPB)
Standard_EXPORT Standard_Integer CheckIntermediatePoint (const BOPTools_PaveBlock &aPB, const TopoDS_Edge &aE, const Standard_Real aTol)
Standard_EXPORT void SharedEdges (const Standard_Integer nF1, const Standard_Integer nF2, TColStd_ListOfInteger &aLNE, TopTools_ListOfShape &aLSE)
Standard_EXPORT void FuseVertices (const TopoDS_Shape &aC, TopTools_DataMapOfShapeShape &aDMVV) const
Standard_EXPORT void TreatPaveBlocks (NMTTools_ListOfCommonBlock &theLCB)
Standard_EXPORT BOPTools_PavePool & ChangePavePoolNew ()
Standard_EXPORT Standard_Boolean CheckCoincidence (const BOPTools_PaveBlock &aPB1, const BOPTools_PaveBlock &aPB2)
Standard_EXPORT void PutClosingPaveOnCurve (BOPTools_Curve &aBC, BOPTools_SSInterference &aFF)

Protected Member Functions

virtual Standard_EXPORT void Init ()
virtual Standard_EXPORT void Clear ()
virtual Standard_EXPORT void PerformVV ()
virtual Standard_EXPORT void PerformVE ()
virtual Standard_EXPORT void PerformVF ()
virtual Standard_EXPORT void PerformEE ()
virtual Standard_EXPORT void PerformEF ()
virtual Standard_EXPORT void PerformFF ()
Standard_EXPORT void MakeSplitEdges ()
virtual Standard_EXPORT void PreparePaveBlocks (const TopAbs_ShapeEnum aType1, const TopAbs_ShapeEnum aType2)
Standard_EXPORT void CorrectShrunkRanges (const Standard_Integer aSide, const BOPTools_Pave &aPave, IntTools_ShrunkRange &aSR)
virtual Standard_EXPORT void PreparePaveBlocks (const Standard_Integer anE)
virtual Standard_EXPORT void PrepareEdges ()
Standard_EXPORT Standard_Boolean IsSuccessorsComputed (const Standard_Integer iF1, const Standard_Integer iF2) const
Standard_EXPORT Standard_Boolean IsBlocksCoinside (const BOPTools_PaveBlock &aPB1, const BOPTools_PaveBlock &aPB2) const
Standard_EXPORT void RefinePavePool ()
Standard_EXPORT Standard_Integer CheckFacePaves (const TopoDS_Vertex &aV, const Standard_Integer nF)
Standard_EXPORT void ReplaceCommonBlocks (const NMTTools_ListOfCommonBlock &aLCB)
Standard_EXPORT void RemoveCommonBlocks (const NMTTools_ListOfCommonBlock &aLCB)
Standard_EXPORT void SplitCommonBlocks (const NMTTools_ListOfCommonBlock &aLCB)
Standard_EXPORT void SplitCommonBlock (const NMTTools_CommonBlock &aCB, NMTTools_ListOfCommonBlock &aLCB)
Standard_EXPORT void EECommonBlocks (const BOPTools_IDMapOfPaveBlockIMapOfPaveBlock &aM)
Standard_EXPORT void EFCommonBlocks (const BOPTools_IDMapOfPaveBlockIMapOfInteger &aMapCB)
Standard_EXPORT void EENewVertices (const BooleanOperations_IndexedDataMapOfShapeInteger &aM)
Standard_EXPORT void EENewVertices (const TopoDS_Vertex &aV, const BooleanOperations_IndexedDataMapOfShapeInteger &aM)
Standard_EXPORT void EFNewVertices (const BooleanOperations_IndexedDataMapOfShapeInteger &aM)
Standard_EXPORT void EFNewVertices (const TopoDS_Vertex &aV, const BooleanOperations_IndexedDataMapOfShapeInteger &aM)
Standard_EXPORT void UpdateCommonBlocks ()
Standard_EXPORT void UpdateCommonBlocks (const Standard_Integer aI)
Standard_EXPORT void UpdatePaveBlocks ()
Standard_EXPORT Standard_Integer SplitIndex (const BOPTools_PaveBlock &aPB) const
Standard_EXPORT void MakeBlocks ()
Standard_EXPORT void PerformVF1 ()
Standard_EXPORT void MakeAloneVertices ()
Standard_EXPORT void FillFaceInfo ()
Standard_EXPORT void CorrectTolR3D (const BOPTools_SSInterference &aFF, const TColStd_MapOfInteger &aMVStick, Standard_Real &aTolR3D)

Protected Attributes

NMTDS_PShapesDataStructure myDS
Standard_Boolean myIsDone
Standard_Integer myNbSources
Standard_Integer myNbEdges
BOPTools_PavePool myPavePool
BOPTools_PavePool myPavePoolNew
NMTTools_CommonBlockPool myCommonBlockPool
BOPTools_SplitShapesPool mySplitShapesPool
Handle_IntTools_Context myContext
BOPTools_SSIntersectionAttribute mySectionAttribute
NMTTools_IndexedDataMapOfIndexedMapOfInteger myAloneVertices
TColStd_DataMapOfIntegerInteger myVSD
NMTDS_PIterator myDSIt
TopoDS_Shape myCompositeShape
NMTDS_PInterfPool myIP
NMTTools_DataMapOfIntegerFaceInfo myFaceInfo

Detailed Description

Definition at line 108 of file NMTTools_PaveFiller.hxx.


Constructor & Destructor Documentation

Definition at line 41 of file NMTTools_PaveFiller.cxx.

{
  myDS=NULL;
  myDSIt=NULL;
  myIsDone=Standard_False;
  myNbSources=0;
  myNbEdges=0;
  myIP=NULL;
}

Definition at line 54 of file NMTTools_PaveFiller.cxx.

{
  Clear();
}

Here is the call graph for this function:


Member Function Documentation

Definition at line 779 of file NMTTools_PaveFiller_7.cxx.

{
  return myAloneVertices;
}

Here is the caller graph for this function:

Definition at line 170 of file NMTTools_PaveFiller.cxx.

{
  return myCommonBlockPool;
}

Here is the caller graph for this function:

BOPTools_PavePool & NMTTools_PaveFiller::ChangePavePool ( )

Definition at line 146 of file NMTTools_PaveFiller.cxx.

{
  return myPavePool;
}

Here is the caller graph for this function:

BOPTools_PavePool & NMTTools_PaveFiller::ChangePavePoolNew ( )

Definition at line 154 of file NMTTools_PaveFiller.cxx.

{
  return myPavePoolNew;
}
BOPTools_SplitShapesPool & NMTTools_PaveFiller::ChangeSplitShapesPool ( )

Definition at line 186 of file NMTTools_PaveFiller.cxx.

{
  return mySplitShapesPool;
}

Here is the caller graph for this function:

Standard_Boolean NMTTools_PaveFiller::CheckCoincidence ( const BOPTools_PaveBlock &  aPB,
const BOPTools_ListOfPaveBlock &  aLPB 
)

Definition at line 1099 of file NMTTools_PaveFiller_6.cxx.

{
  Standard_Boolean bRet;
  Standard_Real aTE;
  Standard_Integer nV11, nV12, nV21, nV22, iVV, iVE, nE2;
  Standard_Integer iV, iCount, iCountExt;
  BOPTools_ListIteratorOfListOfPaveBlock anIt;
  // V11
  const BOPTools_Pave& aPave11=aPBNew.Pave1();
  nV11=aPave11.Index();
  const TopoDS_Vertex& aV11=TopoDS::Vertex(myDS->Shape(nV11));

  // V12
  const BOPTools_Pave& aPave12=aPBNew.Pave2();
  nV12=aPave12.Index();
  const TopoDS_Vertex& aV12=TopoDS::Vertex(myDS->Shape(nV12));
  //
  iCountExt=1;
  iCount=0;
  anIt.Initialize(aLPBFF);
  for (; anIt.More(); anIt.Next()) {
    iCount=0;
    //
    const BOPTools_PaveBlock& aPBR=anIt.Value();
    // V21
    const BOPTools_Pave& aPave21=aPBR.Pave1();
    nV21=aPave21.Index();

    // V22
    const BOPTools_Pave& aPave22=aPBR.Pave2();
    nV22=aPave22.Index();
    //
    if (nV11==nV21 || nV11==nV22 || nV12==nV21 || nV12==nV22) {
      continue;
    }
    //
    // E2
    nE2=aPBR.Edge();
    //
    const TopoDS_Vertex& aV21=TopoDS::Vertex(myDS->Shape(nV21));
    const TopoDS_Vertex& aV22=TopoDS::Vertex(myDS->Shape(nV22));
    const TopoDS_Edge& aE2=TopoDS::Edge(myDS->Shape(nE2));
    //
    // VV
    iV=0;
    iVV=IntTools_Tools::ComputeVV (aV11, aV21);
    if (!iVV) {
      iCount++;
      iV++;
      if (iCount>iCountExt) {
        break;
      }
    }
    //
    iVV=IntTools_Tools::ComputeVV (aV11, aV22);
    if (!iVV) {
      iCount++;
      iV++;
      if (iCount>iCountExt) {
        break;
      }
    }
    // VE
    if (!iV) {
      iVE=myContext->ComputeVE (aV11, aE2, aTE);
      if (!iVE) {
        iCount++;
        if (iCount>iCountExt) {
          break;
        }
      }
    }
    // VV
    iV=0;
    iVV=IntTools_Tools::ComputeVV (aV12, aV21);
    if (!iVV) {
      iCount++;
      iV++;
      if (iCount>iCountExt) {
        break;
      }
    }
    //
    iVV=IntTools_Tools::ComputeVV (aV12, aV22);
    if (!iVV) {
      iCount++;
      iV++;
      if (iCount>iCountExt) {
        break;
      }
    }
    // VE
    if (!iV) {
      iVE=myContext->ComputeVE (aV12, aE2, aTE);
      if (!iVE) {
        iCount++;
        if (iCount>iCountExt) {
          break;
        }
      }
    }
  } // next aPBR
  bRet=(Standard_Boolean)(iCount>iCountExt);
  return bRet;
}

Here is the caller graph for this function:

Standard_Boolean NMTTools_PaveFiller::CheckCoincidence ( const BOPTools_PaveBlock &  aPB1,
const BOPTools_PaveBlock &  aPB2 
)

Definition at line 1574 of file NMTTools_PaveFiller_4.cxx.

{
  Standard_Boolean bRet;
  Standard_Integer nE1, nE2, aNbPoints;
  Standard_Real aT11, aT12, aT21, aT22, aT1m, aD, aTol, aT2x;
  gp_Pnt aP1m;
  //
  bRet=Standard_False;
  //
  aT11=aPB1.Pave1().Param();
  aT12=aPB1.Pave2().Param();
  aT1m=IntTools_Tools::IntermediatePoint (aT11, aT12);
  nE1=aPB1.OriginalEdge();
  const TopoDS_Edge& aE1=(*(TopoDS_Edge*)(&myDS->Shape(nE1)));
  BOPTools_Tools::PointOnEdge(aE1, aT1m, aP1m);
  //
  aT21=aPB2.Pave1().Param();
  aT22=aPB2.Pave2().Param();
  nE2=aPB2.OriginalEdge();
  const TopoDS_Edge& aE2=(*(TopoDS_Edge*)(&myDS->Shape(nE2)));
  //
  GeomAPI_ProjectPointOnCurve& aPPC=myContext->ProjPC(aE2);
  aPPC.Perform(aP1m);
  aNbPoints=aPPC.NbPoints();
  if (aNbPoints) {
    aD=aPPC.LowerDistance();
    //
    aTol=BRep_Tool::Tolerance(aE1);
    aTol=aTol+BRep_Tool::Tolerance(aE2);
    if (aD<aTol) {
      aT2x=aPPC.LowerDistanceParameter();
      if (aT2x>aT21 && aT2x<aT22) {
       return !bRet;
      }
    }
  }
  return bRet;
}
Standard_Integer NMTTools_PaveFiller::CheckFacePaves ( const TopoDS_Vertex &  aV,
const Standard_Integer  nF 
) [protected]

Definition at line 591 of file NMTTools_PaveFiller_5.cxx.

{
  Standard_Integer nEF, nVF, iFlag, i, aNbV, iRet;
  BOPTools_ListIteratorOfListOfPave anIt;
  TColStd_IndexedMapOfInteger aMVF;
  //
  iRet=0;
  //
  BooleanOperations_OnceExplorer aExp(*myDS);
  aExp.Init(nF, TopAbs_EDGE);
  for (; aExp.More(); aExp.Next()) {
    nEF=aExp.Current();
    BOPTools_PaveSet& aPaveSet=myPavePool(myDS->RefEdge(nEF));
    const BOPTools_ListOfPave& aLP=aPaveSet.Set();
    anIt.Initialize(aLP);
    for (; anIt.More(); anIt.Next()) {
      const BOPTools_Pave& aPave=anIt.Value();
      nVF=aPave.Index();
      aMVF.Add(nVF);
    }
  }
  //
  aNbV=aMVF.Extent();
  for (i=1; i<=aNbV; ++i) {
    nVF=aMVF(i);
    const TopoDS_Vertex aVF=TopoDS::Vertex(myDS->Shape(nVF));
    iFlag=IntTools_Tools::ComputeVV(aNewVertex, aVF);
    if (!iFlag) {
      return nVF;
    }
  }
  return iRet;
}

Here is the caller graph for this function:

Standard_Integer NMTTools_PaveFiller::CheckIntermediatePoint ( const BOPTools_PaveBlock &  aPB,
const BOPTools_PaveBlock &  aPBR,
const Standard_Real  aTol 
)

Definition at line 893 of file NMTTools_PaveFiller_6.cxx.

{
  Standard_Integer iVM, nE2;
  //
  nE2=aPBR.Edge();
  const TopoDS_Edge aE2=TopoDS::Edge(myDS->Shape(nE2));//mpv
  iVM=CheckIntermediatePoint(aPB, aE2, aTolC);
  //
  return iVM;
}

Here is the caller graph for this function:

Standard_Integer NMTTools_PaveFiller::CheckIntermediatePoint ( const BOPTools_PaveBlock &  aPB,
const TopoDS_Edge &  aE,
const Standard_Real  aTol 
)

Definition at line 910 of file NMTTools_PaveFiller_6.cxx.

{
  Standard_Real aT11, aT12, aTM, aTmp;
  Standard_Integer iVM;
  gp_Pnt aPM;
  BRep_Builder aBB;
  TopoDS_Vertex aVM;
  //
  // Vertex
  const BOPTools_Pave& aPave11=aPB.Pave1();
  aT11=aPave11.Param();
  //
  const BOPTools_Pave& aPave12=aPB.Pave2();
  aT12=aPave12.Param();
  //
  aTM=IntTools_Tools::IntermediatePoint (aT11, aT12);
  //
  const IntTools_Curve& aIC=aPB.Curve();
  aIC.D0(aTM, aPM);
  //
  aBB.MakeVertex (aVM, aPM, aTolC);
  //
  iVM=myContext->ComputeVE(aVM, aE2, aTmp);
  //
  return iVM;
}
void NMTTools_PaveFiller::Clear ( ) [protected, virtual]

Reimplemented in NMTTools_CheckerSI.

Definition at line 62 of file NMTTools_PaveFiller.cxx.

{
  if (myDSIt) {
    delete myDSIt;
  }
  if (myDS) {
    delete myDS;
  }
  myDSIt=NULL;
  myDS=NULL;

  if (myIP) {
    delete myIP;
  }
  myIP=NULL;
}

Here is the caller graph for this function:

Definition at line 162 of file NMTTools_PaveFiller.cxx.

{
  return myCommonBlockPool;
}
Standard_Integer NMTTools_PaveFiller::CommonBlocksFace ( const Standard_Integer  nF,
NMTTools_ListOfCommonBlock aLCB 
)

Definition at line 144 of file NMTTools_PaveFiller_8.cxx.

{
  Standard_Integer nE;
  TopAbs_ShapeEnum aT;
  NMTTools_ListIteratorOfListOfCommonBlock anIt;
  //
  aT=myDS->GetShapeType(nF);
  //
  if (aT!=TopAbs_FACE) {
    return 1; // Type mismatch
  }
  //
  BooleanOperations_ShapesDataStructure *pDS=myDS;
  BooleanOperations_OnceExplorer aExp(*pDS);
  //
  aExp.Init(nF, TopAbs_EDGE);
  for (; aExp.More(); aExp.Next()) {
    nE=aExp.Current();
    const NMTTools_ListOfCommonBlock& aLCBE=myCommonBlockPool(myDS->RefEdge(nE));
    anIt.Initialize(aLCBE);
    for (; anIt.More(); anIt.Next()) {
      const NMTTools_CommonBlock& aCBE=anIt.Value();
      aLCB.Append(aCBE);
    }
  }
  return 0; //Ok
}

Here is the caller graph for this function:

const TopoDS_Shape & NMTTools_PaveFiller::CompositeShape ( ) const

Definition at line 90 of file NMTTools_PaveFiller.cxx.

{
  return myCompositeShape;
}
Standard_EXPORT const Handle_IntTools_Context& NMTTools_PaveFiller::Context ( ) const

Here is the caller graph for this function:

void NMTTools_PaveFiller::CorrectShrunkRanges ( const Standard_Integer  aSide,
const BOPTools_Pave &  aPave,
IntTools_ShrunkRange &  aSR 
) [protected]

Definition at line 1010 of file NMTTools_PaveFiller_4.cxx.

{
  BooleanOperations_KindOfInterference aType;
  Standard_Integer anIndexInterf ;
  //
  aType=aPave.Type();
  if (aType!=BooleanOperations_EdgeEdge) {
    return;
  }
  //
  anIndexInterf=aPave.Interference();
  if (anIndexInterf<0) {
    // it can be EE interf between E and (e1,e2,..en) -> vertex
    // so we can't decide which aEE.CommonPrt() we should take.
    return;
  }

  BOPTools_CArray1OfEEInterference& aEEs=myIP->EEInterferences();
  const BOPTools_EEInterference& aEE=aEEs(anIndexInterf);
  const IntTools_CommonPrt& aCP=aEE.CommonPrt();
  const TopoDS_Edge& aE1=aCP.Edge1();
  const TopoDS_Edge& aE2=aCP.Edge2();

  const IntTools_Range& aSR=aShrunkRange.ShrunkRange();
  const TopoDS_Edge& aE=aShrunkRange.Edge();

  IntTools_Range aNewRange;
  IntTools_Range aCPRange;

  if (aE1.IsSame(aE)) {
    const IntTools_Range& aR1=aCP.Range1();
    aCPRange=aR1;
  }
  if (aE2.IsSame(aE)) {
    const IntTools_SequenceOfRanges& aSeqR=aCP.Ranges2();
    const IntTools_Range& aR2=aSeqR(1);
     aCPRange=aR2;
  }
  //
  Standard_Real aCoeff=1.05, tV, tNV;
  tV=aPave.Param();
  if (aSide==0) { // Left
    if (aCPRange.Last() > aSR.First()) {
      tNV=aCPRange.Last();
      tNV=tV+aCoeff*(tNV-tV);
      aNewRange.SetFirst(tNV);
      aNewRange.SetLast (aSR.Last());
      if(aNewRange.First() < aNewRange.Last()) {
        aShrunkRange.SetShrunkRange(aNewRange);
      }
    }
  }
  else { // Right
    if (aCPRange.First() < aSR.Last()) {
      tNV=aCPRange.First();
      tNV=tV-aCoeff*(tV-tNV);
      aNewRange.SetFirst(aSR.First());
      aNewRange.SetLast (tNV);

      if(aNewRange.First() < aNewRange.Last()) {
        aShrunkRange.SetShrunkRange(aNewRange);
      }
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void NMTTools_PaveFiller::CorrectTolR3D ( const BOPTools_SSInterference &  aFF,
const TColStd_MapOfInteger &  aMVStick,
Standard_Real &  aTolR3D 
) [protected]

Definition at line 1449 of file NMTTools_PaveFiller_6.cxx.

{
  Standard_Boolean bHasBounds;
  Standard_Integer i, nF[2], nV, aNbCurves;
  Standard_Real aT1, aT2, aU, aV, aT, aA, aTolV, aTolVmax;
  Standard_Real aTolR, aTolTresh, aAmin, aAmax;
  TColStd_MapIteratorOfMapOfInteger aIt;
  gp_Pnt aP, aP1, aP2;
  gp_Dir aDN[2];
  gp_Vec aVT;
  Handle(Geom_Surface) aS[2];
  Handle(Geom_Curve) aC3D;
  GeomAdaptor_Surface aGAS;
  GeomAbs_SurfaceType aType;
  TopoDS_Face aF[2];
  //
  aTolTresh=0.0005;
  aAmin=0.012;// 0.7-7 deg
  aAmax=0.12;
  //
  if (!aMVStick.Extent()) {
    return;
  }
  //
  BOPTools_SSInterference& aFFi=*((BOPTools_SSInterference*)&aFF);
  BOPTools_SequenceOfCurves& aSCvs=aFFi.Curves();
  aNbCurves=aSCvs.Length();
  if (aNbCurves!=1){
    return;
  }
  //
  aFFi.Indices(nF[0], nF[1]);
  for (i=0; i<2; ++i) {
    aF[i]=*((TopoDS_Face*)(&myDS->Shape(nF[i])));
    aS[i]=BRep_Tool::Surface(aF[i]);
    aGAS.Load(aS[i]);
    aType=aGAS.GetType();
    if (aType!=GeomAbs_BSplineSurface) {
      return;
    }
  }
  //
  BOPTools_Curve& aBC=aSCvs(1);
  const IntTools_Curve& aIC=aBC.Curve();
  bHasBounds=aIC.HasBounds();
  if (!bHasBounds){
    return;
  }
  //
  aIC.Bounds (aT1, aT2, aP1, aP2);
  aT=IntTools_Tools::IntermediatePoint(aT1, aT2);
  aC3D=aIC.Curve();
  aC3D->D0(aT, aP);
  //
  for (i=0; i<2; ++i) {
    GeomAPI_ProjectPointOnSurf& aPPS=myContext->ProjPS(aF[i]);
    aPPS.Perform(aP);
    aPPS.LowerDistanceParameters(aU, aV);
    BOPTools_Tools3D::GetNormalToSurface(aS[i], aU, aV, aDN[i]);
  }
  //
  aA=aDN[0].Angle(aDN[1]);
  aA=fabs(aA);
  if (aA > 0.5*M_PI) {
    aA = M_PI - aA;
  }
  //
  if (aA<aAmin || aA>aAmax) {
    return;
  }
  //
  aTolVmax=-1.;
  aIt.Initialize(aMVStick);
  for (; aIt.More(); aIt.Next()) {
    nV=aIt.Key();
    const TopoDS_Vertex& aV=*((TopoDS_Vertex*)(&myDS->Shape(nV)));
    aTolV=BRep_Tool::Tolerance(aV);
    if (aTolV>aTolVmax) {
      aTolVmax=aTolV;
    }
  }
  //

  aTolR=aTolVmax/aA;
  if (aTolR<aTolTresh) {
    aTolR3D=aTolR;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 98 of file NMTTools_PaveFiller.cxx.

{
  return myDS;
}

Here is the caller graph for this function:

Definition at line 106 of file NMTTools_PaveFiller.cxx.

{
  return myDSIt;
}
void NMTTools_PaveFiller::EECommonBlocks ( const BOPTools_IDMapOfPaveBlockIMapOfPaveBlock &  aM) [protected]

Definition at line 503 of file NMTTools_PaveFiller_4.cxx.

{
  NMTTools_ListOfCommonBlock aLCB;
  //
  FindChains(aMapCB, aLCB);
  ReplaceCommonBlocks(aLCB);
}

Here is the call graph for this function:

void NMTTools_PaveFiller::EENewVertices ( const BooleanOperations_IndexedDataMapOfShapeInteger &  aM) [protected]

Definition at line 515 of file NMTTools_PaveFiller_4.cxx.

{
  Standard_Integer aNb, aNbVSD, nVnew, nIEE, nE[2], j, iFlag;
  Standard_Real aT;
  TopoDS_Edge aE;
  TopTools_DataMapOfShapeListOfShape myImages;
  TopTools_DataMapOfShapeShape myOrigins;
  TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItIm;
  TopTools_ListIteratorOfListOfShape aIt;
  BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
  TColStd_MapOfInteger aMFence;
  BOPTools_Pave aPave;
  //
  BOPTools_CArray1OfEEInterference& aEEs=myIP->EEInterferences();
  //
  aNb=aMapVI.Extent();
  if (!aNb) { // no new vertices, no new problems
    return;
  }
  //
  // 0.
  if (aNb==1) {
    TopoDS_Vertex aV1=TopoDS::Vertex(aMapVI.FindKey(1));
    EENewVertices(aV1, aMapVI);
    return;
  }
  //
  // 1.
  TreatNewVertices(aMapVI, myImages, myOrigins);
  //
  aItIm.Initialize(myImages);
  for (; aItIm.More(); aItIm.Next()) {
    const TopoDS_Vertex& aVnew=TopoDS::Vertex(aItIm.Key());
    const TopTools_ListOfShape& aLVSD=aItIm.Value();
    //
    aNbVSD=aLVSD.Extent();
    if (aNbVSD==1) {// simple case aVnew=aVold
      EENewVertices(aVnew, aMapVI);
      continue;
    }
    //
    // aNbVSD>1
    myDS->InsertShapeAndAncestorsSuccessors(aVnew, anASSeq);
    nVnew=myDS->NumberOfInsertedShapes();
    myDS->SetState(nVnew, BooleanOperations_ON);
    //
    aMFence.Clear();
    aIt.Initialize(aLVSD);
    for (; aIt.More(); aIt.Next()) {
      const TopoDS_Vertex& aVold=TopoDS::Vertex(aIt.Value());
      nIEE=aMapVI.FindFromKey(aVold);
      BOPTools_EEInterference& aEE=aEEs(nIEE);
      aEE.Indices(nE[0], nE[1]);
      aEE.SetNewShape(nVnew);
      //
      for (j=0; j<2; ++j) {
        if (aMFence.Add(nE[j])) {
          aE=TopoDS::Edge(myDS->Shape(nE[j]));
          iFlag=myContext->ComputeVE (aVnew, aE, aT);
          if (!iFlag) {
            aPave.SetInterference(-1);
            aPave.SetType (BooleanOperations_EdgeEdge);
            aPave.SetIndex(nVnew);
            aPave.SetParam(aT);
            //
            BOPTools_PaveSet& aPaveSet=myPavePoolNew(myDS->RefEdge(nE[j]));
            aPaveSet.Append(aPave);
          }
        }// if (aMFence.Add(nE[j])) {
      }// for (j=0; j<2; ++j) {
    }//for (; aIt.More(); aIt.Next()) {
  }// for (; aItIm.More(); aItIm.Next())
}

Here is the call graph for this function:

Here is the caller graph for this function:

void NMTTools_PaveFiller::EENewVertices ( const TopoDS_Vertex &  aV,
const BooleanOperations_IndexedDataMapOfShapeInteger &  aM 
) [protected]

Definition at line 820 of file NMTTools_PaveFiller_4.cxx.

{
  Standard_Integer  i, aNewShape, nE1, nE2;
  Standard_Real  aT1, aT2;
  BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
  BOPTools_Pave aPave;
  //
  BOPTools_CArray1OfEEInterference& aEEs=myIP->EEInterferences();
  //
  // one new vertex case is treated in usual way
  //
  // Insert New Vertex in DS;
  myDS->InsertShapeAndAncestorsSuccessors(aNewVertex, anASSeq);
  aNewShape=myDS->NumberOfInsertedShapes();
  myDS->SetState (aNewShape, BooleanOperations_ON);
  // Insert New Vertex in EE Interference
  i=aMapVI.FindFromKey(aNewVertex);
  BOPTools_EEInterference& aEEInterf= aEEs(i);
  aEEInterf.SetNewShape(aNewShape);
  // Extact interference info
  aEEInterf.Indices(nE1, nE2);
  const IntTools_CommonPrt& aCPart=aEEInterf.CommonPrt();
  VertexParameters(aCPart, aT1, aT2);
  //
  // Add Paves to the myPavePoolNew
  aPave.SetInterference(i);
  aPave.SetType (BooleanOperations_EdgeEdge);
  aPave.SetIndex(aNewShape);
  // Pave for edge nE1
  aPave.SetParam(aT1);
  BOPTools_PaveSet& aPaveSet1=myPavePoolNew(myDS->RefEdge(nE1));
  aPaveSet1.Append(aPave);
  // Pave for edge nE2
  aPave.SetParam(aT2);
  BOPTools_PaveSet& aPaveSet2=myPavePoolNew(myDS->RefEdge(nE2));
  aPaveSet2.Append(aPave);
}

Here is the call graph for this function:

void NMTTools_PaveFiller::EFCommonBlocks ( const BOPTools_IDMapOfPaveBlockIMapOfInteger &  aMapCB) [protected]

Definition at line 339 of file NMTTools_PaveFiller_5.cxx.

{
  Standard_Integer i, aNbPB, nE, j, aNbF, nF;
  //
  aNbPB=aMapCB.Extent();
  for (i=1; i<=aNbPB; ++i) {
    const BOPTools_PaveBlock& aPB=aMapCB.FindKey(i);
    const TColStd_IndexedMapOfInteger& aMapF=aMapCB.FindFromIndex(i);
    aNbF=aMapF.Extent();
    //
    nE=aPB.OriginalEdge();
    //
    NMTTools_ListOfCommonBlock& aLCB=myCommonBlockPool(myDS->RefEdge(nE));
    //
    NMTTools_CommonBlockAPI aCBAPI(aLCB);
    if (aCBAPI.IsCommonBlock(aPB)) {
      NMTTools_CommonBlock& aCB=aCBAPI.CommonBlock(aPB);
      for (j=1; j<=aNbF; ++j) {
        nF=aMapF(j);
        aCB.AddFace(nF);
      }
    }
    else {
      NMTTools_CommonBlock aCB;
      //
      aCB.AddPaveBlock(aPB);
      for (j=1; j<=aNbF; ++j) {
        nF=aMapF(j);
        aCB.AddFace(nF);
      }
      aLCB.Append(aCB);
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void NMTTools_PaveFiller::EFNewVertices ( const BooleanOperations_IndexedDataMapOfShapeInteger &  aM) [protected]

Definition at line 378 of file NMTTools_PaveFiller_5.cxx.

{
  Standard_Integer i, j, aNb, aNewShape, aFlag, iX, aNbVV, aNbSimple;
  Standard_Integer aWhat, aWith, nE, nF, nV, aNbIEF, aNbEdges, iTmp;
  Standard_Real aT;
  TopoDS_Compound aCompound;
  TopoDS_Vertex aNewVertex;
  BRep_Builder aBB;
  BOPTools_Pave aPave;
  NMTTools_IndexedDataMapOfIndexedMapOfInteger aMNVE, aMNVIEF;
  BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
  TopTools_IndexedMapOfShape aMNVComplex, aMNVSimple;
  //
  aNb=aMapVI.Extent();
  if (!aNb) { // no new vertices, no new problems
    return;
  }
  //
  BOPTools_CArray1OfESInterference& aEFs=myIP->ESInterferences();
  //
  // 0.
  if (aNb==1) {
    aNewVertex=TopoDS::Vertex(aMapVI.FindKey(1));
    EFNewVertices(aNewVertex, aMapVI);
    return;
  }
  //
  // 1. Make compound from new vertices
  aBB.MakeCompound(aCompound);
  for (i=1; i<=aNb; ++i) {
    const TopoDS_Shape& aV=aMapVI.FindKey(i);
    aBB.Add(aCompound, aV);
  }
  //
  // 2. VV intersection between these vertices
  //       using the auxiliary Filler
  NMTTools_PaveFiller tPF;
  //
  tPF.SetCompositeShape(aCompound);
  //
  tPF.Init();
  tPF.PerformVV();
  //
  NMTDS_ShapesDataStructure& tDS=*(tPF.DS());
  NMTDS_InterfPool& tInterfPool=*(tPF.IP());
  BOPTools_CArray1OfVVInterference& aVVInterfs=tInterfPool.VVInterferences();
  //
  // 3. Separate Comlex and Simple new vertices
  aNbVV=aVVInterfs.Extent();
   for (i=1; i<=aNbVV; ++i) {
    const BOPTools_VVInterference& aVV=aVVInterfs(i);
    aVV.Indices(aWhat, aWith);
    const TopoDS_Shape& aV1=tDS.Shape(aWhat);
    const TopoDS_Shape& aV2=tDS.Shape(aWith);
    aMNVComplex.Add(aV1);
    aMNVComplex.Add(aV2);
  }
  //
  for (i=1; i<=aNb; ++i) {
    const TopoDS_Shape& aV=aMapVI.FindKey(i);
    if (!aMNVComplex.Contains(aV)) {
      aMNVSimple.Add(aV);
    }
  }
  //
  // 4. Treat Simple new Vertices
  aNbSimple=aMNVSimple.Extent();
  for (i=1; i<=aNbSimple; ++i) {
    const TopoDS_Vertex& aV=TopoDS::Vertex(aMNVSimple(i));
    EFNewVertices(aV, aMapVI);
  }
  //
  // 3. Fill Maps : NewVertex-edges (aMNVE)
  //                NewVertex-interferences (aMNVIEE)
  aNb=aVVInterfs.Extent();
  for (i=1; i<=aNb; ++i) {
    const BOPTools_VVInterference& aVV=aVVInterfs(i);
    aNewShape=aVV.NewShape();
    if (!aNewShape) {
      continue;
    }
    //
    if (!aMNVE.Contains(aNewShape)) {
      TColStd_IndexedMapOfInteger aMx;
      aMNVE.Add(aNewShape, aMx);
    }
    if (!aMNVIEF.Contains(aNewShape)) {
      TColStd_IndexedMapOfInteger aMx;
      aMNVIEF.Add(aNewShape, aMx);
    }
    //
    TColStd_IndexedMapOfInteger& aME=aMNVE.ChangeFromKey(aNewShape);
    TColStd_IndexedMapOfInteger& aMIEF=aMNVIEF.ChangeFromKey(aNewShape);
    //
    aVV.Indices(aWhat, aWith);
    //aWhat
    const TopoDS_Shape& aV1=tDS.Shape(aWhat);
    iX=aMapVI.FindFromKey(aV1);
    const BOPTools_ESInterference& aEF1=aEFs(iX);
    aEF1.Indices(nE, nF);
    //
    if (myDS->GetShapeType(nF)==TopAbs_EDGE) {
      iTmp=nE;
      nE=nF;
      nF=iTmp;
    }
    aME.Add(nE);
    aMIEF.Add(iX);
    //aWith
    const TopoDS_Shape& aV2=tDS.Shape(aWith);
    iX=aMapVI.FindFromKey(aV2);
    const BOPTools_ESInterference& aEF2=aEFs(iX);
    aEF2.Indices(nE, nF);
    //
    if (myDS->GetShapeType(nF)==TopAbs_EDGE) {
      iTmp=nE;
      nE=nF;
      nF=iTmp;
    }
    aME.Add(nE);
    aMIEF.Add(iX);
  }// for (i=1; i<=aNb; ++i) {
  //
  // 4. Process new vertices
  aNb=aMNVE.Extent();
  for (i=1; i<=aNb; ++i) { // xx
    //
    //  new Vertex
    nV=aMNVE.FindKey(i);
    aNewVertex=TopoDS::Vertex(tDS.Shape(nV));
    //
    // Insert New Vertex in DS;
    myDS->InsertShapeAndAncestorsSuccessors(aNewVertex, anASSeq);
    aNewShape=myDS->NumberOfInsertedShapes();
    myDS->SetState (aNewShape, BooleanOperations_ON);
    //
    // Update index of NewShape in EF interferences
    const TColStd_IndexedMapOfInteger& aMIEF=aMNVIEF.FindFromKey(nV);
    aNbIEF=aMIEF.Extent();
    for (j=1; j<=aNbIEF; ++j) {
      iX=aMIEF(j);
      BOPTools_ESInterference& aEF=aEFs(iX);
      aEF.SetNewShape(aNewShape);
    }
    //
    // Update Paves on all edges
    const TColStd_IndexedMapOfInteger& aME=aMNVE(i);
    aNbEdges=aME.Extent();
    for (j=1; j<=aNbEdges; ++j) {
      nE=aME(j);
      const TopoDS_Edge aE=TopoDS::Edge(myDS->Shape(nE));//mpv
      //
      aFlag=myContext->ComputeVE (aNewVertex, aE, aT);
      //
      if (!aFlag) {
        aPave.SetInterference(-1);
        aPave.SetType (BooleanOperations_EdgeSurface);
        aPave.SetIndex(aNewShape);
        aPave.SetParam(aT);
        //
        BOPTools_PaveSet& aPaveSet=myPavePoolNew(myDS->RefEdge(nE));
        aPaveSet.Append(aPave);
      }
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void NMTTools_PaveFiller::EFNewVertices ( const TopoDS_Vertex &  aV,
const BooleanOperations_IndexedDataMapOfShapeInteger &  aM 
) [protected]

Definition at line 549 of file NMTTools_PaveFiller_5.cxx.

{
  Standard_Integer i, aNewShape, nE, nF;
  Standard_Real aT;
  BOPTools_Pave aPave;
  BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
  //
  BOPTools_CArray1OfESInterference& aEFs=myIP->ESInterferences();
  //
  // Insert New Vertex in DS;
  myDS->InsertShapeAndAncestorsSuccessors(aNewVertex, anASSeq);
  aNewShape=myDS->NumberOfInsertedShapes();
  myDS->SetState (aNewShape, BooleanOperations_ON);
  //
  // Insert New Vertex in EFInterference
  i=aMapVI.FindFromKey(aNewVertex);
  BOPTools_ESInterference& aEFInterf= aEFs(i);
  aEFInterf.SetNewShape(aNewShape);
  // Extract interference info
  aEFInterf.Indices(nE, nF);
  if (myDS->GetShapeType(nF)==TopAbs_EDGE) {
    nE=nF;
  }
  const IntTools_CommonPrt& aCPart=aEFInterf.CommonPrt();
  VertexParameter(aCPart, aT);
  //
  // Pave for edge nE
  aPave.SetInterference(i);
  aPave.SetType (BooleanOperations_EdgeSurface);
  aPave.SetIndex(aNewShape);
  aPave.SetParam(aT);
  // Append the Pave to the myPavePoolNew
  BOPTools_PaveSet& aPaveSet=myPavePoolNew(myDS->RefEdge(nE));
  aPaveSet.Append(aPave);
  //
}

Here is the call graph for this function:

void NMTTools_PaveFiller::FillFaceInfo ( ) [protected]

Definition at line 1294 of file NMTTools_PaveFiller_6.cxx.

{
  Standard_Integer i, aNbS, aNbFFs, nF, aNbVFs, aNbEFs, j, n1, n2, nX, aNbF;
  TopAbs_ShapeEnum aType;
  TopoDS_Shape aS;
  TColStd_ListIteratorOfListOfInteger aItF;
  BOPTools_ListIteratorOfListOfPaveBlock anItPB;
  NMTTools_DataMapIteratorOfDataMapOfIntegerFaceInfo aItMFI;
  NMTTools_ListIteratorOfListOfCommonBlock aItCB;
  //
  myFaceInfo.Clear();
  //
  BOPTools_CArray1OfSSInterference& aFFs=myIP->SSInterferences();
  BOPTools_CArray1OfVSInterference& aVFs=myIP->VSInterferences();
  BOPTools_CArray1OfESInterference& aEFs=myIP->ESInterferences();
  //
  aNbFFs=aFFs.Extent();
  if (!aNbFFs) {
    return;
  }
  //
  // 0.
  for (i=1; i<=aNbFFs; ++i) {
    NMTTools_FaceInfo aFI;
    //
    BOPTools_SSInterference& aFFi=aFFs(i);
    aFFi.Indices(n1, n2);
    myFaceInfo.Bind(n1, aFI);
    myFaceInfo.Bind(n2, aFI);
  }
  //
  // 1.
  aNbS=myDS->NumberOfShapesOfTheObject();
  for (i=1; i<=aNbS; ++i) {
    aS=myDS->Shape(i);
    aType=aS.ShapeType();
    if (aType==TopAbs_EDGE) {
      const NMTTools_ListOfCommonBlock& aLCB=myCommonBlockPool(myDS->RefEdge(i));
      aItCB.Initialize(aLCB);
      for (; aItCB.More(); aItCB.Next()) {
       const NMTTools_CommonBlock& aCB=aItCB.Value();
       const BOPTools_PaveBlock &aPB1=aCB.PaveBlock1();
       const TColStd_ListOfInteger& aLF=aCB.Faces();
       aNbF=aLF.Extent();
       if (!aNbF) {
         continue;
       }
       //
       aItF.Initialize(aLF);
       for (; aItF.More(); aItF.Next()) {
         nF=aItF.Value();
         if (!myFaceInfo.IsBound(nF)) {
           continue;
         }
         //
         NMTTools_FaceInfo& aFI=myFaceInfo.ChangeFind(nF);
         aFI.ChangePaveBlocksIn().Add(aPB1);
         //
         n1=aPB1.Pave1().Index();
         n2=aPB1.Pave2().Index();
         aFI.ChangeVerticesIn().Add(n1);
         aFI.ChangeVerticesIn().Add(n2);
       }
      }
    }// if (aType==TopAbs_EDGE) {
    else if (aType==TopAbs_FACE) {
      if (!myFaceInfo.IsBound(i)) {
       continue;
      }
      //
      BOPTools_ListOfPaveBlock aLPBOn;
      //
      nF=i;
      NMTTools_FaceInfo& aFI=myFaceInfo.ChangeFind(nF);
      //
      RealSplitsFace(nF, aLPBOn);
      //
      anItPB.Initialize(aLPBOn);
      for (; anItPB.More(); anItPB.Next()) {
       const BOPTools_PaveBlock &aPB=anItPB.Value();
       aFI.ChangePaveBlocksOn().Add(aPB);
       //
       n1=aPB.Pave1().Index();
       n2=aPB.Pave2().Index();
       aFI.ChangeVerticesOn().Add(n1);
       aFI.ChangeVerticesOn().Add(n2);
      }
      //
    }// else if (aType==TopAbs_FACE) {
  }// for (i=1; i<=aNbS; ++i) {
  //
  // 2.
  aItMFI.Initialize(myFaceInfo);
  for (; aItMFI.More(); aItMFI.Next()) {
    nF=aItMFI.Key();
    NMTTools_FaceInfo& aFI=*((NMTTools_FaceInfo*)&aItMFI.Value());
    //
    aFI.SetIndex(nF);
    //
    //
    // 2.1 aVFs
    aNbVFs=aVFs.Extent();
    for (j=1; j<=aNbVFs; ++j) {
      BOPTools_VSInterference& aVFj=aVFs(j);
      aVFj.Indices(n1, n2);
      if (nF==n1) {
       aFI.ChangeVerticesIn().Add(n2);
      }
      else if (nF==n2){
       aFI.ChangeVerticesIn().Add(n1);
      }
    }//  for (j=1; j<=aNbVFs; ++j) {
    //
    // 2.2 aEFs
    aNbEFs=aEFs.Extent();
    for (j=1; j<=aNbEFs; ++j) {
      BOPTools_ESInterference& aEFj=aEFs(j);
      aEFj.Indices(n1, n2);
      if (!(nF==n1 || nF==n2)) {
       continue;
      }
      //
      nX=aEFj.NewShape();
      if (nX<1) {
       continue;
      }
      //
      aS=myDS->Shape(nX);
      aType=aS.ShapeType();
      if (aType!=TopAbs_VERTEX) {
       continue;
      }
      //
      aFI.ChangeVerticesIn().Add(nX);
    }//  for (j=1; j<=aNbEFs; ++j) {
  }// for (; aItMFI.More(); aItMFI.Next()) {
}

Here is the call graph for this function:

Here is the caller graph for this function:

Standard_Boolean NMTTools_PaveFiller::FindPave ( const gp_Pnt &  aP,
const Standard_Real  aTpV,
const BOPTools_PaveSet &  aPS,
BOPTools_Pave &  aPV 
)

Definition at line 1041 of file NMTTools_PaveFiller_6.cxx.

{
  Standard_Integer nV;
  Standard_Boolean bIsVertex=Standard_False;

  const BOPTools_ListOfPave& aLP=aPS.Set();
  BOPTools_ListIteratorOfListOfPave anIt(aLP);
  for (; anIt.More(); anIt.Next()) {
    const BOPTools_Pave& aPC=anIt.Value();
    nV=aPC.Index();
    const TopoDS_Vertex aV=TopoDS::Vertex(myDS->Shape(nV));//mpv
    bIsVertex=IntTools_Tools::IsVertex (aP, aTolPV, aV);
    if (bIsVertex) {
      aPave=aPC;
      return bIsVertex;
    }
  }
  return bIsVertex;
}

Here is the caller graph for this function:

Standard_Integer NMTTools_PaveFiller::FindSDVertex ( const Standard_Integer  nV) const

Definition at line 145 of file NMTTools_PaveFiller_1.cxx.

{
  Standard_Integer nVSD;
  //
  nVSD=0;
  if (myVSD.IsBound(nV)) {
    nVSD=myVSD.Find(nV);
  }
  return nVSD;
}

Here is the caller graph for this function:

void NMTTools_PaveFiller::FuseVertices ( const TopoDS_Shape &  aC,
TopTools_DataMapOfShapeShape &  aDMVV 
) const

Definition at line 788 of file NMTTools_PaveFiller_7.cxx.

{
  Standard_Integer i, aNbVV, n1, n2, nX;
  NMTTools_PaveFiller tPF;
  //
  tPF.SetCompositeShape(aCompound);
  //
  tPF.Init();
  //
  tPF.PerformVV();
  //tPF.PerformNewVertices(); //qq
  //
  NMTDS_ShapesDataStructure& tDS=*(tPF.DS());
  NMTDS_InterfPool& tInterfPool=*(tPF.IP());
  BOPTools_CArray1OfVVInterference& aVVt=tInterfPool.VVInterferences();
  //
  aNbVV=aVVt.Extent();
  for (i=1; i<=aNbVV; ++i) {
    const BOPTools_VVInterference& aVV=aVVt(i);
    aVV.Indices(n1, n2);
    nX=aVV.NewShape();
    if (nX) {
      const TopoDS_Shape& aV1=tDS.Shape(n1);
      const TopoDS_Shape& aV2=tDS.Shape(n2);
      const TopoDS_Shape& aVx=tDS.Shape(nX);
      aDMVV.Bind(aV1, aVx);
      aDMVV.Bind(aV2, aVx);
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Standard_Boolean NMTTools_PaveFiller::HasRealSplitsInOnFace ( const Standard_Integer  nF1,
const Standard_Integer  nF2 
)

Definition at line 205 of file NMTTools_PaveFiller_8.cxx.

{
  Standard_Boolean bFlag;
  BOPTools_ListOfPaveBlock aLPB;
  //
  RealSplitsInFace(0, nF1, nF2, aLPB);
  //
  bFlag=!aLPB.IsEmpty();
  if (bFlag) {
    return bFlag;
  }
  //
  RealSplitsInFace(0, nF1, nF2, aLPB);
  //
  bFlag=!aLPB.IsEmpty();
  return bFlag;
}

Here is the call graph for this function:

void NMTTools_PaveFiller::Init ( ) [protected, virtual]

Reimplemented in NMTTools_CheckerSI.

Definition at line 194 of file NMTTools_PaveFiller.cxx.

{
  myIsDone=Standard_False;
  if (myCompositeShape.IsNull()) {
    return;
  }
  //
  Clear();
  // 1.
  myDS=new NMTDS_ShapesDataStructure;
  myDS->SetCompositeShape(myCompositeShape);
  myDS->Init();
  //
  // 2.
  myDSIt=new NMTDS_Iterator;
  myDSIt->SetDS(myDS);
  myDSIt->Prepare();
  //
  // 3.
  myNbSources=myDS->NumberOfShapesOfTheObject()+
              myDS->NumberOfShapesOfTheTool();
  myNbEdges=myDS->NbEdges();
  //
  // 4
  myIP=new NMTDS_InterfPool;
  //
  // 5
  myContext=new IntTools_Context;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 114 of file NMTTools_PaveFiller.cxx.

{
  return myIP;
}

Here is the caller graph for this function:

Standard_Boolean NMTTools_PaveFiller::IsBlocksCoinside ( const BOPTools_PaveBlock &  aPB1,
const BOPTools_PaveBlock &  aPB2 
) const [protected]

Definition at line 1082 of file NMTTools_PaveFiller_4.cxx.

{
  Standard_Boolean bRetFlag=Standard_True;
  Standard_Real aTolV11, aTolV12, aTolV21, aTolV22;
  Standard_Real d1121, d1122, d1222, d1221, aTolSum, aCoeff=1.05;
  gp_Pnt aP11, aP12, aP21, aP22;

  const TopoDS_Vertex aV11=TopoDS::Vertex(myDS->Shape(aPB1.Pave1().Index()));//mpv
  const TopoDS_Vertex aV12=TopoDS::Vertex(myDS->Shape(aPB1.Pave2().Index()));//mpv
  const TopoDS_Vertex aV21=TopoDS::Vertex(myDS->Shape(aPB2.Pave1().Index()));//mpv
  const TopoDS_Vertex aV22=TopoDS::Vertex(myDS->Shape(aPB2.Pave2().Index()));//mpv

  aTolV11=BRep_Tool::Tolerance(aV11);
  aTolV12=BRep_Tool::Tolerance(aV12);
  aTolV21=BRep_Tool::Tolerance(aV21);
  aTolV22=BRep_Tool::Tolerance(aV22);

  aP11=BRep_Tool::Pnt(aV11);
  aP12=BRep_Tool::Pnt(aV12);
  aP21=BRep_Tool::Pnt(aV21);
  aP22=BRep_Tool::Pnt(aV22);

  d1121=aP11.Distance(aP21);
  aTolSum=aCoeff*(aTolV11+aTolV21);
  if (d1121<aTolSum) {
    d1222=aP12.Distance(aP22);
    aTolSum=aCoeff*(aTolV12+aTolV22);
    if (d1222<aTolSum) {
      return bRetFlag;
    }
  }
  //
  d1122=aP11.Distance(aP22);
  aTolSum=aCoeff*(aTolV11+aTolV22);
  if (d1122<aTolSum) {
    d1221=aP12.Distance(aP21);
    aTolSum=aCoeff*(aTolV12+aTolV21);
    if (d1221<aTolSum) {
      return bRetFlag;
    }
  }
  return !bRetFlag;
}

Here is the caller graph for this function:

Standard_Boolean NMTTools_PaveFiller::IsDone ( ) const

Definition at line 122 of file NMTTools_PaveFiller.cxx.

{
  return myIsDone;
}

Here is the caller graph for this function:

Standard_Boolean NMTTools_PaveFiller::IsExistingPaveBlock ( const BOPTools_PaveBlock &  aPB,
const BOPTools_ListOfPaveBlock &  aLPB,
const Standard_Real  aTol 
)

Definition at line 825 of file NMTTools_PaveFiller_6.cxx.

{
  Standard_Boolean bFlag;
  Standard_Integer nVNew1, nVNew2, nV1, nV2, iC;
  BOPTools_ListIteratorOfListOfPaveBlock anIt;
  //
  bFlag=Standard_False;
  nVNew1=aPBNew.Pave1().Index();
  nVNew2=aPBNew.Pave2().Index();
  //
  anIt.Initialize(aLPBR);
  for (; anIt.More(); anIt.Next()) {
    const BOPTools_PaveBlock& aPBR=anIt.Value();
    nV1=aPBR.Pave1().Index();
    nV2=aPBR.Pave2().Index();
    if (nVNew1==nV1 || nVNew1==nV2 || nVNew2==nV1 || nVNew2==nV2) {
      //
      iC=CheckIntermediatePoint(aPBNew, aPBR, aTolR3D);
      if (!iC) {
        return !bFlag;
      }
    }
  }
  return bFlag;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Standard_Boolean NMTTools_PaveFiller::IsExistingPaveBlock ( const BOPTools_PaveBlock &  aPB,
const TopTools_ListOfShape &  aLPB,
const Standard_Real  aTol 
)

Definition at line 857 of file NMTTools_PaveFiller_6.cxx.

{
  Standard_Boolean bFlag;
  Standard_Integer aNbSE, iC;
  Standard_Real aTolE, aTol;
  TopTools_ListIteratorOfListOfShape anIt;
  //
  bFlag=Standard_False;
  //
  aNbSE=aLSE.Extent();
  if (!aNbSE) {
    return bFlag;
  }
  //
  anIt.Initialize(aLSE);
  for (; anIt.More(); anIt.Next()) {
    const TopoDS_Edge& aE=TopoDS::Edge(anIt.Value());
    aTolE=BRep_Tool::Tolerance(aE);
    aTol=aTolR3D;
    if (aTolE>aTol) {
      aTol=aTolE;
    }
    iC=CheckIntermediatePoint(aPBNew, aE, aTol);
    if (!iC) {
      return !bFlag;
    }
  }
  return bFlag;
}

Here is the call graph for this function:

Standard_Boolean NMTTools_PaveFiller::IsSuccessorsComputed ( const Standard_Integer  iF1,
const Standard_Integer  iF2 
) const [protected]

Definition at line 41 of file NMTTools_PaveFiller_0.cxx.

{
  Standard_Boolean bComputed;
  Standard_Integer i, nSuc, n1, n2, ntmp, aNbS;
  TopAbs_ShapeEnum aType;
  TColStd_IndexedMapOfInteger aMSuc;
  //
  n1=aN1;
  n2=aN2;
  aType=myDS->GetShapeType(aN1);
  if (aType!=TopAbs_VERTEX) {
    ntmp=n1;
    n1=n2;
    n2=ntmp;
  }
  //
  myDS->GetAllSuccessors(n2, aMSuc);
  aNbS=aMSuc.Extent();
  for (i=1; i<=aNbS; ++i) {
    nSuc=aMSuc(i);
    bComputed=myIP->Contains(n1, nSuc);
    if (bComputed) {
      break;
    }
  }
  return bComputed;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 534 of file NMTTools_PaveFiller_7.cxx.

{
  Standard_Integer i, aNbFFs, nF1, nF2, j, aNbPnts, nFx, aNbV;
  Standard_Real aTolF1, aTolF2, aTolSum, aTolV;
  TColStd_ListIteratorOfListOfInteger aIt;
  TColStd_ListOfInteger aLI;
  TopoDS_Vertex aV;
  TopoDS_Compound aCompound;
  BRep_Builder aBB;
  TopTools_DataMapOfShapeListOfInteger aDMVFF, aDMVFF1;
  TopTools_DataMapIteratorOfDataMapOfShapeListOfInteger aItDMVFF;
  TopTools_DataMapOfShapeShape aDMVV;
  TopTools_DataMapOfIntegerShape aDMIV;
  TopTools_DataMapOfShapeInteger aDMVI;
  TopTools_DataMapIteratorOfDataMapOfShapeInteger aItDMVI;
  TopTools_DataMapIteratorOfDataMapOfIntegerShape aItDMIV;
  //
  aBB.MakeCompound(aCompound);
  //
  myAloneVertices.Clear();
  //
  BOPTools_CArray1OfSSInterference& aFFs=myIP->SSInterferences();
  //
  // 1. Collect alone vertices from FFs
  aNbV=0;
  aNbFFs=aFFs.Extent();
  for (i=1; i<=aNbFFs; ++i) {
    BOPTools_SSInterference& aFFi=aFFs(i);
    aFFi.Indices(nF1, nF2);
    //
    const TopoDS_Face aF1=TopoDS::Face(myDS->Shape(nF1));//mpv
    const TopoDS_Face aF2=TopoDS::Face(myDS->Shape(nF2));//mpv
    //
    aTolF1=BRep_Tool::Tolerance(aF1);
    aTolF2=BRep_Tool::Tolerance(aF2);
    aTolSum=aTolF1+aTolF2;
    //
    aLI.Clear();
    aLI.Append(nF1);
    aLI.Append(nF2);
    //
    const IntTools_SequenceOfPntOn2Faces& aSeqAlonePnts=aFFi.AlonePnts();
    aNbPnts=aSeqAlonePnts.Length();
    for (j=1; j<=aNbPnts; ++j) {
      const gp_Pnt& aP=aSeqAlonePnts(j).P1().Pnt();
      BOPTools_Tools::MakeNewVertex(aP, aTolSum, aV);
      aDMVFF.Bind(aV, aLI);
      aBB.Add(aCompound, aV);
      ++aNbV;
    }
  }
  if (!aNbV) {
    return;
  }
  //
  // 2. Try to fuse alone vertices themselves;
  FuseVertices(aCompound, aDMVV);
  //
  // if some are fused, replace them by new ones
  aItDMVFF.Initialize(aDMVFF);
  for (;  aItDMVFF.More(); aItDMVFF.Next()) {
    const TopoDS_Shape& aVx=aItDMVFF.Key();
    const TColStd_ListOfInteger& aLIx=aItDMVFF.Value();
    //
    if (!aDMVV.IsBound(aVx)) {
      aDMVFF1.Bind(aVx, aLIx);
    }
    else {
      const TopoDS_Shape& aVy=aDMVV.Find(aVx);

      if (aDMVFF1.IsBound(aVy)) {
        TColStd_ListOfInteger& aLIy=aDMVFF1.ChangeFind(aVy);
        aIt.Initialize(aLIx);
        for(; aIt.More(); aIt.Next()) {
          nFx=aIt.Value();
          aLIy.Append(nFx);
        }
      }
      else {
        aDMVFF1.Bind(aVy, aLIx);
      }
    }
  }
  aDMVFF.Clear();
  //
  // refine lists of faces in aDMVFF1;
  aItDMVFF.Initialize(aDMVFF1);
  for (;  aItDMVFF.More(); aItDMVFF.Next()) {
    TColStd_MapOfInteger aMIy;
    TColStd_ListOfInteger aLIy;
    //
    const TopoDS_Shape& aVx=aItDMVFF.Key();
    TColStd_ListOfInteger& aLIx=aDMVFF1.ChangeFind(aVx);
    aIt.Initialize(aLIx);
    for(; aIt.More(); aIt.Next()) {
      nFx=aIt.Value();
      if (aMIy.Add(nFx)) {
        aLIy.Append(nFx);
      }
    }
    aLIx.Clear();
    aLIx.Append(aLIy);
  }
  //==================================
  //
  // 3. Collect vertices from DS
  Standard_Integer aNbS, nV, nVSD, aNbVDS, i1, i2, aNbVSD;
  //
  aNbS=myDS->NumberOfShapesOfTheObject();
  // old shapes
  for (i=1; i<=aNbS; ++i) {
    const TopoDS_Shape& aS=myDS->Shape(i);
    if (aS.ShapeType() != TopAbs_VERTEX){
      continue;
    }
    //
    nVSD=FindSDVertex(i);
    nV=(nVSD) ? nVSD : i;
    const TopoDS_Shape& aVx=myDS->Shape(nV);
    if (!aDMVI.IsBound(aVx)) {
      aDMVI.Bind(aVx, nV);
    }
  }
  // new shapes
  i1=myDS->NumberOfSourceShapes()+1;
  i2=myDS->NumberOfInsertedShapes();
  for (i=i1; i<=i2; ++i) {
    const TopoDS_Shape aS=myDS->Shape(i);//mpv
    if (aS.ShapeType() != TopAbs_VERTEX){
      continue;
    }
    if (!aDMVI.IsBound(aS)) {
      aDMVI.Bind(aS, i);
    }
  }
  //
  // 4. Initialize BoundSortBox on aDMVI
  //
  Handle(Bnd_HArray1OfBox) aHAB;
  Bnd_BoundSortBox aBSB;
  //
  aNbVDS=aDMVI.Extent();
  aHAB=new Bnd_HArray1OfBox(1, aNbVDS);
  //
  aItDMVI.Initialize(aDMVI);
  for (i=1; aItDMVI.More(); aItDMVI.Next(), ++i) {
    Bnd_Box aBox;
    //
    nV=aItDMVI.Value();
    aV=TopoDS::Vertex(aItDMVI.Key());
    aTolV=BRep_Tool::Tolerance(aV);
    aBox.SetGap(aTolV);
    BRepBndLib::Add(aV, aBox);
    aHAB->SetValue(i, aBox);
    //
    aDMIV.Bind(i, aV);
  }
  aBSB.Initialize(aHAB);
  //
  // 5. Compare
  aItDMVFF.Initialize(aDMVFF1);
  for (;  aItDMVFF.More(); aItDMVFF.Next()) {
    Bnd_Box aBoxV;
    //
    const TColStd_ListOfInteger& aLIFF=aItDMVFF.Value();
    aV=TopoDS::Vertex(aItDMVFF.Key());
    //
    aTolV=BRep_Tool::Tolerance(aV);
    aBoxV.SetGap(aTolV);
    BRepBndLib::Add(aV, aBoxV);
    //
    const TColStd_ListOfInteger& aLIVSD=aBSB.Compare(aBoxV);
    aNbVSD=aLIVSD.Extent();
    if (aNbVSD==0) {
      // add new vertex in DS and update map myAloneVertices
      BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
      //
      myDS->InsertShapeAndAncestorsSuccessors(aV, anASSeq);
      nV=myDS->NumberOfInsertedShapes();
      //
      aIt.Initialize(aLIFF);
      for (; aIt.More(); aIt.Next()) {
        nFx=aIt.Value();
        if (myAloneVertices.Contains(nFx)) {
          TColStd_IndexedMapOfInteger& aMVx=myAloneVertices.ChangeFromKey(nFx);
          aMVx.Add(nV);
        }
        else {
          TColStd_IndexedMapOfInteger aMVx;
          aMVx.Add(nV);
          myAloneVertices.Add(nFx, aMVx);
        }
      }
    }
  }
  // qqf
  {
    Standard_Integer aNbF, aNbAV, nF, k;
    NMTTools_IndexedDataMapOfIndexedMapOfInteger aMAVF;
    //
    aNbF=myAloneVertices.Extent();
    if (aNbF<2) {
      return;
    }
    //
    // 1. fill map Alone Vertex/Face ->  aMAVF
    for (i=1; i<=aNbF; ++i) {
      nF=myAloneVertices.FindKey(i);
      const TColStd_IndexedMapOfInteger& aMAV=myAloneVertices(i);
      aNbAV=aMAV.Extent();
      for(j=1; j<=aNbAV; ++j) {
        nV=aMAV(j);
        if (aMAVF.Contains(nV)) {
          TColStd_IndexedMapOfInteger& aMF=aMAVF.ChangeFromKey(nV);
          aMF.Add(nF);
        }
        else{
          TColStd_IndexedMapOfInteger aMF;
          aMF.Add(nF);
          aMAVF.Add(nV, aMF);
        }
      }
    }
    //
    // 2 Obtain pairs of faces
    aNbAV=aMAVF.Extent();
    for (i=1; i<=aNbAV; ++i) {
      const TColStd_IndexedMapOfInteger& aMF=aMAVF(i);
      aNbF=aMF.Extent();
      for(j=1; j<aNbF; ++j) {
        nF1=aMF(j);
        for(k=j+1; k<=aNbF; ++k) {
          nF2=aMF(k);
          myIP->Add(nF1, nF2, Standard_True, NMTDS_TI_FF);
        }
      }
    }
  }
  // qqt
}

Here is the call graph for this function:

Here is the caller graph for this function:

void NMTTools_PaveFiller::MakeBlocks ( ) [protected]

Definition at line 230 of file NMTTools_PaveFiller_6.cxx.

{
  myIsDone=Standard_False;
  //
  Standard_Boolean bIsExistingPaveBlock, bIsValidIn2D, bIsCoincided;
  Standard_Boolean bIsMicroEdge, bHasES;
  Standard_Integer i, aNbFFs, nF1, nF2;
  Standard_Integer nV1, nV2, j, aNbCurves;
  Standard_Real aTolR3D, aTol2D, aT1, aT2, aTolPPC=Precision::PConfusion();
  TopoDS_Face aF1, aF2;
  NMTTools_IndexedDataMapOfShapePaveBlock aMEPB;
  BooleanOperations_IndexedDataMapOfShapeInteger aMapEI;
  BOPTools_ListIteratorOfListOfPaveBlock anIt;
  //
  BOPTools_CArray1OfSSInterference& aFFs=myIP->SSInterferences();
  //

  //
  // 1. Make Section Edges from intersection curves
  //    between each pair of faces
  aNbFFs=aFFs.Extent();
  if (!aNbFFs) {
    return;
  }
  //
  FillFaceInfo();
  //
  for (i=1; i<=aNbFFs; ++i) {
    BOPTools_ListOfPaveBlock aLPB;
    TColStd_MapOfInteger aMVStick;
    TopTools_ListOfShape aLSE;
    TColStd_ListOfInteger aLNE;
    BOPTools_PaveSet aPSF;
    NMTTools_MapOfPaveBlock aMPBX;
    TColStd_MapIteratorOfMapOfInteger aItMI;
    NMTTools_MapIteratorOfMapOfPaveBlock aItMPB;
    //
    BOPTools_SSInterference& aFFi=aFFs(i);
    //
    // Faces
    aFFi.Indices(nF1, nF2);
    aF1=*((TopoDS_Face*)(&myDS->Shape(nF1)));
    aF2=*((TopoDS_Face*)(&myDS->Shape(nF2)));
    //
    SharedEdges(nF1, nF2, aLNE, aLSE);
    aFFi.SetSharedEdges(aLNE);
    //
    // aMVStick
    const NMTTools_FaceInfo& aFI1=myFaceInfo.Find(nF1);
    const NMTTools_FaceInfo& aFI2=myFaceInfo.Find(nF2);
    //
    const TColStd_MapOfInteger& aMVOn1=aFI1.VerticesOn();
    const TColStd_MapOfInteger& aMVIn1=aFI1.VerticesIn();
    const TColStd_MapOfInteger& aMVOn2=aFI2.VerticesOn();
    const TColStd_MapOfInteger& aMVIn2=aFI2.VerticesIn();
    //
    for (j=0; j<2; ++j) {
      const TColStd_MapOfInteger& aMV1=(!j) ? aMVOn1 :aMVIn1;
      aItMI.Initialize(aMV1);
      for (; aItMI.More(); aItMI.Next()) {
       nV1=aItMI.Key();
       if (aMVOn2.Contains(nV1) || aMVIn2.Contains(nV1)) {
         aMVStick.Add(nV1);
       }
      }
    }
    //
    //  aLPB
    const NMTTools_MapOfPaveBlock& aMPBIn1=aFI1.PaveBlocksIn();
    const NMTTools_MapOfPaveBlock& aMPBOn1=aFI1.PaveBlocksOn();
    const NMTTools_MapOfPaveBlock& aMPBIn2=aFI2.PaveBlocksIn();
    const NMTTools_MapOfPaveBlock& aMPBOn2=aFI2.PaveBlocksOn();
    //
    aMPBX.Clear();
    for (j=0; j<4; ++j) {
      NMTTools_MapOfPaveBlock *pMPB;
      //
      if (!j) {
       pMPB=((NMTTools_MapOfPaveBlock*)&aMPBIn1);
      }
      else if (j==1) {
       pMPB=((NMTTools_MapOfPaveBlock*)&aMPBOn1);
      }
      else if (j==2) {
       pMPB=((NMTTools_MapOfPaveBlock*)&aMPBIn2);
      }
      else if (j==3) {
       pMPB=((NMTTools_MapOfPaveBlock*)&aMPBOn2);
      }
      //
      const NMTTools_MapOfPaveBlock& aMPB=*pMPB;
      aItMPB.Initialize(aMPB);
      for (; aItMPB.More(); aItMPB.Next()) {
       const BOPTools_PaveBlock& aPB=aItMPB.Key();
       if (aMPBX.Add(aPB)) {
         aLPB.Append(aPB);
       }
       //
       else {
         if (j>1) {
           aFFi.AppendBlock(aPB);
         }
       }
       //
      }
    }
    //
    BOPTools_SequenceOfCurves& aSCvs=aFFi.Curves();
    aNbCurves=aSCvs.Length();
    if (!aNbCurves) {
      continue;
    }
    //
    aTolR3D=aFFi.TolR3D();
    aTol2D=(aTolR3D < 1.e-3) ? 1.e-3 : aTolR3D;
    //
    CorrectTolR3D(aFFi, aMVStick, aTolR3D);
    //
    PrepareSetForFace (nF1, nF2, aLPB, aPSF);
    //
    // Put Paves On Curves
    for (j=1; j<=aNbCurves; ++j) {
      BOPTools_Curve& aBC=aSCvs(j);
      const IntTools_Curve& aC=aBC.Curve();
      // DEBUG f
      Handle(Geom_Curve) aC3D = aC.Curve();
      // DEBUG t
      PutPaveOnCurve (aPSF, aTolR3D, aBC);
    }
    //
    // Put bounding paves on curves
    for (j=1; j<=aNbCurves; ++j) {
      BOPTools_Curve& aBC=aSCvs(j);
      PutBoundPaveOnCurve (aBC, aFFi);
    }
    //modified by NIZNHY-PKV Wed Sep 14 13:12:14 2011f
#if OCC_VERSION_LARGE > 0x06050100 // For OCCT6.5.2 and higher
    //
    // Put closing pave if needded
    for (j=1; j<=aNbCurves; ++j) {
      BOPTools_Curve& aBC=aSCvs(j);
      PutClosingPaveOnCurve (aBC, aFFi);
    }
#endif // OCC_VERSION_LARGE > 0x06050100 // For OCCT6.5.2 and higher
    //modified by NIZNHY-PKV Wed Sep 14 13:12:17 2011t
    //
    //  Pave Blocks on Curves
    bHasES=Standard_False;
    for (j=1; j<=aNbCurves; ++j) {
      BOPTools_Curve& aBC=aSCvs(j);
      const IntTools_Curve& aIC= aBC.Curve();
      BOPTools_PaveSet& aPaveSet=aBC.Set();
      //
      BOPTools_PaveBlockIterator aPBIter(0, aPaveSet);
      for (; aPBIter.More(); aPBIter.Next()) {
        BOPTools_PaveBlock& aPBNew=aPBIter.Value();
        aPBNew.SetCurve(aIC);
        aPBNew.SetFace1(nF1);
        aPBNew.SetFace2(nF2);
        //
        nV1=aPBNew.Pave1().Index();
        nV2=aPBNew.Pave2().Index();
        aT1=aPBNew.Pave1().Param();
        aT2=aPBNew.Pave2().Param();
        //
        if((nV1==nV2) && (Abs(aT2 - aT1) < aTolPPC)) {
          continue;// mkk ft ???
        }
        //
        // 1
        bIsExistingPaveBlock=IsExistingPaveBlock(aPBNew, aLPB, aTolR3D);
        if (bIsExistingPaveBlock) {
          continue;
        }
        //
        bIsCoincided=CheckCoincidence(aPBNew, aLPB);
        if(bIsCoincided) {
          continue;
        }
        //
        // 2
        bIsExistingPaveBlock=IsExistingPaveBlock(aPBNew, aLSE, aTolR3D);
        if (bIsExistingPaveBlock) {
          continue;
        }
       //
        // Checking of validity in 2D
        //
        bIsValidIn2D=myContext->IsValidBlockForFaces(aT1, aT2, aIC, aF1, aF2, aTol2D);
        if (!bIsValidIn2D) {
          continue;
        }
        //
        //
        // Make Section Edge
        TopoDS_Edge aES;
        //
        const TopoDS_Vertex aV1=TopoDS::Vertex(myDS->Shape(nV1));
        const TopoDS_Vertex aV2=TopoDS::Vertex(myDS->Shape(nV2));
        //
        {
          Standard_Real aT;
          //
          myContext->IsVertexOnLine(aV1, aIC, aTolR3D, aT);
          BOPTools_Tools::UpdateVertex (aIC, aT, aV1);
          //
          myContext->IsVertexOnLine(aV2, aIC, aTolR3D, aT);
          BOPTools_Tools::UpdateVertex (aIC, aT, aV2);
        }
        //
        BOPTools_Tools::MakeSectEdge (aIC, aV1, aT1, aV2, aT2, aES);
        //
        NMTTools_Tools::UpdateEdge (aES, aTolR3D);
        bIsMicroEdge=IsMicroEdge(aES, myContext);
        if (bIsMicroEdge) {
          continue;
        }
        //
        {
          Handle(Geom2d_Curve) aC2D1, aC2D2;
          //
          aC2D1=aIC.FirstCurve2d();
          aC2D2=aIC.SecondCurve2d();
          //
          NMTTools_Tools::MakePCurve(aES, aF1, aC2D1);
          NMTTools_Tools::MakePCurve(aES, aF2, aC2D2);
        }
        //
        aMEPB.Add(aES, aPBNew);
        aMapEI.Add(aES, i);
        //
        bHasES=Standard_True;
      }// for (; aPBIter.More(); aPBIter.Next())
    } // end of for (j=1; j<=aNbCurves; ++j)
    // qqf
    if (bHasES) {
      myIP->Add(nF1, nF2, Standard_True, NMTDS_TI_FF);
    }
    // qqt
  }// for (i=1; i<=aNbFFs; ++i)
  //=============================================================
  //
  // II. Post treatment
  //
  // Input data: aMEPB, aMapEI
  // Result    : section edges in myDS
  //
  Standard_Integer aNbSE;
  //
  aNbSE=aMEPB.Extent();
  if (!aNbSE) {
    // there is nothing to do here
    return;
  }
  //
  BRep_Builder aBB;
  TopoDS_Compound aCompound;
  //
  // 1. Make compound from SE
  aBB.MakeCompound(aCompound);
  for (i=1; i<=aNbSE; ++i) {
    const TopoDS_Shape& aSE=aMEPB.FindKey(i);
    aBB.Add(aCompound, aSE);
  }
  //
  //
  // 2. Intersect SE using auxiliary Filler
  NMTTools_PaveFiller tPF;
  //
  tPF.SetCompositeShape(aCompound);
  //
  // 2.1.VV
  tPF.Init();
  tPF.PerformVV();
  //
  // 2.2.VE
  tPF.myPavePool.Resize (tPF.myNbEdges);
  tPF.PrepareEdges();
  tPF.PerformVE();
  //
  // 2.3.VF
  tPF.PerformVF();
  //
  // 2.4.EE
  tPF.myCommonBlockPool.Resize (tPF.myNbEdges);
  tPF.mySplitShapesPool.Resize (tPF.myNbEdges);
  tPF.myPavePoolNew    .Resize (tPF.myNbEdges);

  tPF.PreparePaveBlocks(TopAbs_VERTEX, TopAbs_EDGE);
  tPF.PreparePaveBlocks(TopAbs_EDGE, TopAbs_EDGE);
  //
  tPF.PerformEE();
  //
  tPF.RefinePavePool ();
  //
  tPF.myPavePoolNew.Destroy();
  //
  tPF.MakeSplitEdges();
  tPF.UpdateCommonBlocks();
  //
  // 3. Treatment of the result of intersection
  //
  Standard_Integer aNbOld, aNbLines, aNbPB, mV1, mV2, nE, mE, iFF;
  TopAbs_ShapeEnum aType;
  BOPTools_ListIteratorOfListOfPaveBlock aIt;
  BOPTColStd_IndexedDataMapOfIntegerInteger aMNewOld;
  //
  const NMTDS_ShapesDataStructure& tDS=*(tPF.DS());
  const BOPTools_SplitShapesPool& aSSP=tPF.mySplitShapesPool;
  const NMTTools_CommonBlockPool& aCBP=tPF.myCommonBlockPool;
  //
  aNbLines=tDS.NumberOfInsertedShapes();
  aNbOld=tDS.NumberOfShapesOfTheObject();
  //
  // 3.1 Links between indices in tDS and DS (kept in aMNewOld)
  //
  // 3.1.1.Old vertices [ links ]
  for (i=1; i<=aNbOld; ++i) {
    const TopoDS_Shape& aV=tDS.Shape(i);
    aType=aV.ShapeType();
    if (aType!=TopAbs_VERTEX) {
      continue;
    }
    //
    for (j=1; j<=aNbSE; ++j) {
      const BOPTools_PaveBlock& aPBSE=aMEPB(j);
      nV1=aPBSE.Pave1().Index();
      const TopoDS_Shape aV1=myDS->Shape(nV1);//mpv
      if (aV1.IsSame(aV)) {
        aMNewOld.Add(i, nV1);
        break;
      }
      nV2=aPBSE.Pave2().Index();
      const TopoDS_Shape aV2=myDS->Shape(nV2);//mpv
      if (aV2.IsSame(aV)) {
        aMNewOld.Add(i, nV2);
        break;
      }
    }
  }
  //
  // 3.1.2. New vertices [ links ]
  i=tDS.NumberOfSourceShapes()+1;
  for (; i<=aNbLines; ++i) {
    const TopoDS_Shape& aV=tDS.Shape(i);
    aType=aV.ShapeType();
    if (aType!=TopAbs_VERTEX) {
      continue;
    }
    //
    // Insert new vertex in myDS
    BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
    myDS->InsertShapeAndAncestorsSuccessors(aV, anASSeq);
    nV1=myDS->NumberOfInsertedShapes();
    // link
    aMNewOld.Add(i, nV1);
  }
  //
  // 3.2. Treatment of section edges (SE)
  for (i=1; i<=aNbOld; ++i) {
    const TopoDS_Shape& aE=tDS.Shape(i);
    aType=aE.ShapeType();
    if (aType!=TopAbs_EDGE) {
      continue;
    }
    //
    //  block of section edge that we already have for this SE
    BOPTools_PaveBlock& aPBSE=aMEPB.ChangeFromKey(aE);
    //
    // Corresponding FF-interference
    iFF=aMapEI.FindFromKey(aE);
    BOPTools_SSInterference& aFFi=aFFs(iFF);
    BOPTools_SequenceOfCurves& aSCvs=aFFi.Curves();
    //
    BOPTools_Curve& aBC=aSCvs(1);
    //
    const BOPTools_ListOfPaveBlock& aLPB=aSSP(tDS.RefEdge(i));
    aNbPB=aLPB.Extent();
    //
    if (!aNbPB) {
      // no pave blocks -> use aPBSE and whole edge aE
      BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
      //
      nV1=aPBSE.Pave1().Index();
      const TopoDS_Shape aV1=myDS->Shape(nV1);//mpv
      nV2=aPBSE.Pave2().Index();
      const TopoDS_Shape aV2=myDS->Shape(nV2);//mpv
      //
      anASSeq.SetNewSuccessor(nV1);
      anASSeq.SetNewOrientation(aV1.Orientation());
      anASSeq.SetNewSuccessor(nV2);
      anASSeq.SetNewOrientation(aV2.Orientation());
      //
      myDS->InsertShapeAndAncestorsSuccessors(aE, anASSeq);
      nE=myDS->NumberOfInsertedShapes();
      //
      aPBSE.SetEdge(nE);
      aBC.AppendNewBlock(aPBSE);
      //
      continue;
    }
    //
    nF1=aPBSE.Face1();
    nF2=aPBSE.Face2();
    //
    const NMTTools_ListOfCommonBlock& aLCB=aCBP(tDS.RefEdge(i));
    NMTTools_CommonBlockAPI aCBAPI(aLCB);
    //
    aIt.Initialize(aLPB);
    for (; aIt.More(); aIt.Next()) {
      BOPTools_PaveBlock aPB=aIt.Value();
      //
      const TopoDS_Face aF1=TopoDS::Face(myDS->Shape(nF1));
      const TopoDS_Face aF2=TopoDS::Face(myDS->Shape(nF2));
      //
      if (aCBAPI.IsCommonBlock(aPB)) {
        // it can be Common Block
        Standard_Real aTolEx;
        Handle(Geom2d_Curve) aC2D1, aC2D2;
        TopoDS_Face aF1FWD, aF2FWD;
        //
        NMTTools_CommonBlock& aCB=aCBAPI.CommonBlock(aPB);
        //const BOPTools_ListOfPaveBlock& aLPBx=aCB.PaveBlocks();
        //
        aPB=aCB.PaveBlock1();
        mE=aPB.Edge(); // index of edge in tDS
        const TopoDS_Edge& aEx=TopoDS::Edge(tDS.Shape(mE));
        aTolEx=BRep_Tool::Tolerance(aEx);
        //
        aF1FWD=aF1;
        aF1FWD.Orientation(TopAbs_FORWARD);
        aF2FWD=aF2;
        aF2FWD.Orientation(TopAbs_FORWARD);
        //
        NMTTools_Tools::MakePCurve(aEx, aF1FWD, aC2D1);
        NMTTools_Tools::MakePCurve(aEx, aF2FWD, aC2D2);
        NMTTools_Tools::UpdateEdge (aEx, aTolEx);
      } //if (aCBAPI.IsCommonBlock(aPB))
      //
      // new SE
      mE=aPB.Edge(); // index of edge in tDS
      const TopoDS_Shape& aSp=tDS.Shape(mE);
      //
      const BOPTools_Pave& aPave1=aPB.Pave1();
      aT1=aPave1.Param();
      mV1=aPave1.Index();            // index in tDS
      nV1=aMNewOld.FindFromKey(mV1); // index in myDS
      const TopoDS_Shape aV1=myDS->Shape(nV1);//mpv
      //
      const BOPTools_Pave& aPave2=aPB.Pave2();
      aT2=aPave2.Param();
      mV2=aPave2.Index();
      nV2=aMNewOld.FindFromKey(mV2);
      const TopoDS_Shape aV2=myDS->Shape(nV2);//mpv
      //
      if (!aMNewOld.Contains(mE)) {
        // add new SE to the myDS
        BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
        //
        anASSeq.SetNewSuccessor(nV1);
        anASSeq.SetNewOrientation(aV1.Orientation());

        anASSeq.SetNewSuccessor(nV2);
        anASSeq.SetNewOrientation(aV2.Orientation());

        myDS->InsertShapeAndAncestorsSuccessors(aSp, anASSeq);
        nE=myDS->NumberOfInsertedShapes();
        //
        aMNewOld.Add(mE, nE);
      }
      else {
        nE=aMNewOld.FindFromKey(mE);
      }
      // Form PaveBlock;
      BOPTools_PaveBlock aPBx;
      BOPTools_Pave aP1, aP2;
      //
      aPBx.SetFace1(nF1);
      aPBx.SetFace1(nF2);
      //
      aP1.SetIndex(nV1);
      aP1.SetParam(aT1);
      //
      aP2.SetIndex(nV2);
      aP2.SetParam(aT2);
      //
      aPBx.SetPave1(aP1);
      aPBx.SetPave2(aP2);
      //
      aPBx.SetEdge(nE);
      //
      aBC.AppendNewBlock(aPBx);
    }// for (; aIt.More(); aIt.Next())
  }// for (i=1; i<=aNbOld; ++i)
  //
  myIsDone=Standard_True;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 732 of file NMTTools_PaveFiller_6.cxx.

{
  Standard_Integer i, aNb,  nF1, nF2, nE;
  Standard_Integer aNbCB, aNbF, nSp, nF;
  TopAbs_ShapeEnum aType;
  TopoDS_Face aF1FWD, aF2FWD;
  TColStd_ListIteratorOfListOfInteger aItF;
  BOPTools_ListIteratorOfListOfPaveBlock anIt;
  NMTTools_ListIteratorOfListOfCommonBlock aItCB;
  //
  BOPTools_CArray1OfSSInterference& aFFs=myIP->SSInterferences();
  //
  aNb=aFFs.Extent();
  for (i=1; i<=aNb; i++) {
    BOPTools_SSInterference& aFF=aFFs(i);
    aFF.Indices(nF1, nF2);
    //
    const TopoDS_Face aF1=TopoDS::Face(myDS->Shape(nF1));//mpv
    const TopoDS_Face aF2=TopoDS::Face(myDS->Shape(nF2));//mpv
    //
    aF1FWD=aF1;
    aF1FWD.Orientation(TopAbs_FORWARD);
    aF2FWD=aF2;
    aF2FWD.Orientation(TopAbs_FORWARD);
    //
    // In, On parts processing
    const BOPTools_ListOfPaveBlock& aLPBInOn=aFF.PaveBlocks();
    //
    anIt.Initialize(aLPBInOn);
    for (; anIt.More(); anIt.Next()) {
      const BOPTools_PaveBlock& aPB=anIt.Value();
      nE=aPB.Edge();
      const TopoDS_Edge aE=TopoDS::Edge(myDS->Shape(nE));//mpv

      BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aE, aF1FWD);
      BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aE, aF2FWD);
    }
  }
  // Check common blocks between edges and faces
  // Build P-Curves if they were not built in previos block.
  // The main case is :arguments for e.g aEdge, aFace -> no FFs,
  // but p-curves are needed.
  //
  aNb=myDS->NumberOfShapesOfTheObject();
  for (i=1; i<=aNb; ++i) {
    const TopoDS_Shape& aS=myDS->Shape(i);
    aType=aS.ShapeType();
    //
    if (aType!=TopAbs_EDGE) {
      continue;
    }
    const TopoDS_Edge& aE=TopoDS::Edge(aS);
    //
    if (BRep_Tool::Degenerated(aE)) {
      continue;
    }
    //
    const NMTTools_ListOfCommonBlock& aLCB=myCommonBlockPool(myDS->RefEdge(i));
    aNbCB=aLCB.Extent();
    if (!aNbCB) {
      continue;
    }
    //
    aItCB.Initialize(aLCB);
    for (; aItCB.More(); aItCB.Next()) {
      const NMTTools_CommonBlock& aCB=aItCB.Value();
      const BOPTools_PaveBlock &aPB1=aCB.PaveBlock1();
      //
      const TColStd_ListOfInteger& aLF=aCB.Faces();
      aNbF=aLF.Extent();
      if (!aNbF) {
        continue;
      }
      //
      nSp=aPB1.Edge();
      const TopoDS_Edge aSp=TopoDS::Edge(myDS->Shape(nSp));//mpv
      //
      aItF.Initialize(aLF);
      for (; aItF.More(); aItF.Next()) {
        nF=aItF.Value();
        aF1FWD=TopoDS::Face(myDS->Shape(nF));
        aF1FWD.Orientation(TopAbs_FORWARD);
        //
        BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aSp, aF1FWD);
      } // for (; aItCB.More(); aItCB.Next()) {
    }//if (aS.ShapeType()==TopAbs_EDGE) {
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 93 of file NMTTools_PaveFiller_7.cxx.

{
  myIsDone=Standard_False;
  //
  Standard_Boolean bIsNewVertex1, bIsNewVertex2;
  Standard_Integer i, aNbS, nV1, nV2, aNbPaveBlocks, aNewShapeIndex;
  Standard_Real    t1, t2;
  TopAbs_Orientation anOri;
  TopoDS_Edge aE, aESplit;
  TopoDS_Vertex aV1, aV2;
  //
  aNbS=myDS->NumberOfShapesOfTheObject();
  for (i=1; i<=aNbS; ++i) {
    if (myDS->GetShapeType(i) != TopAbs_EDGE)
      continue;
    //
    // Original Edge
    aE=TopoDS::Edge(myDS->Shape(i));
    if (BRep_Tool::Degenerated(aE)){
      continue;
    }
    //
    anOri=aE.Orientation();
    aE.Orientation(TopAbs_FORWARD);
    //
    // Making Split Edges
    //
    // Split Set for the Original Edge i
    BOPTools_ListOfPaveBlock& aSplitEdges=mySplitShapesPool(myDS->RefEdge(i));
    BOPTools_ListIteratorOfListOfPaveBlock aPBIt(aSplitEdges);
    //
    aNbPaveBlocks=aSplitEdges.Extent();

    for (; aPBIt.More(); aPBIt.Next()) {
      BOPTools_PaveBlock& aPB=aPBIt.Value();
      // aPave1
      const BOPTools_Pave& aPave1=aPB.Pave1();
      nV1=aPave1.Index();
      t1=aPave1.Param();
      aV1=TopoDS::Vertex(myDS->GetShape(nV1));
      aV1.Orientation(TopAbs_FORWARD);
      // aPave2
      const BOPTools_Pave& aPave2=aPB.Pave2();
      nV2=aPave2.Index();
      t2=aPave2.Param();
      aV2=TopoDS::Vertex(myDS->GetShape(nV2));
      aV2.Orientation(TopAbs_REVERSED);
      //xx
      if (aNbPaveBlocks==1) {
        bIsNewVertex1=myDS->IsNewShape (nV1);
        bIsNewVertex2=myDS->IsNewShape (nV2);
        if (!bIsNewVertex1 && !bIsNewVertex2) {
          aPB.SetEdge(i);
          continue;
        }
      }
      //xx
      BOPTools_Tools::MakeSplitEdge(aE, aV1, t1, aV2, t2, aESplit);
      //
      // Add Split Part of the Original Edge to the DS
      BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;

      anASSeq.SetNewSuccessor(nV1);
      anASSeq.SetNewOrientation(aV1.Orientation());

      anASSeq.SetNewSuccessor(nV2);
      anASSeq.SetNewOrientation(aV2.Orientation());
      //
      if (anOri==TopAbs_INTERNAL) {
        anASSeq.SetNewAncestor(i);
        aESplit.Orientation(anOri);
      }
      //
      myDS->InsertShapeAndAncestorsSuccessors(aESplit, anASSeq);
      aNewShapeIndex=myDS->NumberOfInsertedShapes();
      myDS->SetState(aNewShapeIndex, BooleanOperations_UNKNOWN);
      //
      // Fill Split Set for the Original Edge
      aPB.SetEdge(aNewShapeIndex);
      //
    }
  }
  myIsDone=Standard_True;
}

Here is the caller graph for this function:

const BOPTools_PavePool & NMTTools_PaveFiller::PavePool ( ) const

Definition at line 138 of file NMTTools_PaveFiller.cxx.

{
  return myPavePool;
}

Here is the caller graph for this function:

void NMTTools_PaveFiller::Perform ( ) [virtual]

Reimplemented in NMTTools_CheckerSI.

Definition at line 228 of file NMTTools_PaveFiller.cxx.

{
  myIsDone=Standard_False;
  //
  //----------------
  try {
    // 0.
    Init();
    //1.VV
    //
    PerformVV();
    //
    // 2.VE
    myPavePool.Resize (myNbEdges);

    PrepareEdges();

    PerformVE();
    //
    // 3.VF
    PerformVF();
    //
    // 4.EE
    myCommonBlockPool.Resize (myNbEdges);
    mySplitShapesPool.Resize (myNbEdges);
    myPavePoolNew    .Resize (myNbEdges);

    PreparePaveBlocks(TopAbs_VERTEX, TopAbs_EDGE);
    PreparePaveBlocks(TopAbs_EDGE, TopAbs_EDGE);
    //
    PerformEE();
    //
    RefinePavePool ();
    //
    myPavePoolNew.Destroy();
    myPavePoolNew.Resize (myNbEdges);
    //
    //modified by NIZNHY-PKV Mon Dec 12 09:13:53 2011f
    UpdateCommonBlocks(0);
    //modified by NIZNHY-PKV Mon Dec 12 09:13:56 2011t
    //
    // 5.EF
    PreparePaveBlocks(TopAbs_EDGE, TopAbs_FACE);
    PerformEF();
    //
    RefinePavePool();
    //
    myPavePoolNew.Destroy();

    MakeSplitEdges();

    UpdateCommonBlocks();
    //
    // 6. FF
    PerformFF ();
    //
    MakeBlocks();
    //
    MakePCurves();
    //
    // 7.Postprocessing
    UpdatePaveBlocks();
    //
    NMTTools_DEProcessor aDEP(*this);
    aDEP.Do();
    //
    MakeAloneVertices();
    //
    //modified by NIZNHY-PKV Mon Dec 12 09:14:23 2011f
    myIP->Purge();
    //modified by NIZNHY-PKV Mon Dec 12 09:14:27 2011t
    myIsDone=Standard_True;
  }
  catch (BOPTColStd_Failure& ) {
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void NMTTools_PaveFiller::PerformEE ( ) [protected, virtual]

Definition at line 148 of file NMTTools_PaveFiller_4.cxx.

{
  myIsDone=Standard_False;
  //
  Standard_Boolean bJustAdd;
  Standard_Integer n1, n2, anIndexIn, nE1, nE2, aNbVEs, aBlockLength;
  Standard_Integer aTmp, aWhat, aWith, i, aNbCPrts, aDiscretize=30;
  Standard_Integer aNbLPB1, aNbLPB2;
  Standard_Real aTolE1, aTolE2, aDeflection=0.01;
  BOPTools_ListIteratorOfListOfPaveBlock anIt1, anIt2;
  TopoDS_Edge aEWhat, aEWith;
  TopoDS_Vertex aNewVertex;
  BooleanOperations_IndexedDataMapOfShapeInteger aMapVI;
  BOPTools_IDMapOfPaveBlockIMapOfPaveBlock aMapCB;
  //
  BOPTools_CArray1OfEEInterference& aEEs=myIP->EEInterferences();
  //
  myDSIt->Initialize(TopAbs_EDGE, TopAbs_EDGE);
  //
  // BlockLength correction
  aNbVEs=myDSIt->BlockLength();
  aBlockLength=aEEs.BlockLength();
  if (aNbVEs > aBlockLength) {
    aEEs.SetBlockLength(aNbVEs);
  }
  //
  for (; myDSIt->More(); myDSIt->Next()) {
    myDSIt->Current(n1, n2, bJustAdd);
    anIndexIn = 0;
    nE1=n1;
    nE2=n2;
    //
    if(bJustAdd) {
      continue;
    }
    //
    const TopoDS_Edge aE1=TopoDS::Edge(myDS->Shape(nE1));//mpv
    const TopoDS_Edge aE2=TopoDS::Edge(myDS->Shape(nE2));//mpv
    //
    if (BRep_Tool::Degenerated(aE1) || BRep_Tool::Degenerated(aE2)){
      continue;
    }
    //
    aTolE1=BRep_Tool::Tolerance(aE1);
    aTolE2=BRep_Tool::Tolerance(aE2);
    //
    BOPTools_ListOfPaveBlock& aLPB1=mySplitShapesPool(myDS->RefEdge(nE1));
    BOPTools_ListOfPaveBlock& aLPB2=mySplitShapesPool(myDS->RefEdge(nE2));
    //
    // Modified  Thu Sep 14 14:35:18 2006
    // Contribution of Samtech www.samcef.com BEGIN
    aNbLPB1=aLPB1.Extent();
    aNbLPB2=aLPB2.Extent();
    //
    //if (aE1.IsSame(aE2) && aNbLPB1==1 && aNbLPB2==1) {
    //  continue;
    //}
    // Contribution of Samtech www.samcef.com END
    //
    for (anIt1.Initialize(aLPB1); anIt1.More(); anIt1.Next()) {
      BOPTools_PaveBlock& aPB1=anIt1.Value();
      const IntTools_ShrunkRange& aShrunkRange1=aPB1.ShrunkRange();
      //
      const IntTools_Range& aSR1=aShrunkRange1.ShrunkRange();
      const Bnd_Box&        aBB1=aShrunkRange1.BndBox();
      //
      for (anIt2.Initialize(aLPB2); anIt2.More(); anIt2.Next()) {
        BOPTools_PaveBlock& aPB2=anIt2.Value();
        const IntTools_ShrunkRange& aShrunkRange2=aPB2.ShrunkRange();
        //
        const IntTools_Range& aSR2=aShrunkRange2.ShrunkRange();
        const Bnd_Box&        aBB2=aShrunkRange2.BndBox();
        //
        if (aBB1.IsOut (aBB2)) {
          continue;
        }
        //
        // EE
        IntTools_EdgeEdge aEE;
        aEE.SetEdge1 (aE1);
        aEE.SetEdge2 (aE2);
        aEE.SetTolerance1 (aTolE1);
        aEE.SetTolerance2 (aTolE2);
        aEE.SetDiscretize (aDiscretize);
        aEE.SetDeflection (aDeflection);
        //
        IntTools_Range anewSR1 = aSR1;
        IntTools_Range anewSR2 = aSR2;
        //
        BOPTools_Tools::CorrectRange (aE1, aE2, aSR1, anewSR1);
        BOPTools_Tools::CorrectRange (aE2, aE1, aSR2, anewSR2);
        //
        aEE.SetRange1(anewSR1);
        aEE.SetRange2(anewSR2);
        //
        aEE.Perform();
        //
        anIndexIn=0;
        //
        if (aEE.IsDone()) {
          // reverse order if it is necessary
          aEWhat=aE1;
          aEWith=aE2;
          aWhat=nE1;
          aWith=nE2;
          if (aEE.Order()) {
            aTmp=aWhat;
            aWhat=aWith;
            aWith=aTmp;
            aEWhat=aE2;
            aEWith=aE1;
          }
          //
          const IntTools_SequenceOfCommonPrts& aCPrts=aEE.CommonParts();
          aNbCPrts=aCPrts.Length();
          for (i=1; i<=aNbCPrts; i++) {
            const IntTools_CommonPrt& aCPart=aCPrts(i);
            const IntTools_SequenceOfRanges& aRanges2=aCPart.Ranges2();
            //
            anIndexIn=0;
            //
            TopAbs_ShapeEnum aType=aCPart.Type();
            switch (aType) {
              case TopAbs_VERTEX:  {
                Standard_Real aT1, aT2, aTol=Precision::PConfusion();
                Standard_Boolean bIsOnPave1, bIsOnPave2;
                IntTools_Range aR1, aR2;
                //
                VertexParameters(aCPart, aT1, aT2);
                //
                //decide to keep the pave or not
                aR1 = (aEE.Order()) ? anewSR2 : anewSR1;
                aR2 = (aEE.Order()) ? anewSR1 : anewSR2;
                //
                aTol=0.8*aTol;
                bIsOnPave1=IsOnPave(aT1, aR1, aTol);
                bIsOnPave2=IsOnPave(aT2, aR2, aTol);
                //
                if(bIsOnPave1 || bIsOnPave2) {
                   continue;
                }
                //
                BOPTools_Tools::MakeNewVertex(aEWhat, aT1, aEWith, aT2, aNewVertex);
                //
                {
                  Standard_Integer nV11, nV12, nV21, nV22, nVS[2], k, j, iFound;
                  Standard_Real aTolVx, aTolVnew, aD2, aDT2;
                  TColStd_MapOfInteger aMV;
                  gp_Pnt aPnew, aPx;
                  //
                  iFound=0;
                  j=-1;
                  nV11=aPB1.Pave1().Index();
                  nV12=aPB1.Pave2().Index();
                  nV21=aPB2.Pave1().Index();
                  nV22=aPB2.Pave2().Index();
                  aMV.Add(nV11);
                  aMV.Add(nV12);
                  //
                  if (aMV.Contains(nV21)) {
                    ++j;
                    nVS[j]=nV21;
                  }
                  if (aMV.Contains(nV22)) {
                    ++j;
                    nVS[j]=nV22;
                  }
                  //
                  aTolVnew=BRep_Tool::Tolerance(aNewVertex);
                  aPnew=BRep_Tool::Pnt(aNewVertex);
                  //
                  for (k=0; k<=j; ++k) {
                    const TopoDS_Vertex& aVx=TopoDS::Vertex(myDS->Shape(nVS[k]));
                    aTolVx=BRep_Tool::Tolerance(aVx);
                    aPx=BRep_Tool::Pnt(aVx);
                    aD2=aPnew.SquareDistance(aPx);
                    //
                    aDT2=100.*(aTolVnew+aTolVx)*(aTolVnew+aTolVx);
                    //
                    if (aD2<aDT2) {
                      iFound=1;
                      break;
                    }
                  }
                  //
                  if (iFound) {
                    continue;
                  }
                }
                //
                // Add Interference to the Pool
                BOPTools_EEInterference anInterf (aWhat, aWith, aCPart);
                //
                anIndexIn=aEEs.Append(anInterf);
                // qqf
                {
                  myIP->Add(aWhat, aWith, Standard_True, NMTDS_TI_EE);
                }
                // qqt
                //
                // Collect
                aMapVI.Add(aNewVertex, anIndexIn);
              }
                break;

              case TopAbs_EDGE: {
                Standard_Integer aNbComPrt2;
                Standard_Boolean aCoinsideFlag;
                //
                aNbComPrt2=aRanges2.Length();
                aCoinsideFlag=IsBlocksCoinside(aPB1, aPB2);
                //
                if (aNbComPrt2>1 || !aCoinsideFlag) {
                  break;
                }
                //
                // Fill aMapCB
                if (aMapCB.Contains(aPB1)) {
                  BOPTools_IMapOfPaveBlock& aMapPB=aMapCB.ChangeFromKey(aPB1);
                  aMapPB.Add(aPB1);
                  aMapPB.Add(aPB2);
                }
                else {
                  BOPTools_IMapOfPaveBlock aMapPB;
                  aMapPB.Add(aPB1);
                  aMapPB.Add(aPB2);
                  aMapCB.Add(aPB1, aMapPB);
                }
                //
                if (aMapCB.Contains(aPB2)) {
                  BOPTools_IMapOfPaveBlock& aMapPB=aMapCB.ChangeFromKey(aPB2);
                  aMapPB.Add(aPB1);
                  aMapPB.Add(aPB2);
                }
                else {
                  BOPTools_IMapOfPaveBlock aMapPB;
                  aMapPB.Add(aPB1);
                  aMapPB.Add(aPB2);
                  aMapCB.Add(aPB2, aMapPB);
                }
                // qqf
                {
                  myIP->Add(aWhat, aWith, Standard_True, NMTDS_TI_EE);
                }
                // qqt
              }
                break;
            default:
              break;
            } // switch (aType)
          } // for (i=1; i<=aNbCPrts; i++)
        }// if (aEE.IsDone())
      } // for (; anIt2.More(); anIt2.Next())
    } // for (; anIt1.More(); anIt1.Next())
  }// for (; myDSIt.More(); myDSIt.Next())
  //
  {
    NMTTools_ListOfCommonBlock aLCB;
    //
    FindChains(aMapCB, aLCB);
    EENewVertices (aMapVI);
    //TreatPaveBlocks(*this, aLCB);
    TreatPaveBlocks(aLCB);
    ReplaceCommonBlocks(aLCB);
  }
  //
  PerformVF1();
  //
  myIsDone=Standard_True;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void NMTTools_PaveFiller::PerformEF ( ) [protected, virtual]

Definition at line 101 of file NMTTools_PaveFiller_5.cxx.

{
  Standard_Boolean bJustAdd;
  Standard_Integer n1, n2, anIndexIn, nE, nF, aNbEFs, aBlockLength;
  Standard_Integer aDiscretize;
  Standard_Real aTolE, aTolF, aDeflection;
  BooleanOperations_IndexedDataMapOfShapeInteger aMapVI;
  BOPTools_IDMapOfPaveBlockIMapOfInteger aMapCB;
  BOPTools_IMapOfPaveBlock aIMPBx;
  //
  myIsDone=Standard_False;
  aDeflection=0.01;
  aDiscretize=35;
  //
  BOPTools_CArray1OfESInterference& aEFs=myIP->ESInterferences();
  //
  myDSIt->Initialize(TopAbs_EDGE, TopAbs_FACE);
  //
  // BlockLength correction
  aNbEFs=myDSIt->BlockLength();
  aBlockLength=aEFs.BlockLength();
  if (aNbEFs > aBlockLength) {
    aEFs.SetBlockLength(aNbEFs);
  }
  //
  for (; myDSIt->More(); myDSIt->Next()) {
    myDSIt->Current(n1, n2, bJustAdd);
    //
    if(bJustAdd) {
      continue;
    }
    //
    anIndexIn = 0;
    //
    nE=n1;
    nF=n2;
    if (myDS->GetShapeType(n2)==TopAbs_EDGE) {
      nE=n2;
      nF=n1;
    }
    //
    // all Common Blocks for face nF
    NMTTools_ListOfCommonBlock aLCBF;
    CommonBlocksFace(nF, aLCBF);
    NMTTools_CommonBlockAPI aCBAPIF(aLCBF);
    //
    // Edge
    const TopoDS_Edge aE=TopoDS::Edge(myDS->Shape(nE));
    if (BRep_Tool::Degenerated(aE)){
      continue;
    }
    //
    // Face
    const TopoDS_Face aF=TopoDS::Face(myDS->Shape(nF));
    //
    TopTools_IndexedMapOfShape aME;
    TopExp::MapShapes(aF, TopAbs_EDGE, aME);
    if (aME.Contains(aE)) {
      continue;
    }
    //
    aTolF=BRep_Tool::Tolerance(aF);
    aTolE=BRep_Tool::Tolerance(aE);

    const Bnd_Box& aBBF=myDS->GetBoundingBox(nF);
    //
    // Process each PaveBlock on edge nE
    BOPTools_ListOfPaveBlock& aLPB=mySplitShapesPool(myDS->RefEdge(nE));
    //
    BOPTools_ListIteratorOfListOfPaveBlock anIt(aLPB);
    for (; anIt.More(); anIt.Next()) {
      BOPTools_PaveBlock& aPB=anIt.Value();
      if (aCBAPIF.IsCommonBlock(aPB)) {
        continue;
      }
      //
      const IntTools_ShrunkRange& aShrunkRange=aPB.ShrunkRange();
      const IntTools_Range& aSR =aShrunkRange.ShrunkRange();
      const Bnd_Box& aBBE=aShrunkRange.BndBox();
      //
      if (aBBF.IsOut (aBBE)) {
        continue;
      }
      //
      // EF
      IntTools_EdgeFace aEF;
      aEF.SetEdge (aE);
      aEF.SetFace (aF);
      aEF.SetTolE (aTolE);
      aEF.SetTolF (aTolF);
      aEF.SetDiscretize (aDiscretize);
      aEF.SetDeflection (aDeflection);
      //
      aEF.SetContext(myContext);
      //
      IntTools_Range anewSR = aSR;
      //
      // Correction of the Shrunk Range
      BOPTools_Tools::CorrectRange(aE, aF, aSR, anewSR);
      aEF.SetRange (anewSR);
      //
      aEF.Perform();
      //
      if (aEF.IsDone()) {
        Standard_Boolean bCoinsideFlag;
        Standard_Integer i, aNbCPrts;
        TopAbs_ShapeEnum aType;
        //
        const IntTools_SequenceOfCommonPrts& aCPrts=aEF.CommonParts();
        //
        aNbCPrts=aCPrts.Length();
        for (i=1; i<=aNbCPrts; ++i) {
          anIndexIn=0;
          //
          const IntTools_CommonPrt& aCPart=aCPrts(i);
          aType=aCPart.Type();
          //
          switch (aType) {
            //
            case TopAbs_VERTEX:  {
              Standard_Boolean bIsOnPave1, bIsOnPave2;
              Standard_Integer nVF;
              Standard_Real aT, aTolToDecide;
              TopoDS_Vertex aNewVertex;
              //
              const IntTools_Range& aR=aCPart.Range1();
              //
              // New Vertex
              VertexParameter(aCPart, aT);
              BOPTools_Tools::MakeNewVertex(aE, aT, aF, aNewVertex);
              //
              //decide to add pave or not
              aTolToDecide=5.e-8;
              bIsOnPave1=IsOnPave(anewSR.First(), aR, aTolToDecide);
              bIsOnPave2=IsOnPave(anewSR.Last() , aR, aTolToDecide);
              //
              if (!bIsOnPave1 && !bIsOnPave2) {
                nVF=CheckFacePaves(aNewVertex, nF);
                if (!nVF) {
                  // really new vertex
                  // Add Interference to the Pool
                  BOPTools_ESInterference anInterf (nE, nF, aCPart);
                  anIndexIn=aEFs.Append(anInterf);
                  anInterf.SetNewShape(0);
                  //
                  aMapVI.Add(aNewVertex, anIndexIn);
                  aIMPBx.Add(aPB);
                  //
                  myIP->Add(nE, nF, Standard_True, NMTDS_TI_EF);
                  //
                }// if (!nVF)
              }// if (!bIsOnPave1 && !bIsOnPave2)
              //
              //modified by NIZNHY-PKV Fri Apr 18 10:55:38 2008f
              else {
                const BOPTools_Pave& aPave=(bIsOnPave1)? aPB.Pave1() : aPB.Pave2();
                nVF=aPave.Index();
                const TopoDS_Vertex& aVF=TopoDS::Vertex(myDS->Shape(nVF));
                BOPTools_Tools::UpdateVertex (aVF, aNewVertex);
              }
              //modified by NIZNHY-PKV Fri Apr 18 10:55:40 2008t
              //
            }// case TopAbs_VERTEX:
              break;
            //
            case TopAbs_EDGE: {
              bCoinsideFlag=BOPTools_Tools::IsBlockInOnFace(aPB, aF, myContext);
              if (!bCoinsideFlag) {
                break;
              }
              //
              // Fill aMapCB
              if (aMapCB.Contains(aPB)) {
                TColStd_IndexedMapOfInteger& aMapF=aMapCB.ChangeFromKey(aPB);
                aMapF.Add(nF);
              }
              else {
                TColStd_IndexedMapOfInteger aMapF;
                aMapF.Add(nF);
                aMapCB.Add(aPB, aMapF);
              }
              //
              aIMPBx.Add(aPB);
              myIP->Add(nE, nF, Standard_True, NMTDS_TI_EF);
            }// case TopAbs_EDGE:
              break;

            default:
              break;
          } // switch (aType)
        } // for (i=1; i<=aNbCPrts; i++)
      } //if (aEF.IsDone())
    } // for (; anIt.More(); anIt.Next())
  }// for (; myDSIt.More(); myDSIt.Next())
  //
  // Treat New vertices
  EFNewVertices(aMapVI);
  //
  // Add draft Common Blocks of EF type
  EFCommonBlocks(aMapCB);
  //
  // Collect all CB we suspected to split by new vertices
  NMTTools_ListOfCommonBlock aLCBx;
  {
    Standard_Integer i, aNbPBx, nEx;
    BOPTools_IMapOfPaveBlock aMx;
    //
    aNbPBx=aIMPBx.Extent();
    for (i=1; i<=aNbPBx; ++i) {
      const BOPTools_PaveBlock& aPBx=aIMPBx(i);
      nEx=aPBx.OriginalEdge();
      NMTTools_ListOfCommonBlock& aLCB=myCommonBlockPool(myDS->RefEdge(nEx));
      if (aLCB.Extent()) {
        NMTTools_CommonBlockAPI aCBAPIx(aLCB);
        if (aCBAPIx.IsCommonBlock(aPBx)) {
          NMTTools_CommonBlock& aCBx=aCBAPIx.CommonBlock(aPBx);
          const BOPTools_PaveBlock& aPB1=aCBx.PaveBlock1();
          if (!aMx.Contains(aPB1)){
            aMx.Add(aPB1);
            aLCBx.Append(aCBx);
          }
        }
      }
    }
  }
  //
  // Split the common blocks above
  if (aLCBx.Extent()) {
    ReplaceCommonBlocks(aLCBx);
  }
  //
  myIsDone=Standard_True;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void NMTTools_PaveFiller::PerformFF ( ) [protected, virtual]

Definition at line 123 of file NMTTools_PaveFiller_6.cxx.

{
  myIsDone=Standard_False;
  //
  Standard_Boolean bToApproxC3d, bToApproxC2dOnS1, bToApproxC2dOnS2, bIsDone;
  Standard_Boolean bJustAdd, bToSplit;
  Standard_Integer n1, n2, anIndexIn, nF1, nF2, aBlockLength, aNbFFs;
  Standard_Integer aNbCurves, aNbPoints;
  Standard_Real anApproxTol, aTolR3D, aTolR2D;
  BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger aMapWhat, aMapWith;
  IntTools_SequenceOfPntOn2Faces aPnts;
  IntTools_SequenceOfCurves aCvs;
  //
  BOPTools_CArray1OfSSInterference& aFFs=myIP->SSInterferences();
  //
  //  F/F Interferences  [BooleanOperations_SurfaceSurface]
  myDSIt->Initialize(TopAbs_FACE, TopAbs_FACE);
  //
  // BlockLength correction
  aNbFFs=myDSIt->BlockLength();
  aBlockLength=aFFs.BlockLength();
  if (aNbFFs > aBlockLength) {
    aFFs.SetBlockLength(aNbFFs);
  }
  //
  //modified by NIZNHY-PKV Thu Sep 15 08:02:52 2011f
  bToSplit=Standard_False;
  //modified by NIZNHY-PKV Thu Sep 15 08:02:55 2011t
  //
  for (; myDSIt->More(); myDSIt->Next()) {
    myDSIt->Current(n1, n2, bJustAdd);
    //
    nF1 = n2;
    nF2 = n1;
    if(n1 < n2) {
      nF1 = n1;
      nF2 = n2;
    }
    anIndexIn=0;
    aPnts.Clear();
    aCvs.Clear();
    //
    const TopoDS_Face aF1=TopoDS::Face(myDS->Shape(nF1));//mpv
    const TopoDS_Face aF2=TopoDS::Face(myDS->Shape(nF2));//mpv
    //
    // FF
    bToApproxC3d     = mySectionAttribute.Approximation();
    bToApproxC2dOnS1 = mySectionAttribute.PCurveOnS1();
    bToApproxC2dOnS2 = mySectionAttribute.PCurveOnS2();
    //
    anApproxTol=1.e-7;
    //
    IntTools_FaceFace aFF;
    //
    aFF.SetParameters (bToApproxC3d, bToApproxC2dOnS1,
                       bToApproxC2dOnS2, anApproxTol);
    //
    aFF.Perform(aF1, aF2);
    //
    bIsDone=aFF.IsDone();
    //
    if (!bIsDone) {
      BOPTools_SSInterference anInterf (nF1, nF2, 1.e-07, 1.e-07, aCvs, aPnts);
      anIndexIn=aFFs.Append(anInterf);
      continue;
    }
    //
    aTolR3D=aFF.TolReached3d();
    aTolR2D=aFF.TolReached2d();
    if (aTolR3D < 1.e-7){
      aTolR3D=1.e-7;
    }
    //
    //modified by NIZNHY-PKV Thu Sep 15 08:03:02 2011f
#if OCC_VERSION_LARGE > 0x06050100 // For OCCT6.5.2 and higher
    aFF.PrepareLines3D(bToSplit);
#else
    aFF.PrepareLines3D();
#endif // OCC_VERSION_LARGE > 0x06050100 // For OCCT6.5.2 and higher
    //modified by NIZNHY-PKV Thu Sep 15 08:03:04 2011t
    //
    const IntTools_SequenceOfCurves& aCvsX=aFF.Lines();
    const IntTools_SequenceOfPntOn2Faces& aPntsX=aFF.Points();
    //
    aNbCurves=aCvsX.Length();
    aNbPoints=aPntsX.Length();
    //
    if (!aNbCurves && !aNbPoints) {
      BOPTools_SSInterference anInterf (nF1, nF2, 1.e-07, 1.e-07, aCvs, aPnts);
      anIndexIn=aFFs.Append(anInterf);
      continue;
    }
    //
    {
      BOPTools_SSInterference anInterf (nF1, nF2, aTolR3D, aTolR2D, aCvsX, aPntsX);
      anIndexIn=aFFs.Append(anInterf);
    }
    //
  }// for (; myDSIt.More(); myDSIt.Next())
  //
  myIsDone=Standard_True;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void NMTTools_PaveFiller::PerformVE ( ) [protected, virtual]

Definition at line 75 of file NMTTools_PaveFiller_2.cxx.

{
  myIsDone=Standard_False;
  //
  Standard_Boolean bJustAdd;
  Standard_Integer n1, n2, anIndexIn, aFlag, aWhat;
  Standard_Integer aWith, aNbVEs, aBlockLength, iSDV, nV1;
  Standard_Real aT;
#if OCC_VERSION_LARGE > 0x06030008
  // In OCCT6.3.0sp9 is changed a signature of IntTools_Context::ComputeVE() method
  Standard_Boolean bToUpdateVertex;
  Standard_Real aDist;
#endif
  TopoDS_Vertex aV1;
  TopoDS_Edge aE2;
  BOPTools_IndexedMapOfCoupleOfInteger aSnareMap;
  BOPTools_CoupleOfInteger aCouple;
  //
  BOPTools_CArray1OfVEInterference& aVEs=myIP->VEInterferences();
  //
  myDSIt->Initialize (TopAbs_VERTEX, TopAbs_EDGE);
  //
  // BlockLength correction
  aNbVEs=myDSIt->BlockLength();
  aBlockLength=aVEs.BlockLength();
  if (aNbVEs > aBlockLength) {
    aVEs.SetBlockLength(aNbVEs);
  }
  //
  for (; myDSIt->More(); myDSIt->Next()) {
    myDSIt->Current(n1, n2, bJustAdd);
    if (!IsSuccessorsComputed(n1, n2)) {
      anIndexIn=0;
      aWhat=n1; // Vertex
      aWith=n2; // Edge
      if (myDS->GetShapeType(n1)==TopAbs_EDGE) {
        aWhat=n2;
        aWith=n1;
      }
      //
      if(bJustAdd) {
        continue;
      }
      // Edge
      aE2=TopoDS::Edge(myDS->Shape(aWith));
      if (BRep_Tool::Degenerated(aE2)){
        continue;
      }
      // Vertex
      nV1=aWhat;
      aV1=TopoDS::Vertex(myDS->Shape(aWhat));
      //
      iSDV=FindSDVertex(aWhat);
      if (iSDV) {
        nV1=iSDV;
        aV1=TopoDS::Vertex(myDS->Shape(nV1));
        // Modified to find same domain vertex Thu Sep 14 14:35:18 2006
        // Contribution of Samtech www.samcef.com BEGIN
        Standard_Integer nVE, iSDVE, iRet;
        //
        BooleanOperations_OnceExplorer aExp(*myDS);
        iRet=0;
        aExp.Init(aWith, TopAbs_VERTEX);
        for (; aExp.More(); aExp.Next()) {
          nVE=aExp.Current();
          iSDVE=FindSDVertex(nVE);
          if (iSDVE==iSDV) {
            iRet=1;
            break;
          }
        }
        if (iRet) {
          continue;
        }
      }
      else {
        if (Contains(aE2, aV1)) {
          continue;
        }
        // Contribution of Samtech www.samcef.com END
      }
      //
      //modified by NIZNHY-PKV Mon Dec 28 08:58:05 2009f
#if OCC_VERSION_LARGE > 0x06030008
      // In OCCT6.3.0sp9 is changed a signature of IntTools_Context::ComputeVE() method
      aFlag = myContext->ComputeVE (aV1, aE2, aT, bToUpdateVertex, aDist);
#else
      aFlag = myContext->ComputeVE (aV1, aE2, aT);
#endif
      //modified by NIZNHY-PKV Mon Dec 28 08:58:13 2009t
      //
      if (!aFlag) {
        // Add Interference to the Pool
        BOPTools_VEInterference anInterf (aWhat, aWith, aT);
        anIndexIn=aVEs.Append(anInterf);
        //
        // Add Pave to the Edge's myPavePool
        aCouple.SetCouple(nV1, aWith);
        if (!aSnareMap.Contains(aCouple)){
          aSnareMap.Add(aCouple);
          //
          BOPTools_Pave aPave(nV1, aT, BooleanOperations_VertexEdge);
          aPave.SetInterference(anIndexIn);
          BOPTools_PaveSet& aPaveSet= myPavePool(myDS->RefEdge(aWith));
          aPaveSet.Append(aPave);
        }
        //
        // State for the Vertex in DS;
        myDS->SetState (aWhat, BooleanOperations_ON);
        // Insert Vertex in Interference Object
        BOPTools_VEInterference& aVE=aVEs(anIndexIn);
        aVE.SetNewShape(aWhat);
        //
        myIP->Add(aWhat, aWith, Standard_True, NMTDS_TI_VE);
        //
        //modified by NIZNHY-PKV Mon Dec 28 09:00:54 2009f
#if OCC_VERSION_LARGE > 0x06030008
        // In OCCT6.3.0sp9 is changed a signature of IntTools_Context::ComputeVE() method
        if (bToUpdateVertex) {
          BRep_Builder aBB;
          //
          aBB.UpdateVertex(aV1, aDist);
        }
#endif
        //modified by NIZNHY-PKV Mon Dec 28 09:00:57 2009t
        //
      } //if (!aFlag) {
    }
  }
  myIsDone=Standard_True;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void NMTTools_PaveFiller::PerformVF ( ) [protected, virtual]

Definition at line 54 of file NMTTools_PaveFiller_3.cxx.

{
  myIsDone=Standard_False;
  //
  Standard_Boolean aJustAdd;
  Standard_Integer n1, n2, anIndexIn, aFlag, aWhat, aWith, aNbVSs, aBlockLength, iSDV;
  Standard_Real aU, aV;
  TopoDS_Vertex aV1;
  TopoDS_Face aF2;
  //
  BOPTools_CArray1OfVSInterference& aVSs=myIP->VSInterferences();
  //
  // V/E Interferences
  myDSIt->Initialize(TopAbs_VERTEX, TopAbs_FACE);
  //
  // BlockLength correction
  aNbVSs=myDSIt->BlockLength();
  aBlockLength=aVSs.BlockLength();
  if (aNbVSs > aBlockLength) {
    aVSs.SetBlockLength(aNbVSs);
  }
  //
  for (; myDSIt->More(); myDSIt->Next()) {
    myDSIt->Current(n1, n2, aJustAdd);
    if (! IsSuccessorsComputed(n1, n2)) {
      anIndexIn=0;
      aWhat=n1; // Vertex
      aWith=n2; // Face
      if (myDS->GetShapeType(n1)==TopAbs_FACE) {
        aWhat=n2;
        aWith=n1;
      }
      //
      iSDV=FindSDVertex(aWhat);
        //
      if(aJustAdd) {
        //myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexSurface, anIndexIn);
        continue;
      }
      //
      aV1=TopoDS::Vertex(myDS->Shape(aWhat));
      if (iSDV) {
        aV1=TopoDS::Vertex(myDS->Shape(iSDV));
      }
        //
      aF2=TopoDS::Face(myDS->Shape(aWith));
      //
      // Modified  Thu Sep 14 14:35:18 2006
      // Contribution of Samtech www.samcef.com BEGIN
      if (Contains(aF2, aV1)) {
        continue;
      }
      // Contribution of Samtech www.samcef.com END
      //
      aFlag=myContext->ComputeVS (aV1, aF2, aU, aV);
      //
      if (!aFlag) {
        //
        // Add Interference to the Pool
        BOPTools_VSInterference anInterf (aWhat, aWith, aU, aV);
        anIndexIn=aVSs.Append(anInterf);
        //
        // SetState for Vertex in DS;
        myDS->SetState (aWhat, BooleanOperations_ON);
        // Insert Vertex in Interference Object
        BOPTools_VSInterference& aVS=aVSs(anIndexIn);
        aVS.SetNewShape(aWhat);
        // qqf
        {
          myIP->Add(aWhat, aWith, Standard_True, NMTDS_TI_VF);
        }
        // qqt
      }
      //myIntrPool->AddInterference(aWhat, aWith, BooleanOperations_VertexSurface, anIndexIn);
    }
  }
  myIsDone=Standard_True;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void NMTTools_PaveFiller::PerformVF1 ( ) [protected]

Definition at line 1504 of file NMTTools_PaveFiller_4.cxx.

{
  Standard_Integer i, aNbEE, n1, n2, nNewShape, aNbS, nF;
  Standard_Integer anIndexIn, aFlag;
  Standard_Real aU, aV;
  TColStd_ListOfInteger aLFI;
  TColStd_ListIteratorOfListOfInteger aItLFI;
  //
  BOPTools_CArray1OfVSInterference& aVSs=myIP->VSInterferences();
  BOPTools_CArray1OfEEInterference& aEEs=myIP->EEInterferences();
  //
  aNbS=myDS->NumberOfShapesOfTheObject();
  for (i=1; i<=aNbS; ++i) {
    const TopoDS_Shape& aF=myDS->Shape(i);
    if (aF.ShapeType()==TopAbs_FACE) {
      aLFI.Append(i);
    }
  }
  if (!aLFI.Extent()) {
    return;
  }
  //
  aNbEE=aEEs.Extent();
  for (i=1; i<=aNbEE; ++i) {
    BOPTools_EEInterference& aEE=aEEs(i);
    aEE.Indices(n1, n2);
    nNewShape=aEE.NewShape();
    if (!nNewShape) {
      continue;
    }
    //
    const TopoDS_Shape& aSnew=myDS->Shape(nNewShape);
    if (aSnew.ShapeType()!=TopAbs_VERTEX) {
      continue;
    }
    //
    const TopoDS_Vertex& aVnew=TopoDS::Vertex(aSnew);
    //
    Bnd_Box aBV;
    //
    BRepBndLib::Add(aVnew, aBV);
    //
    aItLFI.Initialize(aLFI);
    for (; aItLFI.More(); aItLFI.Next()) {
      nF=aItLFI.Value();
      //
      const TopoDS_Face& aF=TopoDS::Face(myDS->Shape(nF));
      const Bnd_Box& aBF=myDS->GetBoundingBox(nF);
      if (aBF.IsOut(aBV)) {
        continue;
      }
      //
      anIndexIn=0;
      aFlag=myContext->ComputeVS (aVnew, aF, aU, aV);
      if (!aFlag) {
        BOPTools_VSInterference anInterf (nNewShape, nF, aU, aV);
        //
        anIndexIn=aVSs.Append(anInterf);
        BOPTools_VSInterference& aVS=aVSs(anIndexIn);
        aVS.SetNewShape(nNewShape);//->
      }
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void NMTTools_PaveFiller::PerformVV ( ) [protected, virtual]

Definition at line 56 of file NMTTools_PaveFiller_1.cxx.

{
  myIsDone=Standard_False;
  //
  Standard_Integer aNbVVs, aBL, aNbVSD, nVnew, i, j, n1, n2;
  TColStd_DataMapIteratorOfDataMapOfIntegerListOfInteger aIt1;
  TColStd_ListIteratorOfListOfInteger aItX, aItY;
  TColStd_ListOfInteger aLIX;
  TopTools_ListOfShape aLV;
  TopoDS_Vertex aVnew;
  //
  myVSD.Clear();
  //
  const TColStd_DataMapOfIntegerListOfInteger& aMVSD=myDSIt->SDVertices();
  aNbVSD=aMVSD.Extent();
  if (!aNbVSD) {
    return;
  }
  //
  BOPTools_CArray1OfVVInterference& aVVs=myIP->VVInterferences();
  //
  // BlockLength correction
  myDSIt->Initialize(TopAbs_VERTEX, TopAbs_VERTEX);
  aNbVVs=myDSIt->BlockLength();
  aBL=aVVs.BlockLength();
  if (aNbVVs > aBL) {
    aVVs.SetBlockLength(aNbVVs);
  }
  //
  aIt1.Initialize(aMVSD);
  for (; aIt1.More(); aIt1.Next()) {
    aLV.Clear();
    //
    n1=aIt1.Key();
    const TColStd_ListOfInteger& aLIV=aIt1.Value();
    //
    // new vertex
    const TopoDS_Shape& aS1=myDS->Shape(n1);
    aLV.Append(aS1);
    aItX.Initialize(aLIV);
    for (; aItX.More(); aItX.Next()) {
      n2=aItX.Value();
      const TopoDS_Shape& aS2=myDS->Shape(n2);
      aLV.Append(aS2);
    }
    //
    NMTTools_Tools::MakeNewVertex(aLV, aVnew);
    //
    BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
    //
    myDS->InsertShapeAndAncestorsSuccessors(aVnew, anASSeq);
    nVnew=myDS->NumberOfInsertedShapes();
    myDS->SetState (nVnew, BooleanOperations_ON);
    //
    // myVSD, aLIX
    aLIX.Clear();
    aLIX.Append(n1);
    myVSD.Bind(n1, nVnew);
    //
    aItX.Initialize(aLIV);
    for (; aItX.More(); aItX.Next()) {
      n2=aItX.Value();
      aLIX.Append(n2);
      myVSD.Bind(n2, nVnew);
    }
    //
    // interferences
    aItX.Initialize(aLIX);
    for (i=0; aItX.More(); aItX.Next(), ++i) {
      aItY.Initialize(aLIX);
      for (j=0; aItY.More(); aItY.Next(), ++j) {
        if (j>i) {
          n1=aItX.Value();
          n2=aItY.Value();
          myIP->Add(n1, n2, Standard_True, NMTDS_TI_VV);
          //
          BOPTools_VVInterference aVV(n1, n2);
          aVV.SetNewShape(nVnew);
          aVVs.Append(aVV);
        }
      }
    }
  }//for (; aIt1.More(); aIt1.Next()) {
  myIsDone=Standard_True;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void NMTTools_PaveFiller::PrepareEdges ( ) [protected, virtual]

Definition at line 211 of file NMTTools_PaveFiller_2.cxx.

{
  Standard_Integer  i, nV, ii, aNBSuc, ip, aNbShapesObject;
  Standard_Real aT;
  TopAbs_Orientation anOr;
  TopoDS_Edge   aE;
  TopoDS_Vertex aV;
  //
  aNbShapesObject=myDS->NumberOfShapesOfTheObject();
  for (i=1; i<=myNbSources; ++i) {
    if (myDS->GetShapeType(i)==TopAbs_EDGE) {
      aE=TopoDS::Edge(myDS->Shape(i));
      //
      if (BRep_Tool::Degenerated(aE)){
        continue;
      }
      //
      BOPTools_PaveSet& aPaveSet=myPavePool(myDS->RefEdge(i));
      //
      // A <-
      aNBSuc=myDS->NumberOfSuccessors(i);
      for (ii=1; ii <=aNBSuc; ii++) {
        nV=myDS->GetSuccessor(i, ii);
        anOr=myDS->GetOrientation(i, ii);
        aV=TopoDS::Vertex(myDS->Shape(nV));
        aV.Orientation(anOr);
        aT=BRep_Tool::Parameter(aV, aE);
        //
        ip=FindSDVertex(nV);
        if (ip) {
          aV=TopoDS::Vertex(myDS->Shape(ip));
          aV.Orientation(anOr);// XX ? if the edge is closed it'll be amazing result
          nV=ip;
        }
        //
        BOPTools_Pave aPave(nV, aT);
        aPaveSet.Append (aPave);
      }
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void NMTTools_PaveFiller::PrepareFace ( const Standard_Integer  nF,
TopoDS_Face &  aF 
)

Definition at line 61 of file NMTTools_PaveFiller_9.cxx.

{
  Standard_Boolean bToReverse, bIsDegenerated;
  Standard_Integer iRankF, nE, nSp, aNbPB;
  Standard_Real aTol;
  TopLoc_Location aLoc;
  TopoDS_Face aF;
  TopoDS_Wire newWire;
  TopoDS_Edge aSp;
  TopAbs_Orientation anOrF, anOrE;
  BRep_Builder aBB;
  TopExp_Explorer aExpW, aExpE;
  BOPTools_ListIteratorOfListOfPaveBlock aItPB;
  //
  iRankF=myDS->Rank(nF);
  aF=TopoDS::Face(myDS->Shape(nF));
  anOrF=aF.Orientation();
  aF.Orientation(TopAbs_FORWARD);
  //
  Handle(Geom_Surface) aS=BRep_Tool::Surface(aF, aLoc);
  aTol=BRep_Tool::Tolerance(aF);
  //
  aBB.MakeFace (newFace, aS, aLoc, aTol);
  //
  aExpW.Init(aF, TopAbs_WIRE);
  for (; aExpW.More(); aExpW.Next()) {
    const TopoDS_Shape& aW=aExpW.Current();
    aBB.MakeWire(newWire);
    //
    aExpE.Init(aW, TopAbs_EDGE);
    for (; aExpE.More(); aExpE.Next()) {
      const TopoDS_Edge& aE=TopoDS::Edge(aExpE.Current());
      bIsDegenerated=BRep_Tool::Degenerated(aE);
      anOrE=aE.Orientation();
      //
      nE=myDS->ShapeIndex(aE, iRankF);
      const BOPTools_ListOfPaveBlock& aLPB=mySplitShapesPool(myDS->RefEdge(nE));
      aNbPB=aLPB.Extent();
      if (!aNbPB) {
        aBB.Add(newWire, aE);
        continue;
      }
      //
      aItPB.Initialize(aLPB);
      for (; aItPB.More(); aItPB.Next()) {
        const BOPTools_PaveBlock& aPB=aItPB.Value();
        const BOPTools_PaveBlock& aPBR=RealPaveBlock(aPB);
        nSp=aPBR.Edge();
        //
        aSp=TopoDS::Edge(myDS->Shape(nSp));
        if (!bIsDegenerated) {
          bToReverse=BOPTools_Tools3D::IsSplitToReverse1(aSp, aE, myContext);
          if (bToReverse) {
            aSp.Reverse();
          }
        }
        else {
         aSp.Orientation(anOrE);
        }
        aBB.Add(newWire, aSp);
      }
    }
    aBB.Add(newFace, newWire);
  }
  newFace.Orientation(anOrF);
}

Here is the call graph for this function:

void NMTTools_PaveFiller::PreparePaveBlocks ( const TopAbs_ShapeEnum  aType1,
const TopAbs_ShapeEnum  aType2 
) [protected, virtual]

Reimplemented in NMTTools_CheckerSI.

Definition at line 897 of file NMTTools_PaveFiller_4.cxx.

{
  myIsDone=Standard_False;
  //
  Standard_Boolean bOk1, bOk2, bOk3, bFlag;
  Standard_Integer i, aNb, nE[2], n1, n2, aNbSplits;
  TColStd_MapOfInteger aMap;
  //
  bOk1= (aType1==TopAbs_VERTEX) &&  (aType2==TopAbs_EDGE) ;
  bOk2= (aType1==TopAbs_EDGE)   &&  (aType2==TopAbs_EDGE) ;
  bOk3= (aType1==TopAbs_EDGE)   &&  (aType2==TopAbs_FACE) ;
  if (!bOk1 && !bOk2 && !bOk3) {// error: Type mismatch
    return;
  }
  //
  aNb=bOk2 ? 2 : 1;
  //
  myDSIt->Initialize(aType1, aType2);
  for (; myDSIt->More(); myDSIt->Next()) {
    myDSIt->Current(n1, n2, bFlag);
    //
    nE[0]=n1;
    nE[1]=n2;
    if (myDS->GetShapeType(n1)!=TopAbs_EDGE) {
      nE[0]=n2;
      nE[1]=n1;
    }
    //
    for (i=0; i<aNb; ++i) {
      BOPTools_ListOfPaveBlock& aLPB=mySplitShapesPool(myDS->RefEdge(nE[i]));
      aNbSplits=aLPB.Extent();
      if (!aNbSplits) {
        if (aMap.Add(nE[i])) {
          PreparePaveBlocks(nE[i]);
          if (!myIsDone) {
            return;
          }
        }
      }
    }
  }// for (; myDSIt.More(); myDSIt.Next())
  myIsDone=Standard_True;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void NMTTools_PaveFiller::PreparePaveBlocks ( const Standard_Integer  anE) [protected, virtual]

Reimplemented in NMTTools_CheckerSI.

Definition at line 946 of file NMTTools_PaveFiller_4.cxx.

{
  myIsDone=Standard_False;
  //
  char buf[512];
  Standard_Integer nV1, nV2, iErr;
  TopoDS_Edge aE;
  TopoDS_Vertex aV1, aV2;
  //
  BOPTools_ListOfPaveBlock& aLPB=mySplitShapesPool(myDS->RefEdge(nE));
  // Edge
  aE=TopoDS::Edge(myDS->Shape(nE));
  if (BRep_Tool::Degenerated(aE)) {
    myIsDone=Standard_True;
    return;
  }
  //
  BOPTools_PaveSet& aPS=myPavePool(myDS->RefEdge(nE));
  //
  BOPTools_PaveBlockIterator aPBIt(nE, aPS);
  for (; aPBIt.More(); aPBIt.Next()) {
    BOPTools_PaveBlock& aPB=aPBIt.Value();
    const IntTools_Range& aRange=aPB.Range();
    //
    const BOPTools_Pave& aPave1=aPB.Pave1();
    nV1=aPave1.Index();
    aV1=TopoDS::Vertex(myDS->GetShape(nV1));
    //
    const BOPTools_Pave& aPave2=aPB.Pave2();
    nV2=aPave2.Index();
    aV2=TopoDS::Vertex(myDS->GetShape(nV2));
    //
    // ShrunkRange
    IntTools_ShrunkRange aSR (aE, aV1, aV2, aRange, myContext);
    iErr=aSR.ErrorStatus();
    if (!aSR.IsDone()) {
      sprintf (buf, "Can not obtain ShrunkRange for Edge %d\n", nE);
      BOPTColStd_Dump::PrintMessage(buf);
      sprintf (buf, "Can not obtain ShrunkRange for Edge %d", nE);
      throw
        BOPTColStd_Failure(buf) ;
    }
    //
    if (iErr==6) {
      sprintf(buf,
              "Warning: [PreparePaveBlocks()] Max.Dummy Shrunk Range for Edge %d\n", nE);
      BOPTColStd_Dump::PrintMessage(buf);
    }
    else {
      // Check left paves and correct ShrunkRange if it is necessary
      CorrectShrunkRanges (0, aPave1, aSR);
      CorrectShrunkRanges (1, aPave2, aSR);
    }
    //
    aPB.SetShrunkRange(aSR);
    aLPB.Append(aPB);
  } //for (; aPBIt.More(); aPBIt.Next())
  myIsDone=Standard_True;
}

Here is the call graph for this function:

void NMTTools_PaveFiller::PrepareSetForFace ( const Standard_Integer  nF1,
const Standard_Integer  nF2,
const BOPTools_ListOfPaveBlock &  aLPB,
BOPTools_PaveSet &  aPSF 
)

Definition at line 1068 of file NMTTools_PaveFiller_6.cxx.

{
  Standard_Integer nV1, nV2;
  TColStd_MapOfInteger aMap;
  BOPTools_ListIteratorOfListOfPaveBlock anIt;
  //
  anIt.Initialize(aLPBC);
  for (; anIt.More(); anIt.Next()) {
    const BOPTools_PaveBlock& aPB=anIt.Value();
    const BOPTools_Pave& aPave1=aPB.Pave1();
    nV1=aPave1.Index();
    if (!aMap.Contains(nV1)) {
      aMap.Add(nV1);
      aPSF.Append(aPave1);
    }
    const BOPTools_Pave& aPave2=aPB.Pave2();
    nV2=aPave2.Index();
    if (!aMap.Contains(nV2)) {
      aMap.Add(nV2);
      aPSF.Append(aPave2);
    }
  }
}

Here is the caller graph for this function:

void NMTTools_PaveFiller::PutBoundPaveOnCurve ( BOPTools_Curve &  aBC,
BOPTools_SSInterference &  aFF 
)

Definition at line 943 of file NMTTools_PaveFiller_6.cxx.

{
  Standard_Boolean bHasBounds, bVF;
  Standard_Integer nF1, nF2;
  Standard_Real aT1, aT2, aTolR3D;
  gp_Pnt aP1, aP2;
  //
  const IntTools_Curve& aIC=aBC.Curve();
  bHasBounds=aIC.HasBounds ();
  if (!bHasBounds){
    return;
  }
  //
  // Bounds
  aIC.Bounds (aT1, aT2, aP1, aP2);
  //
  // Faces
  aFFi.Indices(nF1, nF2);
  aTolR3D=aFFi.TolR3D();
  //
  const TopoDS_Face aF1=TopoDS::Face(myDS->GetShape(nF1));//mpv
  const TopoDS_Face aF2=TopoDS::Face(myDS->GetShape(nF2));//mpv
  //
  bVF=myContext->IsValidPointForFaces (aP1, aF1, aF2, aTolR3D);
  if (bVF) {
    PutBoundPaveOnCurve (aP1, aT1, aBC, aFFi);
  }
  //
  bVF=myContext->IsValidPointForFaces (aP2, aF1, aF2, aTolR3D);
  if (bVF) {
    PutBoundPaveOnCurve (aP2, aT2, aBC, aFFi);
  }
}

Here is the caller graph for this function:

void NMTTools_PaveFiller::PutBoundPaveOnCurve ( const gp_Pnt &  aP,
const Standard_Real  aT,
BOPTools_Curve &  aBC,
BOPTools_SSInterference &  aFF 
)

Definition at line 982 of file NMTTools_PaveFiller_6.cxx.

{
  Standard_Boolean bFound1, bFound2;
  Standard_Integer nV;
  Standard_Real aTolV=aFFi.TolR3D();

  BOPTools_Pave aPave1, aPave2, aPave;
  BOPTools_PaveSet& aCPS=aBC.Set();
  BOPTools_PaveSet& aFFiPS=aFFi.NewPaveSet();
  const IntTools_Curve& aIC=aBC.Curve();
  //
  bFound1=FindPave(aP, aTolV, aCPS  , aPave1);
  bFound2=FindPave(aP, aTolV, aFFiPS, aPave2);
  //
  if (!bFound1 && !bFound2) {
    TopoDS_Vertex aNewVertex;
    BOPTools_Tools::MakeNewVertex(aP, aTolV, aNewVertex);
    //
    BooleanOperations_AncestorsSeqAndSuccessorsSeq anASSeq;
    myDS->InsertShapeAndAncestorsSuccessors(aNewVertex, anASSeq);
    nV=myDS->NumberOfInsertedShapes();
    aPave.SetIndex(nV);
    aPave.SetParam(aT);

    aCPS.Append(aPave);
    aFFiPS.Append(aPave);
    //
    // Append Techno Vertex to the Curve
    TColStd_ListOfInteger& aTVs=aBC.TechnoVertices();
    aTVs.Append(nV);
  }
  if (bFound1 && !bFound2) {
    nV=aPave1.Index();
    aPave.SetIndex(nV);
    aPave.SetParam(aT);
    aFFiPS.Append(aPave);
    //
    const TopoDS_Vertex aV=TopoDS::Vertex(myDS->Shape(nV));//mpv
    BOPTools_Tools::UpdateVertex (aIC, aT, aV);
  }

  if (!bFound1 && bFound2) {
    nV=aPave2.Index();
    aPave.SetIndex(nV);
    aPave.SetParam(aT);
    aCPS.Append(aPave);
    //
    const TopoDS_Vertex aV=TopoDS::Vertex(myDS->Shape(nV));//mpv
    BOPTools_Tools::UpdateVertex (aIC, aT, aV);
  }
}

Here is the call graph for this function:

Standard_EXPORT void NMTTools_PaveFiller::PutClosingPaveOnCurve ( BOPTools_Curve &  aBC,
BOPTools_SSInterference &  aFF 
)

Here is the caller graph for this function:

void NMTTools_PaveFiller::PutPaveOnCurve ( const BOPTools_PaveSet &  aPSF,
const Standard_Real  aTol,
BOPTools_Curve &  aBC 
)

Definition at line 1248 of file NMTTools_PaveFiller_6.cxx.

{
  Standard_Integer nV;
  Standard_Boolean bIsVertexOnLine;
  Standard_Real aT;
  BOPTools_ListIteratorOfListOfPave anIt;
  Bnd_Box aBBC;
  GeomAdaptor_Curve aGAC;
  //
  const IntTools_Curve& aC=aBC.Curve();
  Handle (Geom_Curve) aC3D= aC.Curve();
  aGAC.Load(aC3D);
  BndLib_Add3dCurve::Add(aGAC, aTolR3D, aBBC);
  //
  const BOPTools_ListOfPave& aLP=aPaveSet.Set();
  anIt.Initialize(aLP);
  for (; anIt.More(); anIt.Next()) {
    const BOPTools_Pave& aPave=anIt.Value();
    //
    nV=aPave.Index();
    const TopoDS_Vertex aV=TopoDS::Vertex(myDS->Shape(nV));
    //
    Bnd_Box aBBV;
    BRepBndLib::Add(aV, aBBV);
    if (aBBC.IsOut(aBBV)){
      continue;
    }
    //
    bIsVertexOnLine=myContext->IsVertexOnLine(aV, aC, aTolR3D, aT);
    //
    //
    if (bIsVertexOnLine) {
      BOPTools_Pave aPaveNew(nV, aT, BooleanOperations_SurfaceSurface);
      BOPTools_PaveSet& aPS=aBC.Set();
      aPS.Append(aPaveNew);
      //<-B
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

const BOPTools_PaveBlock & NMTTools_PaveFiller::RealPaveBlock ( const BOPTools_PaveBlock &  aPB)

Definition at line 126 of file NMTTools_PaveFiller_8.cxx.

{
  Standard_Integer nE;
  //
  nE=aPB.OriginalEdge();
  const NMTTools_ListOfCommonBlock& aLCBE=myCommonBlockPool(myDS->RefEdge(nE));
  NMTTools_CommonBlockAPI aCBAPI(aLCBE);
  if (aCBAPI.IsCommonBlock(aPB)) {
    NMTTools_CommonBlock& aCB=aCBAPI.CommonBlock(aPB);
    const BOPTools_PaveBlock& aPBx=aCB.PaveBlock1();
    return aPBx;
  }
  return aPB;
}

Here is the call graph for this function:

Here is the caller graph for this function:

const BOPTools_PaveBlock & NMTTools_PaveFiller::RealPaveBlock ( const BOPTools_PaveBlock &  aPB,
TColStd_ListOfInteger &  aLB,
Standard_Integer &  aIsCommonBlock 
)

Definition at line 91 of file NMTTools_PaveFiller_8.cxx.

{
  Standard_Integer nE, nSpx;
  BOPTools_ListIteratorOfListOfPaveBlock aItPBx;
  //
  aIsCommonBlock=0;
  aLB.Clear();
  nE=aPB.OriginalEdge();
  const NMTTools_ListOfCommonBlock& aLCBE=myCommonBlockPool(myDS->RefEdge(nE));
  NMTTools_CommonBlockAPI aCBAPI(aLCBE);
  if (aCBAPI.IsCommonBlock(aPB)) {
    NMTTools_CommonBlock& aCB=aCBAPI.CommonBlock(aPB);
    //
    aIsCommonBlock=1;
    //
    const BOPTools_ListOfPaveBlock& aLPBx=aCB.PaveBlocks();
    aItPBx.Initialize(aLPBx);
    for (; aItPBx.More(); aItPBx.Next()) {
      const BOPTools_PaveBlock& aPBx=aItPBx.Value();
      nSpx=aPBx.Edge();
      aLB.Append(nSpx);
    }
    //
    const BOPTools_PaveBlock& aPBx=aCB.PaveBlock1();
    return aPBx;
  }
  return aPB;
}

Here is the call graph for this function:

void NMTTools_PaveFiller::RealSplitsFace ( const Standard_Integer  nF2,
BOPTools_ListOfPaveBlock &  aLs 
)

Definition at line 180 of file NMTTools_PaveFiller_8.cxx.

{
  Standard_Integer nE;
  BOPTools_ListIteratorOfListOfPaveBlock anIt;
  //
  BooleanOperations_ShapesDataStructure *pDS=myDS;
  BooleanOperations_OnceExplorer aExp(*pDS);
  //
  aExp.Init(nF, TopAbs_EDGE);
  for (; aExp.More(); aExp.Next()) {
    nE=aExp.Current();
    const BOPTools_ListOfPaveBlock& aLPBE=mySplitShapesPool(myDS->RefEdge(nE));
    anIt.Initialize(aLPBE);
    for (; anIt.More(); anIt.Next()) {
      const BOPTools_PaveBlock& aPB=anIt.Value();
      const BOPTools_PaveBlock& aPBR=RealPaveBlock(aPB);
      aLPB.Append(aPBR);
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void NMTTools_PaveFiller::RealSplitsInFace ( const Standard_Integer  aBid,
const Standard_Integer  nF1,
const Standard_Integer  nF2,
BOPTools_ListOfPaveBlock &  aLs 
)

Definition at line 227 of file NMTTools_PaveFiller_8.cxx.

{
  Standard_Integer nE1;
  //
  BooleanOperations_ShapesDataStructure *pDS=myDS;
  BooleanOperations_OnceExplorer aExp(*pDS);
  aExp.Init(nF1, TopAbs_EDGE);
  for (; aExp.More(); aExp.Next()) {
    nE1=aExp.Current();
    RealSplitsInFace (nE1, nF2, aLPB);
  }
}

Here is the caller graph for this function:

void NMTTools_PaveFiller::RealSplitsInFace ( const Standard_Integer  nE1,
const Standard_Integer  nF2,
BOPTools_ListOfPaveBlock &  aLs 
)

Definition at line 246 of file NMTTools_PaveFiller_8.cxx.

{
  Standard_Integer nF1;
  //
  TColStd_ListIteratorOfListOfInteger anItLFCB;
  NMTTools_ListIteratorOfListOfCommonBlock anItCB;
  //
  const NMTTools_ListOfCommonBlock& aLCB=myCommonBlockPool(myDS->RefEdge(nE1));
  //
  anItCB.Initialize(aLCB);
  for (; anItCB.More(); anItCB.Next()) {
    NMTTools_CommonBlock& aCB=anItCB.ChangeValue();
    const BOPTools_PaveBlock& aPB1=aCB.PaveBlock1(nE1);
    const BOPTools_PaveBlock& aPB1R=RealPaveBlock(aPB1);

    const TColStd_ListOfInteger& aLFCB=aCB.Faces();
    anItLFCB.Initialize(aLFCB);
    for (; anItLFCB.More(); anItLFCB.Next()) {
      nF1=anItLFCB.Value();
      if (nF1==nF2) {
        aLPB.Append(aPB1R);
      }
    }
  }
}

Here is the call graph for this function:

void NMTTools_PaveFiller::RealSplitsInFace ( const Standard_Integer  nF1,
BOPTools_ListOfPaveBlock &  aLPB 
)

Definition at line 706 of file NMTTools_PaveFiller_8.cxx.

{
  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.ChangeValue();
      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);
  }
}

Here is the call graph for this function:

void NMTTools_PaveFiller::RealSplitsOnEdge ( const Standard_Integer  nE1,
const Standard_Integer  nE2,
BOPTools_ListOfPaveBlock &  aLs 
)

Definition at line 277 of file NMTTools_PaveFiller_8.cxx.

{
  Standard_Integer nE;
  //
  BOPTools_ListIteratorOfListOfPaveBlock anIt;
  NMTTools_ListIteratorOfListOfCommonBlock anItCB;
  //
  const NMTTools_ListOfCommonBlock& aLCB=myCommonBlockPool(myDS->RefEdge(nE1));

  anItCB.Initialize(aLCB);
  for (; anItCB.More(); anItCB.Next()) {
    NMTTools_CommonBlock& aCB=anItCB.ChangeValue();
    const BOPTools_PaveBlock& aPB1=aCB.PaveBlock1(nE1);
    const BOPTools_PaveBlock& aPB1R=RealPaveBlock(aPB1);
    //
    const BOPTools_ListOfPaveBlock& aLPBx=aCB.PaveBlocks();
    anIt.Initialize(aLPBx);
    for (; anIt.More(); anIt.Next()) {
      const BOPTools_PaveBlock& aPB2=anIt.Value();
      nE=aPB2.OriginalEdge();
      if (nE==nE2) {
        aLPB.Append(aPB1R);
      }
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void NMTTools_PaveFiller::RealSplitsOnFace ( const Standard_Integer  nE1,
const Standard_Integer  nF2,
BOPTools_ListOfPaveBlock &  aLs 
)

Definition at line 309 of file NMTTools_PaveFiller_8.cxx.

{
  Standard_Integer nE2;
  //
  BooleanOperations_ShapesDataStructure *pDS=myDS;
  BooleanOperations_OnceExplorer aExp(*pDS);
  aExp.Init(nF2, TopAbs_EDGE);
  for (; aExp.More(); aExp.Next()) {
    nE2=aExp.Current();
    RealSplitsOnEdge(nE1, nE2, aLPB);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void NMTTools_PaveFiller::RealSplitsOnFace ( const Standard_Integer  aBid,
const Standard_Integer  nF1,
const Standard_Integer  nF2,
BOPTools_ListOfPaveBlock &  aLs 
)

Definition at line 327 of file NMTTools_PaveFiller_8.cxx.

{
  Standard_Integer nE1;
  //
//   BooleanOperations_ShapesDataStructure *pDS=myDS;
  BooleanOperations_OnceExplorer aExp(*myDS);
  aExp.Init(nF1, TopAbs_EDGE);
  for (; aExp.More(); aExp.Next()) {
    nE1=aExp.Current();
    RealSplitsOnFace(nE1, nF2, aLPB);
  }
}

Here is the call graph for this function:

Definition at line 863 of file NMTTools_PaveFiller_4.cxx.

{
  Standard_Integer  i, aNbNew;

  for (i=1; i<=myNbSources; i++) {

    if ((myDS->GetShape(i)).ShapeType()==TopAbs_EDGE) {
      BOPTools_PaveSet& aPS= myPavePool(myDS->RefEdge(i));
      //
      BOPTools_PaveSet& aNewPS= myPavePoolNew(myDS->RefEdge(i));
      BOPTools_ListOfPave& aNewLP=aNewPS.ChangeSet();
      //
      aNbNew=aNewLP.Extent();
      if (aNbNew) {
        BOPTools_ListIteratorOfListOfPave anIt(aNewLP);
        for (; anIt.More(); anIt.Next()) {
          const BOPTools_Pave& aPave=anIt.Value();
          aPS.Append(aPave);
        }
        // Clear the ListOfPaveBlock
        BOPTools_ListOfPaveBlock& aLPB=mySplitShapesPool(myDS->RefEdge(i));
        aLPB.Clear();
        // Prepare the paveBlocks for that egde again
        PreparePaveBlocks(i);
      }
      aNewLP.Clear();
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1236 of file NMTTools_PaveFiller_4.cxx.

{
  Standard_Integer nE;
  NMTTools_ListOfCommonBlock aLCBx;
  NMTTools_ListIteratorOfListOfCommonBlock anItCB, anItCBE;
  BOPTools_ListIteratorOfListOfPaveBlock anItLPB;
  //
  anItCB.Initialize(aLCB);
  for (; anItCB.More(); anItCB.Next()) {
    const NMTTools_CommonBlock& aCB=anItCB.Value();
    const BOPTools_ListOfPaveBlock& aLPB=aCB.PaveBlocks();
    //
    // Remove aCB from each edge
    anItLPB.Initialize(aLPB);
    for (; anItLPB.More(); anItLPB.Next()) {
      const BOPTools_PaveBlock& aPB=anItLPB.Value();
      nE=aPB.OriginalEdge();
      //
      NMTTools_ListOfCommonBlock& aLCBE=myCommonBlockPool(myDS->RefEdge(nE));
      anItCBE.Initialize(aLCBE);
      for (; anItCBE.More(); anItCBE.Next()) {
        const NMTTools_CommonBlock& aCBE=anItCBE.Value();
        if (aCBE.IsEqual(aCB)) {
          aLCBE.Remove(anItCBE);
          break;
        }
      }
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1131 of file NMTTools_PaveFiller_4.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void NMTTools_PaveFiller::SetCompositeShape ( const TopoDS_Shape &  aS)

Definition at line 82 of file NMTTools_PaveFiller.cxx.

Here is the caller graph for this function:

void NMTTools_PaveFiller::SharedEdges ( const Standard_Integer  nF1,
const Standard_Integer  nF2,
TColStd_ListOfInteger &  aLNE,
TopTools_ListOfShape &  aLSE 
)

Definition at line 57 of file NMTTools_PaveFiller_8.cxx.

{
  Standard_Integer nE1, nE2;
  TColStd_MapOfInteger aM1;
  //
  BooleanOperations_ShapesDataStructure *pDS=myDS;
  BooleanOperations_OnceExplorer aExp(*pDS);
  //
  aExp.Init(nF1, TopAbs_EDGE);
  for (; aExp.More(); aExp.Next()) {
    nE1=aExp.Current();
    aM1.Add(nE1);
  }

  aExp.Init(nF2, TopAbs_EDGE);
  for (; aExp.More(); aExp.Next()) {
    nE2=aExp.Current();
    if (aM1.Contains(nE2)) {
      aLNE.Append(nE2);
      const TopoDS_Shape& aE2=myDS->Shape(nE2);
      aLSE.Append(aE2);
    }
  }
}

Here is the caller graph for this function:

Definition at line 1271 of file NMTTools_PaveFiller_4.cxx.

{
  Standard_Boolean bIsCoincided;
  Standard_Integer i, j,nE, aNbE, aNbSPBx, aNbPB, k;
  BOPTools_SequenceOfPaveBlock aSPBx;
  BOPTools_ListIteratorOfListOfPaveBlock anItLPB;
  BOPTools_ListIteratorOfListOfPave anIt;
  BOPTools_PaveBlockIterator anPBIt;
  //
  const BOPTools_ListOfPaveBlock& aLPB=aCB.PaveBlocks();
  aNbE=aLPB.Extent();
  //
  // 1. Checking: Whether we realy need to split the common block ?
  anItLPB.Initialize(aLPB);
  for (; anItLPB.More(); anItLPB.Next()) {
    const BOPTools_PaveBlock& aPB=anItLPB.Value();
    nE=aPB.OriginalEdge();
    BOPTools_PaveSet& aPSE=myPavePoolNew(myDS->RefEdge(nE));
    aPSE.SortSet();
    //
    BOPTools_PaveSet aPSx;
    //
    const BOPTools_ListOfPave& aLPE=aPSE.Set();
    anIt.Initialize(aLPE);
    for (; anIt.More(); anIt.Next()) {
      const BOPTools_Pave& aPx=anIt.Value();
      if (aPB.IsInBlock(aPx)) {
        aPSx.Append(aPx);
      }
    }
    aNbPB=aPSx.Set().Extent();
    break;
  }
  //
  if (!aNbPB) {
    // we need not split it
    aLCBx.Append(aCB);
    return;
  }
  //
  // 2. Get sequence of pave Blocks containing all new pave blocks
  // for each edges's source pave Block
  anItLPB.Initialize(aLPB);
  for (; anItLPB.More(); anItLPB.Next()) {
    const BOPTools_PaveBlock& aPB=anItLPB.Value();
    const BOPTools_Pave& aPave1=aPB.Pave1();
    const BOPTools_Pave& aPave2=aPB.Pave2();
    nE=aPB.OriginalEdge();
    //
    BOPTools_PaveSet aPSx;
    //
    // the set aPsx will contain bounadry paves aPave1, aPave2 and
    // all paves of the edge nE that are inside block aPB
    aPSx.Append(aPave1);
    aPSx.Append(aPave2);
    //
    BOPTools_PaveSet& aPSE=myPavePoolNew(myDS->RefEdge(nE));
    aPSE.SortSet();
    //
    const BOPTools_ListOfPave& aLPE=aPSE.Set();
    anIt.Initialize(aLPE);
    for (; anIt.More(); anIt.Next()) {
      const BOPTools_Pave& aPx=anIt.Value();
      if (aPB.IsInBlock(aPx)) {
        aPSx.Append(aPx);
      }
    }
    //
    // Form pave blocks from aPSx and collect them in aSPBx
    anPBIt.Initialize(nE, aPSx);
    for (; anPBIt.More(); anPBIt.Next()) {
      const BOPTools_PaveBlock& aPBx=anPBIt.Value();
      aSPBx.Append(aPBx);
    }
  }
  //
  // 3. Do new common blocks
  //
  const TColStd_ListOfInteger& aLF=aCB.Faces();
  aNbSPBx=aSPBx.Length();
  aNbPB=aNbSPBx/aNbE;
  //
  Standard_Integer k1, k2, n11, n12, n21, n22;
  //
  for (i=1; i<=aNbPB; ++i) {
    NMTTools_CommonBlock aCBx;
    //
    aCBx.AddFaces(aLF);
    //
    const BOPTools_PaveBlock& aPB1=aSPBx(i);
    n11=aPB1.Pave1().Index();
    n12=aPB1.Pave2().Index();
    //
    aCBx.AddPaveBlock(aPB1);
    //
    for (j=2; j<=aNbE; ++j) {
      k1=(j-1)*aNbPB+1;
      k2=k1+aNbPB-1;
      for(k=k1; k<=k2; ++k) {
        const BOPTools_PaveBlock& aPB2=aSPBx(k);
        n21=aPB2.Pave1().Index();
        n22=aPB2.Pave2().Index();
        if ((n21==n11 && n22==n12) || (n21==n12 && n22==n11)) {
         //modified by NIZNHY-PKV Thu Nov 11 08:13:24 2010f
         bIsCoincided=CheckCoincidence(aPB2, aPB1);
         if (bIsCoincided) {
           aCBx.AddPaveBlock(aPB2);
           break;
         }
         //aCBx.AddPaveBlock(aPB2);
         //break;
         //modified by NIZNHY-PKV Thu Nov 11 08:13:31 2010t
        }
      }
    }
    aLCBx.Append(aCBx);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1141 of file NMTTools_PaveFiller_4.cxx.

{
  Standard_Integer nE;
  NMTTools_ListOfCommonBlock aLCBx;
  NMTTools_ListIteratorOfListOfCommonBlock anIt, anItCBx;
  BOPTools_ListIteratorOfListOfPaveBlock anItLPE;
  //
  anIt.Initialize(aLCB);
  for (; anIt.More(); anIt.Next()) {
    const NMTTools_CommonBlock& aCB=anIt.Value();
    //
    //XXX
    aLCBx.Clear();
    //XXX
    SplitCommonBlock(aCB, aLCBx);
    //
    anItCBx.Initialize(aLCBx);
    for (; anItCBx.More(); anItCBx.Next()) {
      const NMTTools_CommonBlock& aCBx=anItCBx.Value();
      const BOPTools_ListOfPaveBlock& aLPBx=aCBx.PaveBlocks();
      //
      anItLPE.Initialize(aLPBx);
      for (; anItLPE.More(); anItLPE.Next()) {
        const BOPTools_PaveBlock& aPBx=anItLPE.Value();
        nE=aPBx.OriginalEdge();
        NMTTools_ListOfCommonBlock& aLCBE=myCommonBlockPool(myDS->RefEdge(nE));
        aLCBE.Append(aCBx);
      }
    }
  }
  // Modified to provide the order of edges
  // in common block where the edge with max
  // tolerance value will be the first
  //  Thu Sep 14 14:35:18 2006
  // Contribution of Samtech www.samcef.com BEGIN
  Standard_Integer i, iMax, aNb, aNbCB, nSp;
  Standard_Real aTolSp, aTolMax;
  BOPTools_ListOfPaveBlock *pLPBE;
  //
  aNb=myDS->NumberOfShapesOfTheObject();
  for (nE=1; nE<=aNb; ++nE) {
    const TopoDS_Shape& aE=myDS->Shape(nE);
    if (aE.ShapeType()!=TopAbs_EDGE) {
      continue;
    }
    //
    NMTTools_ListOfCommonBlock& aLCBE=myCommonBlockPool(myDS->RefEdge(nE));
    aNbCB=aLCBE.Extent();
    if (!aNbCB) {
      continue;
    }
    //
    anIt.Initialize(aLCBE);
    for (; anIt.More(); anIt.Next()) {
      NMTTools_CommonBlock& aCBE=anIt.ChangeValue();
      const BOPTools_ListOfPaveBlock& aLPBE=aCBE.PaveBlocks();
      //
      aTolMax=-1.;
      anItLPE.Initialize(aLPBE);
      for (i=0; anItLPE.More(); anItLPE.Next(), ++i) {
        const BOPTools_PaveBlock& aPB=anItLPE.Value();
        nSp=aPB.OriginalEdge();
        const TopoDS_Edge& aSp=TopoDS::Edge(myDS->Shape(nSp));
        aTolSp=BRep_Tool::Tolerance(aSp);
        if (aTolSp>aTolMax) {
          iMax=i;
          aTolSp=aTolMax;
        }
      }
      //
      BOPTools_ListOfPaveBlock aLPBx;
      //
      anItLPE.Initialize(aLPBE);
      for (i=0; anItLPE.More(); anItLPE.Next(), ++i) {
        const BOPTools_PaveBlock& aPB=anItLPE.Value();
        if (i==iMax) {
          aLPBx.Prepend(aPB);
        }
        else {
          aLPBx.Append(aPB);
        }
      }
      //
      pLPBE=(BOPTools_ListOfPaveBlock *)&aLPBE;
      pLPBE->Clear();
      pLPBE->Append(aLPBx);
    }//for (; anIt.More(); anIt.Next()) {
  }//for (nE=1; nE<=aNb; ++nE) {
  // Contribution of Samtech www.samcef.com END
}

Here is the call graph for this function:

Here is the caller graph for this function:

Standard_Integer NMTTools_PaveFiller::SplitIndex ( const BOPTools_PaveBlock &  aPB) const [protected]

Definition at line 437 of file NMTTools_PaveFiller_7.cxx.

{
  Standard_Integer anOriginalEdge, anEdgeIndex=0;

  anOriginalEdge=aPBx.OriginalEdge();

  const BOPTools_ListOfPaveBlock& aLPB=mySplitShapesPool(myDS->RefEdge(anOriginalEdge));
  //
  BOPTools_ListIteratorOfListOfPaveBlock anIt(aLPB);
  for (; anIt.More(); anIt.Next()) {
    BOPTools_PaveBlock& aPB=anIt.Value();
    if (aPB.IsEqual(aPBx)) {
      anEdgeIndex=aPB.Edge();
      return anEdgeIndex;
    }
  }
  return anEdgeIndex;
}

Here is the caller graph for this function:

Standard_Integer NMTTools_PaveFiller::SplitsFace ( const Standard_Integer  nF2,
BOPTools_ListOfPaveBlock &  aLs 
)

Definition at line 348 of file NMTTools_PaveFiller_8.cxx.

{
  Standard_Integer nE;
  TopAbs_ShapeEnum aT;
  BOPTools_ListIteratorOfListOfPaveBlock anIt;
  //
  aT=myDS->GetShapeType(nF);
  //
  if (aT!=TopAbs_FACE) {
    return 1; // Type mismatch
  }
  //
  BooleanOperations_ShapesDataStructure *pDS=myDS;
  BooleanOperations_OnceExplorer aExp(*pDS);
  //
  aExp.Init(nF, TopAbs_EDGE);
  for (; aExp.More(); aExp.Next()) {
    nE=aExp.Current();
    const BOPTools_ListOfPaveBlock& aLPBE=mySplitShapesPool(myDS->RefEdge(nE));
    anIt.Initialize(aLPBE);
    for (; anIt.More(); anIt.Next()) {
      const BOPTools_PaveBlock& aPBE=anIt.Value();
      aLPB.Append(aPBE);
    }
  }
  return 0; //Ok
}

Here is the caller graph for this function:

Standard_Integer NMTTools_PaveFiller::SplitsFace ( const Standard_Integer  nF2,
TColStd_ListOfInteger &  aLs 
)

Definition at line 548 of file NMTTools_PaveFiller_8.cxx.

{
  Standard_Integer nE, iErr;
  BOPTools_ListIteratorOfListOfPaveBlock aIt;
  BOPTools_ListOfPaveBlock aLPB;
  //
  iErr=SplitsFace(nF, aLPB);
   if (iErr) {
    return iErr;
  }

  aIt.Initialize(aLPB);
  for (; aIt.More(); aIt.Next()) {
    const BOPTools_PaveBlock& aPB=aIt.Value();
    nE=aPB.Edge();
    aSplits.Append(nE);
  }
  return 0; //Ok
}

Here is the call graph for this function:

const BOPTools_SplitShapesPool & NMTTools_PaveFiller::SplitShapesPool ( ) const

Definition at line 178 of file NMTTools_PaveFiller.cxx.

{
  return mySplitShapesPool;
}

Here is the caller graph for this function:

Standard_Integer NMTTools_PaveFiller::SplitsInFace ( const Standard_Integer  aBid,
const Standard_Integer  nF1,
const Standard_Integer  nF2,
TColStd_ListOfInteger &  aLs 
)

Definition at line 573 of file NMTTools_PaveFiller_8.cxx.

{
  Standard_Integer nE, iErr;
  BOPTools_ListIteratorOfListOfPaveBlock aIt;
  BOPTools_ListOfPaveBlock aLPB;
  //
  iErr=SplitsInFace(0, nF1, nF2, aLPB);
  if (iErr) {
    return iErr;
  }
  aIt.Initialize(aLPB);
  for (; aIt.More(); aIt.Next()) {
    const BOPTools_PaveBlock& aPB=aIt.Value();
    nE=aPB.Edge();
    aSplits.Append(nE);
  }
  return iErr;
}

Here is the caller graph for this function:

Standard_Integer NMTTools_PaveFiller::SplitsInFace ( const Standard_Integer  nE1,
const Standard_Integer  nF2,
TColStd_ListOfInteger &  aLs 
)

Definition at line 598 of file NMTTools_PaveFiller_8.cxx.

{
  Standard_Integer nE, iErr;
  BOPTools_ListIteratorOfListOfPaveBlock aIt;
  BOPTools_ListOfPaveBlock aLPB;
  //
  iErr=SplitsInFace(nE1, nF2, aLPB);
  if (iErr) {
    return iErr;
  }
  aIt.Initialize(aLPB);
  for (; aIt.More(); aIt.Next()) {
    const BOPTools_PaveBlock& aPB=aIt.Value();
    nE=aPB.Edge();
    aSplits.Append(nE);
  }
  return iErr;
}

Here is the call graph for this function:

Standard_Integer NMTTools_PaveFiller::SplitsInFace ( const Standard_Integer  aBid,
const Standard_Integer  nF1,
const Standard_Integer  nF2,
BOPTools_ListOfPaveBlock &  aLs 
)

Definition at line 381 of file NMTTools_PaveFiller_8.cxx.

{
  Standard_Integer nE1;
  TopAbs_ShapeEnum aT1, aT2;

  aT1=myDS->GetShapeType(nF1);
  aT2=myDS->GetShapeType(nF2);

  if (aT1!=TopAbs_FACE || aT2!=TopAbs_FACE) {
    return 1; // Type mismatch
  }
  BooleanOperations_ShapesDataStructure *pDS=myDS;
  BooleanOperations_OnceExplorer aExp(*pDS);
  aExp.Init(nF1, TopAbs_EDGE);
  for (; aExp.More(); aExp.Next()) {
    nE1=aExp.Current();
    SplitsInFace (nE1, nF2, aLPB);
  }
  return 0; //Ok
}

Here is the call graph for this function:

Standard_Integer NMTTools_PaveFiller::SplitsInFace ( const Standard_Integer  nE1,
const Standard_Integer  nF2,
BOPTools_ListOfPaveBlock &  aLs 
)

Definition at line 408 of file NMTTools_PaveFiller_8.cxx.

{
  Standard_Integer nF1;
  TopAbs_ShapeEnum aT1, aT2;

  aT1=myDS->GetShapeType(nE1);
  aT2=myDS->GetShapeType(nF2);

  if (aT1!=TopAbs_EDGE || aT2!=TopAbs_FACE) {
    return 1; // Type mismatch
  }
  //
  TColStd_ListIteratorOfListOfInteger anItLFCB;
  NMTTools_ListIteratorOfListOfCommonBlock anItCB;
  //
  const NMTTools_ListOfCommonBlock& aLCB=myCommonBlockPool(myDS->RefEdge(nE1));
  //
  anItCB.Initialize(aLCB);
  for (; anItCB.More(); anItCB.Next()) {
    NMTTools_CommonBlock& aCB=anItCB.ChangeValue();
    const BOPTools_PaveBlock& aPB1=aCB.PaveBlock1(nE1);

    const TColStd_ListOfInteger& aLFCB=aCB.Faces();
    anItLFCB.Initialize(aLFCB);
    for (; anItLFCB.More(); anItLFCB.Next()) {
      nF1=anItLFCB.Value();
      if (nF1==nF2) {
        aLPB.Append(aPB1);
      }
    }
  }
  return 0; //Ok
}

Here is the call graph for this function:

Standard_Integer NMTTools_PaveFiller::SplitsOnEdge ( const Standard_Integer  nE1,
const Standard_Integer  nE2,
TColStd_ListOfInteger &  aLs 
)

Definition at line 622 of file NMTTools_PaveFiller_8.cxx.

{
  Standard_Integer nE, iErr;
  BOPTools_ListIteratorOfListOfPaveBlock aIt;
  BOPTools_ListOfPaveBlock aLPB;
  //
  iErr=SplitsOnEdge(nE1, nE2, aLPB);
  if (iErr) {
    return iErr;
  }
  aIt.Initialize(aLPB);
  for (; aIt.More(); aIt.Next()) {
    const BOPTools_PaveBlock& aPB=aIt.Value();
    nE=aPB.Edge();
    aSplits.Append(nE);
  }
  return iErr;
}

Here is the caller graph for this function:

Standard_Integer NMTTools_PaveFiller::SplitsOnEdge ( const Standard_Integer  nE1,
const Standard_Integer  nE2,
BOPTools_ListOfPaveBlock &  aLs 
)

Definition at line 447 of file NMTTools_PaveFiller_8.cxx.

{
  Standard_Integer nE;
  TopAbs_ShapeEnum aT1, aT2;

  aT1=myDS->GetShapeType(nE1);
  aT2=myDS->GetShapeType(nE2);

  if (aT1!=TopAbs_EDGE || aT2!=TopAbs_EDGE) {
    return 1; // Type mismatch
  }
  //
  BOPTools_ListIteratorOfListOfPaveBlock anIt;
  NMTTools_ListIteratorOfListOfCommonBlock anItCB;
  //
  const NMTTools_ListOfCommonBlock& aLCB=myCommonBlockPool(myDS->RefEdge(nE1));

  anItCB.Initialize(aLCB);
  for (; anItCB.More(); anItCB.Next()) {
    NMTTools_CommonBlock& aCB=anItCB.ChangeValue();
    const BOPTools_PaveBlock& aPB1=aCB.PaveBlock1(nE1);//XXX
    //
    const BOPTools_ListOfPaveBlock& aLPBx=aCB.PaveBlocks();
    anIt.Initialize(aLPBx);
    for (; anIt.More(); anIt.Next()) {
      const BOPTools_PaveBlock& aPB2=anIt.Value();
      nE=aPB2.OriginalEdge();
      if (nE==nE2) {
        aLPB.Append(aPB1);
      }
    }
  }
  return 0; //Ok
}

Here is the call graph for this function:

Standard_Integer NMTTools_PaveFiller::SplitsOnFace ( const Standard_Integer  nE1,
const Standard_Integer  nF2,
TColStd_ListOfInteger &  aLs 
)

Definition at line 646 of file NMTTools_PaveFiller_8.cxx.

{
  Standard_Integer nE, iErr;
  BOPTools_ListIteratorOfListOfPaveBlock aIt;
  BOPTools_ListOfPaveBlock aLPB;
  //
  iErr=SplitsOnEdge(nE1, nF2, aLPB);
  if (iErr) {
    return iErr;
  }
  aIt.Initialize(aLPB);
  for (; aIt.More(); aIt.Next()) {
    const BOPTools_PaveBlock& aPB=aIt.Value();
    nE=aPB.Edge();
    aSplits.Append(nE);
  }
  return iErr;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Standard_Integer NMTTools_PaveFiller::SplitsOnFace ( const Standard_Integer  aBid,
const Standard_Integer  nF1,
const Standard_Integer  nF2,
TColStd_ListOfInteger &  aLs 
)

Definition at line 670 of file NMTTools_PaveFiller_8.cxx.

{
  Standard_Integer nE, iErr;
  BOPTools_ListIteratorOfListOfPaveBlock aIt;
  BOPTools_ListOfPaveBlock aLPB;
  //
  iErr=SplitsOnFace(0, nF1, nF2, aLPB);
   if (iErr) {
    return iErr;
  }

  aIt.Initialize(aLPB);
  for (; aIt.More(); aIt.Next()) {
    const BOPTools_PaveBlock& aPB=aIt.Value();
    nE=aPB.Edge();
    aSplits.Append(nE);
  }
  return 0; //Ok
}

Here is the call graph for this function:

Standard_Integer NMTTools_PaveFiller::SplitsOnFace ( const Standard_Integer  nE1,
const Standard_Integer  nF2,
BOPTools_ListOfPaveBlock &  aLs 
)

Definition at line 487 of file NMTTools_PaveFiller_8.cxx.

{
  Standard_Integer nE2, ip;
  TopAbs_ShapeEnum aT1, aT2;

  aT1=myDS->GetShapeType(nE1);
  aT2=myDS->GetShapeType(nF2);

  if (aT1!=TopAbs_EDGE || aT2!=TopAbs_FACE) {
    return 1; // Type mismatch
  }
  BooleanOperations_ShapesDataStructure *pDS=myDS;
  BooleanOperations_OnceExplorer aExp(*pDS);
  aExp.Init(nF2, TopAbs_EDGE);
  for (; aExp.More(); aExp.Next()) {
    nE2=aExp.Current();
    ip=SplitsOnEdge(nE1, nE2, aLPB);
    if (ip) {
      return ip;
    }
  }
  return 0; //Ok
}

Here is the call graph for this function:

Standard_Integer NMTTools_PaveFiller::SplitsOnFace ( const Standard_Integer  aBid,
const Standard_Integer  nF1,
const Standard_Integer  nF2,
BOPTools_ListOfPaveBlock &  aLs 
)

Definition at line 516 of file NMTTools_PaveFiller_8.cxx.

{
  Standard_Integer nE1, ip;
  TopAbs_ShapeEnum aT1, aT2;

  aT1=myDS->GetShapeType(nF1);
  aT2=myDS->GetShapeType(nF2);

  if (aT1!=TopAbs_FACE || aT2!=TopAbs_FACE) {
    return 1; // Type mismatch
  }
//   BooleanOperations_ShapesDataStructure *pDS=myDS;
  BooleanOperations_OnceExplorer aExp(*myDS);
  aExp.Init(nF1, TopAbs_EDGE);
  for (; aExp.More(); aExp.Next()) {
    nE1=aExp.Current();
    ip=SplitsOnFace(nE1, nF2, aLPB);
    if (ip) {
      return ip;
    }
  }
  return 0; //Ok
}

Here is the call graph for this function:

Definition at line 423 of file NMTTools_PaveFiller_4.cxx.

{
  Standard_Boolean bFound;
  Standard_Integer nE, nV, nVp, iFlag;
  Standard_Real aT;
  TColStd_MapOfInteger aMI;
  TColStd_MapIteratorOfMapOfInteger aItMI;
  NMTTools_ListIteratorOfListOfCommonBlock aItLCB;
  BOPTools_ListIteratorOfListOfPaveBlock aItLPB;
  BOPTools_ListIteratorOfListOfPave aItLP;
  //
  aItLCB.Initialize(theLCB);
  for (; aItLCB.More(); aItLCB.Next()) {
    const NMTTools_CommonBlock& aCB=aItLCB.Value();
    //
    aMI.Clear();
    const BOPTools_ListOfPaveBlock& aLPB=aCB.PaveBlocks();
    //
    // 1 -> aMI
    aItLPB.Initialize(aLPB);
    for (; aItLPB.More(); aItLPB.Next()) {
      const BOPTools_PaveBlock& aPB=aItLPB.Value();
      nE=aPB.OriginalEdge();
      BOPTools_PaveSet& aPaveSet=myPavePoolNew(myDS->RefEdge(nE));
      BOPTools_ListOfPave& aLP=aPaveSet.ChangeSet();
      //
      aItLP.Initialize(aLP);
      for (; aItLP.More(); aItLP.Next()) {
        const BOPTools_Pave& aPave=aItLP.Value();
        nV=aPave.Index();
        aMI.Add(nV);
      }
    }//for (; anItLPB.More(); anItLPB.Next()) {
    //
    // 2
    aItLPB.Initialize(aLPB);
    for (; aItLPB.More(); aItLPB.Next()) {
      const BOPTools_PaveBlock& aPB=aItLPB.Value();
      nE=aPB.OriginalEdge();
      BOPTools_PaveSet& aPaveSet=myPavePoolNew(myDS->RefEdge(nE));
      BOPTools_ListOfPave& aLP=aPaveSet.ChangeSet();
      //
      aItMI.Initialize(aMI);
      for (; aItMI.More(); aItMI.Next()) {
        nV=aItMI.Key();
        bFound=Standard_False;
        aItLP.Initialize(aLP);
        for (; aItLP.More(); aItLP.Next()) {
          const BOPTools_Pave& aPave=aItLP.Value();
          nVp=aPave.Index();
          if (nVp==nV) {
            bFound=!bFound;
            break;
          }
        }
        //
        if (!bFound) {
          // Append Pave of nV to rhe edge nE
          const TopoDS_Edge& aE=*(TopoDS_Edge*)(&myDS->Shape(nE));
          const TopoDS_Vertex& aV= *(TopoDS_Vertex*)(&myDS->Shape(nV));
          iFlag=myContext->ComputeVE (aV, aE, aT);
          if (!iFlag) {
            BOPTools_Pave aPave;
            //
            aPave.SetInterference(-1);
            aPave.SetType (BooleanOperations_EdgeEdge);
            aPave.SetIndex(nV);
            aPave.SetParam(aT);
            aPaveSet.Append(aPave);
          }
        }
      }//for (; aItMI.More(); aItMI.Next()) {
    }//for (; anItLPB.More(); anItLPB.Next()) {
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 360 of file NMTTools_PaveFiller_7.cxx.

{
  myIsDone=Standard_False;
  //
  Standard_Integer nE, aNbS,  nSp, nEx, nSpx;
  NMTTools_ListIteratorOfListOfCommonBlock aCBIt;
  BOPTools_ListIteratorOfListOfPaveBlock aPBIt;
  //
  aNbS=myDS->NumberOfShapesOfTheObject();
  //
  for (nE=1; nE<=aNbS; ++nE) {
    if (myDS->GetShapeType(nE)!=TopAbs_EDGE){
      continue;
    }
    if (BRep_Tool::Degenerated(TopoDS::Edge(myDS->Shape(nE)))){
      continue;
    }
    //
    NMTTools_ListOfCommonBlock& aLCB=myCommonBlockPool(myDS->RefEdge(nE));
    /*BOPTools_ListOfPaveBlock& aLPB=*/mySplitShapesPool  (myDS->RefEdge(nE));
    //
    aCBIt.Initialize(aLCB);
    for (; aCBIt.More(); aCBIt.Next()) {
      NMTTools_CommonBlock& aCB=aCBIt.ChangeValue();
      //
      // Among all PBs of aCB the first PB will be one
      // that have max tolerance value
      {
        Standard_Real aTolEx, aTolExMax;
        BOPTools_ListOfPaveBlock *pLPB, aLPBx;
        //
        aTolExMax=-1.;
        pLPB=(BOPTools_ListOfPaveBlock *)&aCB.PaveBlocks();
        aPBIt.Initialize(*pLPB);
        for (; aPBIt.More(); aPBIt.Next()) {
          const BOPTools_PaveBlock& aPBx=aPBIt.Value();
          nEx=aPBx.OriginalEdge();
          const TopoDS_Edge& aEx=TopoDS::Edge(myDS->Shape(nEx));
          aTolEx=BRep_Tool::Tolerance(aEx);
          if (aTolEx>aTolExMax) {
            aTolExMax=aTolEx;
            aLPBx.Prepend(aPBx);
          }
          else{
            aLPBx.Append(aPBx);
          }
        }
        //
        pLPB->Clear();
        *pLPB=aLPBx;
      }
      //
      BOPTools_PaveBlock& aPB=aCB.PaveBlock1(nE);
      nSp=SplitIndex(aPB);
      aPB.SetEdge(nSp);
      //
      const BOPTools_ListOfPaveBlock& aCBLPB=aCB.PaveBlocks();
      aPBIt.Initialize(aCBLPB);
      for (; aPBIt.More(); aPBIt.Next()) {
        BOPTools_PaveBlock& aPBx=aPBIt.Value();
        nEx=aPBx.OriginalEdge();
        if (nEx==nE) {
          continue;
        }
        //
        nSpx=SplitIndex(aPBx);
        aPBx.SetEdge(nSpx);
      }
      //
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void NMTTools_PaveFiller::UpdateCommonBlocks ( const Standard_Integer  aI) [protected]

Definition at line 181 of file NMTTools_PaveFiller_7.cxx.

{
  Standard_Integer nE, aNbS,  nEx, nEMax, j, aNbPoints, aNbLCB, nF;
  Standard_Real aTolEx, aTolExMax, aTSRMax[2], aTx[2], aTmp;
  TColStd_ListIteratorOfListOfInteger aItLI;
  gp_Pnt aPMax[2];
  TopoDS_Edge aEMax;
  BOPTools_ListIteratorOfListOfPaveBlock aItLPB, aItLPBS;
  NMTTools_ListIteratorOfListOfCommonBlock aItLCB;
  NMTTools_MapOfPaveBlock aMPB;
  //
  myIsDone=Standard_False;
  //
  aNbS=myDS->NumberOfShapesOfTheObject();
  for (nE=1; nE<=aNbS; ++nE) {
    if (myDS->GetShapeType(nE)!=TopAbs_EDGE){
      continue;
    }
    //
    const TopoDS_Edge& aE=*((TopoDS_Edge*)&myDS->Shape(nE));
    if (BRep_Tool::Degenerated(aE)){
      continue;
    }
    //
    NMTTools_ListOfCommonBlock& aLCB=myCommonBlockPool(myDS->RefEdge(nE));
    //modified by NIZNHY-PKV Thu Jan 19 09:03:19 2012f
    aNbLCB=aLCB.Extent();
    if (!aNbLCB) {
      continue;
    }
    // 0
    NMTTools_ListOfCommonBlock aLCBx;
    //
    aItLCB.Initialize(aLCB);
    for (; aItLCB.More(); aItLCB.Next()) {
      NMTTools_CommonBlock aCBx;
      //
      NMTTools_CommonBlock& aCB=aItLCB.ChangeValue();
      const BOPTools_ListOfPaveBlock &aLPB=aCB.PaveBlocks();
      aItLPB.Initialize(aLPB);
      for (; aItLPB.More(); aItLPB.Next()) {
        const BOPTools_PaveBlock& aPBx=aItLPB.Value();
        nEx=aPBx.OriginalEdge();
        BOPTools_ListOfPaveBlock& aLPBS=mySplitShapesPool(myDS->RefEdge(nEx));
        aItLPBS.Initialize(aLPBS);
        for (; aItLPBS.More(); aItLPBS.Next()) {
          const BOPTools_PaveBlock& aPBSx=aItLPBS.Value();
          if (aPBSx.IsEqual(aPBx)) {
            aCBx.AddPaveBlock(aPBSx);
            break;
          }
        }// for (; aItLPBS.More(); aItLPBS.Next()) {
      }// for (; aItLPB.More(); aItLPB.Next()) {
      //
      const TColStd_ListOfInteger& aLI=aCB.Faces();
      aItLI.Initialize(aLI);
      for (; aItLI.More(); aItLI.Next()) {
        nF=aItLI.Value();
        aCBx.AddFace(nF);
      }
      //
      aLCBx.Append(aCBx);
    }//for (; aItLCB.More(); aItLCB.Next()) {
    //
    aLCB.Clear();
    //
    aItLCB.Initialize(aLCBx);
    for (; aItLCB.More(); aItLCB.Next()) {
      NMTTools_CommonBlock& aCBx=aItLCB.ChangeValue();
      aLCB.Append(aCBx);
    }
    //modified by NIZNHY-PKV Thu Jan 19 09:03:30 2012t
    // 1
    aItLCB.Initialize(aLCB);
    for (; aItLCB.More(); aItLCB.Next()) {
      NMTTools_CommonBlock& aCB=aItLCB.ChangeValue();
      //
      BOPTools_PaveBlock aPBMax;
      aTolExMax=-1.;
      const BOPTools_ListOfPaveBlock &aLPB=aCB.PaveBlocks();
      aItLPB.Initialize(aLPB);
      for (; aItLPB.More(); aItLPB.Next()) {
        const BOPTools_PaveBlock& aPBx=aItLPB.Value();
        nEx=aPBx.OriginalEdge();
        const TopoDS_Edge& aEx=*((TopoDS_Edge*)&myDS->Shape(nEx));
        aTolEx=BRep_Tool::Tolerance(aEx);
        if (aTolEx>aTolExMax) {
          aTolExMax=aTolEx;
          aEMax=aEx;
          aPBMax=aPBx;
        }
      }
      //
      // 2
      if (aMPB.Contains(aPBMax)) {
        continue;
      }
      aMPB.Add(aPBMax);
      //
      nEMax=aPBMax.OriginalEdge();
      const IntTools_ShrunkRange& aISRMax=aPBMax.ShrunkRange();
      const IntTools_Range& aSRMax=aISRMax.ShrunkRange();
      const Bnd_Box& aBoxMax=aISRMax.BndBox();
      aSRMax.Range(aTSRMax[0], aTSRMax[1]);
      for (j=0; j<2; ++j) {
        BOPTools_Tools::PointOnEdge(aEMax, aTSRMax[j], aPMax[j]);
      }
      //
      // 3
      aItLPB.Initialize(aLPB);
      for (; aItLPB.More(); aItLPB.Next()) {
        const BOPTools_PaveBlock& aPBx=aItLPB.Value();
        nEx=aPBx.OriginalEdge();
        if (nEx==nEMax) {
          continue;
        }
        //
        const TopoDS_Edge& aEx=*((TopoDS_Edge*)&myDS->Shape(nEx));
        GeomAPI_ProjectPointOnCurve& aPPCx=myContext->ProjPC(aEx);
        //
        for (j=0; j<2; ++j) {
          aPPCx.Perform(aPMax[j]);
          aNbPoints=aPPCx.NbPoints();
          if (!aNbPoints) {
            break;
          }
          aTx[j]=aPPCx.LowerDistanceParameter();
        }
        if (!aNbPoints) {
          // correction the range is impossible due to
          // a projection problem
          continue;
        }
        //
        if (aTx[0]>aTx[1]){
          aTmp=aTx[0];
          aTx[0]=aTx[1];
          aTx[1]=aTmp;
        }
        //
        // 4 Correction
        // 4.1 aPBx
        {
          const IntTools_ShrunkRange& aISRx=aPBx.ShrunkRange();
          IntTools_Range *pSRx=(IntTools_Range *)(&aISRx.ShrunkRange());
          Bnd_Box *pBoxx=(Bnd_Box *)(&aISRx.BndBox());
          //
          pSRx->SetFirst(aTx[0]);
          pSRx->SetLast(aTx[1]);
          *pBoxx=aBoxMax;
        }
        //
        // 4.2 aPBSx
        BOPTools_ListOfPaveBlock& aLPBSx=mySplitShapesPool(myDS->RefEdge(nEx));
        aItLPBS.Initialize(aLPBSx);
        for (; aItLPBS.More(); aItLPBS.Next()) {
          const BOPTools_PaveBlock& aPBSx=aItLPBS.Value();
          if (!aPBSx.IsEqual(aPBx)) {
            continue;
          }
          //
          const IntTools_ShrunkRange& aISRx=aPBSx.ShrunkRange();
          IntTools_Range *pSRx=(IntTools_Range *)(&aISRx.ShrunkRange());
          Bnd_Box *pBoxx=(Bnd_Box *)(&aISRx.BndBox());
          //
          pSRx->SetFirst(aTx[0]);
          pSRx->SetLast(aTx[1]);
          *pBoxx=aBoxMax;
        }
        //
        //
      }//for (; aItLPB.More(); aItLPB.Next()) {
    }//for (; aItLCB.More(); aItLCB.Next()) {
  }//for (nE=1; nE<=aNbS; ++nE) {
}

Here is the call graph for this function:

Definition at line 460 of file NMTTools_PaveFiller_7.cxx.

{
  myIsDone=Standard_False;
  //
  Standard_Integer i, aNbFFs, nF1, nF2, aNbF, nF, iRankF, nE, nV1, nV2, aNbPB;
  Standard_Real aT1, aT2;
  TColStd_IndexedMapOfInteger aMF, aME;
  TopExp_Explorer aExp;
  TopoDS_Vertex aV1, aV2;
  TopoDS_Edge aE;
  BOPTools_Pave aPave1, aPave2;
  BOPTools_PaveBlock aPB;
  //
  BOPTools_CArray1OfSSInterference& aFFs=myIP->SSInterferences();
  //
  aNbFFs=aFFs.Extent();
  for (i=1; i<=aNbFFs; ++i) {
    BOPTools_SSInterference& aFFi=aFFs(i);
    aFFi.Indices(nF1, nF2);
    aMF.Add(nF1);
    aMF.Add(nF2);
  }
  //
  aNbF=aMF.Extent();
  for(i=1; i<=aNbF; ++i) {
    nF=aMF(i);
    iRankF=myDS->Rank(nF);
    const TopoDS_Shape aF=myDS->Shape(nF);//mpv
    aExp.Init(aF, TopAbs_EDGE);
    for(; aExp.More();  aExp.Next()) {
      aE=TopoDS::Edge(aExp.Current());
      //
      if (BRep_Tool::Degenerated(aE)) {
        continue;
      }
      //
      nE=myDS->ShapeIndex(aE, iRankF);
      //
      if (aME.Contains(nE)) {
        continue;
      }
      aME.Add(nE);
      //
      BOPTools_ListOfPaveBlock& aLPB=mySplitShapesPool(myDS->RefEdge(nE));
      aNbPB=aLPB.Extent();
      if (aNbPB) {
        continue;
      }
      TopExp::Vertices(aE, aV1, aV2);
      //
      nV1=myDS->ShapeIndex(aV1, iRankF);
      aT1=BRep_Tool::Parameter(aV1, aE);
      aPave1.SetIndex(nV1);
      aPave1.SetParam(aT1);
      //
      nV2=myDS->ShapeIndex(aV2, iRankF);
      aT2=BRep_Tool::Parameter(aV2, aE);
      aPave2.SetIndex(nV2);
      aPave2.SetParam(aT2);
      //
      aPB.SetEdge(nE);
      aPB.SetOriginalEdge(nE);
      aPB.SetPave1(aPave1);
      aPB.SetPave2(aPave2);
      //
      aLPB.Append(aPB);
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 489 of file NMTTools_PaveFiller.hxx.

Definition at line 485 of file NMTTools_PaveFiller.hxx.

TopoDS_Shape NMTTools_PaveFiller::myCompositeShape [protected]

Definition at line 492 of file NMTTools_PaveFiller.hxx.

Handle_IntTools_Context NMTTools_PaveFiller::myContext [protected]

Definition at line 487 of file NMTTools_PaveFiller.hxx.

Definition at line 479 of file NMTTools_PaveFiller.hxx.

Definition at line 491 of file NMTTools_PaveFiller.hxx.

Definition at line 494 of file NMTTools_PaveFiller.hxx.

Definition at line 493 of file NMTTools_PaveFiller.hxx.

Standard_Boolean NMTTools_PaveFiller::myIsDone [protected]

Definition at line 480 of file NMTTools_PaveFiller.hxx.

Standard_Integer NMTTools_PaveFiller::myNbEdges [protected]

Definition at line 482 of file NMTTools_PaveFiller.hxx.

Standard_Integer NMTTools_PaveFiller::myNbSources [protected]

Definition at line 481 of file NMTTools_PaveFiller.hxx.

BOPTools_PavePool NMTTools_PaveFiller::myPavePool [protected]

Definition at line 483 of file NMTTools_PaveFiller.hxx.

BOPTools_PavePool NMTTools_PaveFiller::myPavePoolNew [protected]

Definition at line 484 of file NMTTools_PaveFiller.hxx.

BOPTools_SSIntersectionAttribute NMTTools_PaveFiller::mySectionAttribute [protected]

Definition at line 488 of file NMTTools_PaveFiller.hxx.

BOPTools_SplitShapesPool NMTTools_PaveFiller::mySplitShapesPool [protected]

Definition at line 486 of file NMTTools_PaveFiller.hxx.

TColStd_DataMapOfIntegerInteger NMTTools_PaveFiller::myVSD [protected]

Definition at line 490 of file NMTTools_PaveFiller.hxx.


The documentation for this class was generated from the following files: