//function : ShapeInfo
//purpose :
//=======================================================================
-const BOPDS_ShapeInfo& BOPDS_DS::ShapeInfo(const Standard_Integer theI)const
+const BOPDS_ShapeInfo& BOPDS_DS::ShapeInfo
+ (const Standard_Integer theI)const
{
return myLines(theI);
}
//=======================================================================
void BOPDS_DS::Init()
{
- Standard_Integer i1, i2, j, aI, aNb, aNbS, aNbE, aNbSx, nV, nW, nE, aNbF;
- Standard_Integer n1, n2, n3;
+ Standard_Integer i1, i2, j, aI, aNb, aNbS, aNbE, aNbSx;
+ Standard_Integer n1, n2, n3, nV, nW, nE, aNbF;
Standard_Real aTol;
TopAbs_ShapeEnum aTS;
TopoDS_Iterator aItS;
// pure internal vertices on the face
aItS.Initialize(aS);
for (; aItS.More(); aItS.Next()) {
- const TopoDS_Shape& aSx=aItS.Value();
- if (aSx.ShapeType()==TopAbs_VERTEX){
- nV=Index(aSx);
- aMI.Add(nV);
- }
+ const TopoDS_Shape& aSx=aItS.Value();
+ if (aSx.ShapeType()==TopAbs_VERTEX){
+ nV=Index(aSx);
+ aMI.Add(nV);
+ }
}
//
//
n1=aIt1.Value();
BOPDS_ShapeInfo& aSI1=ChangeShapeInfo(n1);
if (aSI1.ShapeType()!=TopAbs_SHELL) {
- continue;
+ continue;
}
//
const BOPCol_ListOfInteger& aLI2=aSI1.SubShapes();
aIt2.Initialize(aLI2);
for (; aIt2.More(); aIt2.Next()) {
- n2=aIt2.Value();
- BOPDS_ShapeInfo& aSI2=ChangeShapeInfo(n2);
- if (aSI2.ShapeType()!=TopAbs_FACE) {
- continue;
- }
- //
- aMI.Add(n2);
- //
- const BOPCol_ListOfInteger& aLI3=aSI2.SubShapes();
- aIt3.Initialize(aLI3);
- for (; aIt3.More(); aIt3.Next()) {
- n3=aIt3.Value();
- aMI.Add(n3);
- }
+ n2=aIt2.Value();
+ BOPDS_ShapeInfo& aSI2=ChangeShapeInfo(n2);
+ if (aSI2.ShapeType()!=TopAbs_FACE) {
+ continue;
+ }
+ //
+ aMI.Add(n2);
+ //
+ const BOPCol_ListOfInteger& aLI3=aSI2.SubShapes();
+ aIt3.Initialize(aLI3);
+ for (; aIt3.More(); aIt3.Next()) {
+ n3=aIt3.Value();
+ aMI.Add(n3);
+ }
}
}
//
//function : InitShape
//purpose :
//=======================================================================
-void BOPDS_DS::InitShape(const Standard_Integer aI,
- const TopoDS_Shape& aS,
- Handle(NCollection_BaseAllocator)& theAllocator,
- BOPCol_DataMapOfShapeInteger& aMSI)
+void BOPDS_DS::InitShape
+ (const Standard_Integer aI,
+ const TopoDS_Shape& aS,
+ Handle(NCollection_BaseAllocator)& theAllocator,
+ BOPCol_DataMapOfShapeInteger& aMSI)
{
Standard_Integer aIx;
TopoDS_Iterator aIt;
bRet=HasInterf(theI1, n2);
if (theFlag) {
if(bRet) {
- break;
+ break;
}
}
else {
if(!bRet) {
- break;
+ break;
}
}
}
//function : HasInterfSubShapes
//purpose :
//=======================================================================
-Standard_Boolean BOPDS_DS::HasInterfSubShapes(const Standard_Integer theI1,
- const Standard_Integer theI2)const
+Standard_Boolean BOPDS_DS::HasInterfSubShapes
+ (const Standard_Integer theI1,
+ const Standard_Integer theI2)const
{
Standard_Boolean bRet;
Standard_Integer n1;
//function : PaveBlocks
//purpose :
//=======================================================================
-const BOPDS_ListOfPaveBlock& BOPDS_DS::PaveBlocks(const Standard_Integer theI)const
+const BOPDS_ListOfPaveBlock& BOPDS_DS::PaveBlocks
+ (const Standard_Integer theI)const
{
static BOPDS_ListOfPaveBlock sLPB;
Standard_Integer aRef;
//function : ChangePaveBlocks
//purpose :
//=======================================================================
-BOPDS_ListOfPaveBlock& BOPDS_DS::ChangePaveBlocks(const Standard_Integer theI)
+BOPDS_ListOfPaveBlock& BOPDS_DS::ChangePaveBlocks
+ (const Standard_Integer theI)
{
Standard_Boolean bHasReference;
Standard_Integer aRef;
//purpose :
//=======================================================================
void BOPDS_DS::SetCommonBlock(const Handle(BOPDS_PaveBlock)& thePB,
- const Handle(BOPDS_CommonBlock)& theCB)
+ const Handle(BOPDS_CommonBlock)& theCB)
{
if (IsCommonBlock(thePB)) {
Handle(BOPDS_CommonBlock)& aCB = myMapPBCB.ChangeFind(thePB);
//purpose :
//=======================================================================
void BOPDS_DS::FaceInfoOn(const Standard_Integer theF,
- BOPDS_IndexedMapOfPaveBlock& theMPB,
- BOPCol_MapOfInteger& theMI)
+ BOPDS_IndexedMapOfPaveBlock& theMPB,
+ BOPCol_MapOfInteger& theMI)
{
Standard_Integer nS, nSD, nV1, nV2;
BOPCol_ListIteratorOfListOfInteger aIt;
//purpose :
//=======================================================================
void BOPDS_DS::FaceInfoIn(const Standard_Integer theF,
- BOPDS_IndexedMapOfPaveBlock& theMPB,
- BOPCol_MapOfInteger& theMI)
+ BOPDS_IndexedMapOfPaveBlock& theMPB,
+ BOPCol_MapOfInteger& theMI)
{
Standard_Integer i, aNbVF, aNbEF, nV, nE, nVSD;
TopoDS_Iterator aItS;
if (aSx.ShapeType()==TopAbs_VERTEX){
nV=Index(aSx);
if (HasShapeSD(nV, nVSD)) {
- nV=nVSD;
+ nV=nVSD;
}
theMI.Add(nV);
}
//purpose :
//=======================================================================
void BOPDS_DS::AloneVertices(const Standard_Integer theI,
- BOPCol_ListOfInteger& theLI)const
+ BOPCol_ListOfInteger& theLI)const
{
if (HasFaceInfo(theI)) {
//
const BOPDS_FaceInfo& aFI=FaceInfo(theI);
//
for (i=0; i<2; ++i) {
- const BOPDS_IndexedMapOfPaveBlock& aMPB=(!i) ? aFI.PaveBlocksIn() : aFI.PaveBlocksSc();
+ const BOPDS_IndexedMapOfPaveBlock& aMPB=
+ (!i) ? aFI.PaveBlocksIn() : aFI.PaveBlocksSc();
aItMPB.Initialize(aMPB);
for (; aItMPB.More(); aItMPB.Next()) {
const Handle(BOPDS_PaveBlock)& aPB=aItMPB.Value();
}
//
for (i=0; i<2; ++i) {
- const BOPCol_MapOfInteger& aMIV=(!i) ? aFI.VerticesIn() : aFI.VerticesSc();
+ const BOPCol_MapOfInteger& aMIV=
+ (!i) ? aFI.VerticesIn() : aFI.VerticesSc();
aItMI.Initialize(aMIV);
for (; aItMI.More(); aItMI.Next()) {
nV=aItMI.Value();
- if (nV>0) {
+ if (nV>=0) {
if (aMI.Add(nV)) {
theLI.Append(nV);
}
//function : VerticesOnIn
//purpose :
//=======================================================================
-void BOPDS_DS::VerticesOnIn(const Standard_Integer nF1,
- const Standard_Integer nF2,
- BOPCol_MapOfInteger& aMI,
- BOPDS_MapOfPaveBlock& aMPB)const
+void BOPDS_DS::VerticesOnIn
+ (const Standard_Integer nF1,
+ const Standard_Integer nF2,
+ BOPCol_MapOfInteger& aMI,
+ BOPDS_MapOfPaveBlock& aMPB)const
{
Standard_Integer i, nV, nV1, nV2;
BOPCol_MapIteratorOfMapOfInteger aIt;
for (; aIt.More(); aIt.Next()) {
nV=aIt.Value();
if (aMVOn2.Contains(nV) || aMVIn2.Contains(nV)) {
- aMI.Add(nV);
+ aMI.Add(nV);
}
}
}
//purpose :
//=======================================================================
void BOPDS_DS::SharedEdges(const Standard_Integer nF1,
- const Standard_Integer nF2,
- BOPCol_ListOfInteger& theLI,
- const Handle(NCollection_BaseAllocator)& aAllocator)
+ const Standard_Integer nF2,
+ BOPCol_ListOfInteger& theLI,
+ const Handle(NCollection_BaseAllocator)& aAllocator)
{
Standard_Integer nE, nSp;
BOPCol_ListIteratorOfListOfInteger aItLI;
//purpose :
//=======================================================================
void BOPDS_DS::AddShapeSD(const Standard_Integer theIndex,
- const Standard_Integer theIndexSD)
+ const Standard_Integer theIndexSD)
{
myShapesSD.Bind(theIndex, theIndexSD);
}
//function : HasShapeSD
//purpose :
//=======================================================================
-Standard_Boolean BOPDS_DS::HasShapeSD(const Standard_Integer theIndex,
- Standard_Integer& theIndexSD)const
+Standard_Boolean BOPDS_DS::HasShapeSD
+ (const Standard_Integer theIndex,
+ Standard_Integer& theIndexSD)const
{
Standard_Boolean bRet;
//
// function: CheckCoincidence
// purpose:
//=======================================================================
-Standard_Boolean BOPDS_DS::CheckCoincidence(const Handle(BOPDS_PaveBlock)& aPB1,
- const Handle(BOPDS_PaveBlock)& aPB2)
+Standard_Boolean BOPDS_DS::CheckCoincidence
+ (const Handle(BOPDS_PaveBlock)& aPB1,
+ const Handle(BOPDS_PaveBlock)& aPB2)
{
Standard_Boolean bRet;
Standard_Integer nE1, nE2, aNbPoints;
}
return bRet;
}
-
//=======================================================================
// function: SortPaveBlocks
// purpose:
//
aCB->AddPaveBlocks(aLPBN);
}
-
//=======================================================================
// function: IsToSort
// purpose:
//=======================================================================
-Standard_Boolean BOPDS_DS::IsToSort(const Handle(BOPDS_CommonBlock)& aCB,
- Standard_Integer& theI)
+Standard_Boolean BOPDS_DS::IsToSort
+ (const Handle(BOPDS_CommonBlock)& aCB,
+ Standard_Integer& theI)
{
Standard_Boolean bRet;
bRet = Standard_False;
return bRet;
}
-
//=======================================================================
// function: IsSubShape
// purpose:
//=======================================================================
-Standard_Boolean BOPDS_DS::IsSubShape(const Standard_Integer theI1,
- const Standard_Integer theI2)
+Standard_Boolean BOPDS_DS::IsSubShape
+ (const Standard_Integer theI1,
+ const Standard_Integer theI2)
{
Standard_Boolean bRet;
Standard_Integer nS;
// purpose:
//=======================================================================
void BOPDS_DS::Paves(const Standard_Integer theEdge,
- BOPDS_ListOfPave& theLP)
+ BOPDS_ListOfPave& theLP)
{
Standard_Integer aNb, i;
BOPDS_Pave *pPaves;
// purpose:
//=======================================================================
void BOPDS_DS::UpdateEdgeTolerance(const Standard_Integer nE,
- const Standard_Real aTol)
+ const Standard_Real aTol)
{
Standard_Integer nV;
Standard_Real aTolV;
ResetShape(aSx);
}
}
-#include <Geom_Curve.hxx>
-
//=======================================================================
//function : ComputeParameter
//purpose :
//purpose :
//=======================================================================
void BOPDS_DS::BuildBndBoxSolid(const Standard_Integer theIndex,
- Bnd_Box& aBoxS)
+ Bnd_Box& aBoxS)
{
Standard_Boolean bIsOpenBox, bIsInverted;
Standard_Integer nSh, nFc;
nFc=aItLI1.Value();
const BOPDS_ShapeInfo& aSIFc=ShapeInfo(nFc);
if (aSIFc.ShapeType()!=TopAbs_FACE) {
- continue;
+ continue;
}
//
const Bnd_Box& aBFc=aSIFc.Box();
aBoxS.Add(aBFc);
//
if (!bIsOpenBox) {
- bIsOpenBox=(aBFc.IsOpenXmin() || aBFc.IsOpenXmax() ||
- aBFc.IsOpenYmin() || aBFc.IsOpenYmax() ||
- aBFc.IsOpenZmin() || aBFc.IsOpenZmax());
- if (bIsOpenBox) {
- break;
- }
+ bIsOpenBox=(aBFc.IsOpenXmin() || aBFc.IsOpenXmax() ||
+ aBFc.IsOpenYmin() || aBFc.IsOpenYmax() ||
+ aBFc.IsOpenZmin() || aBFc.IsOpenZmax());
+ if (bIsOpenBox) {
+ break;
+ }
}
//
const TopoDS_Face& aFc=*((TopoDS_Face*)&aSIFc.Shape());
aTolFc=BRep_Tool::Tolerance(aFc);
if (aTolFc>aTolS) {
- aTolS=aTolFc;
+ aTolS=aTolFc;
}
}//for (; aItLI1.More(); aItLI1.Next()) {
if (bIsOpenBox) {
//function : DoSplitSEAMOnFace
//purpose :
//=======================================================================
- void BOPTools_AlgoTools3D::DoSplitSEAMOnFace (const TopoDS_Edge& aSplit,
- const TopoDS_Face& aF)
+void BOPTools_AlgoTools3D::DoSplitSEAMOnFace (const TopoDS_Edge& aSplit,
+ const TopoDS_Face& aF)
{
- Standard_Boolean bIsUPeriodic, bIsVPeriodic, bIsLeft = Standard_False;
- Standard_Real aTol, a, b, anUPeriod, anVPeriod, aT, anU, dU/*=1.e-7*/, anU1,
- anV, dV/*=1.e-7*/, anV1;
- Standard_Real aScPr;
+ Standard_Boolean bIsUPeriodic, bIsVPeriodic, bIsLeft;
+ Standard_Real aTol, a, b, anUPeriod, anVPeriod, aT, anU, dU, anU1;
+ Standard_Real aScPr, anV, dV, anV1;
gp_Pnt2d aP2D;
gp_Vec2d aVec2D;
Handle(Geom2d_Curve) aTmpC1, aTmpC2;
BRep_Builder BB;
TopoDS_Edge aSp;
//
+ bIsLeft = Standard_False;
aSp=aSplit;
aSp.Orientation(TopAbs_FORWARD);
aTol=BRep_Tool::Tolerance(aSp);
aScPr = (anU1==anU) ? aDir2D1*aDOX : aDir2D1*aDOY;
//
aTmpC1=Handle(Geom2d_Curve)::DownCast(C2D1->Copy());
- Handle(Geom2d_TrimmedCurve) aC1 = new Geom2d_TrimmedCurve(aTmpC1, a, b);
+ Handle(Geom2d_TrimmedCurve) aC1 =
+ new Geom2d_TrimmedCurve(aTmpC1, a, b);
//
aTmpC2=Handle(Geom2d_Curve)::DownCast(C2D1->Copy());
- Handle(Geom2d_TrimmedCurve) aC2 = new Geom2d_TrimmedCurve(aTmpC2, a, b);
+ Handle(Geom2d_TrimmedCurve) aC2 =
+ new Geom2d_TrimmedCurve(aTmpC2, a, b);
gp_Vec2d aTrV(anU1-anU, anV1-anV);
aC2->Translate(aTrV);
//
}
}
}
-
//=======================================================================
//function : GetNormalToFaceOnEdge
//purpose :
//=======================================================================
- void BOPTools_AlgoTools3D::GetNormalToFaceOnEdge (const TopoDS_Edge& aE,
- const TopoDS_Face& aF,
- gp_Dir& aDNF)
+void BOPTools_AlgoTools3D::GetNormalToFaceOnEdge (const TopoDS_Edge& aE,
+ const TopoDS_Face& aF,
+ gp_Dir& aDNF)
{
Standard_Real aT, aT1, aT2;
aDNF.Reverse();
}
}
-
//=======================================================================
//function : GetNormalToFaceOnEdge
//purpose :
//=======================================================================
- void BOPTools_AlgoTools3D::GetNormalToFaceOnEdge (const TopoDS_Edge& aE,
- const TopoDS_Face& aF1,
- const Standard_Real aT,
- gp_Dir& aDNF1)
+void BOPTools_AlgoTools3D::GetNormalToFaceOnEdge (const TopoDS_Edge& aE,
+ const TopoDS_Face& aF1,
+ const Standard_Real aT,
+ gp_Dir& aDNF1)
{
Standard_Real U, V, aTolPC;
gp_Pnt2d aP2D;
aDNF1=aDD1U^aDD1V;
}
-
//=======================================================================
//function : SenseFlag
//purpose :
//=======================================================================
- Standard_Integer BOPTools_AlgoTools3D::SenseFlag (const gp_Dir& aDNF1,
- const gp_Dir& aDNF2)
+Standard_Integer BOPTools_AlgoTools3D::SenseFlag (const gp_Dir& aDNF1,
+ const gp_Dir& aDNF2)
{
Standard_Boolean bIsDirsCoinside;
+ //
bIsDirsCoinside=IntTools_Tools::IsDirsCoinside(aDNF1, aDNF2);
if (!bIsDirsCoinside) {
return 0;
}
return -1;
}
-
//=======================================================================
//function : GetNormalToSurface
//purpose :
//=======================================================================
- Standard_Boolean BOPTools_AlgoTools3D::GetNormalToSurface (const Handle(Geom_Surface)& aS,
- const Standard_Real U,
- const Standard_Real V,
- gp_Dir& aDNS)
+Standard_Boolean BOPTools_AlgoTools3D::GetNormalToSurface
+ (const Handle(Geom_Surface)& aS,
+ const Standard_Real U,
+ const Standard_Real V,
+ gp_Dir& aDNS)
{
Standard_Boolean bFlag;
aDNS=aDD1U^aDD1V;
return bFlag;
}
-
//=======================================================================
//function : GetApproxNormalToFaceOnEdge
//purpose :
//=======================================================================
-
- void BOPTools_AlgoTools3D::GetApproxNormalToFaceOnEdge(const TopoDS_Edge& aE,
- const TopoDS_Face& aF,
- const Standard_Real aT,
- gp_Pnt& aPNear,
- gp_Dir& aDNF,
- Standard_Real aDt2D)
+void BOPTools_AlgoTools3D::GetApproxNormalToFaceOnEdge
+ (const TopoDS_Edge& aE,
+ const TopoDS_Face& aF,
+ const Standard_Real aT,
+ gp_Pnt& aPNear,
+ gp_Dir& aDNF,
+ Standard_Real aDt2D)
{
Standard_Real aFirst, aLast;
- Handle(Geom2d_Curve) aC2D= BRep_Tool::CurveOnSurface (aE, aF, aFirst, aLast);
+ Handle(Geom2d_Curve) aC2D=
+ BRep_Tool::CurveOnSurface (aE, aF, aFirst, aLast);
if (aC2D.IsNull()) {
return;
PointNearEdge (aE, aF, aT, aDt2D, aPx2DNear, aPNear);
Handle(Geom_Surface) aS=BRep_Tool::Surface(aF);
- BOPTools_AlgoTools3D::GetNormalToSurface (aS, aPx2DNear.X(), aPx2DNear.Y(), aDNF);
+ BOPTools_AlgoTools3D::GetNormalToSurface
+ (aS, aPx2DNear.X(), aPx2DNear.Y(), aDNF);
if (aF.Orientation()==TopAbs_REVERSED){
aDNF.Reverse();
}
}
-
-
//=======================================================================
//function : GetApproxNormalToFaceOnEdge
//purpose :
//=======================================================================
- void BOPTools_AlgoTools3D::GetApproxNormalToFaceOnEdge (const TopoDS_Edge& aE,
- const TopoDS_Face& aF,
- const Standard_Real aT,
- gp_Pnt& aPNear,
- gp_Dir& aDNF,
- Handle(BOPInt_Context)& theContext)
+void BOPTools_AlgoTools3D::GetApproxNormalToFaceOnEdge
+ (const TopoDS_Edge& aE,
+ const TopoDS_Face& aF,
+ const Standard_Real aT,
+ gp_Pnt& aPNear,
+ gp_Dir& aDNF,
+ Handle(BOPInt_Context)& theContext)
{
Standard_Real aFirst, aLast;
- Handle(Geom2d_Curve) aC2D= BRep_Tool::CurveOnSurface (aE, aF, aFirst, aLast);
+ Handle(Geom2d_Curve) aC2D=
+ BRep_Tool::CurveOnSurface (aE, aF, aFirst, aLast);
if (aC2D.IsNull()) {
return;
}
//gp_Pnt aPNear;
gp_Pnt2d aPx2DNear;
- BOPTools_AlgoTools3D::PointNearEdge (aE, aF, aT, aPx2DNear, aPNear, theContext);
+ BOPTools_AlgoTools3D::PointNearEdge
+ (aE, aF, aT, aPx2DNear, aPNear, theContext);
Handle(Geom_Surface) aS=BRep_Tool::Surface(aF);
- BOPTools_AlgoTools3D::GetNormalToSurface (aS, aPx2DNear.X(), aPx2DNear.Y(), aDNF);
+ BOPTools_AlgoTools3D::GetNormalToSurface
+ (aS, aPx2DNear.X(), aPx2DNear.Y(), aDNF);
if (aF.Orientation()==TopAbs_REVERSED){
aDNF.Reverse();
}
}
-
//=======================================================================
//function : PointNearEdge
//purpose :
//=======================================================================
- void BOPTools_AlgoTools3D::PointNearEdge (const TopoDS_Edge& aE,
- const TopoDS_Face& aF,
- const Standard_Real aT,
- const Standard_Real aDt2D,
- gp_Pnt2d& aPx2DNear,
- gp_Pnt& aPxNear)
+void BOPTools_AlgoTools3D::PointNearEdge (const TopoDS_Edge& aE,
+ const TopoDS_Face& aF,
+ const Standard_Real aT,
+ const Standard_Real aDt2D,
+ gp_Pnt2d& aPx2DNear,
+ gp_Pnt& aPxNear)
{
Standard_Real aFirst, aLast, aETol, aFTol, transVal;
GeomAbs_SurfaceType aTS;
aPx2DNear = aPx2D.Translated( transVec );
}
else {
- aPx2DNear.SetCoord (aPx2D.X()+aDt2D*aDP.X(), aPx2D.Y()+aDt2D*aDP.Y());
+ aPx2DNear.SetCoord
+ (aPx2D.X()+aDt2D*aDP.X(), aPx2D.Y()+aDt2D*aDP.Y());
}
}
else {
- aPx2DNear.SetCoord (aPx2D.X()+aDt2D*aDP.X(), aPx2D.Y()+aDt2D*aDP.Y());
+ aPx2DNear.SetCoord
+ (aPx2D.X()+aDt2D*aDP.X(), aPx2D.Y()+aDt2D*aDP.Y());
}
//
aS->D0(aPx2DNear.X(), aPx2DNear.Y(), aPxNear);
}
-
//=======================================================================
//function : PointNearEdge
//purpose :
//=======================================================================
-void BOPTools_AlgoTools3D::PointNearEdge (const TopoDS_Edge& aE,
- const TopoDS_Face& aF,
- const Standard_Real aT,
- gp_Pnt2d& aPx2DNear,
- gp_Pnt& aPxNear,
- Handle(BOPInt_Context)& theContext)
+void BOPTools_AlgoTools3D::PointNearEdge
+ (const TopoDS_Edge& aE,
+ const TopoDS_Face& aF,
+ const Standard_Real aT,
+ gp_Pnt2d& aPx2DNear,
+ gp_Pnt& aPxNear,
+ Handle(BOPInt_Context)& theContext)
{
Standard_Real aTolE, aTolF, dTx, dT2D;
Handle(Geom_Surface) aS;
dT2D=dTx;
}
//
- BOPTools_AlgoTools3D::PointNearEdge (aE, aF, aT, dT2D, aPx2DNear, aPxNear);
+ BOPTools_AlgoTools3D::PointNearEdge
+ (aE, aF, aT, dT2D, aPx2DNear, aPxNear);
if (!theContext->IsPointInOnFace(aF, aPx2DNear)) {
Standard_Integer iErr;
Standard_Real aU1, aU2, aV1, aV2, dV, dU, dTresh;
}
//
if (dU < dTresh || dV < dTresh) {
- iErr = BOPTools_AlgoTools3D::PointInFace(aF, aP, aP2d, theContext);
+ iErr = BOPTools_AlgoTools3D::PointInFace
+ (aF, aP, aP2d, theContext);
if (!iErr) {
aPxNear = aP;
aPx2DNear = aP2d;
}
}
}
-
//=======================================================================
// function: PointNearEdge
// purpose:
//=======================================================================
- void BOPTools_AlgoTools3D::PointNearEdge (const TopoDS_Edge& aE,
- const TopoDS_Face& aF,
- gp_Pnt2d& aPInFace2D,
- gp_Pnt& aPInFace,
- Handle(BOPInt_Context)& theContext)
+void BOPTools_AlgoTools3D::PointNearEdge
+ (const TopoDS_Edge& aE,
+ const TopoDS_Face& aF,
+ gp_Pnt2d& aPInFace2D,
+ gp_Pnt& aPInFace,
+ Handle(BOPInt_Context)& theContext)
{
Standard_Real aT, aT1, aT2;
//
aFF.Orientation(TopAbs_FORWARD);
BOPTools_AlgoTools3D::OrientEdgeOnFace (aE, aFF, aERight);
- BOPTools_AlgoTools3D::PointNearEdge (aERight, aFF, aT, aPInFace2D, aPInFace, theContext);
+ BOPTools_AlgoTools3D::PointNearEdge
+ (aERight, aFF, aT, aPInFace2D, aPInFace, theContext);
}
-
//=======================================================================
//function : MinStepIn2d
//purpose :
//=======================================================================
- Standard_Real BOPTools_AlgoTools3D::MinStepIn2d()
+Standard_Real BOPTools_AlgoTools3D::MinStepIn2d()
{
Standard_Real dt=1.e-5;
return dt;
}
-
//=======================================================================
//function : IsEmptyShape
//purpose :
//=======================================================================
- Standard_Boolean BOPTools_AlgoTools3D::IsEmptyShape(const TopoDS_Shape& aS)
+Standard_Boolean BOPTools_AlgoTools3D::IsEmptyShape
+ (const TopoDS_Shape& aS)
{
Standard_Boolean bHasGeometry=Standard_False;
//
return !bHasGeometry;
}
-
//=======================================================================
//function : Add
//purpose :
}
}
}
-
//=======================================================================
//function : HasGeometry
//purpose :
//=======================================================================
- Standard_Boolean HasGeometry(const TopoDS_Shape& aS)
+Standard_Boolean HasGeometry(const TopoDS_Shape& aS)
{
Standard_Boolean bHasGeometry=Standard_True;
TopAbs_ShapeEnum aType= aS.ShapeType();
if (aType == TopAbs_VERTEX) {
-
- Handle(BRep_TVertex) TV = Handle(BRep_TVertex)::DownCast(aS.TShape());
- BRep_ListIteratorOfListOfPointRepresentation itrp(TV->Points());
-
- while (itrp.More()) {
- const Handle(BRep_PointRepresentation)& PR = itrp.Value();
-
- if (PR->IsPointOnCurve()) {
- return bHasGeometry;
- }
-
- else if (PR->IsPointOnCurveOnSurface()) {
- return bHasGeometry;
- }
-
- else if (PR->IsPointOnSurface()) {
- return bHasGeometry;
- }
- itrp.Next();
- }
+ return bHasGeometry;
}
-
//
else if (aType == TopAbs_EDGE) {
Handle(BRep_TEdge) TE = Handle(BRep_TEdge)::DownCast(aS.TShape());
return !bHasGeometry;
}
-
-
//=======================================================================
//function : OrientEdgeOnFace
//purpose :
//=======================================================================
- void BOPTools_AlgoTools3D::OrientEdgeOnFace (const TopoDS_Edge& aE,
- const TopoDS_Face& aF,
- TopoDS_Edge& aERight)
+void BOPTools_AlgoTools3D::OrientEdgeOnFace (const TopoDS_Edge& aE,
+ const TopoDS_Face& aF,
+ TopoDS_Edge& aERight)
{
if (BRep_Tool::IsClosed(aE, aF)) {
aERight=aE;
aERight=aE;
aERight.Orientation(aE.Orientation());
}
-
//=======================================================================
//function : PointInFace
//purpose :
//=======================================================================
- Standard_Integer BOPTools_AlgoTools3D::PointInFace(const TopoDS_Face& aF,
- gp_Pnt& theP,
- gp_Pnt2d& theP2D,
- Handle(BOPInt_Context)& theContext)
+Standard_Integer BOPTools_AlgoTools3D::PointInFace
+ (const TopoDS_Face& aF,
+ gp_Pnt& theP,
+ gp_Pnt2d& theP2D,
+ Handle(BOPInt_Context)& theContext)
{
Standard_Boolean bIsDone, bHasFirstPoint, bHasSecondPoint;
Standard_Integer iErr, aIx, aNbDomains;
//
aNbDomains=aHatcher.NbDomains(aIx);
if (aNbDomains > 0) {
- const HatchGen_Domain& aDomain=aHatcher.Domain (aIx, 1) ;
+ const HatchGen_Domain& aDomain=aHatcher.Domain (aIx, 1);
bHasFirstPoint=aDomain.HasFirstPoint();
if (!bHasFirstPoint) {
iErr=3;