1 // Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #ifndef SUIT_DATAOBJECT_ITERATOR_H
20 #define SUIT_DATAOBJECT_ITERATOR_H
22 #include "SUIT_DataObject.h"
25 \class SUIT_DataObjectIterator
26 Provides functionality of SUIT tree detour
27 It is possible to use "to-depth" or "to-breadth" detour and
28 to control level detour (from left or from right)
30 class SUIT_EXPORT SUIT_DataObjectIterator
33 typedef enum { DepthLeft, DepthRight, BreadthLeft, BreadthRight, User } DetourType;
35 SUIT_DataObjectIterator( SUIT_DataObject* root, const int det, const bool fromTrueRoot = false );
37 virtual void operator++();
38 SUIT_DataObject* current() const;
44 SUIT_DataObject* parent( SUIT_DataObject* ) const;
45 SUIT_DataObject* extreme( DataObjectList&, bool FromLeft ) const;
46 SUIT_DataObject* globalSibling( SUIT_DataObject*, bool next ) const;
49 SUIT_DataObject* myRoot;
50 SUIT_DataObject* myCurrent;
53 SUIT_DataObject* myExtremeChild;
54 int myDetourType, myCurrentLevel;
58 \class SUIT_DataObjectIterator
59 Provides functionality of SUIT tree detour between certain levels
60 Only "to-breadth" detour is used
62 class SUIT_DataObjectLevelIterator : public SUIT_DataObjectIterator
65 SUIT_DataObjectLevelIterator( SUIT_DataObject* root, const int start, const int end = 0,
66 const bool LeftToRight = true );
67 virtual void operator++();