Back to home page

EIC code displayed by LXR

 
 

    


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