Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-22 08:59:40

0001 // Created on: 2000-01-26
0002 // Created by: Denis PASCAL
0003 // Copyright (c) 2000-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _TDataStd_ChildNodeIterator_HeaderFile
0017 #define _TDataStd_ChildNodeIterator_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 #include <Standard_DefineAlloc.hxx>
0021 #include <Standard_Handle.hxx>
0022 
0023 #include <Standard_Integer.hxx>
0024 #include <Standard_Boolean.hxx>
0025 class TDataStd_TreeNode;
0026 
0027 //! Iterates on the ChildStepren step of a step, at the
0028 //! first level only. It is possible to ask the
0029 //! iterator to explore all the sub step levels of the
0030 //! given one, with the option "allLevels".
0031 class TDataStd_ChildNodeIterator
0032 {
0033 public:
0034   DEFINE_STANDARD_ALLOC
0035 
0036   //! Creates an empty iterator.
0037   Standard_EXPORT TDataStd_ChildNodeIterator();
0038 
0039   //! Iterates on the ChildStepren of the given Step. If
0040   //! <allLevels> option is set to true, it explores not
0041   //! only the first, but all the sub Step levels.
0042   Standard_EXPORT TDataStd_ChildNodeIterator(const occ::handle<TDataStd_TreeNode>& aTreeNode,
0043                                              const bool allLevels = false);
0044 
0045   //! Initializes the iteration on the Children Step of
0046   //! the given Step. If <allLevels> option is set to
0047   //! true, it explores not only the first, but all the
0048   //! sub Step levels.
0049   Standard_EXPORT void Initialize(const occ::handle<TDataStd_TreeNode>& aTreeNode,
0050                                   const bool                            allLevels = false);
0051 
0052   //! Returns True if there is a current Item in the
0053   //! iteration.
0054   bool More() const { return !myNode.IsNull(); }
0055 
0056   //! Move to the next Item
0057   Standard_EXPORT void Next();
0058 
0059   //! Move to the next Brother. If there is none, go up
0060   //! etc. This method is interesting only with
0061   //! "allLevels" behavior, because it avoids to explore
0062   //! the current Step ChildStepren.
0063   Standard_EXPORT void NextBrother();
0064 
0065   //! Returns the current item; a null Step if there is
0066   //! no one.
0067   const occ::handle<TDataStd_TreeNode>& Value() const { return myNode; }
0068 
0069 private:
0070   occ::handle<TDataStd_TreeNode> myNode;
0071   int                            myFirstLevel;
0072 };
0073 
0074 #endif // _TDataStd_ChildNodeIterator_HeaderFile