Improvement of partition.

This commit is contained in:
skl 2006-11-23 13:44:54 +00:00
parent bb799cae63
commit c5886a79fa
8 changed files with 417 additions and 129 deletions

View File

@ -52,7 +52,9 @@
//=======================================================================
void GEOMAlgo_ShapeSet::Add(const TopoDS_Shape& theShape)
{
myMap.Add(theShape);
if (myMap.Add(theShape)) {
myList.Append(theShape);
}
}
//=======================================================================
//function : Add
@ -66,7 +68,9 @@
aExp.Init(theShape, theType);
for (; aExp.More(); aExp.Next()) {
const TopoDS_Shape& aS=aExp.Current();
myMap.Add(aS);
if (myMap.Add(aS)) {
myList.Append(aS);
}
}
}
//=======================================================================
@ -79,7 +83,10 @@
//
aIt.Initialize(theLS);
for (; aIt.More(); aIt.Next()) {
myMap.Add(aIt.Value());
const TopoDS_Shape& aS=aIt.Value();
if (myMap.Add(aS)) {
myList.Append(aS);
}
}
}
//=======================================================================
@ -88,6 +95,7 @@
//=======================================================================
const TopTools_ListOfShape& GEOMAlgo_ShapeSet::GetSet()const
{
/*
TopTools_ListOfShape *pL;
TopTools_MapIteratorOfMapOfOrientedShape aIt;
//
@ -97,6 +105,7 @@
for (; aIt.More(); aIt.Next()) {
pL->Append(aIt.Key());
}
*/
return myList;
}
//=======================================================================
@ -115,7 +124,7 @@
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aF=aIt.Value();
aOr=aF.Orientation();
if (aOr==TopAbs_FORWARD||aOr==TopAbs_REVERSED) {
if (aOr==TopAbs_FORWARD || aOr==TopAbs_REVERSED) {
bRet=myMap.Contains(aF);
if (!bRet) {
break;
@ -130,6 +139,7 @@
//=======================================================================
void GEOMAlgo_ShapeSet::Subtract(const GEOMAlgo_ShapeSet& theOther)
{
/*
TopTools_MapIteratorOfMapOfOrientedShape aIt;
//
aIt.Initialize(theOther.myMap);
@ -137,4 +147,21 @@
const TopoDS_Shape& aS=aIt.Key();
myMap.Remove(aS);
}
*/
//
TopTools_ListIteratorOfListOfShape aIt;
TopTools_ListOfShape aLS;
//
myMap.Clear();
aIt.Initialize(myList);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aS=aIt.Value();
if (!theOther.myMap.Contains(aS)) {
if(myMap.Add(aS)){
aLS.Append(aS);
}
}
}
//
myList=aLS;
}

View File

@ -65,9 +65,6 @@
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_MapOfShape.hxx>
#include <TopTools_MapIteratorOfMapOfShape.hxx>
#include <TopTools_DataMapOfShapeListOfShape.hxx>
#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
#include <BRepClass3d_SolidClassifier.hxx>
@ -81,8 +78,13 @@
#include <NMTTools_ListOfCoupleOfShape.hxx>
#include <NMTTools_ListIteratorOfListOfCoupleOfShape.hxx>
#include <NMTTools_CoupleOfShape.hxx>
#include <TopTools_DataMapOfShapeListOfShape.hxx>
#include <TopTools_DataMapOfShapeListOfShape.hxx>
#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
#include <TopTools_MapOfShape.hxx>
#include <TopTools_MapIteratorOfMapOfShape.hxx>
//
static
Standard_Boolean FindFacePairs (const TopoDS_Edge& ,
const TopTools_ListOfShape& ,
@ -212,7 +214,7 @@ static
const TopoDS_Face& theFace2)
{
Standard_Boolean bRet;
Standard_Real aT1, aT2, aT, aDt2D, aD1, aD2, aDt2Dx;
Standard_Real aT1, aT2, aT, aDt2D, aDt2Dx;//aD1, aD2,
gp_Pnt aPx, aPF, aPF1, aPF2;
gp_Pnt2d aP2D, aPF2D;
gp_Dir aDNF1, aDNF2;
@ -247,12 +249,51 @@ static
// 3
bRet=Standard_False;
//
//modified by NIZNHY-PKV Mon Nov 13 12:12:53 2006f
//
BOPTools_Tools3D::GetApproxNormalToFaceOnEdge (aE1, theFace1, aT, aPF1, aDNF1);
BOPTools_Tools3D::GetApproxNormalToFaceOnEdge (aE2, theFace2, aT, aPF2, aDNF2);
//
{
Standard_Real aA12, aA1x, aTwoPI;
//
aTwoPI=2.*PI;
gp_Vec aVBF (aPx, aPF );
gp_Vec aVBF1(aPx, aPF1);
gp_Vec aVBF2(aPx, aPF2);
//
gp_Dir aDTF1;
gp_Dir aDBF (aVBF);
gp_Dir aDBF1(aVBF1);
gp_Dir aDBF2(aVBF2);
//
aDTF1=aDNF1^aDBF1;
//aA12=aDBF1.AngleWithRef(aDBF2, aDTF1);
aA12=AngleWithRef(aDBF1, aDBF2, aDTF1);
if (aA12<0.) {
aA12=aA12+aTwoPI;
}
//aA1x=aDBF1.AngleWithRef(aDBF , aDTF1);
aA1x=AngleWithRef(aDBF1, aDBF , aDTF1);
if (aA1x<0.) {
aA1x=aA1x+aTwoPI;
}
//
if (aA1x<aA12) {
bRet=!bRet; //TopAbs_IN;
}
}
//
/*
{
Standard_Real aD1, aD2;
//
//BOPTools_Tools3D::GetApproxNormalToFaceOnEdge (aE1, theFace1, aT, aPF1, aDNF1);
gp_Pln aPlnF1(aPx, aDNF1);
//
aD1=BOPTools_Tools3D::SignDistance(aPF, aPlnF1);
if (aD1<=0.) {
BOPTools_Tools3D::GetApproxNormalToFaceOnEdge (aE2, theFace2, aT, aPF2, aDNF2);
//BOPTools_Tools3D::GetApproxNormalToFaceOnEdge (aE2, theFace2, aT, aPF2, aDNF2);
gp_Pln aPlnF2(aPx, aDNF2);
//
aD2=BOPTools_Tools3D::SignDistance(aPF, aPlnF2);
@ -260,7 +301,12 @@ static
bRet=!bRet; //TopAbs_IN;
}
}
}
*/
//modified by NIZNHY-PKV Mon Nov 13 12:12:55 2006t
//
return bRet;
}
//=======================================================================
//function : GetFaceOff
@ -1012,3 +1058,98 @@ Standard_Real AngleWithRef(const gp_Dir& theD1,
}
return aBeta;
}
//
/*
static
void Path(const TopoDS_Shape& ,
const TopoDS_Shape& ,
const TopTools_IndexedDataMapOfShapeListOfShape& ,
const TopTools_IndexedMapOfShape& ,
TopTools_IndexedMapOfShape& );
//=======================================================================
// function: MakeConnexityBlock.
// purpose:
//=======================================================================
void GEOMAlgo_Tools3D::MakeConnexityBlock (const TopTools_ListOfShape& theLFIn,
const TopTools_IndexedMapOfShape& theMEAvoid,
TopTools_ListOfShape& theLCB)
{
Standard_Integer j, aNbF;
TopTools_IndexedDataMapOfShapeListOfShape aEFMap;
TopTools_IndexedMapOfShape aMFP, aCBMap;
TopTools_ListIteratorOfListOfShape aIt;
TopExp_Explorer aExp;
TopAbs_ShapeEnum aType;
//
aIt.Initialize(theLFIn);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aF=aIt.Value();
aType=aF.ShapeType();
TopExp::MapShapesAndAncestors(aF, TopAbs_EDGE, TopAbs_FACE, aEFMap);
}
//
aCBMap.Clear();
const TopoDS_Shape& aF=theLFIn.First();
//
aCBMap.Add(aF);
//
aExp.Init(aF, TopAbs_EDGE);
for (; aExp.More(); aExp.Next()){
const TopoDS_Shape& aE=aExp.Current();
if (theMEAvoid.Contains(aE)){
continue;
}
//
const TopTools_ListOfShape& aLF=aEFMap.FindFromKey(aE);
aIt.Initialize(aLF);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aF1=aIt.Value();
if (!aF1.IsSame(aF)) {
Path (aE, aF1, aEFMap, theMEAvoid, aCBMap);
}
}
}
//
aNbF=aCBMap.Extent();
for (j=1; j<=aNbF; ++j) {
const TopoDS_Shape& aFx=aCBMap(j);
theLCB.Append(aFx);
}
}
//=======================================================================
// function: Path
// purpose:
//=======================================================================
void Path(const TopoDS_Shape& theE1,
const TopoDS_Shape& theF1,
const TopTools_IndexedDataMapOfShapeListOfShape& theEFMap,
const TopTools_IndexedMapOfShape& theMEAvoid,
TopTools_IndexedMapOfShape& theCBMap)
{
TopTools_ListIteratorOfListOfShape aIt;
TopExp_Explorer aExp;
//
if (theCBMap.Contains(theF1)){
return;
}
theCBMap.Add(theF1);
//
aExp.Init(theF1, TopAbs_EDGE);
for (; aExp.More(); aExp.Next()){
const TopoDS_Shape& aE=aExp.Current();
if (!aE.IsSame(theE1)){
if (theMEAvoid.Contains(aE)) {
continue;
}
//
const TopTools_ListOfShape& aLF=theEFMap.FindFromKey(aE);
aIt.Initialize(aLF);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aF=aIt.Value();
Path (aE, aF, theEFMap, theMEAvoid, theCBMap);
}
}
}
}
*/

View File

@ -53,12 +53,6 @@
#include <GEOMAlgo_WireSplitter.hxx>
static
void Path(const TopoDS_Shape& aV1,
const TopTools_IndexedDataMapOfShapeListOfShape& aMVE,
TopTools_MapOfShape& aMVP,
TopTools_MapOfShape& aMEP,
TopTools_MapOfShape& aMEC);
static
void MakeWire(const TopTools_ListOfShape& aLE,
TopoDS_Wire& newWire);
@ -122,20 +116,21 @@ static
void GEOMAlgo_WESCorrector::DoConnexityBlocks()
{
Standard_Boolean bRegular;
Standard_Integer i, aNbV;
Standard_Integer i, aNbV, j, aNbC, aNbVP, aNbVS;
TopTools_ListIteratorOfListOfShape aIt;
TopoDS_Iterator aItE;
TopoDS_Shape aER;
TopTools_MapOfShape aMER, aMEP, aMEC, aMVP;
TopTools_MapIteratorOfMapOfShape aItM;
TopTools_IndexedMapOfShape aMER, aMEP, aMEC, aMVP;
TopTools_IndexedMapOfShape aMVS, aMVAdd;
TopTools_IndexedDataMapOfShapeListOfShape aMVE;
//
// 1. aMVE;
const TopTools_ListOfShape& aLE=myWES->StartElements();
aIt.Initialize(aLE);
const TopTools_ListOfShape& aLSE=myWES->StartElements();
aIt.Initialize(aLSE);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aE=aIt.Value();
if (aMEP.Add(aE)) {
if (!aMEP.Contains(aE)) {
aMEP.Add(aE);
TopExp::MapShapesAndAncestors(aE, TopAbs_VERTEX, TopAbs_EDGE, aMVE);
}
else {
@ -143,42 +138,74 @@ static
}
}
//
aMEP.Clear();
//
// 2.
aNbV=aMVE.Extent();
for (i=1; i<=aNbV; ++i) {
const TopoDS_Shape& aV=aMVE.FindKey(i);
if (aMVP.Contains(aV)) {
//
aNbVS=aMVS.Extent();
if (aNbVS==aNbV) {
break;
}
//
if (aMVS.Contains(aV)) {
continue;
}
aMVS.Add(aV); // aMVS - globally processed vertices
//
//------------------------------------- goal: aMEC
aMEC.Clear(); // aMEC - edges of CB
aMVP.Clear(); // aMVP - vertices to process right now
aMVAdd.Clear(); // aMVAdd vertices to process on next step of while(1)
//
aMVP.Add(aV);
//
const TopTools_ListOfShape& aLEi=aMVE(i);
aIt.Initialize(aLEi);
while(1) {
aNbVP=aMVP.Extent();
for (j=1; j<=aNbVP; ++j) {
const TopoDS_Shape& aVP=aMVP(j);
const TopTools_ListOfShape& aLE=aMVE.FindFromKey(aVP);
aIt.Initialize(aLE);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aE=aIt.Value();
if (aMEP.Contains(aE)) {
if (aMEC.Contains(aE)) {
continue;
}
//
aMEP.Add(aE);
aMEC.Add(aE);
//
aItE.Initialize(aE);
for (; aItE.More(); aItE.Next()) {
const TopoDS_Shape& aVE=aItE.Value();
Path(aVE, aMVE, aMVP, aMEP, aMEC);
if (!aMVS.Contains(aVE)) {
aMVS.Add(aVE);
aMVAdd.Add(aVE);
}
}//for (; aIt.More(); aIt.Next()) {
}
}
}//for (j=1; j<=aNbVP; ++j)
//
aNbVP=aMVAdd.Extent();
if (!aNbVP) {
break; // from while(1)
}
//
aMVP.Clear();
for (j=1; j<=aNbVP; ++j) {
const TopoDS_Shape& aVE=aMVAdd(j);
aMVP.Add(aVE);
}
aMVAdd.Clear();
}// while(1) {
//-------------------------------------
BOP_ConnexityBlock aCB;
TopTools_ListOfShape aLEC;
TopTools_IndexedDataMapOfShapeListOfShape aMVER;
//
bRegular=Standard_True;
aItM.Initialize(aMEC);
for (; aItM.More(); aItM.Next()) {
aER=aItM.Key();
aNbC=aMEC.Extent();
for (j=1; j<=aNbC; ++j) {
aER=aMEC(j);
//
if (aMER.Contains(aER)) {
Standard_Boolean bClosed;
@ -200,14 +227,14 @@ static
if (bRegular) {
TopExp::MapShapesAndAncestors(aER, TopAbs_VERTEX, TopAbs_EDGE, aMVER);
}
}
}//for (j=1; j<=aNbC; ++j) {
//
if (bRegular) {
Standard_Integer j, aNbVR, aNbER;
Standard_Integer k, aNbVR, aNbER;
//
aNbVR=aMVER.Extent();
for (j=1; j<=aNbVR; ++j) {
const TopTools_ListOfShape& aLER=aMVE(j);
for (k=1; k<=aNbVR; ++k) {
const TopTools_ListOfShape& aLER=aMVER(k);//?? it was aMVE(k)
aNbER=aLER.Extent();
if (aNbER==1) {
const TopoDS_Edge& aEx=TopoDS::Edge(aER);
@ -229,41 +256,7 @@ static
aMEC.Clear();
}//for (i=1; i<=aNbV; ++i) {
}
//=======================================================================
// function: Path
// purpose:
//=======================================================================
void Path(const TopoDS_Shape& aV1,
const TopTools_IndexedDataMapOfShapeListOfShape& aMVE,
TopTools_MapOfShape& aMVP,
TopTools_MapOfShape& aMEP,
TopTools_MapOfShape& aMEC)
{
TopoDS_Iterator aItE;
TopTools_ListIteratorOfListOfShape aIt;
//
if (aMVP.Contains(aV1)) {
return;
}
aMVP.Add(aV1);
//
const TopTools_ListOfShape& aLE=aMVE.FindFromKey(aV1);
aIt.Initialize(aLE);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aE=aIt.Value();
if (aMEP.Contains(aE)) {
continue;
}
aMEP.Add(aE);
aMEC.Add(aE);
//
aItE.Initialize(aE);
for (; aItE.More(); aItE.Next()) {
const TopoDS_Shape& aVE=aItE.Value();
Path(aVE, aMVE, aMVP, aMEP, aMEC);
}
}
}
//=======================================================================
// function: DoCorrections
// purpose:

View File

@ -116,11 +116,6 @@ static
Standard_Real Tolerance2D (const TopoDS_Vertex& aV,
const GeomAdaptor_Surface& aGAS);
static
void UVTolerance2D (const TopoDS_Vertex& aV,
const GeomAdaptor_Surface& aGAS,
Standard_Real& aTolU,
Standard_Real& aTolV);
static
Standard_Integer NbWaysOut(const BOP_ListOfEdgeInfo& );
//
@ -456,7 +451,7 @@ static
Standard_Integer i,j, aNb, aNbj;
Standard_Real aTol, anAngleIn, anAngleOut, anAngle, aMinAngle;
Standard_Real aTol2D, aTol2D2;
Standard_Real aTol2, aD2, aTolUVb, aTolVVb;
Standard_Real aTol2, aD2;//, aTolUVb, aTolVVb;
Standard_Boolean anIsSameV2d, anIsSameV, anIsFound, anIsOut, anIsNotPassed;
BOP_ListIteratorOfListOfEdgeInfo anIt;
TopoDS_Vertex aVb;
@ -494,9 +489,13 @@ static
aTol=2.*Tolerance2D(aVb, aGAS);
aTol2=aTol*aTol;
//
//modified by NIZNHY-PKV Tue Nov 14 16:56:19 2006f
/*
UVTolerance2D(aVb, aGAS, aTolUVb, aTolVVb);
aTolUVb = 2.*aTolUVb;
aTolVVb = 2.*aTolVVb;
*/
//modified by NIZNHY-PKV Tue Nov 14 16:56:26 2006t
//
aNb=aLS.Length();
if (aNb>0) {
@ -511,7 +510,7 @@ static
aBuf.Append(aEPrev);
anIsSameV=aVPrev.IsSame(aVb);
anIsSameV2d = Standard_False;
anIsSameV2d=Standard_False;
if (anIsSameV) {
anIsSameV2d = Standard_True;
@ -519,6 +518,8 @@ static
aD2=aPaPrev.SquareDistance(aPb);
anIsSameV2d =aD2<aTol2;
//
//modified by NIZNHY-PKV Tue Nov 14 16:56:49 2006f
/*
if(anIsSameV2d) {
Standard_Real udist, vdist;
//
@ -528,6 +529,8 @@ static
anIsSameV2d=!anIsSameV2d;
}
}
*/
//modified by NIZNHY-PKV Tue Nov 14 16:56:54 2006t
}//if (anIsSameV) {
//
if (anIsSameV && anIsSameV2d) {
@ -892,6 +895,15 @@ Standard_Integer NbWaysOut(const BOP_ListOfEdgeInfo& aLEInfo)
}
return iCnt;
}
//modified by NIZNHY-PKV Tue Nov 14 16:55:31 2006f
/*
static
void UVTolerance2D (const TopoDS_Vertex& aV,
const GeomAdaptor_Surface& aGAS,
Standard_Real& aTolU,
Standard_Real& aTolV);
*/
/*
//=======================================================================
//function : UVTolerance2D
//purpose :
@ -907,3 +919,5 @@ void UVTolerance2D (const TopoDS_Vertex& aV,
aTolU=aGAS.UResolution(aTolV3D);
aTolV=aGAS.VResolution(aTolV3D);
}
*/
//modified by NIZNHY-PKV Tue Nov 14 16:55:39 2006

View File

@ -269,7 +269,7 @@ static
//
// Modified Thu Sep 14 14:35:18 2006
// Contribution of Samtech www.samcef.com BEGIN
Standard_Boolean bIsExistingPaveBlock, bIsValidIn2D;//, bIsCoincided;
Standard_Boolean bIsExistingPaveBlock, bIsValidIn2D, bIsCoincided;
// Contribution of Samtech www.samcef.com END
//
Standard_Integer i, aNbFFs, nF1, nF2, aBid=0;
@ -285,7 +285,7 @@ static
//
NMTTools_DataMapOfIntegerListOfPaveBlock aMFInOn;
NMTTools_DataMapIteratorOfDataMapOfIntegerListOfPaveBlock aItMF;
//
//---
{
Standard_Integer aNbS, aNbF, nF, aNbOn, nSp;
TopAbs_ShapeEnum aType;
@ -364,6 +364,7 @@ static
aLPB.Append(aLPBX);
}
}
//---
//
// 1. Produce Section Edges from intersection curves
// between each pair of faces
@ -381,6 +382,7 @@ static
//
BOPTools_ListOfPaveBlock aLPB;
//
//---
{
BOPTools_ListIteratorOfListOfPaveBlock anItPB;
NMTTools_MapOfPaveBlock aMPB;
@ -409,6 +411,7 @@ static
}
}
}
//---
//
TopTools_ListOfShape aLSE;
TColStd_ListOfInteger aLNE;
@ -468,17 +471,23 @@ static
}
//
// 1
bIsExistingPaveBlock=IsExistingPaveBlock(aPBNew, aLPB, aTolR3D);
if (bIsExistingPaveBlock) {
continue;
}
//
bIsCoincided=CheckCoincidence(aPBNew, aLPB);
if(bIsCoincided) {
continue;
}
//
// Modified
// to provide checking whether aPBNew already exists in list
// of section edges aLSE
// Thu Sep 14 14:35:18 2006
// Contribution of Samtech www.samcef.com BEGIN
// 3
// 2
bIsExistingPaveBlock=IsExistingPaveBlock(aPBNew, aLSE, aTolR3D);
if (bIsExistingPaveBlock) {
continue;
@ -492,7 +501,6 @@ static
continue;
}
//
//aBC.AppendNewBlock(aPBNew);
//
// Make Section Edge
TopoDS_Edge aES;
@ -502,16 +510,33 @@ static
//
BOPTools_Tools::MakeSectEdge (aIC, aV1, aT1, aV2, aT2, aES);
//
//modified by NIZNHY-PKV Thu Nov 16 11:13:46 2006f SKL/PartC5
{
Handle(Geom2d_Curve) aC2D1, aC2D2;
//
aC2D1=aIC.FirstCurve2d();
aC2D2=aIC.SecondCurve2d();
//
NMTTools_Tools::MakePCurve(aES, aF1, aC2D1);
NMTTools_Tools::MakePCurve(aES, aF2, aC2D2);
NMTTools_Tools::UpdateEdge (aES, aTolR3D);
}
//
/*
{
Standard_Real aTolR2D;
Handle(Geom2d_Curve) aC2D1, aC2D2;
//
aTolR2D=aFFi.TolR2D();
Handle(Geom2d_Curve) aC2D1=aIC.FirstCurve2d();
Handle(Geom2d_Curve) aC2D2=aIC.SecondCurve2d();
aC2D1=aIC.FirstCurve2d();
aC2D2=aIC.SecondCurve2d();
//
NMTTools_Tools::MakePCurve(aES, aF1, aC2D1, aTolR2D);
NMTTools_Tools::MakePCurve(aES, aF2, aC2D2, aTolR2D);
}
*/
//modified by NIZNHY-PKV Thu Nov 16 11:17:34 2006t
//
aMEPB.Add(aES, aPBNew);
aMapEI.Add(aES, i);
@ -712,15 +737,18 @@ static
const TopoDS_Edge& aEx=TopoDS::Edge(tDS.Shape(mE));
aTolEx=BRep_Tool::Tolerance(aEx);
//
// The code till the if block end is restored from V2_2_2 revision
//
aF1FWD=aF1;
aF1FWD.Orientation(TopAbs_FORWARD);
NMTTools_Tools::MakePCurve(aEx, aF1FWD, aC2D1, aTolEx);
//
aF2FWD=aF2;
aF2FWD.Orientation(TopAbs_FORWARD);
NMTTools_Tools::MakePCurve(aEx, aF2FWD, aC2D2, aTolEx);
//
//modified by NIZNHY-PKV Thu Nov 16 12:49:13 2006f SKL/PartC5
//NMTTools_Tools::MakePCurve(aEx, aF1FWD, aC2D1, aTolEx);
//NMTTools_Tools::MakePCurve(aEx, aF2FWD, aC2D2, aTolEx);
NMTTools_Tools::MakePCurve(aEx, aF1FWD, aC2D1);
NMTTools_Tools::MakePCurve(aEx, aF2FWD, aC2D2);
NMTTools_Tools::UpdateEdge (aEx, aTolEx);
//modified by NIZNHY-PKV Thu Nov 16 12:49:24 2006t
} //if (aCBAPI.IsCommonBlock(aPB))
//
// new SE
@ -1277,8 +1305,7 @@ void SharedEdges1(const TopoDS_Face& aF1,
}
}
}
//modified by NIZNHY-PKV Tue Oct 24 12:00:50 2006
// it seems that the method is not used
//=======================================================================
// function: CheckCoincidence
// purpose:
@ -1291,6 +1318,7 @@ void SharedEdges1(const TopoDS_Face& aF1,
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();
@ -1303,9 +1331,7 @@ void SharedEdges1(const TopoDS_Face& aF1,
//
iCountExt=1;
iCount=0;
BOPTools_ListIteratorOfListOfPaveBlock anIt(aLPBFF);
//
anIt.Initialize(aLPBFF);
for (; anIt.More(); anIt.Next()) {
iCount=0;
//
@ -1313,13 +1339,20 @@ void SharedEdges1(const TopoDS_Face& aF1,
// V21
const BOPTools_Pave& aPave21=aPBR.Pave1();
nV21=aPave21.Index();
const TopoDS_Vertex& aV21=TopoDS::Vertex(myDS->Shape(nV21));
// V22
const BOPTools_Pave& aPave22=aPBR.Pave2();
nV22=aPave22.Index();
const TopoDS_Vertex& aV22=TopoDS::Vertex(myDS->Shape(nV22));
//modified by NIZNHY-PKV Wed Nov 15 13:08:13 2006f
if (nV11==nV21 || nV11==nV22 || nV12==nV21 || nV12==nV22) {
continue;
}
//modified by NIZNHY-PKV Wed Nov 15 13:08:15 2006t
// 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

View File

@ -81,11 +81,22 @@ is
aM1: IndexedDataMapOfShapeIndexedMapOfShape from NMTTools;
aM2:out IndexedDataMapOfShapeIndexedMapOfShape from NMTTools);
--modified by NIZNHY-PKV Thu Nov 16 10:58:08 2006f
-- MakePCurve(myclass;
-- aE : Edge from TopoDS;
-- aF : Face from TopoDS;
-- aC2D: Curve from Geom2d;
-- aTolR2D: Real from Standard);
MakePCurve(myclass;
aE : Edge from TopoDS;
aF : Face from TopoDS;
aC2D: Curve from Geom2d;
aTolR2D: Real from Standard);
aC2D : Curve from Geom2d);
UpdateEdge(myclass;
aE : Edge from TopoDS;
aTol : Real from Standard);
--modified by NIZNHY-PKV Thu Nov 16 10:58:14 2006t
--fields
end Tools;

View File

@ -70,6 +70,7 @@
//
#include <TopTools_MapOfShape.hxx>
#include <TopTools_MapIteratorOfMapOfShape.hxx>
#include <TopoDS_Iterator.hxx>
static
void ProcessBlock(const Standard_Integer iV,
@ -82,6 +83,70 @@ static
TopTools_IndexedMapOfShape& aProcessed,
TopTools_IndexedMapOfShape& aChain);
//modified by NIZNHY-PKV Thu Nov 16 10:46:53 2006f SKL/PartC5
//=======================================================================
// function: UpdateEdge
// purpose:
//=======================================================================
void NMTTools_Tools::UpdateEdge(const TopoDS_Edge& aE,
const Standard_Real aTolR)
{
Standard_Real aTolE, aTolES, aTolV;
TopoDS_Iterator aIt;
BRep_Builder aBB;
//
aTolE=BRep_Tool::Tolerance(aE);
aTolES=Max(aTolR, aTolE);
aBB.UpdateEdge(aE, aTolES);
//
aIt.Initialize(aE);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Vertex& aV=TopoDS::Vertex(aIt.Value());
aTolV=BRep_Tool::Tolerance(aV);
if (aTolV<aTolES) {
aBB.UpdateVertex(aV, aTolES);
}
}
}
//=======================================================================
// function: MakePCurve
// purpose:
//=======================================================================
void NMTTools_Tools::MakePCurve(const TopoDS_Edge& aE,
const TopoDS_Face& aF,
const Handle(Geom2d_Curve)& aC2Dx1)
{
Standard_Real aTolE, aT1, aT2, aOutFirst, aOutLast, aOutTol;
Handle(Geom2d_Curve) aC2D, aC2DA;
TopoDS_Face aFFWD;
BRep_Builder aBB;
//
aFFWD=aF;
aFFWD.Orientation(TopAbs_FORWARD);
//
aTolE=BRep_Tool::Tolerance(aE);
//
const Handle(Geom_Curve)& aC3DE=BRep_Tool::Curve(aE, aT1, aT2);
Handle(Geom_TrimmedCurve)aC3DETrim=new Geom_TrimmedCurve(aC3DE, aT1, aT2);
//
aC2D=aC2Dx1;
if (aC2D.IsNull()) { // ?
BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aE, aFFWD);
BOPTools_Tools2D::CurveOnSurface(aE, aFFWD, aC2D, aOutFirst, aOutLast, aOutTol, Standard_True);
}
//
if (aC3DE->IsPeriodic()) {
BOPTools_Tools2D::AdjustPCurveOnFace(aFFWD, aT1, aT2, aC2D, aC2DA);
}
else {
BOPTools_Tools2D::AdjustPCurveOnFace(aFFWD, aC3DETrim, aC2D, aC2DA);
}
//
aBB.UpdateEdge(aE, aC2DA, aFFWD, aTolE);
BRepLib::SameParameter(aE);
}
/*
//=======================================================================
// function: MakePCurve
// purpose:
@ -140,7 +205,8 @@ static
aBB.UpdateEdge(aE, aC2DA, aFFWD, aTolFact);
BRepLib::SameParameter(aE);
}
*/
//modified by NIZNHY-PKV Thu Nov 16 10:46:55 2006t
//=======================================================================
// function: IsSplitInOnFace
// purpose:

View File

@ -94,7 +94,10 @@ Standard_EXPORT static void FindChains(const NMTTools_ListOfCoupleOfShape& aLCS
Standard_EXPORT static void FindChains(const NMTTools_IndexedDataMapOfShapeIndexedMapOfShape& aM1,NMTTools_IndexedDataMapOfShapeIndexedMapOfShape& aM2) ;
Standard_EXPORT static void MakePCurve(const TopoDS_Edge& aE,const TopoDS_Face& aF,const Handle(Geom2d_Curve)& aC2D,const Standard_Real aTolR2D) ;
Standard_EXPORT static void MakePCurve(const TopoDS_Edge& aE,const TopoDS_Face& aF,const Handle(Geom2d_Curve)& aC2D) ;
Standard_EXPORT static void UpdateEdge(const TopoDS_Edge& aE,const Standard_Real aTol) ;