X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FShHealOper%2FShHealOper_ShapeProcess.cxx;h=d4a1040f1ad37161e5eb96bcbc1719d004e4dee5;hb=refs%2Ftags%2FV8_4_0b1;hp=07c7291febd73fca7c1e5fb3eb8e99151b8c8465;hpb=9499b99fe2dcb53e1ea364f97986f8f432b04600;p=modules%2Fgeom.git diff --git a/src/ShHealOper/ShHealOper_ShapeProcess.cxx b/src/ShHealOper/ShHealOper_ShapeProcess.cxx index 07c7291fe..d4a1040f1 100644 --- a/src/ShHealOper/ShHealOper_ShapeProcess.cxx +++ b/src/ShHealOper/ShHealOper_ShapeProcess.cxx @@ -1,27 +1,29 @@ -// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// 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. -// -// 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 +// 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 +// 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_ShapeProcess.cxx // Created: 14.04.04 10:58:04 // Author: Galina KULIKOVA - +// #include #include #include @@ -37,6 +39,13 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include //======================================================================= //function : ShHealOper_ShapeProcess() @@ -50,8 +59,9 @@ ShHealOper_ShapeProcess::ShHealOper_ShapeProcess ( ) : //myResource = new Resource_Manager("ShHealing"); myPrefix = "ShapeProcess"; mySaveHistoryMode = Standard_False; - myLevel = TopAbs_FACE; + myLevel = TopAbs_EDGE; myDone = Standard_False; + myOperations.Context()->SetDetalisation ( TopAbs_EDGE ); } //======================================================================= @@ -61,23 +71,22 @@ ShHealOper_ShapeProcess::ShHealOper_ShapeProcess ( ) : ShHealOper_ShapeProcess::ShHealOper_ShapeProcess (const TCollection_AsciiString& theNameResource, const TCollection_AsciiString& thePrefix ) : - myOperations(theNameResource.ToCString(),thePrefix.ToCString()) + myOperations(theNameResource.ToCString(),thePrefix.ToCString()) { //myResource = new Resource_Manager(theNameResource); myPrefix = thePrefix; mySaveHistoryMode = Standard_False; - myLevel = TopAbs_FACE; + myLevel = TopAbs_EDGE; myDone = Standard_False; } //======================================================================= //function : Perform -//purpose : +//purpose : //======================================================================= -void ShHealOper_ShapeProcess::Perform(const TopoDS_Shape& theOldShape, - TopoDS_Shape& theNewShape) +void ShHealOper_ShapeProcess::Perform(const TopoDS_Shape& theOldShape, + TopoDS_Shape& theNewShape) { - myMapModifications.Clear(); //ShapeProcessAPI_ApplySequence aOperations(myResource,myPrefix.ToCString()); //myDone = Standard_False; @@ -97,12 +106,35 @@ void ShHealOper_ShapeProcess::Perform(const TopoDS_Shape& theOldShape, myDone = !anOldShape.IsSame(theNewShape); if(!myDone) { Standard_Real aendTol =aSatol.Tolerance(theNewShape,0); - myDone = (fabs(ainitTol - aendTol) > Precision::Confusion()); + myDone = (fabs(ainitTol - aendTol) > Precision::Confusion()); + if ( myDone ) { + if ( ainitTol > aendTol ) + myStatistics.AddModif( "Tolerance fixed (decreased)" ); + else + myStatistics.AddModif( "Tolerance fixed (increased)" ); + } + } + + // fill myStatistics with messages + Handle(ShapeExtend_MsgRegistrator) msg = myOperations.Context()->Messages(); + const ShapeExtend_DataMapOfShapeListOfMsg& shape2msg = msg->MapShape(); + ShapeExtend_DataMapIteratorOfDataMapOfShapeListOfMsg s2msg( shape2msg ); + for ( ; s2msg.More(); s2msg.Next() ) + { + const Message_ListOfMsg & msgList = s2msg.Value(); + Message_ListIteratorOfListOfMsg mIt( msgList ); + for ( ; mIt.More(); mIt.Next() ) + { + Message_Msg& m = mIt.Value(); + TCollection_AsciiString txt = m.Get(); + myStatistics.AddModif( txt.ToCString() ); + } } } + //======================================================================= //function : SetOperators -//purpose : +//purpose : //======================================================================= void ShHealOper_ShapeProcess::SetOperators(const TColStd_SequenceOfAsciiString& theSeqOperators) @@ -125,18 +157,18 @@ void ShHealOper_ShapeProcess::SetOperators(const TColStd_SequenceOfAsciiString& //purpose : //======================================================================= -void ShHealOper_ShapeProcess::SetParameter(const TCollection_AsciiString& theNameParam, - const TCollection_AsciiString& theVal) +void ShHealOper_ShapeProcess::SetParameter(const TCollection_AsciiString& theNameParam, + const TCollection_AsciiString& theVal) { TCollection_AsciiString anameParam(myPrefix); anameParam += "."; anameParam+= theNameParam; - if(theVal.IsIntegerValue()) - myOperations.Context()->ResourceManager()-> - SetResource(anameParam.ToCString(),theVal.IntegerValue()); - else if(theVal.IsRealValue()) + if(theVal.IsRealValue()) myOperations.Context()->ResourceManager()-> SetResource(anameParam.ToCString(),theVal.RealValue()); + else if(theVal.IsIntegerValue()) + myOperations.Context()->ResourceManager()-> + SetResource(anameParam.ToCString(),theVal.IntegerValue()); else myOperations.Context()->ResourceManager()-> SetResource(anameParam.ToCString(),theVal.ToCString()); @@ -169,14 +201,14 @@ Standard_Boolean ShHealOper_ShapeProcess::GetOperators(TColStd_SequenceOfAsciiSt //======================================================================= Standard_Boolean ShHealOper_ShapeProcess::GetParameter(const TCollection_AsciiString& theNameParam, - TCollection_AsciiString& theVal) + TCollection_AsciiString& theVal) { TCollection_AsciiString namePar(myPrefix); namePar += "."; namePar += theNameParam; if(!myOperations.Context()->ResourceManager()->Find(namePar.ToCString())) return Standard_False; - + theVal = myOperations.Context()->ResourceManager()->Value(namePar.ToCString()); return Standard_True; }