Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:07

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 
0032 //! Defines an Iterator on Entities.
0033 //! Allows considering of various criteria
0034 class Interface_EntityIterator 
0035 {
0036 public:
0037 
0038   DEFINE_STANDARD_ALLOC
0039 
0040   
0041   //! Defines an empty iterator (see AddList & AddItem)
0042   Standard_EXPORT Interface_EntityIterator();
0043   
0044   //! Defines an iterator on a list, directly i.e. without copying it
0045   Standard_EXPORT Interface_EntityIterator(const Handle(TColStd_HSequenceOfTransient)& list);
0046   
0047   //! Gets a list of entities and adds its to the iteration list
0048   Standard_EXPORT void AddList (const Handle(TColStd_HSequenceOfTransient)& list);
0049   
0050   //! Adds to the iteration list a defined entity
0051   Standard_EXPORT void AddItem (const Handle(Standard_Transient)& anentity);
0052   
0053   //! same as AddItem (kept for compatibility)
0054   Standard_EXPORT void GetOneItem (const Handle(Standard_Transient)& anentity);
0055   
0056   //! Selects entities with are Kind of a given type,  keep only
0057   //! them (is keep is True) or reject only them (if keep is False)
0058   Standard_EXPORT void SelectType (const Handle(Standard_Type)& atype, const Standard_Boolean keep);
0059   
0060   //! Returns count of entities which will be iterated on
0061   //! Calls Start if not yet done
0062   Standard_EXPORT Standard_Integer NbEntities() const;
0063   
0064   //! Returns count of entities of a given type (kind of)
0065   Standard_EXPORT Standard_Integer NbTyped (const Handle(Standard_Type)& type) const;
0066   
0067   //! Returns the list of entities of a given type (kind of)
0068   Standard_EXPORT Interface_EntityIterator Typed (const Handle(Standard_Type)& type) const;
0069   
0070   //! Allows re-iteration (useless for the first iteration)
0071   Standard_EXPORT virtual void Start() const;
0072   
0073   //! Says if there are other entities (vertices) to iterate
0074   //! the first time, calls Start
0075   Standard_EXPORT Standard_Boolean More() const;
0076   
0077   //! Sets iteration to the next entity (vertex) to give
0078   Standard_EXPORT void Next() const;
0079   
0080   //! Returns the current Entity iterated, to be used by Interface
0081   //! tools
0082   Standard_EXPORT const Handle(Standard_Transient)& Value() const;
0083   
0084   //! Returns the content of the Iterator, accessed through a Handle
0085   //! to be used by a frontal-engine logic
0086   //! Returns an empty Sequence if the Iterator is empty
0087   //! Calls Start if not yet done
0088   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) Content() const;
0089   
0090   //! Clears data of iteration
0091   Standard_EXPORT void Destroy();
0092 
0093   //! Destructor
0094   Standard_EXPORT virtual ~Interface_EntityIterator();
0095 
0096 protected:
0097 
0098   
0099   //! Allows subclasses of EntityIterator to reevaluate an iteration
0100   Standard_EXPORT void Reset();
0101 
0102 
0103 
0104 
0105 private:
0106 
0107 
0108 
0109   Handle(Interface_IntVal) thecurr;
0110   Handle(TColStd_HSequenceOfTransient) thelist;
0111 
0112 
0113 };
0114 
0115 
0116 
0117 
0118 
0119 
0120 
0121 #endif // _Interface_EntityIterator_HeaderFile