Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:54

0001 // Created on: 1996-09-25
0002 // Created by: Christian CAILLET
0003 // Copyright (c) 1996-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 _IFSelect_SelectExplore_HeaderFile
0018 #define _IFSelect_SelectExplore_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Standard_Integer.hxx>
0024 #include <IFSelect_SelectDeduct.hxx>
0025 class Interface_EntityIterator;
0026 class Interface_Graph;
0027 class Standard_Transient;
0028 class TCollection_AsciiString;
0029 
0030 
0031 class IFSelect_SelectExplore;
0032 DEFINE_STANDARD_HANDLE(IFSelect_SelectExplore, IFSelect_SelectDeduct)
0033 
0034 //! A SelectExplore determines from an input list of Entities,
0035 //! a list obtained by a way of exploration. This implies the
0036 //! possibility of recursive exploration : the output list is
0037 //! itself reused as input, etc...
0038 //! Examples : Shared Entities, can be considered at one level
0039 //! (immediate shared) or more, or max level
0040 //!
0041 //! Then, for each input entity, if it is not rejected, it can be
0042 //! either taken itself, or explored : it then produces a list.
0043 //! According to a level, either the produced lists or taken
0044 //! entities give the result (level one), or lists are themselves
0045 //! considered and for each item, is it taken or explored.
0046 //!
0047 //! Remark that rejection is just a safety : normally, an input
0048 //! entity is, either taken itself, or explored
0049 //! A maximum level can be specified. Else, the process continues
0050 //! until all entities have been either taken or rejected
0051 class IFSelect_SelectExplore : public IFSelect_SelectDeduct
0052 {
0053 
0054 public:
0055 
0056   
0057   //! Returns the required exploring level
0058   Standard_EXPORT Standard_Integer Level() const;
0059   
0060   //! Returns the list of selected entities. Works by calling the
0061   //! method Explore on each input entity : it can be rejected,
0062   //! taken for output, or to explore. If the maximum level has not
0063   //! yet been attained, or if no max level is specified, entities
0064   //! to be explored are themselves used as if they were input
0065   Standard_EXPORT Interface_EntityIterator RootResult (const Interface_Graph& G) const Standard_OVERRIDE;
0066   
0067   //! Analyses and, if required, Explores an entity, as follows :
0068   //! The explored list starts as empty, it has to be filled by this
0069   //! method.
0070   //! If it returns False, <ent> is rejected for result (this is to
0071   //! be used only as safety)
0072   //! If it returns True and <explored> remains empty, <ent> is
0073   //! taken itself for result, not explored
0074   //! If it returns True and <explored> is not empty, the content
0075   //! of this list is considered :
0076   //! If maximum level is attained, it is taken for result
0077   //! Else (or no max), each of its entity will be itself explored
0078   Standard_EXPORT virtual Standard_Boolean Explore (const Standard_Integer level, const Handle(Standard_Transient)& ent, const Interface_Graph& G, Interface_EntityIterator& explored) const = 0;
0079   
0080   //! Returns a text saying "(Recursive)" or "(Level nn)" plus
0081   //! specific criterium returned by ExploreLabel (see below)
0082   Standard_EXPORT TCollection_AsciiString Label() const Standard_OVERRIDE;
0083   
0084   //! Returns a text defining the way of exploration
0085   Standard_EXPORT virtual TCollection_AsciiString ExploreLabel() const = 0;
0086 
0087 
0088 
0089 
0090   DEFINE_STANDARD_RTTIEXT(IFSelect_SelectExplore,IFSelect_SelectDeduct)
0091 
0092 protected:
0093 
0094   
0095   //! Initializes a SelectExplore : the level must be specified on
0096   //! starting. 0 means all levels, 1 means level one only, etc...
0097   Standard_EXPORT IFSelect_SelectExplore(const Standard_Integer level);
0098 
0099 
0100 
0101 private:
0102 
0103 
0104   Standard_Integer thelevel;
0105 
0106 
0107 };
0108 
0109 
0110 
0111 
0112 
0113 
0114 
0115 #endif // _IFSelect_SelectExplore_HeaderFile