X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FShHealOper%2FShHealOper_CloseContour.cxx;h=5eaa14a8f074688cd4ac6b69e5aa47cdd2e87ed4;hb=refs%2Ftags%2FV8_4_0b1;hp=e5f0083933a960fde43bd5573939cb099f69c719;hpb=d3dd282390888d7dc091ba2c2ffe7923bd7458e6;p=modules%2Fgeom.git diff --git a/src/ShHealOper/ShHealOper_CloseContour.cxx b/src/ShHealOper/ShHealOper_CloseContour.cxx index e5f008393..5eaa14a8f 100644 --- a/src/ShHealOper/ShHealOper_CloseContour.cxx +++ b/src/ShHealOper/ShHealOper_CloseContour.cxx @@ -1,9 +1,29 @@ +// 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, 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 +// 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 +// 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: ShHealOper_CloseContour.cxx // Created: 20.04.04 11:36:01 // Author: Galina KULIKOVA -// Copyright: Airbus Industries 2004 - - +// #include #include #include @@ -35,20 +55,20 @@ #include #include #include + //======================================================================= //function : ShHealOper_CloseContour() //purpose : Constructor //======================================================================= - ShHealOper_CloseContour::ShHealOper_CloseContour (const TopoDS_Shape& theShape ) { Init(theShape); } + //======================================================================= //function : Init //purpose : //======================================================================= - void ShHealOper_CloseContour::Init(const TopoDS_Shape& theShape) { ShHealOper_Tool::Init(theShape); @@ -56,11 +76,11 @@ void ShHealOper_CloseContour::Init(const TopoDS_Shape& theShape) myMaxTolerance = 1.0; TopExp::MapShapesAndAncestors(theShape,TopAbs_EDGE,TopAbs_FACE,myMapEdgesFace); } + //======================================================================= //function : Perform //purpose : //======================================================================= - Standard_Boolean ShHealOper_CloseContour::Perform(const TopTools_SequenceOfShape& theSeqEdges, const Standard_Boolean theModeVertex, const Standard_Boolean theModeFixGapsCurves) @@ -84,11 +104,11 @@ Standard_Boolean ShHealOper_CloseContour::Perform(const TopTools_SequenceOfShape return myDone; } + //======================================================================= //function : Perform //purpose : //======================================================================= - Standard_Boolean ShHealOper_CloseContour::Perform(const TopoDS_Wire& theWire, const Standard_Boolean theModeVertex, const Standard_Boolean theModeFixGapsCurves) @@ -105,11 +125,11 @@ Standard_Boolean ShHealOper_CloseContour::Perform(const TopoDS_Wire& theWire, build(asewd); return myDone; } + //======================================================================= //function : Build //purpose : //======================================================================= - void ShHealOper_CloseContour::build(Handle(ShapeExtend_WireData)& theSewd) { TopTools_SequenceOfShape aCommonFaces; @@ -210,11 +230,11 @@ void ShHealOper_CloseContour::build(Handle(ShapeExtend_WireData)& theSewd) } return; } + //======================================================================= //function : checkGaps //purpose : //======================================================================= - Standard_Boolean ShHealOper_CloseContour::fixGaps(const Handle(ShapeExtend_WireData)& theWire, const TopTools_SequenceOfShape& theCommonFaces) { @@ -232,10 +252,14 @@ Standard_Boolean ShHealOper_CloseContour::fixGaps(const Handle(ShapeExtend_WireD Standard_Integer ind1 = (ind2 >1 ? ind2 -1 : theWire->NbEdges()); TopoDS_Edge aE1= theWire->Edge(ind1); TopoDS_Edge aE2= theWire->Edge(ind2); - if(!myModeVertex) + if(!myModeVertex) { buildEdge(aE1,aE2,theCommonFaces); - else + myStatistics.AddModif("An edge added to close a wire"); + } + else { myMaxTolerance = RealLast(); + myStatistics.AddModif("Tolerance of vertex increased to close a wire"); + } if(ind2 == ind1) break; } } @@ -248,11 +272,10 @@ Standard_Boolean ShHealOper_CloseContour::fixGaps(const Handle(ShapeExtend_WireD //function : checkOneFace //purpose : //======================================================================= - -Standard_Boolean ShHealOper_CloseContour::checkOneFace(const Handle(ShapeExtend_WireData)& theSewd, - TopTools_SequenceOfShape& theCommonFaces) const +Standard_Boolean +ShHealOper_CloseContour::checkOneFace(const Handle(ShapeExtend_WireData)& theSewd, + TopTools_SequenceOfShape& theCommonFaces) const { - TopTools_IndexedMapOfShape amapfaces; TopoDS_Edge aEdge1 = theSewd->Edge(1); Standard_Boolean isOneFace = myMapEdgesFace.Contains(aEdge1 ); @@ -310,13 +333,13 @@ Standard_Boolean ShHealOper_CloseContour::checkOneFace(const Handle(ShapeExtend_ theCommonFaces.Append(aF); } } - return isOneFace; + return isOneFace; } + //======================================================================= //function : buildEdge //purpose : //======================================================================= - void ShHealOper_CloseContour::buildEdge(const TopoDS_Edge& aE1, const TopoDS_Edge& aE2, const TopTools_SequenceOfShape& theCommonFaces) @@ -385,11 +408,11 @@ void ShHealOper_CloseContour::buildEdge(const TopoDS_Edge& aE1, myFreeEdges.Append(edge); } } + //======================================================================= //function : UpdateWire //purpose : //======================================================================= - void ShHealOper_CloseContour::updateWire (Handle(ShapeExtend_WireData)& sbwd) { Standard_Integer i=1;