1 // Copyright (C) 2014-2015 EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 // Lesser General Public License for more details.
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // modify it under the terms of the GNU Lesser General Public
20 // License as published by the Free Software Foundation; either
21 // version 2.1 of the License, or (at your option) any later version.
23 // This library is distributed in the hope that it will be useful,
24 // but WITHOUT ANY WARRANTY; without even the implied warranty of
25 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
26 // Lesser General Public License for more details.
28 // You should have received a copy of the GNU Lesser General Public
29 // License along with this library; if not, write to the Free Software
30 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
32 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
35 #ifndef HYDROData_Iterator_HeaderFile
36 #define HYDROData_Iterator_HeaderFile
38 #include "HYDROData_Document.h"
40 #include <TDF_ChildIDIterator.hxx>
42 /**\class HYDROData_Iterator
43 * \brief Allows to iterate all objects by the document and kind of object.
45 * Using the document data structures, iterates through objects, filtered by
46 * kind of this object. This class must have information about all kinds of
47 * objects of the document: for correct iteration and creation of them.
49 class HYDROData_Iterator
53 * Initializes iterator by objects of the document.
54 * \param theDoc document to iterate
55 * \param theKind kind of the iterated object, can be UNKNOWN: to iterate all objects
57 HYDRODATA_EXPORT HYDROData_Iterator( const Handle(HYDROData_Document)& theDoc,
58 const ObjectKind theKind = KIND_UNKNOWN);
61 * Iterates to the next object
63 HYDRODATA_EXPORT void Next();
66 * Returns true if current object exists
68 HYDRODATA_EXPORT bool More() const;
71 * Returns the current object of the iterator.
73 HYDRODATA_EXPORT Handle(HYDROData_Entity) Current();
78 * Creates object in the document on the given label
79 * \param theDoc document where object will be located
80 * \param theKind kind of the new object, can not be UNKNOWN
82 static HYDRODATA_EXPORT Handle(HYDROData_Entity) CreateObject(
83 TDF_Label& theNewLabel,
84 const ObjectKind& theObjectKind );
87 * Returns object associated to the given label.
89 static HYDRODATA_EXPORT Handle(HYDROData_Entity) Object(
90 const TDF_Label& theLabel );
94 friend class HYDROData_Document;
95 friend class HYDROData_Entity;
98 * Creates object in the document, call HYDROData_Document method to create
99 * objects from other packages.
100 * \param theDoc document where object will be located
101 * \param theKind kind of the new object, can not be UNKNOWN
103 static Handle(HYDROData_Entity) CreateObject(
104 const Handle(HYDROData_Document)& theDoc,
105 const ObjectKind& theObjectKind );
107 TDF_ChildIDIterator myIter; ///< iterator by the objects in the document