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