1 // Created on: 2000-01-26
2 // Created by: Denis PASCAL
3 // Copyright (c) 2000-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef _TDataStd_ChildNodeIterator_HeaderFile
17 #define _TDataStd_ChildNodeIterator_HeaderFile
19 #include <Standard.hxx>
20 #include <Standard_DefineAlloc.hxx>
21 #include <Standard_Handle.hxx>
23 #include <Standard_Integer.hxx>
24 #include <Standard_Boolean.hxx>
25 class TDataStd_TreeNode;
28 //! Iterates on the ChildStepren step of a step, at the
29 //! first level only. It is possible to ask the
30 //! iterator to explore all the sub step levels of the
31 //! given one, with the option "allLevels".
32 class TDataStd_ChildNodeIterator
39 //! Creates an empty iterator.
40 Standard_EXPORT TDataStd_ChildNodeIterator();
42 //! Iterates on the ChildStepren of the given Step. If
43 //! <allLevels> option is set to true, it explores not
44 //! only the first, but all the sub Step levels.
45 Standard_EXPORT TDataStd_ChildNodeIterator(const Handle(TDataStd_TreeNode)& aTreeNode, const Standard_Boolean allLevels = Standard_False);
47 //! Initializes the iteration on the Children Step of
48 //! the given Step. If <allLevels> option is set to
49 //! true, it explores not only the first, but all the
51 Standard_EXPORT void Initialize (const Handle(TDataStd_TreeNode)& aTreeNode, const Standard_Boolean allLevels = Standard_False);
53 //! Returns True if there is a current Item in the
55 Standard_Boolean More() const;
57 //! Move to the next Item
58 Standard_EXPORT void Next();
60 //! Move to the next Brother. If there is none, go up
61 //! etc. This method is interesting only with
62 //! "allLevels" behavior, because it avoids to explore
63 //! the current Step ChildStepren.
64 Standard_EXPORT void NextBrother();
66 //! Returns the current item; a null Step if there is
68 const Handle(TDataStd_TreeNode)& Value() const;
83 Handle(TDataStd_TreeNode) myNode;
84 Standard_Integer myFirstLevel;
90 #include <TDataStd_ChildNodeIterator.lxx>
96 #endif // _TDataStd_ChildNodeIterator_HeaderFile