-// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// Created :
// Author : Peter KURNEV
-#include <GEOMAlgo_Tools3D.ixx>
+#include <GEOMAlgo_Tools3D.hxx>
#include <Precision.hxx>
Standard_Real aT,
gp_Pnt& aPF,
gp_Dir& aDNF,
- IntTools_Context& aCtx);
+ const Handle(IntTools_Context)& aCtx);
//=======================================================================
//function : IsInternalFace
const TopoDS_Solid& theSolid,
const TopTools_IndexedDataMapOfShapeListOfShape& theMEF,
const Standard_Real theTol,
- IntTools_Context& theContext)
+ const Handle(IntTools_Context)& theContext)
{
Standard_Boolean bRet;
Standard_Integer aNbF;
Standard_Boolean GEOMAlgo_Tools3D::IsInternalFace(const TopoDS_Face& theFace,
const TopoDS_Edge& theEdge,
const TopTools_ListOfShape& theLF,
- IntTools_Context& theContext)
+ const Handle(IntTools_Context)& theContext)
{
Standard_Boolean bRet;
Standard_Boolean aNbF;
const TopoDS_Edge& theEdge,
const TopoDS_Face& theFace1,
const TopoDS_Face& theFace2,
- IntTools_Context& theContext)
+ const Handle(IntTools_Context)& theContext)
{
Standard_Boolean bRet;
Standard_Real aT1, aT2, aT, aDt2D, aDt2Dx;
GetApproxNormalToFaceOnEdge (aE1, theFace1, aT, aPF1, aDNF1, theContext);
GetApproxNormalToFaceOnEdge (aE2, theFace2, aT, aPF2, aDNF2, theContext);
//
- aTwoPI=2.*PI;
+ aTwoPI = 2.*M_PI;
gp_Vec aVBF (aPx, aPF );
gp_Vec aVBF1(aPx, aPF1);
gp_Vec aVBF2(aPx, aPF2);
NMTTools_ListIteratorOfListOfCoupleOfShape aIt;
//
aAngleMin=100.;
- aTwoPI=PI+PI;
+ aTwoPI = M_PI+M_PI;
BRep_Tool::Range(theE1, aT1, aT2);
aT=BOPTools_Tools2D::IntermediatePoint(aT1, aT2);
// Ref
const TopoDS_Face& aF2=TopoDS::Face(aCS.Shape2());
//
if (aF2==theF1) {
- aAngle=PI;
+ aAngle=M_PI;
}
else if (aF2.IsSame(theF1)) {
aAngle=aTwoPI;
const TopoDS_Solid& theRef,
const Standard_Real theTol,
const TopTools_IndexedMapOfShape& theBounds,
- IntTools_Context& theCtx)
+ const Handle(IntTools_Context)& theCtx)
{
TopAbs_State aState;
TopExp_Explorer aExp;
TopAbs_State GEOMAlgo_Tools3D::ComputeStateByOnePoint(const TopoDS_Shape& theS,
const TopoDS_Solid& theRef,
const Standard_Real theTol,
- IntTools_Context& theCtx)
+ const Handle(IntTools_Context)& theCtx)
{
TopAbs_State aState;
TopAbs_ShapeEnum aType;
TopAbs_State GEOMAlgo_Tools3D::ComputeState(const TopoDS_Vertex& theV,
const TopoDS_Solid& theRef,
const Standard_Real theTol,
- IntTools_Context& theCtx)
+ const Handle(IntTools_Context)& theCtx)
{
TopAbs_State aState;
gp_Pnt aP3D;
TopAbs_State GEOMAlgo_Tools3D::ComputeState(const TopoDS_Edge& theE,
const TopoDS_Solid& theRef,
const Standard_Real theTol,
- IntTools_Context& theCtx)
+ const Handle(IntTools_Context)& theCtx)
{
Standard_Real aT1, aT2, aT = 0.;
TopAbs_State aState;
TopAbs_State GEOMAlgo_Tools3D::ComputeState(const gp_Pnt& theP,
const TopoDS_Solid& theRef,
const Standard_Real theTol,
- IntTools_Context& theCtx)
+ const Handle(IntTools_Context)& theCtx)
{
TopAbs_State aState;
//
- BRepClass3d_SolidClassifier& aSC=theCtx.SolidClassifier(theRef);
+ BRepClass3d_SolidClassifier& aSC=theCtx->SolidClassifier(theRef);
aSC.Perform(theP, theTol);
//
aState=aSC.State();
//=======================================================================
Standard_Boolean GEOMAlgo_Tools3D::IsSplitToReverse(const TopoDS_Shape& theSp,
const TopoDS_Shape& theSr,
- IntTools_Context& theCtx)
+ const Handle(IntTools_Context)& theCtx)
{
Standard_Boolean bRet;
TopAbs_ShapeEnum aType;
//=======================================================================
Standard_Boolean GEOMAlgo_Tools3D::IsSplitToReverse(const TopoDS_Face& theFSp,
const TopoDS_Face& theFSr,
- IntTools_Context& theContext)
+ const Handle(IntTools_Context)& theContext)
{
Standard_Boolean bRet, bFound, bInFace;
Standard_Real aT1, aT2, aT, aU, aV, aScPr;
//modified by NIZNHY-PKV Tue Nov 22 10:50:37 2011t
//
// Parts of theContext.ComputeVS(..)
- GeomAPI_ProjectPointOnSurf& aProjector=theContext.ProjPS(theFSr);
+ GeomAPI_ProjectPointOnSurf& aProjector=theContext->ProjPS(theFSr);
aProjector.Perform(aPFSp);
if (!aProjector.IsDone()) {
return bRet;
//
aProjector.LowerDistanceParameters(aU, aV);
gp_Pnt2d aP2D(aU, aV);
- bInFace=theContext.IsPointInFace (theFSr, aP2D);
+ bInFace=theContext->IsPointInFace (theFSr, aP2D);
if (!bInFace) {
return bRet;
}
//=======================================================================
Standard_Boolean GEOMAlgo_Tools3D::IsSplitToReverse(const TopoDS_Edge& theSplit,
const TopoDS_Edge& theEdge,
- IntTools_Context& theContext)
+ const Handle(IntTools_Context)& theContext)
{
Standard_Boolean bRet, aFlag, bIsDegenerated;
Standard_Real aTE, aTS, aScPr, aTa, aTb, aT1, aT2;
aFlag=BOPTools_Tools2D::EdgeTangent(theSplit, aTS, aVS);
gp_Dir aDTS(aVS);
//
- aFlag=theContext.ProjectPointOnEdge(aP, theEdge, aTE);
+ aFlag=theContext->ProjectPointOnEdge(aP, theEdge, aTE);
aFlag=BOPTools_Tools2D::EdgeTangent(theEdge, aTE, aVE);
gp_Dir aDTE(aVE);
//
Standard_Real aCosinus, aSinus, aBeta, aHalfPI, aScPr;
gp_XYZ aXYZ;
//
- aHalfPI=0.5*PI;
+ aHalfPI=0.5*M_PI;
//
const gp_XYZ& aXYZ1=theD1.XYZ();
const gp_XYZ& aXYZ2=theD2.XYZ();
aBeta=aHalfPI*(1.-aCosinus);
}
else {
- aBeta=2.*PI-aHalfPI*(3.+aCosinus);
+ aBeta=2.*M_PI-aHalfPI*(3.+aCosinus);
}
//
aScPr=aXYZ.Dot(theDRef.XYZ());
Standard_Real aT,
gp_Pnt& aPF,
gp_Dir& aDNF,
- IntTools_Context& aCtx)
+ const Handle(IntTools_Context)& aCtx)
{
Standard_Boolean bReverse;
Standard_Real aT1, aT2, dT, aU, aV;
aDNF.Reverse();
}
//
- GeomAPI_ProjectPointOnSurf& aProjector=aCtx.ProjPS(aF);
+ GeomAPI_ProjectPointOnSurf& aProjector=aCtx->ProjPS(aF);
//
aProjector.Perform(aPFx);
if(aProjector.IsDone()) {
//modified by NIZNHY-PKV Tue Nov 22 10:36:59 2011f
//=======================================================================
//function : PntInFace
-//purpose :
+//purpose :
//=======================================================================
-Standard_Integer GEOMAlgo_Tools3D::PntInFace(const TopoDS_Face& aF,
+Standard_Integer GEOMAlgo_Tools3D::PntInFace(const TopoDS_Face& aF,
gp_Pnt& theP,
gp_Pnt2d& theP2D)
{
aTolTangfIntr=1.e-10;
//
Geom2dHatch_Intersector aIntr(aTotArcIntr, aTolTangfIntr);
- Geom2dHatch_Hatcher aHatcher(aIntr,
- aTolHatch2D, aTolHatch3D,
+ Geom2dHatch_Hatcher aHatcher(aIntr,
+ aTolHatch2D, aTolHatch3D,
Standard_True, Standard_False);
//
iErr=0;
//
aFF=aF;
aFF.Orientation (TopAbs_FORWARD);
- //
+ //
aS=BRep_Tool::Surface(aFF);
BRepTools::UVBounds(aFF, aUMin, aUMax, aVMin, aVMax);
//