1 // Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // File : ShHealOper_ModifStats.hxx
24 // Created : Mon Dec 1 15:29:48 2014
26 #ifndef __ShHealOper_ModifStats_HXX__
27 #define __ShHealOper_ModifStats_HXX__
33 * \brief Structure describing modifications done in a shape
35 class Standard_EXPORT ShHealOper_ModifStats
39 struct Standard_EXPORT Datum
41 std::string myModif; // what is done
42 mutable int myCount; // how many times (in how many sub-shapes)
44 Datum( const std::string& txt, int cnt=0 ): myModif( txt ), myCount(cnt) {}
45 bool operator< ( const Datum& o ) const { return myModif < o.myModif; }
48 // record a modification
49 void AddModif( const std::string& modifText, int nb=1 )
51 std::set< Datum >::iterator d = myData.insert( Datum( modifText )).first;
55 // add data from another ShHealOper_ModifStats
56 void Add( const ShHealOper_ModifStats& stats )
58 if ( myData.empty() ) myData = stats.myData;
60 std::set< Datum >::const_iterator d = stats.myData.begin();
61 for ( ; d != stats.myData.end(); ++d )
62 AddModif( d->myModif, d->myCount );
66 // return all recorder modifications
67 const std::set< Datum >& GetData() const { return myData; }
69 // clear all statistics
70 void Clear() { myData.clear(); }
74 std::set< Datum > myData;