Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-13 09:18:11

0001 // Created on: 2001-01-31
0002 // Created by: Pavel TELKOV
0003 // Copyright (c) 2001-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 // The original implementation Copyright: (C) RINA S.p.A
0017 
0018 #ifndef TObj_ModelIterator_HeaderFile
0019 #define TObj_ModelIterator_HeaderFile
0020 
0021 #include <TObj_Object.hxx>
0022 #include <NCollection_Sequence.hxx>
0023 #include <TObj_ObjectIterator.hxx>
0024 
0025 /**
0026  * This class provides an iterator by all objects in the model.
0027  */
0028 
0029 class TObj_ModelIterator : public TObj_ObjectIterator
0030 {
0031 public:
0032   /**
0033    * Constructor
0034    */
0035   //! Creates Iterator and initialize it by Model`s label
0036   Standard_EXPORT TObj_ModelIterator(const occ::handle<TObj_Model>& theModel);
0037 
0038 public:
0039   /**
0040    * Methods to iterate on objects.
0041    */
0042 
0043   //! Returns True if iteration is not finished and method Value()
0044   //! will give the object
0045   Standard_EXPORT bool More() const override;
0046 
0047   //! Iterates to the next object
0048   Standard_EXPORT void Next() override;
0049 
0050   //! Returns current object (or MainObj of Model if iteration has finished)
0051   Standard_EXPORT occ::handle<TObj_Object> Value() const override;
0052 
0053 protected:
0054   /**
0055    * private methods
0056    */
0057 
0058   //! Add iterator on children of indicated object recursively.
0059   virtual Standard_EXPORT void addIterator(const occ::handle<TObj_Object>& theObj);
0060 
0061 protected:
0062   /**
0063    * Fields
0064    */
0065   occ::handle<TObj_Object> myObject; //!< Current object
0066   NCollection_Sequence<occ::handle<TObj_ObjectIterator>>
0067     myIterSeq; //!< Sequence of iterators in model
0068 
0069 public:
0070   //! CASCADE RTTI
0071   DEFINE_STANDARD_RTTIEXT(TObj_ModelIterator, TObj_ObjectIterator)
0072 };
0073 
0074 //! Define handle class for TObj_ObjectIterator
0075 #endif
0076 
0077 #ifdef _MSC_VER
0078 #pragma once
0079 #endif