Mantis issue 0020820: EDF 1350 GEOM : Partition issue. A fix by PKV.

This commit is contained in:
jfa 2010-04-28 08:20:24 +00:00
parent cca1790227
commit d6508b2300

View File

@ -19,13 +19,10 @@
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// IMPROVED by NIZNHY-PKV Thu Oct 12 16:03:33 2006
// File: NMTTools_PaveFiller_6.cxx
// Created: Fri Dec 19 10:27:31 2003
// Author: Peter KURNEV
// <pkv@irinox>
//
#include <NMTTools_PaveFiller.ixx>
#include <Precision.hxx>
@ -101,12 +98,6 @@
#include <NMTTools_DataMapIteratorOfDataMapOfIntegerListOfPaveBlock.hxx>
#include <NMTTools_MapOfPaveBlock.hxx>
/*
static
void SharedEdges1(const TopoDS_Face& aF1,
const TopoDS_Face& aF2,
TopTools_ListOfShape& aLS);
*/
static
Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
IntTools_Context& aCtx);
@ -127,7 +118,6 @@ static
BOPTColStd_IndexedDataMapOfIntegerIndexedMapOfInteger aMapWhat, aMapWith;
IntTools_SequenceOfPntOn2Faces aPnts;
IntTools_SequenceOfCurves aCvs;
//BooleanOperations_KindOfInterference aTypeFF=BooleanOperations_SurfaceSurface;
//
BOPTools_CArray1OfSSInterference& aFFs=myIP->SSInterferences();
//
@ -174,10 +164,8 @@ static
bIsDone=aFF.IsDone();
//
if (!bIsDone) {
//modified by NIZNHY-PKV Tue Jun 30 09:36:28 2009f
BOPTools_SSInterference anInterf (nF1, nF2, 1.e-07, 1.e-07, aCvs, aPnts);
anIndexIn=aFFs.Append(anInterf);
//modified by NIZNHY-PKV Tue Jun 30 09:36:31 2009t
continue;
}
//
@ -210,11 +198,12 @@ static
//
myIsDone=Standard_True;
}
//=======================================================================
// function: MakeBlocks
// purpose:
//=======================================================================
void NMTTools_PaveFiller::MakeBlocks()
void NMTTools_PaveFiller::MakeBlocks()
{
myIsDone=Standard_False;
//
@ -381,10 +370,10 @@ static
// Put Paves On Curves
for (j=1; j<=aNbCurves; ++j) {
BOPTools_Curve& aBC=aSCvs(j);
// DEBUG
// DEBUG f
const IntTools_Curve& aC=aBC.Curve();
Handle (Geom_Curve) aC3D= aC.Curve();
//
Handle(Geom_Curve) aC3D = aC.Curve();
// DEBUG t
PutPaveOnCurve (aPSF, aTolR3D, aBC);
}
//
@ -451,8 +440,20 @@ static
// Make Section Edge
TopoDS_Edge aES;
//
const TopoDS_Vertex aV1=TopoDS::Vertex(myDS->Shape(nV1));//mpv
const TopoDS_Vertex aV2=TopoDS::Vertex(myDS->Shape(nV2));//mpv
const TopoDS_Vertex aV1=TopoDS::Vertex(myDS->Shape(nV1));
const TopoDS_Vertex aV2=TopoDS::Vertex(myDS->Shape(nV2));
//
//modified by NIZNHY-PKV Thu Apr 22 07:54:35 2010f
{
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);
}
//modified by NIZNHY-PKV Thu Apr 22 07:54:37 2010t
//
BOPTools_Tools::MakeSectEdge (aIC, aV1, aT1, aV2, aT2, aES);
//
@ -462,7 +463,6 @@ static
continue;
}
//
{
Handle(Geom2d_Curve) aC2D1, aC2D2;
//
@ -743,11 +743,12 @@ static
//
myIsDone=Standard_True;
}
//=======================================================================
// function: MakePCurves
// purpose:
//=======================================================================
void NMTTools_PaveFiller::MakePCurves()
void NMTTools_PaveFiller::MakePCurves()
{
Standard_Integer i, aNb, nF1, nF2, nE;
Standard_Integer aNbCB, aNbF, nSp, nF;
@ -835,11 +836,12 @@ static
}//if (aS.ShapeType()==TopAbs_EDGE) {
}
}
//=======================================================================
// function: IsExistingPaveBlock
// purpose:
//=======================================================================
Standard_Boolean NMTTools_PaveFiller::IsExistingPaveBlock(const BOPTools_PaveBlock& aPBNew,
Standard_Boolean NMTTools_PaveFiller::IsExistingPaveBlock(const BOPTools_PaveBlock& aPBNew,
const BOPTools_ListOfPaveBlock& aLPBR,
const Standard_Real aTolR3D)
{
@ -866,11 +868,12 @@ static
}
return bFlag;
}
//=======================================================================
// function: IsExistingPaveBlock
// purpose:
//=======================================================================
Standard_Boolean NMTTools_PaveFiller::IsExistingPaveBlock(const BOPTools_PaveBlock& aPBNew,
Standard_Boolean NMTTools_PaveFiller::IsExistingPaveBlock(const BOPTools_PaveBlock& aPBNew,
const TopTools_ListOfShape& aLSE,
const Standard_Real aTolR3D)
{
@ -901,14 +904,14 @@ static
}
return bFlag;
}
//=======================================================================
// function: CheckIntermediatePoint
// purpose:
//=======================================================================
Standard_Integer NMTTools_PaveFiller::CheckIntermediatePoint(const BOPTools_PaveBlock& aPB,
Standard_Integer NMTTools_PaveFiller::CheckIntermediatePoint(const BOPTools_PaveBlock& aPB,
const BOPTools_PaveBlock& aPBR,
const Standard_Real aTolC)
{
Standard_Integer iVM, nE2;
//
@ -918,11 +921,12 @@ static
//
return iVM;
}
//=======================================================================
// function: CheckIntermediatePoint
// purpose:
//=======================================================================
Standard_Integer NMTTools_PaveFiller::CheckIntermediatePoint(const BOPTools_PaveBlock& aPB,
Standard_Integer NMTTools_PaveFiller::CheckIntermediatePoint(const BOPTools_PaveBlock& aPB,
const TopoDS_Edge& aE2,
const Standard_Real aTolC)
{
@ -950,11 +954,12 @@ static
//
return iVM;
}
//=======================================================================
// function: PutBoundPaveOnCurve
// purpose:
//=======================================================================
void NMTTools_PaveFiller::PutBoundPaveOnCurve(BOPTools_Curve& aBC,
void NMTTools_PaveFiller::PutBoundPaveOnCurve(BOPTools_Curve& aBC,
BOPTools_SSInterference& aFFi)
{
Standard_Boolean bHasBounds, bVF;
@ -988,11 +993,12 @@ static
PutBoundPaveOnCurve (aP2, aT2, aBC, aFFi);
}
}
//=======================================================================
// function: PutBoundPaveOnCurve
// purpose:
//=======================================================================
void NMTTools_PaveFiller::PutBoundPaveOnCurve(const gp_Pnt& aP,
void NMTTools_PaveFiller::PutBoundPaveOnCurve(const gp_Pnt& aP,
const Standard_Real aT,
BOPTools_Curve& aBC,
BOPTools_SSInterference& aFFi)
@ -1046,11 +1052,12 @@ static
BOPTools_Tools::UpdateVertex (aIC, aT, aV);
}
}
//=======================================================================
// function: FindPave
// purpose:
//=======================================================================
Standard_Boolean NMTTools_PaveFiller::FindPave(const gp_Pnt& aP,
Standard_Boolean NMTTools_PaveFiller::FindPave(const gp_Pnt& aP,
const Standard_Real aTolPV,
const BOPTools_PaveSet& aPS,
BOPTools_Pave& aPave)
@ -1072,11 +1079,12 @@ static
}
return bIsVertex;
}
//=======================================================================
// function: PrepareSetForFace
// purpose:
//=======================================================================
void NMTTools_PaveFiller::PrepareSetForFace(const Standard_Integer ,//nF1,
void NMTTools_PaveFiller::PrepareSetForFace(const Standard_Integer ,//nF1,
const Standard_Integer ,//nF2,
const BOPTools_ListOfPaveBlock& aLPBC,
BOPTools_PaveSet& aPSF)
@ -1102,95 +1110,13 @@ static
}
}
}
//=======================================================================
// function: PutPaveOnCurve
// purpose:
//=======================================================================
void NMTTools_PaveFiller::PutPaveOnCurve(const BOPTools_PaveSet& aPaveSet,
const Standard_Real aTolR3D,
BOPTools_Curve& aBC)
{
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));//mpv
//
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
BOPTools_Tools::UpdateVertex (aC, aT, aV);
}
}
}
/////////////
//=======================================================================
//function : SharedEdges1
//purpose :
//=======================================================================
/*
void SharedEdges1(const TopoDS_Face& aF1,
const TopoDS_Face& aF2,
TopTools_ListOfShape& aLS)
{
Standard_Integer i, aNbE, aNbF;;
TopTools_IndexedDataMapOfShapeListOfShape aMEF;
//
TopExp::MapShapesAndAncestors(aF1, TopAbs_EDGE, TopAbs_FACE, aMEF);
TopExp::MapShapesAndAncestors(aF2, TopAbs_EDGE, TopAbs_FACE, aMEF);
//
aNbE=aMEF.Extent();
for (i=1; i<=aNbE; ++i) {
const TopTools_ListOfShape& aLF=aMEF.FindFromIndex(i);
aNbF=aLF.Extent();
if (aNbF>1) {
if (aNbF==2) {
const TopoDS_Shape& aF1x=aLF.First();
const TopoDS_Shape& aF2x=aLF.Last();
if (aF1x.IsSame(aF2x)) {
continue;
}
}
const TopoDS_Shape& aE=aMEF.FindKey(i);
aLS.Append (aE);
}
}
}
*/
//=======================================================================
// function: CheckCoincidence
// purpose:
//=======================================================================
Standard_Boolean NMTTools_PaveFiller::CheckCoincidence(const BOPTools_PaveBlock& aPBNew,
Standard_Boolean NMTTools_PaveFiller::CheckCoincidence(const BOPTools_PaveBlock& aPBNew,
const BOPTools_ListOfPaveBlock& aLPBFF)
{
Standard_Boolean bRet;
Standard_Real aTE;
@ -1334,3 +1260,51 @@ Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE,
//
return bRet;
}
//=======================================================================
// function: PutPaveOnCurve
// purpose:
//=======================================================================
void NMTTools_PaveFiller::PutPaveOnCurve(const BOPTools_PaveSet& aPaveSet,
const Standard_Real aTolR3D,
BOPTools_Curve& aBC)
{
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));//mpv
//
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
//modified by NIZNHY-PKV Thu Apr 22 10:36:45 2010f
//BOPTools_Tools::UpdateVertex (aC, aT, aV);
//modified by NIZNHY-PKV Thu Apr 22 10:36:48 2010t
}
}
}