X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_Iterator.h;h=d19feda666a1c8a8894a0c9c52f713e3eab39301;hb=b86ee42a0010ef6bde30373a8741dd865d557dd3;hp=746366a64d9d8c230c3cb1d7e45e9bd7671ebe4c;hpb=5bdd5a07050d0879edb5efdc7e009850a46c64f8;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_Iterator.h b/src/HYDROData/HYDROData_Iterator.h index 746366a6..d19feda6 100644 --- a/src/HYDROData/HYDROData_Iterator.h +++ b/src/HYDROData/HYDROData_Iterator.h @@ -1,8 +1,25 @@ +// Copyright (C) 2014-2015 EDF-R&D +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + #ifndef HYDROData_Iterator_HeaderFile #define HYDROData_Iterator_HeaderFile -#include -#include +#include "HYDROData_Document.h" #include @@ -21,8 +38,8 @@ public: * \param theDoc document to iterate * \param theKind kind of the iterated object, can be UNKNOWN: to iterate all objects */ - HYDRODATA_EXPORT HYDROData_Iterator(Handle(HYDROData_Document) theDoc, - ObjectKind theKind = KIND_UNKNOWN); + HYDRODATA_EXPORT HYDROData_Iterator( const Handle(HYDROData_Document)& theDoc, + const ObjectKind theKind = KIND_UNKNOWN); /** * Iterates to the next object @@ -37,12 +54,29 @@ public: /** * Returns the current object of the iterator. */ - HYDRODATA_EXPORT Handle(HYDROData_Object) Current(); + HYDRODATA_EXPORT Handle(HYDROData_Entity) Current(); + +public: + + /** + * Creates object in the document on the given label + * \param theDoc document where object will be located + * \param theKind kind of the new object, can not be UNKNOWN + */ + static HYDRODATA_EXPORT Handle(HYDROData_Entity) CreateObject( + TDF_Label& theNewLabel, + const ObjectKind& theObjectKind ); + + /** + * Returns object associated to the given label. + */ + static HYDRODATA_EXPORT Handle(HYDROData_Entity) Object( + const TDF_Label& theLabel ); protected: friend class HYDROData_Document; - friend class HYDROData_Object; + friend class HYDROData_Entity; /** * Creates object in the document, call HYDROData_Document method to create @@ -50,13 +84,9 @@ protected: * \param theDoc document where object will be located * \param theKind kind of the new object, can not be UNKNOWN */ - static Handle_HYDROData_Object CreateObject( - Handle_HYDROData_Document theDoc, ObjectKind theKind); - - /** - * Returns object associated to the given label. - */ - static Handle_HYDROData_Object Object(const TDF_Label theLabel); + static Handle(HYDROData_Entity) CreateObject( + const Handle(HYDROData_Document)& theDoc, + const ObjectKind& theObjectKind ); TDF_ChildIDIterator myIter; ///< iterator by the objects in the document };