-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
+// 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 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
-// Lesser General Public License for more details.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
// File : SUIT_TreeSync.h
// Author : Alexander SOLOVYOV
//
template <class SrcItem, class TrgItem, class TreeData>
QList< DiffItem<SrcItem,TrgItem> > diffSiblings( const SrcItem&,
- const TrgItem&,
- const TreeData& );
+ const TrgItem&,
+ const TreeData& );
template <class SrcItem, class TrgItem, class TreeData>
TrgItem createSubTree( const SrcItem&, const TrgItem&, const TrgItem&, const TreeData& );
template <class SrcItem, class TrgItem, class TreeData>
const typename QList<TrgItem>::const_iterator findEqual( const SrcItem& it,
- const typename QList<TrgItem>::const_iterator& first,
- const typename QList<TrgItem>::const_iterator& last,
- const TreeData& td );
+ const typename QList<TrgItem>::const_iterator& first,
+ const typename QList<TrgItem>::const_iterator& last,
+ const TreeData& td );
//
for ( ; anIt != aLast; anIt++ ) {
const DiffItem<SrcItem,TrgItem>& item = *anIt;
if ( item.mySrc == td.nullSrc() ) {
- if ( item.myTrg == td.nullTrg() )
- qDebug( "error: both null" );
+ if ( item.myTrg == td.nullTrg() )
+ qDebug( "error: both null" );
else
- // delete item
- td.deleteItemWithChildren( item.myTrg );
+ // delete item
+ td.deleteItemWithChildren( item.myTrg );
}
else {
- if ( item.myTrg == td.nullTrg() ) {
- // add item (recursively)
- TrgItem nitem = createSubTree( item.mySrc, r2, lastItem, td );
- if ( nitem != td.nullTrg() )
- lastItem = nitem;
- }
+ if ( item.myTrg == td.nullTrg() ) {
+ // add item (recursively)
+ TrgItem nitem = createSubTree( item.mySrc, r2, lastItem, td );
+ if ( nitem != td.nullTrg() )
+ lastItem = nitem;
+ }
else {
- // update item
- synchronize( item.mySrc, item.myTrg, td );
- lastItem = item.myTrg;
- }
+ // update item
+ synchronize( item.mySrc, item.myTrg, td );
+ lastItem = item.myTrg;
+ }
}
}
return r2;
*/
template <class SrcItem, class TrgItem, class TreeData>
const typename QList<TrgItem>::const_iterator findEqual( const SrcItem& it,
- const typename QList<TrgItem>::const_iterator& first,
- const typename QList<TrgItem>::const_iterator& last,
- const TreeData& td )
+ const typename QList<TrgItem>::const_iterator& first,
+ const typename QList<TrgItem>::const_iterator& last,
+ const TreeData& td )
{
typename QList<TrgItem>::const_iterator cur = first;
for ( ; cur != last; cur++ ) {
*/
template <class SrcItem, class TrgItem, class TreeData>
QList< DiffItem<SrcItem,TrgItem> > diffSiblings( const SrcItem& src, const TrgItem& trg,
- const TreeData& td )
+ const TreeData& td )
{
//if( src==td.nullSrc() || trg==td.nullTrg() )
// return;
// target is found
// mark all items before found one as "to be deleted"
for ( typename QList<TrgItem>::const_iterator it = cur; it != f; it++ ) {
- DiffItem<SrcItem,TrgItem> ndiff;
- ndiff.mySrc = td.nullSrc();
- ndiff.myTrg = *it; // delete item
- d.append( ndiff );
+ DiffItem<SrcItem,TrgItem> ndiff;
+ ndiff.mySrc = td.nullSrc();
+ ndiff.myTrg = *it; // delete item
+ d.append( ndiff );
}
cur = f;
DiffItem<SrcItem,TrgItem> ndiff;
*/
template <class SrcItem, class TrgItem, class TreeData>
TrgItem createSubTree( const SrcItem& src, const TrgItem& parent,
- const TrgItem& after, const TreeData& td )
+ const TrgItem& after, const TreeData& td )
{
if ( src == td.nullSrc() )
return td.nullTrg();