Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-10 09:17:17

0001 // Created on: 1992-02-03
0002 // Created by: Christian CAILLET
0003 // Copyright (c) 1992-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _Interface_EntityIterator_HeaderFile
0018 #define _Interface_EntityIterator_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <TColStd_HSequenceOfTransient.hxx>
0025 #include <Standard_Type.hxx>
0026 #include <Standard_Boolean.hxx>
0027 #include <Standard_Integer.hxx>
0028 class Interface_IntVal;
0029 class Standard_Transient;
0030 
0031 //! Defines an Iterator on Entities.
0032 //! Allows considering of various criteria
0033 class Interface_EntityIterator
0034 {
0035 public:
0036   DEFINE_STANDARD_ALLOC
0037 
0038   //! Defines an empty iterator (see AddList & AddItem)
0039   Standard_EXPORT Interface_EntityIterator();
0040 
0041   //! Defines an iterator on a list, directly i.e. without copying it
0042   Standard_EXPORT Interface_EntityIterator(const Handle(TColStd_HSequenceOfTransient)& list);
0043 
0044   //! Gets a list of entities and adds its to the iteration list
0045   Standard_EXPORT void AddList(const Handle(TColStd_HSequenceOfTransient)& list);
0046 
0047   //! Adds to the iteration list a defined entity
0048   Standard_EXPORT void AddItem(const Handle(Standard_Transient)& anentity);
0049 
0050   //! same as AddItem (kept for compatibility)
0051   Standard_EXPORT void GetOneItem(const Handle(Standard_Transient)& anentity);
0052 
0053   //! Selects entities with are Kind of a given type,  keep only
0054   //! them (is keep is True) or reject only them (if keep is False)
0055   Standard_EXPORT void SelectType(const Handle(Standard_Type)& atype, const Standard_Boolean keep);
0056 
0057   //! Returns count of entities which will be iterated on
0058   //! Calls Start if not yet done
0059   Standard_EXPORT Standard_Integer NbEntities() const;
0060 
0061   //! Returns count of entities of a given type (kind of)
0062   Standard_EXPORT Standard_Integer NbTyped(const Handle(Standard_Type)& type) const;
0063 
0064   //! Returns the list of entities of a given type (kind of)
0065   Standard_EXPORT Interface_EntityIterator Typed(const Handle(Standard_Type)& type) const;
0066 
0067   //! Allows re-iteration (useless for the first iteration)
0068   Standard_EXPORT virtual void Start() const;
0069 
0070   //! Says if there are other entities (vertices) to iterate
0071   //! the first time, calls Start
0072   Standard_EXPORT Standard_Boolean More() const;
0073 
0074   //! Sets iteration to the next entity (vertex) to give
0075   Standard_EXPORT void Next() const;
0076 
0077   //! Returns the current Entity iterated, to be used by Interface
0078   //! tools
0079   Standard_EXPORT const Handle(Standard_Transient)& Value() const;
0080 
0081   //! Returns the content of the Iterator, accessed through a Handle
0082   //! to be used by a frontal-engine logic
0083   //! Returns an empty Sequence if the Iterator is empty
0084   //! Calls Start if not yet done
0085   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) Content() const;
0086 
0087   //! Clears data of iteration
0088   Standard_EXPORT void Destroy();
0089 
0090   //! Destructor
0091   Standard_EXPORT virtual ~Interface_EntityIterator();
0092 
0093 protected:
0094   //! Allows subclasses of EntityIterator to reevaluate an iteration
0095   Standard_EXPORT void Reset();
0096 
0097 private:
0098   Handle(Interface_IntVal)             thecurr;
0099   Handle(TColStd_HSequenceOfTransient) thelist;
0100 };
0101 
0102 #endif // _Interface_EntityIterator_HeaderFile