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/
19 #ifndef SUIT_DATAOBJECT_ITERATOR_H
20 #define SUIT_DATAOBJECT_ITERATOR_H
22 #include "SUIT_DataObject.h"
25 Class provide data object iterator.
27 class SUIT_EXPORT SUIT_DataObjectIterator
30 typedef enum { DepthLeft, DepthRight, BreadthLeft, BreadthRight, User } DetourType;
32 SUIT_DataObjectIterator( SUIT_DataObject* root, const int det, const bool fromTrueRoot = false );
34 virtual void operator++();
35 SUIT_DataObject* current() const;
41 SUIT_DataObject* parent( SUIT_DataObject* ) const;
42 SUIT_DataObject* extreme( DataObjectList&, bool FromLeft ) const;
43 SUIT_DataObject* globalSibling( SUIT_DataObject*, bool next ) const;
46 SUIT_DataObject* myRoot;
47 SUIT_DataObject* myCurrent;
50 SUIT_DataObject* myExtremeChild;
51 int myDetourType, myCurrentLevel;
54 class SUIT_DataObjectLevelIterator : public SUIT_DataObjectIterator
57 SUIT_DataObjectLevelIterator( SUIT_DataObject* root, const int start, const int end = 0,
58 const bool LeftToRight = true );
59 virtual void operator++();