//=======================================================================
void GEOMAlgo_ShapeSet::Add(const TopoDS_Shape& theShape)
{
- myMap.Add(theShape);
+ if (myMap.Add(theShape)) {
+ myList.Append(theShape);
+ }
}
//=======================================================================
//function : Add
//purpose :
//=======================================================================
void GEOMAlgo_ShapeSet::Add(const TopoDS_Shape& theShape,
- const TopAbs_ShapeEnum theType)
+ const TopAbs_ShapeEnum theType)
{
TopExp_Explorer aExp;
//
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);
+ }
}
}
//=======================================================================
//
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);
+ }
}
}
//=======================================================================
//=======================================================================
const TopTools_ListOfShape& GEOMAlgo_ShapeSet::GetSet()const
{
+ /*
TopTools_ListOfShape *pL;
TopTools_MapIteratorOfMapOfOrientedShape aIt;
//
for (; aIt.More(); aIt.Next()) {
pL->Append(aIt.Key());
}
+ */
return myList;
}
//=======================================================================
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;
//=======================================================================
void GEOMAlgo_ShapeSet::Subtract(const GEOMAlgo_ShapeSet& theOther)
{
+ /*
TopTools_MapIteratorOfMapOfOrientedShape aIt;
//
aIt.Initialize(theOther.myMap);
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;
}
#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>
#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& ,
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;
// 3
bRet=Standard_False;
//
+ //modified by NIZNHY-PKV Mon Nov 13 12:12:53 2006f
+ //
BOPTools_Tools3D::GetApproxNormalToFaceOnEdge (aE1, theFace1, aT, aPF1, aDNF1);
- gp_Pln aPlnF1(aPx, aDNF1);
+ BOPTools_Tools3D::GetApproxNormalToFaceOnEdge (aE2, theFace2, aT, aPF2, aDNF2);
//
- aD1=BOPTools_Tools3D::SignDistance(aPF, aPlnF1);
- if (aD1<=0.) {
- BOPTools_Tools3D::GetApproxNormalToFaceOnEdge (aE2, theFace2, aT, aPF2, aDNF2);
- gp_Pln aPlnF2(aPx, aDNF2);
+ {
+ Standard_Real aA12, aA1x, aTwoPI;
+ //
+ aTwoPI=2.*PI;
+ gp_Vec aVBF (aPx, aPF );
+ gp_Vec aVBF1(aPx, aPF1);
+ gp_Vec aVBF2(aPx, aPF2);
//
- aD2=BOPTools_Tools3D::SignDistance(aPF, aPlnF2);
- if (aD2<=0.) {
+ 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);
+ gp_Pln aPlnF2(aPx, aDNF2);
+ //
+ aD2=BOPTools_Tools3D::SignDistance(aPF, aPlnF2);
+ if (aD2<=0.) {
+ bRet=!bRet; //TopAbs_IN;
+ }
+ }
+ }
+ */
+ //modified by NIZNHY-PKV Mon Nov 13 12:12:55 2006t
+ //
return bRet;
+
}
//=======================================================================
//function : GetFaceOff
}
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);
+ }
+ }
+ }
+}
+*/
#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);
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 {
}
}
//
- 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);
- for (; aIt.More(); aIt.Next()) {
- const TopoDS_Shape& aE=aIt.Value();
- if (aMEP.Contains(aE)) {
- continue;
+ 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 (aMEC.Contains(aE)) {
+ continue;
+ }
+ aMEC.Add(aE);
+ //
+ aItE.Initialize(aE);
+ for (; aItE.More(); aItE.Next()) {
+ const TopoDS_Shape& aVE=aItE.Value();
+ if (!aMVS.Contains(aVE)) {
+ aMVS.Add(aVE);
+ aMVAdd.Add(aVE);
+ }
+ }
+ }
+ }//for (j=1; j<=aNbVP; ++j)
+ //
+ aNbVP=aMVAdd.Extent();
+ if (!aNbVP) {
+ break; // from while(1)
}
//
- 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);
+ aMVP.Clear();
+ for (j=1; j<=aNbVP; ++j) {
+ const TopoDS_Shape& aVE=aMVAdd(j);
+ aMVP.Add(aVE);
}
- }//for (; aIt.More(); aIt.Next()) {
- //
+ 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;
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);
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:
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& );
//
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;
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) {
aBuf.Append(aEPrev);
anIsSameV=aVPrev.IsSame(aVb);
- anIsSameV2d = Standard_False;
+ anIsSameV2d=Standard_False;
if (anIsSameV) {
anIsSameV2d = Standard_True;
aD2=aPaPrev.SquareDistance(aPb);
anIsSameV2d =aD2<aTol2;
//
+ //modified by NIZNHY-PKV Tue Nov 14 16:56:49 2006f
+ /*
if(anIsSameV2d) {
Standard_Real udist, vdist;
//
anIsSameV2d=!anIsSameV2d;
}
}
+ */
+ //modified by NIZNHY-PKV Tue Nov 14 16:56:54 2006t
}//if (anIsSameV) {
//
if (anIsSameV && anIsSameV2d) {
}
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 :
aTolU=aGAS.UResolution(aTolV3D);
aTolV=aGAS.VResolution(aTolV3D);
}
+*/
+//modified by NIZNHY-PKV Tue Nov 14 16:55:39 2006
//
// 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;
//
NMTTools_DataMapOfIntegerListOfPaveBlock aMFInOn;
NMTTools_DataMapIteratorOfDataMapOfIntegerListOfPaveBlock aItMF;
- //
+ //---
{
Standard_Integer aNbS, aNbF, nF, aNbOn, nSp;
TopAbs_ShapeEnum aType;
aLPB.Append(aLPBX);
}
}
+ //---
//
// 1. Produce Section Edges from intersection curves
// between each pair of faces
//
BOPTools_ListOfPaveBlock aLPB;
//
+ //---
{
BOPTools_ListIteratorOfListOfPaveBlock anItPB;
NMTTools_MapOfPaveBlock aMPB;
}
}
}
+ //---
//
TopTools_ListOfShape aLSE;
TColStd_ListOfInteger aLNE;
}
//
// 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;
continue;
}
//
- //aBC.AppendNewBlock(aPBNew);
//
// Make Section Edge
TopoDS_Edge aES;
//
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);
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
}
}
}
-//modified by NIZNHY-PKV Tue Oct 24 12:00:50 2006
-// it seems that the method is not used
+
//=======================================================================
// function: CheckCoincidence
// purpose:
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();
//
iCountExt=1;
iCount=0;
- BOPTools_ListIteratorOfListOfPaveBlock anIt(aLPBFF);
-
- //
+ anIt.Initialize(aLPBFF);
for (; anIt.More(); anIt.Next()) {
iCount=0;
//
// 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
FindChains(myclass;
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);
+ aE : Edge from TopoDS;
+ aF : Face from TopoDS;
+ 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;
//
#include <TopTools_MapOfShape.hxx>
#include <TopTools_MapIteratorOfMapOfShape.hxx>
+#include <TopoDS_Iterator.hxx>
static
void ProcessBlock(const Standard_Integer iV,
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:
aBB.UpdateEdge(aE, aC2DA, aFFWD, aTolFact);
BRepLib::SameParameter(aE);
}
-
+*/
+//modified by NIZNHY-PKV Thu Nov 16 10:46:55 2006t
//=======================================================================
// function: IsSplitInOnFace
// purpose:
// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
+// License as published by the Free Software Foundation; either
// version 2.1 of the License.
-//
-// This library is distributed in the hope that it will be useful
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
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) ;