Salome HOME
refs #417: showing new objects
[modules/hydro.git] / src / HYDROData / HYDROData_Iterator.h
index 8fc27f833e0f749e2f108a2e6c2081093840a0c3..d09d360dab383eab5be0733c3e18127c86773ea0 100644 (file)
@@ -1,8 +1,8 @@
+
 #ifndef HYDROData_Iterator_HeaderFile
 #define HYDROData_Iterator_HeaderFile
 
-#include <HYDROData_Object.h>
-#include <HYDROData_Document.h>
+#include "HYDROData_Document.h"
 
 #include <TDF_ChildIDIterator.hxx>
 
@@ -21,8 +21,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,13 +37,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_Image;
-  friend class HYDROData_Calculation;
+  friend class HYDROData_Entity;
 
   /**
    * Creates object in the document, call HYDROData_Document method to create 
@@ -51,13 +67,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
 };