1 // Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #ifndef HYDROData_Iterator_HeaderFile
24 #define HYDROData_Iterator_HeaderFile
26 #include "HYDROData_Document.h"
28 #include <TDF_ChildIDIterator.hxx>
30 /**\class HYDROData_Iterator
31 * \brief Allows to iterate all objects by the document and kind of object.
33 * Using the document data structures, iterates through objects, filtered by
34 * kind of this object. This class must have information about all kinds of
35 * objects of the document: for correct iteration and creation of them.
37 class HYDROData_Iterator
41 * Initializes iterator by objects of the document.
42 * \param theDoc document to iterate
43 * \param theKind kind of the iterated object, can be UNKNOWN: to iterate all objects
45 HYDRODATA_EXPORT HYDROData_Iterator( const Handle(HYDROData_Document)& theDoc,
46 const ObjectKind theKind = KIND_UNKNOWN);
49 * Iterates to the next object
51 HYDRODATA_EXPORT void Next();
54 * Returns true if current object exists
56 HYDRODATA_EXPORT bool More() const;
59 * Returns the current object of the iterator.
61 HYDRODATA_EXPORT Handle(HYDROData_Entity) Current();
66 * Creates object in the document on the given label
67 * \param theDoc document where object will be located
68 * \param theKind kind of the new object, can not be UNKNOWN
70 static HYDRODATA_EXPORT Handle(HYDROData_Entity) CreateObject(
71 TDF_Label& theNewLabel,
72 const ObjectKind& theObjectKind );
75 * Returns object associated to the given label.
77 static HYDRODATA_EXPORT Handle(HYDROData_Entity) Object(
78 const TDF_Label& theLabel );
82 friend class HYDROData_Document;
83 friend class HYDROData_Entity;
86 * Creates object in the document, call HYDROData_Document method to create
87 * objects from other packages.
88 * \param theDoc document where object will be located
89 * \param theKind kind of the new object, can not be UNKNOWN
91 static Handle(HYDROData_Entity) CreateObject(
92 const Handle(HYDROData_Document)& theDoc,
93 const ObjectKind& theObjectKind );
95 TDF_ChildIDIterator myIter; ///< iterator by the objects in the document