-// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// 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
-//
+//
// 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/
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_GlueDetector.cxx
-// Created: Wed Dec 15 11:08:09 2004
-// Author: Peter KURNEV
-// <pkv@irinox>
+// File: GEOMAlgo_GlueDetector.cxx
+// Created: Wed Dec 15 11:08:09 2004
+// Author: Peter KURNEV
-#include <GEOMAlgo_GlueAnalyser.ixx>
+#include <GEOMAlgo_GlueAnalyser.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
#include <GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx>
#include <GEOMAlgo_Tools.hxx>
#include <GEOMAlgo_CoupleOfShapes.hxx>
+#include <GEOMAlgo_ListOfCoupleOfShapes.hxx>
#include <GEOMAlgo_Gluer.hxx>
#include <Bnd_HArray1OfBox.hxx>
#include <BRepBndLib.hxx>
//=======================================================================
-//function :
-//purpose :
+//function :
+//purpose :
//=======================================================================
GEOMAlgo_GlueAnalyser::GEOMAlgo_GlueAnalyser()
:
{}
//=======================================================================
//function : ~
-//purpose :
+//purpose :
//=======================================================================
GEOMAlgo_GlueAnalyser::~GEOMAlgo_GlueAnalyser()
{}
//=======================================================================
//function : HasSolidsToGlue
-//purpose :
+//purpose :
//=======================================================================
Standard_Boolean GEOMAlgo_GlueAnalyser::HasSolidsToGlue()const
{
}
//=======================================================================
//function : HasSolidsAlone
-//purpose :
+//purpose :
//=======================================================================
Standard_Boolean GEOMAlgo_GlueAnalyser::HasSolidsAlone()const
{
}
//=======================================================================
//function : SolidsToGlue
-//purpose :
+//purpose :
//=======================================================================
const GEOMAlgo_ListOfCoupleOfShapes& GEOMAlgo_GlueAnalyser::SolidsToGlue()const
{
}
//=======================================================================
//function : SolidsAlone
-//purpose :
+//purpose :
//=======================================================================
const TopTools_ListOfShape& GEOMAlgo_GlueAnalyser::SolidsAlone()const
{
}
//=======================================================================
//function : Perform
-//purpose :
+//purpose :
//=======================================================================
void GEOMAlgo_GlueAnalyser::Perform()
{
return;
}
//
+ // Initialize the context
+ GEOMAlgo_ShapeAlgo::Perform();
+ //
InnerTolerance();
if (myErrorStatus) {
return;
}
//=======================================================================
//function : DetectVertices
-//purpose :
+//purpose :
//=======================================================================
void GEOMAlgo_GlueAnalyser::DetectVertices()
{
const TopoDS_Shape& aV=aMV(i);
Bnd_Box aBox;
//
- aBox.SetGap(myTol);
+ aBox.SetGap(myTol);
BRepBndLib::Add(aV, aBox);
aHAB->SetValue(i, aBox);
aMIS.Add(i, aV);
- aMSB.Add(aV, aBox);
+ aMSB.Add(aV, aBox);
}
//
aBSB.Initialize(aHAB);
const TColStd_ListOfInteger& aLI=aBSB.Compare(aBoxV);
aNbVSD=aLI.Extent();
if (!aNbVSD) {
- myErrorStatus=3; // it must not be
+ myErrorStatus=3; // it must not be
return;
}
//
aIndex=aIt.Value();
const TopoDS_Shape& aVx=aMIS.FindFromKey(aIndex);
if(!j) {
- aVF=aVx;
+ aVF=aVx;
}
aLVSD.Append(aVx);
aMVProcessed.Add(aVx);
for (; aItS.More(); aItS.Next()) {
const TopoDS_Shape& aVSD=aItS.Value();
if (!myOrigins.IsBound(aVSD)) {
- myOrigins.Bind(aVSD, aV);
+ myOrigins.Bind(aVSD, aV);
}
}
}
}
//=======================================================================
//function : DetectFaces
-//purpose :
+//purpose :
//=======================================================================
void GEOMAlgo_GlueAnalyser::DetectFaces()
{
}
//=======================================================================
//function : DetectEdges
-//purpose :
+//purpose :
//=======================================================================
void GEOMAlgo_GlueAnalyser::DetectEdges()
{
}
//=======================================================================
//function : DetectShapes
-//purpose :
+//purpose :
//=======================================================================
void GEOMAlgo_GlueAnalyser::DetectShapes(const TopAbs_ShapeEnum aType)
{
aNbF=aMF.Extent();
for (i=1; i<=aNbF; ++i) {
const TopoDS_Shape& aS=aMF(i);
- //
- aPKF.Clear();
+ //
+ //aPKF.Clear();//qft
if (aType==TopAbs_FACE) {
const TopoDS_Face& aF=TopoDS::Face(aS);
FacePassKey(aF, aPKF);
for (; aItS.More(); aItS.Next()) {
const TopoDS_Shape& aFSD=aItS.Value();
if (!myOrigins.IsBound(aFSD)) {
- myOrigins.Bind(aFSD, aNewShape);
+ myOrigins.Bind(aFSD, aNewShape);
}
}
}
}
//=======================================================================
//function : DetectSolids
-//purpose :
+//purpose :
//=======================================================================
void GEOMAlgo_GlueAnalyser::DetectSolids()
{
TopTools_IndexedDataMapOfShapeListOfShape aMFS;
TopTools_IndexedMapOfShape aMx, aMS;
TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItIm;
+ GEOMAlgo_CoupleOfShapes aCS;
+ //
GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape aMPKLS;
GEOMAlgo_PassKeyShape aPKSx;
- GEOMAlgo_CoupleOfShapes aCS;
//
aBB.MakeCompound(aCmp);
//
aFx[1]=aLF.Last();
for (i=0; i<2; ++i) {
if (!aMFS.Contains(aFx[i])) {
- continue;// it must not be so
+ continue;// it must not be so
}
//
const TopTools_ListOfShape& aLS=aMFS.FindFromKey(aFx[i]);
aNbS=aLS.Extent();
if (aNbS!=1) {
- continue;
+ continue;
}
aSx[i]=aLS.First();
}
continue;
}
//
- aPKSx.Clear();
- aPKSx.SetIds(aSx[0], aSx[1]);
+ //aPKSx.Clear();//qft
+ //qf
+ //aPKSx.SetIds(aSx[0], aSx[1]);
+ aPKSx.SetShapes(aSx[0], aSx[1]);
+ //qt
//
if (!aMPKLS.Contains(aPKSx)) {
TopTools_ListOfShape aLSx;
//
mySolidsToGlue.Clear();
mySolidsAlone.Clear();
-
+
//
aNbC=aMPKLS.Extent();
if (!aNbC) {