Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:19

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 
0035   DEFINE_STANDARD_ALLOC
0036 
0037   //! Creates an empty iterator.
0038   Standard_EXPORT TDataStd_ChildNodeIterator();
0039   
0040   //! Iterates on the ChildStepren of the given Step. If
0041   //! <allLevels> option is set to true, it explores not
0042   //! only the first, but all the sub Step levels.
0043   Standard_EXPORT TDataStd_ChildNodeIterator(const Handle(TDataStd_TreeNode)& aTreeNode, const Standard_Boolean allLevels = Standard_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 Handle(TDataStd_TreeNode)& aTreeNode, const Standard_Boolean allLevels = Standard_False);
0050   
0051   //! Returns True if there is a current Item in the
0052   //! iteration.
0053   Standard_Boolean More() const { return !myNode.IsNull(); }
0054 
0055   //! Move to the next Item
0056   Standard_EXPORT void Next();
0057   
0058   //! Move to the next Brother. If there is none, go up
0059   //! etc. This method is interesting only with
0060   //! "allLevels" behavior, because it avoids to explore
0061   //! the current Step ChildStepren.
0062   Standard_EXPORT void NextBrother();
0063   
0064   //! Returns the current item; a null Step if there is
0065   //! no one.
0066   const Handle(TDataStd_TreeNode)& Value() const { return myNode; }
0067 
0068 private:
0069 
0070   Handle(TDataStd_TreeNode) myNode;
0071   Standard_Integer myFirstLevel;
0072 
0073 };
0074 
0075 #endif // _TDataStd_ChildNodeIterator_HeaderFile