-// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// Copyright (C) 2007-2011 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
+// 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
//
+
// File: GEOMAlgo_Gluer.cxx
// Created: Sat Dec 04 12:45:53 2004
// Author: Peter KURNEV
// <peter@PREFEX>
-
-
+//
#include <GEOMAlgo_Gluer.ixx>
#include <NMTDS_BoxBndTree.hxx>
#include <GEOMAlgo_PassKeyShape.hxx>
#include <GEOMAlgo_Tools.hxx>
//
-
+//modified by NIZNHY-PKV Thu Jan 21 10:02:52 2010f
+#include <NMTDS_BndSphereTree.hxx>
+#include <NMTDS_BndSphere.hxx>
+#include <NMTDS_IndexedDataMapOfShapeBndSphere.hxx>
+//modified by NIZNHY-PKV Thu Jan 21 10:02:56 2010t
+//
static
void GetSubShapes(const TopoDS_Shape& aS,
TopTools_IndexedMapOfShape& aMSS);
myKeepNonSolids=aFlag;
}
//=======================================================================
+//function : KeepNonSolids
+//purpose :
+//=======================================================================
+//Standard_Boolean GEOMAlgo_Gluer::KeepNonSolids()const
+//{
+// return myKeepNonSolids;
+//}
+//=======================================================================
//function : AloneShapes
//purpose :
//=======================================================================
}
}
}
+
//=======================================================================
//function : MakeVertices
//purpose :
myErrorStatus=0;
//
Standard_Integer j, i, aNbV, aNbVSD;
+ Standard_Real aTolV;
+ gp_Pnt aPV;
TColStd_ListIteratorOfListOfInteger aIt;
TopoDS_Shape aVF;
TopoDS_Vertex aVnew;
TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItIm;
TopTools_DataMapOfShapeListOfShape aMVV;
GEOMAlgo_IndexedDataMapOfIntegerShape aMIS;
- GEOMAlgo_IndexedDataMapOfShapeBox aMSB;
- //
- NMTDS_BoxBndTreeSelector aSelector;
- NMTDS_BoxBndTree aBBTree;
- NCollection_UBTreeFiller <Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
+ //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
//
+ NMTDS_BndSphereTreeSelector aSelector;
+ NMTDS_BndSphereTree aBBTree;
+ NCollection_UBTreeFiller <Standard_Integer, NMTDS_BndSphere> aTreeFiller(aBBTree);
//
TopExp::MapShapes(myShape, TopAbs_VERTEX, aMV);
aNbV=aMV.Extent();
}
//
for (i=1; i<=aNbV; ++i) {
- const TopoDS_Shape& aV=aMV(i);
- Bnd_Box aBox;
+ NMTDS_BndSphere aBox;
//
- aBox.SetGap(myTol);
- BRepBndLib::Add(aV, aBox);
+ const TopoDS_Vertex& aV=*((TopoDS_Vertex*)&aMV(i));
+ aPV=BRep_Tool::Pnt(aV);
+ aTolV=BRep_Tool::Tolerance(aV);
+ //
+ aBox.SetGap(myTol);
+ aBox.SetCenter(aPV);
+ aBox.SetRadius(aTolV);
//
aTreeFiller.Add(i, aBox);
//
//------------------------------
// Chains
for (i=1; i<=aNbV; ++i) {
- const TopoDS_Shape& aV=aMV(i);
+ const TopoDS_Vertex& aV=*((TopoDS_Vertex*)&aMV(i));
//
if (aMVProcessed.Contains(aV)) {
continue;
}
//
const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP);
- const Bnd_Box& aBoxVP=aMSB.FindFromKey(aVP);
+ //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
//
aSelector.Clear();
aSelector.SetBox(aBoxVP);
}
//
const TColStd_ListOfInteger& aLI=aSelector.Indices();
+ //
aIt.Initialize(aLI);
for (; aIt.More(); aIt.Next()) {
aIP1=aIt.Value();
aMV.Clear();
aItIm.Initialize(myImages);
for (; aItIm.More(); aItIm.Next()) {
- const TopoDS_Shape& aV=aItIm.Key();
+ const TopoDS_Vertex& aV=*((TopoDS_Vertex*)&aItIm.Key());
const TopTools_ListOfShape& aLVSD=aItIm.Value();
aNbVSD=aLVSD.Extent();
if (aNbVSD>1) {
theMS.Add(theShape);
//
if (theShape.ShapeType() == TopAbs_COMPOUND ||
- theShape.ShapeType() == TopAbs_COMPSOLID)
- {
+ theShape.ShapeType() == TopAbs_COMPSOLID) {
TopoDS_Iterator It (theShape, Standard_True, Standard_True);
- for (; It.More(); It.Next())
- {
+ for (; It.More(); It.Next()) {
MakeSubShapes(It.Value(), theMS, theResult);
}
}
- else if (theShape.ShapeType() == TopAbs_SOLID)
- {
+ else if (theShape.ShapeType() == TopAbs_SOLID) {
// build a solid
TopoDS_Solid aNewSolid;
TopExp_Explorer aExpS, aExp;
//
aBB.Add(theResult, aNewSolid);
}
- else if (theShape.ShapeType() == TopAbs_WIRE)
- {
- if (myKeepNonSolids)
- {
+ else if (theShape.ShapeType() == TopAbs_WIRE) {
+ if (myKeepNonSolids) {
// just add image
- if (!myOrigins.IsBound(theShape))
- {
+ if (!myOrigins.IsBound(theShape)) {
// build wire
const TopoDS_Wire& aW=TopoDS::Wire(theShape);
//
}
else
{
- if (myKeepNonSolids)
- {
+ if (myKeepNonSolids) {
// just add image
const TopoDS_Shape& aShapeR = myOrigins.Find(theShape);
aBB.Add(theResult, aShapeR);
//
return bRet;
}
+
//
// ErrorStatus
//