-// 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
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
-// File: GEOMAlgo_GetInPlace_1.cxx
-// Author: Peter KURNEV
+// File: GEOMAlgo_GetInPlace_1.cxx
+// Author: Peter KURNEV
#include <GEOMAlgo_GetInPlace.hxx>
-#include <Basics_OCCTVersion.hxx>
-
#include <math.h>
#include <gp_Pnt.hxx>
#include <Geom2dAdaptor_Curve.hxx>
#include <Geom2dHatch_Hatcher.hxx>
#include <Geom2dHatch_Intersector.hxx>
-#include <GeomAPI_ProjectPointOnCurve.hxx>
-
#include <HatchGen_Domain.hxx>
+#include <GeomAPI_ProjectPointOnCurve.hxx>
#include <TopAbs_State.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <TopoDS_Solid.hxx>
#include <TopoDS_Face.hxx>
+#include <BRep_Tool.hxx>
#include <TopExp_Explorer.hxx>
-#include <BRep_Tool.hxx>
#include <BRepTools.hxx>
#include <BRepClass3d_SolidClassifier.hxx>
#include <BOPTools_Tools2D.hxx>
+
static
Standard_Integer PntInEdge(const TopoDS_Edge& aF,
- gp_Pnt& aP);
+ gp_Pnt& aP);
static
Standard_Integer PntInEdge(const TopoDS_Edge& aF,
- gp_Pnt& aP,
- Standard_Real& aT);
+ gp_Pnt& aP,
+ Standard_Real& aT);
static
Standard_Integer PntInFace(const TopoDS_Face& aF,
- gp_Pnt& aP);
+ gp_Pnt& aP);
static
Standard_Integer PntInFace(const TopoDS_Face& aF,
- gp_Pnt& aP,
- gp_Pnt2d& theP2D);
+ gp_Pnt& aP,
+ gp_Pnt2d& theP2D);
static
Standard_Integer PntInSolid(const TopoDS_Solid& aZ,
- const Standard_Real aTol,
- gp_Pnt& aP);
+ const Standard_Real aTol,
+ gp_Pnt& aP);
+
//=======================================================================
//function : CheckCoincidence
//purpose :
//=======================================================================
Standard_Boolean GEOMAlgo_GetInPlace::CheckCoincidence(const TopoDS_Shape& aS1,
- const TopoDS_Shape& aS2)
+ const TopoDS_Shape& aS2)
{
Standard_Boolean bOk;
Standard_Integer iErr;
//
const TopoDS_Edge& aE1=*((TopoDS_Edge*)&aS1);
//
-#if OCC_VERSION_LARGE > 0x06050200
GeomAPI_ProjectPointOnCurve& aPPC=myContext->ProjPC(aE1);
-#else
- GeomAPI_ProjectPointOnCurve& aPPC=myContext.ProjPC(aE1);
-#endif
aPPC.Perform(aP2);
aNbPoints=aPPC.NbPoints();
if (aNbPoints) {
aDmin=aPPC.LowerDistance();
aT=aPPC.LowerDistanceParameter();
if (aDmin < myTolerance) {
- dT=1.e-12;
- BRep_Tool::Curve(aE1, aT1, aT2);
+ dT=1.e-12;
+ BRep_Tool::Curve(aE1, aT1, aT2);
if(aT > (aT1-dT) && aT < (aT2+dT)) {
- bOk=Standard_True;
- }
+ bOk=Standard_True;
+ }
}
}
//else {
else if (aType1==TopAbs_FACE) {
const TopoDS_Face& aF1=*((TopoDS_Face*)&aS1);
//
-#if OCC_VERSION_LARGE > 0x06050200
bOk=myContext->IsValidPointForFace(aP2, aF1, myTolerance);
-#else
- bOk=myContext.IsValidPointForFace(aP2, aF1, myTolerance);
-#endif
}
//
else if (aType1==TopAbs_SOLID) {
const TopoDS_Solid& aZ1=*((TopoDS_Solid*)&aS1);
//
-#if OCC_VERSION_LARGE > 0x06050200
BRepClass3d_SolidClassifier& aSC=myContext->SolidClassifier(aZ1);
-#else
- BRepClass3d_SolidClassifier& aSC=myContext.SolidClassifier(aZ1);
-#endif
aSC.Perform(aP2, myTolerance);
aState=aSC.State();
bOk=(aState==TopAbs_IN);
//purpose :
//=======================================================================
Standard_Integer PntInEdge(const TopoDS_Edge& aE,
- gp_Pnt& aP)
+ gp_Pnt& aP)
+
{
Standard_Integer iErr;
Standard_Real aT;
//purpose :
//=======================================================================
Standard_Integer PntInEdge(const TopoDS_Edge& aE,
- gp_Pnt& aP,
- Standard_Real& aT)
+ gp_Pnt& aP,
+ Standard_Real& aT)
{
Standard_Integer iErr;
Standard_Real aT1, aT2;
//purpose :
//=======================================================================
Standard_Integer PntInSolid(const TopoDS_Solid& aZ,
- const Standard_Real aTol,
- gp_Pnt& aP)
+ const Standard_Real aTol,
+ gp_Pnt& aP)
{
Standard_Integer iErr;
Standard_Real aUx, aVx, aCoef;
//purpose :
//=======================================================================
Standard_Integer PntInFace(const TopoDS_Face& aF,
- gp_Pnt& aP)
+ gp_Pnt& aP)
{
Standard_Integer iErr;
//
//purpose :
//=======================================================================
Standard_Integer PntInFace(const TopoDS_Face& aF,
- gp_Pnt& theP,
- gp_Pnt2d& theP2D)
+ gp_Pnt& theP,
+ gp_Pnt2d& theP2D)
{
Standard_Boolean bIsDone, bHasFirstPoint, bHasSecondPoint;
Standard_Integer iErr, aIx, aNbDomains, i;
//
Geom2dHatch_Intersector aIntr(aTotArcIntr, aTolTangfIntr);
Geom2dHatch_Hatcher aHatcher(aIntr,
- aTolHatch2D, aTolHatch3D,
- Standard_True, Standard_False);
+ aTolHatch2D, aTolHatch3D,
+ Standard_True, Standard_False);
//
iErr=0;
aEpsT=1.e-12;
//
return iErr;
}
+