1 // Created on: 2004-11-23
2 // Created by: Pavel TELKOV
3 // Copyright (c) 2004-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 // The original implementation Copyright: (C) RINA S.p.A
18 #ifndef TObj_LabelIterator_HeaderFile
19 #define TObj_LabelIterator_HeaderFile
21 #include <TObj_Object.hxx>
23 #include <TDF_Label.hxx>
24 #include <TDF_ChildIterator.hxx>
25 #include <TObj_ObjectIterator.hxx>
28 * This class is a basis for OCAF based iterators.
31 class TObj_LabelIterator : public TObj_ObjectIterator
39 //! Creates an Empty Iterator
40 Standard_EXPORT TObj_LabelIterator();
47 //! Creates an iterator an initialize it by theLabel and recursive flag.
48 //! If isRecursive is Standard_True make recursive iterations
49 Standard_EXPORT TObj_LabelIterator
50 (const TDF_Label& theLabel,
51 const Standard_Boolean isRecursive = Standard_False);
58 //! Returns True if there is a current Item in the iteration.
59 virtual Standard_EXPORT Standard_Boolean More () const Standard_OVERRIDE
60 { return !myNode.IsNull(); }
62 //! Move to the next Item
63 virtual Standard_EXPORT void Next () Standard_OVERRIDE;
65 //! Returns the current item
66 virtual Standard_EXPORT Handle(TObj_Object) Value () const Standard_OVERRIDE
69 //! Returns the label of the current item
70 inline const TDF_Label& LabelValue() const
78 //! Shifts iterator to the next object
79 virtual Standard_EXPORT void MakeStep() = 0;
86 //! Initialize Iterator by the theLabel
87 Standard_EXPORT void Init(const TDF_Label& theLabel,
88 const Standard_Boolean isRecursive = Standard_False)
89 { myIterator.Initialize(theLabel,isRecursive); }
96 TDF_Label myNode; //!< Current node
97 TDF_ChildIterator myIterator; //!< OCAF Child iterator
98 Handle(TObj_Object) myObject; //!< Current Object
102 DEFINE_STANDARD_RTTIEXT(TObj_LabelIterator,TObj_ObjectIterator)
105 //! Define handle class for TObj_LabelIterator
106 DEFINE_STANDARD_HANDLE(TObj_LabelIterator,TObj_ObjectIterator)