0031668: Visualization - WebGL sample doesn't work on Emscripten 1.39
[occt.git] / src / TObj / TObj_ModelIterator.hxx
1 // Created on: 2001-01-31
2 // Created by: Pavel TELKOV
3 // Copyright (c) 2001-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
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.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 // The original implementation Copyright: (C) RINA S.p.A
17
18 #ifndef TObj_ModelIterator_HeaderFile
19 #define TObj_ModelIterator_HeaderFile
20
21 #include <TObj_Object.hxx>
22 #include <TObj_ObjectIterator.hxx>
23 #include <TObj_SequenceOfIterator.hxx>
24
25
26 /**
27 * This class provides an iterator by all objects in the model.
28 */
29
30 class TObj_ModelIterator : public TObj_ObjectIterator
31 {
32  public:
33   /**
34   * Constructor
35   */
36   //! Creates Iterator and initialize it by Model`s label
37   Standard_EXPORT TObj_ModelIterator(const Handle(TObj_Model)& theModel);
38   
39  public:
40   /**
41   * Methods to iterate on objects.
42   */
43   
44   //! Returns True if iteration is not finished and method Value()
45   //! will give the object
46   virtual Standard_EXPORT Standard_Boolean More() const Standard_OVERRIDE;
47   
48   //! Iterates to the next object
49   virtual Standard_EXPORT void Next () Standard_OVERRIDE;
50   
51   //! Returns current object (or MainObj of Model if iteration has finished)
52   virtual Standard_EXPORT Handle(TObj_Object) Value () const Standard_OVERRIDE;
53   
54  protected:
55   /**
56    * private methods
57    */
58   
59   //! Add iterator on children of indicated object recursively.
60   virtual Standard_EXPORT void addIterator(const Handle(TObj_Object)& theObj);
61   
62  protected:
63   /**
64   * Fields
65   */
66   Handle(TObj_Object)  myObject;     //!< Current object
67   TObj_SequenceOfIterator myIterSeq; //!< Sequence of iterators in model
68     
69  public:
70   //! CASCADE RTTI
71   DEFINE_STANDARD_RTTIEXT(TObj_ModelIterator,TObj_ObjectIterator)
72 };
73
74 //! Define handle class for TObj_ObjectIterator
75 DEFINE_STANDARD_HANDLE(TObj_ModelIterator,TObj_ObjectIterator)
76
77 #endif
78
79 #ifdef _MSC_VER
80 #pragma once
81 #endif