Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-15 08:29:42

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