-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016 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
// 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
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_Gluer.cxx
-// Created: Sat Dec 04 12:45:53 2004
-// Author: Peter KURNEV
-// <peter@PREFEX>
+// File: GEOMAlgo_Gluer.cxx
+// Created: Sat Dec 04 12:45:53 2004
+// Author: Peter KURNEV
+// <peter@PREFEX>
//
#include <GEOMAlgo_Gluer.hxx>
-#include <NMTDS_BoxBndTree.hxx>
#include <NCollection_UBTreeFiller.hxx>
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
#include <BRepLib.hxx>
#include <BRepTools.hxx>
#include <BRepBndLib.hxx>
-
+//
+#include <IntTools_Tools.hxx>
#include <IntTools_Context.hxx>
-#include <BOPTools_Tools.hxx>
-#include <BOPTools_Tools3D.hxx>
-#include <BOPTools_Tools2D.hxx>
-#include <BOP_CorrectTolerances.hxx>
+#include <BOPTools_AlgoTools.hxx>
+#include <BOPTools_AlgoTools3D.hxx>
+#include <BOPTools_AlgoTools2D.hxx>
+#include <GEOMAlgo_BoxBndTree.hxx>
+#include <GEOMAlgo_AlgoTools.hxx>
#include <GEOMAlgo_IndexedDataMapOfIntegerShape.hxx>
#include <GEOMAlgo_IndexedDataMapOfShapeBox.hxx>
#include <GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx>
#include <GEOMAlgo_PassKeyShape.hxx>
-#include <GEOMAlgo_Tools.hxx>
-//
-
-#include <NMTDS_BndSphereTree.hxx>
-#include <NMTDS_BndSphere.hxx>
-#include <NMTDS_IndexedDataMapOfShapeBndSphere.hxx>
+#include <GEOMAlgo_BndSphereTree.hxx>
+#include <GEOMAlgo_BndSphere.hxx>
+#include <GEOMAlgo_IndexedDataMapOfShapeBndSphere.hxx>
//
static
void GetSubShapes(const TopoDS_Shape& aS,
- TopTools_IndexedMapOfShape& aMSS);
+ TopTools_IndexedMapOfShape& aMSS);
//=======================================================================
//function : GEOMAlgo_Gluer
TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItIm;
TopTools_DataMapOfShapeListOfShape aMVV;
GEOMAlgo_IndexedDataMapOfIntegerShape aMIS;
- //modified by NIZNHY-PKV Thu Jan 21 10:03:07 2010f
- //GEOMAlgo_IndexedDataMapOfShapeBox aMSB;
- NMTDS_IndexedDataMapOfShapeBndSphere aMSB;
- //modified by NIZNHY-PKV Thu Jan 21 10:03:10 2010t
+ GEOMAlgo_IndexedDataMapOfShapeBndSphere aMSB;
//
- NMTDS_BndSphereTreeSelector aSelector;
- NMTDS_BndSphereTree aBBTree;
- NCollection_UBTreeFiller <Standard_Integer, NMTDS_BndSphere> aTreeFiller(aBBTree);
+ GEOMAlgo_BndSphereTreeSelector aSelector;
+ GEOMAlgo_BndSphereTree aBBTree;
+ NCollection_UBTreeFiller <Standard_Integer, GEOMAlgo_BndSphere> aTreeFiller(aBBTree);
//
TopExp::MapShapes(myShape, TopAbs_VERTEX, aMV);
aNbV=aMV.Extent();
}
//
for (i=1; i<=aNbV; ++i) {
- NMTDS_BndSphere aBox;
+ GEOMAlgo_BndSphere aBox;
//
const TopoDS_Vertex& aV=*((TopoDS_Vertex*)&aMV(i));
aPV=BRep_Tool::Pnt(aV);
TColStd_MapIteratorOfMapOfInteger aIt1;
//
aMIP.Add(i);
- while(1) {
+ for(;;) {
aNbIP=aMIP.Extent();
aIt1.Initialize(aMIP);
for(; aIt1.More(); aIt1.Next()) {
}
//
const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP);
- //modified by NIZNHY-PKV Thu Jan 21 10:04:09 2010f
- const NMTDS_BndSphere& aBoxVP=aMSB.FindFromKey(aVP);
- //const Bnd_Box& aBoxVP=aMSB.FindFromKey(aVP);
- //modified by NIZNHY-PKV Thu Jan 21 10:04:11 2010t
+ const GEOMAlgo_BndSphere& aBoxVP=aMSB.FindFromKey(aVP);
//
aSelector.Clear();
aSelector.SetBox(aBoxVP);
aNbVSD=aBBTree.Select(aSelector);
if (!aNbVSD) {
continue; // it must not be
- }
+ }
//
const TColStd_ListOfInteger& aLI=aSelector.Indices();
//
//
aER.Orientation(TopAbs_FORWARD);
if (!BRep_Tool::Degenerated(aER)) {
- // build p-curve
- //if (bIsUPeriodic) {
- // GEOMAlgo_Tools::RefinePCurveForEdgeOnFace(aER, aFFWD, aUMin, aUMax);
- //}
- //BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aER, aFFWD);
- //
// orient image
- Standard_Boolean bIsToReverse=BOPTools_Tools3D::IsSplitToReverse1(aER, aE, myContext);
+ Standard_Boolean bIsToReverse=
+ GEOMAlgo_AlgoTools::IsSplitToReverse(aER, aE, myContext);
if (bIsToReverse) {
aER.Reverse();
}
aBB.Add(theResult, aShapeR);
}
}
- else
- {
+ else {
if (myKeepNonSolids) {
// just add image
const TopoDS_Shape& aShapeR = myOrigins.Find(theShape);
myResult=aCmp;
//
if (aMS.Extent()) {
- BOP_CorrectTolerances::CorrectCurveOnSurface(myResult);
+ BOPTools_AlgoTools::CorrectCurveOnSurface(myResult, 0.0001);
}
}
//=======================================================================
}
// check geometric coincidence
if (myCheckGeometry) {
- iErr=GEOMAlgo_Tools::RefineSDShapes(aMPKLF, myTol, myContext);
+ iErr=GEOMAlgo_AlgoTools::RefineSDShapes(aMPKLF, myTol, myContext);
if (iErr) {
myErrorStatus=200;
return;
//purpose :
//=======================================================================
void GEOMAlgo_Gluer::FacePassKey(const TopoDS_Face& aF,
- GEOMAlgo_PassKeyShape& aPK)
+ GEOMAlgo_PassKeyShape& aPK)
{
Standard_Integer i, aNbE;
TopTools_ListOfShape aLE;
//purpose :
//=======================================================================
void GEOMAlgo_Gluer::EdgePassKey(const TopoDS_Edge& aE,
- GEOMAlgo_PassKeyShape& aPK)
+ GEOMAlgo_PassKeyShape& aPK)
{
TopoDS_Vertex aV1, aV2;
//
//purpose :
//=======================================================================
void GEOMAlgo_Gluer::MakeVertex(const TopTools_ListOfShape& aLV,
- TopoDS_Vertex& aNewVertex)
+ TopoDS_Vertex& aNewVertex)
{
Standard_Integer aNbV;
Standard_Real aTolV, aD, aDmax;
//purpose :
//=======================================================================
void GEOMAlgo_Gluer::MakeEdge(const TopoDS_Edge& aE,
- TopoDS_Edge& aNewEdge)
+ TopoDS_Edge& aNewEdge)
{
myErrorStatus=0;
//
}
//
else {
- BOPTools_Tools::MakeSplitEdge(aEx, aVR1, aT1, aVR2, aT2, aNewEdge);
+ BOPTools_AlgoTools::MakeSplitEdge(aEx, aVR1, aT1, aVR2, aT2, aNewEdge);
}
}
//=======================================================================
//purpose :
//=======================================================================
void GEOMAlgo_Gluer::MakeFace(const TopoDS_Face& aF,
- TopoDS_Face& aNewFace)
+ TopoDS_Face& aNewFace)
{
myErrorStatus=0;
//
aFFWD.Orientation(TopAbs_FORWARD);
//
aS=BRep_Tool::Surface(aFFWD, aLoc);
- bIsUPeriodic=GEOMAlgo_Tools::IsUPeriodic(aS);
+ bIsUPeriodic=GEOMAlgo_AlgoTools::IsUPeriodic(aS);
aTol=BRep_Tool::Tolerance(aFFWD);
BRepTools::UVBounds(aF, aUMin, aUMax, aVMin, aVMax);
//
if (!BRep_Tool::Degenerated(aER)) {
// build p-curve
if (bIsUPeriodic) {
- GEOMAlgo_Tools::RefinePCurveForEdgeOnFace(aER, aFFWD, aUMin, aUMax);
- }
- BOPTools_Tools2D::BuildPCurveForEdgeOnFace(aER, aFFWD);
-
+ GEOMAlgo_AlgoTools::RefinePCurveForEdgeOnFace(aER, aFFWD, aUMin, aUMax);
+ }
+ BOPTools_AlgoTools2D::BuildPCurveForEdgeOnFace(aER, aFFWD);
+
// orient image
- bIsToReverse=BOPTools_Tools3D::IsSplitToReverse1(aER, aE, myContext);
+ bIsToReverse=GEOMAlgo_AlgoTools::IsSplitToReverse(aER, aE, myContext);
if (bIsToReverse) {
aER.Reverse();
}
const TopoDS_Edge& aER=TopoDS::Edge(myOrigins.Find(aE));
//
aC3D=BRep_Tool::Curve(aE, aT1, aT2);
- aT=BOPTools_Tools2D::IntermediatePoint(aT1, aT2);
+ aT=IntTools_Tools::IntermediatePoint(aT1, aT2);
aC3D->D0(aT, aP);
myContext->ProjectPointOnEdge(aP, aER, aTR);
//
- BOPTools_Tools3D::GetNormalToFaceOnEdge (aE, aF, aT, aDNF);
+ BOPTools_AlgoTools3D::GetNormalToFaceOnEdge (aE, aF, aT, aDNF);
if (aF.Orientation()==TopAbs_REVERSED) {
aDNF.Reverse();
}
//
- BOPTools_Tools3D::GetNormalToFaceOnEdge (aER, aFR, aTR, aDNFR);
+ BOPTools_AlgoTools3D::GetNormalToFaceOnEdge (aER, aFR, aTR, aDNFR);
if (aFR.Orientation()==TopAbs_REVERSED) {
aDNFR.Reverse();
}
//purpose :
//=======================================================================
void GetSubShapes(const TopoDS_Shape& aS,
- TopTools_IndexedMapOfShape& aMSS)
+ TopTools_IndexedMapOfShape& aMSS)
{
Standard_Integer aR;
TopAbs_ShapeEnum aType;
//function : Modified
//purpose :
//=======================================================================
-const TopTools_ListOfShape& GEOMAlgo_Gluer::Modified (const TopoDS_Shape& aS)
+const TopTools_ListOfShape& GEOMAlgo_Gluer::Modified
+ (const TopoDS_Shape& aS)
{
TopAbs_ShapeEnum aType;
//