mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-12-29 10:50:35 +05:00
Mantis issue 0020820: EDF 1350 GEOM : Partition issue. A fix by PKV.
This commit is contained in:
parent
cca1790227
commit
d6508b2300
@ -19,13 +19,10 @@
|
||||
//
|
||||
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||
//
|
||||
// File: NMTTools_PaveFiller_6.cxx
|
||||
// Created: Fri Dec 19 10:27:31 2003
|
||||
// Author: Peter KURNEV
|
||||
|
||||
// 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,13 +836,14 @@ static
|
||||
}//if (aS.ShapeType()==TopAbs_EDGE) {
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function: IsExistingPaveBlock
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
Standard_Boolean NMTTools_PaveFiller::IsExistingPaveBlock(const BOPTools_PaveBlock& aPBNew,
|
||||
const BOPTools_ListOfPaveBlock& aLPBR,
|
||||
const Standard_Real aTolR3D)
|
||||
Standard_Boolean NMTTools_PaveFiller::IsExistingPaveBlock(const BOPTools_PaveBlock& aPBNew,
|
||||
const BOPTools_ListOfPaveBlock& aLPBR,
|
||||
const Standard_Real aTolR3D)
|
||||
{
|
||||
Standard_Boolean bFlag;
|
||||
Standard_Integer nVNew1, nVNew2, nV1, nV2, iC;
|
||||
@ -866,13 +868,14 @@ static
|
||||
}
|
||||
return bFlag;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function: IsExistingPaveBlock
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
Standard_Boolean NMTTools_PaveFiller::IsExistingPaveBlock(const BOPTools_PaveBlock& aPBNew,
|
||||
const TopTools_ListOfShape& aLSE,
|
||||
const Standard_Real aTolR3D)
|
||||
Standard_Boolean NMTTools_PaveFiller::IsExistingPaveBlock(const BOPTools_PaveBlock& aPBNew,
|
||||
const TopTools_ListOfShape& aLSE,
|
||||
const Standard_Real aTolR3D)
|
||||
{
|
||||
Standard_Boolean bFlag;
|
||||
Standard_Integer aNbSE, iC;
|
||||
@ -901,14 +904,14 @@ static
|
||||
}
|
||||
return bFlag;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function: CheckIntermediatePoint
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
Standard_Integer NMTTools_PaveFiller::CheckIntermediatePoint(const BOPTools_PaveBlock& aPB,
|
||||
const BOPTools_PaveBlock& aPBR,
|
||||
const Standard_Real aTolC)
|
||||
|
||||
Standard_Integer NMTTools_PaveFiller::CheckIntermediatePoint(const BOPTools_PaveBlock& aPB,
|
||||
const BOPTools_PaveBlock& aPBR,
|
||||
const Standard_Real aTolC)
|
||||
{
|
||||
Standard_Integer iVM, nE2;
|
||||
//
|
||||
@ -918,13 +921,14 @@ static
|
||||
//
|
||||
return iVM;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function: CheckIntermediatePoint
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
Standard_Integer NMTTools_PaveFiller::CheckIntermediatePoint(const BOPTools_PaveBlock& aPB,
|
||||
const TopoDS_Edge& aE2,
|
||||
const Standard_Real aTolC)
|
||||
Standard_Integer NMTTools_PaveFiller::CheckIntermediatePoint(const BOPTools_PaveBlock& aPB,
|
||||
const TopoDS_Edge& aE2,
|
||||
const Standard_Real aTolC)
|
||||
{
|
||||
Standard_Real aT11, aT12, aTM, aTmp;
|
||||
Standard_Integer iVM;
|
||||
@ -950,12 +954,13 @@ static
|
||||
//
|
||||
return iVM;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function: PutBoundPaveOnCurve
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
void NMTTools_PaveFiller::PutBoundPaveOnCurve(BOPTools_Curve& aBC,
|
||||
BOPTools_SSInterference& aFFi)
|
||||
void NMTTools_PaveFiller::PutBoundPaveOnCurve(BOPTools_Curve& aBC,
|
||||
BOPTools_SSInterference& aFFi)
|
||||
{
|
||||
Standard_Boolean bHasBounds, bVF;
|
||||
Standard_Integer nF1, nF2;
|
||||
@ -988,14 +993,15 @@ static
|
||||
PutBoundPaveOnCurve (aP2, aT2, aBC, aFFi);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function: PutBoundPaveOnCurve
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
void NMTTools_PaveFiller::PutBoundPaveOnCurve(const gp_Pnt& aP,
|
||||
const Standard_Real aT,
|
||||
BOPTools_Curve& aBC,
|
||||
BOPTools_SSInterference& aFFi)
|
||||
void NMTTools_PaveFiller::PutBoundPaveOnCurve(const gp_Pnt& aP,
|
||||
const Standard_Real aT,
|
||||
BOPTools_Curve& aBC,
|
||||
BOPTools_SSInterference& aFFi)
|
||||
{
|
||||
Standard_Boolean bFound1, bFound2;
|
||||
Standard_Integer nV;
|
||||
@ -1046,14 +1052,15 @@ static
|
||||
BOPTools_Tools::UpdateVertex (aIC, aT, aV);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function: FindPave
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
Standard_Boolean NMTTools_PaveFiller::FindPave(const gp_Pnt& aP,
|
||||
const Standard_Real aTolPV,
|
||||
const BOPTools_PaveSet& aPS,
|
||||
BOPTools_Pave& aPave)
|
||||
Standard_Boolean NMTTools_PaveFiller::FindPave(const gp_Pnt& aP,
|
||||
const Standard_Real aTolPV,
|
||||
const BOPTools_PaveSet& aPS,
|
||||
BOPTools_Pave& aPave)
|
||||
{
|
||||
Standard_Integer nV;
|
||||
Standard_Boolean bIsVertex=Standard_False;
|
||||
@ -1072,14 +1079,15 @@ static
|
||||
}
|
||||
return bIsVertex;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function: PrepareSetForFace
|
||||
// purpose:
|
||||
//=======================================================================
|
||||
void NMTTools_PaveFiller::PrepareSetForFace(const Standard_Integer ,//nF1,
|
||||
const Standard_Integer ,//nF2,
|
||||
const BOPTools_ListOfPaveBlock& aLPBC,
|
||||
BOPTools_PaveSet& aPSF)
|
||||
void NMTTools_PaveFiller::PrepareSetForFace(const Standard_Integer ,//nF1,
|
||||
const Standard_Integer ,//nF2,
|
||||
const BOPTools_ListOfPaveBlock& aLPBC,
|
||||
BOPTools_PaveSet& aPSF)
|
||||
{
|
||||
Standard_Integer nV1, nV2;
|
||||
TColStd_MapOfInteger aMap;
|
||||
@ -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,
|
||||
const BOPTools_ListOfPaveBlock& aLPBFF)
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user