Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1992-12-09
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 _IFSelect_SelectAnyList_HeaderFile
0018 #define _IFSelect_SelectAnyList_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <IFSelect_SelectDeduct.hxx>
0024 #include <Standard_Integer.hxx>
0025 class IFSelect_IntParam;
0026 class Interface_EntityIterator;
0027 class Standard_Transient;
0028 class Interface_Graph;
0029 class TCollection_AsciiString;
0030 
0031 
0032 class IFSelect_SelectAnyList;
0033 DEFINE_STANDARD_HANDLE(IFSelect_SelectAnyList, IFSelect_SelectDeduct)
0034 
0035 //! A SelectAnyList kind Selection selects a List of an Entity, as
0036 //! well as this Entity contains some. A List contains sub-entities
0037 //! as one per Item, or several (for instance if an Entity binds
0038 //! couples of sub-entities, each item is one of these couples).
0039 //! Remark that only Entities are taken into account (neither
0040 //! Reals, nor Strings, etc...)
0041 //!
0042 //! To define the list on which to work, SelectAnyList has two
0043 //! deferred methods : NbItems (which gives the length of the
0044 //! list), FillResult (which fills an EntityIterator). They are
0045 //! intended to get a List in an Entity of the required Type (and
0046 //! consider that list is empty if Entity has not required Type)
0047 //!
0048 //! In addition, remark that some types of Entity define more than
0049 //! one list in each instance : a given sub-class of SelectAnyList
0050 //! must be attached to one list
0051 //!
0052 //! SelectAnyList keeps or rejects a sub-set of the list,
0053 //! that is the Items of which rank in the list is in a given
0054 //! range (for instance form 2nd to 6th, etc...)
0055 //! Range is defined by two Integer values. In order to allow
0056 //! external control of them, these values are not directly
0057 //! defined as fields, but accessed through IntParams, that is,
0058 //! referenced as Transient (Handle) objects
0059 //!
0060 //! Warning : the Input can be any kind of Selection, BUT its
0061 //! RootResult must have zero (empty) or one Entity maximum
0062 class IFSelect_SelectAnyList : public IFSelect_SelectDeduct
0063 {
0064 
0065 public:
0066 
0067   
0068   //! Keeps Input Entity, as having required type. It works by
0069   //! keeping in <iter>, only suitable Entities (SelectType can be
0070   //! used). Called by RootResult (which waits for ONE ENTITY MAX)
0071   Standard_EXPORT virtual void KeepInputEntity (Interface_EntityIterator& iter) const = 0;
0072   
0073   //! Returns count of Items in the list in the Entity <ent>
0074   //! If <ent> has not required type, returned value must be Zero
0075   Standard_EXPORT virtual Standard_Integer NbItems (const Handle(Standard_Transient)& ent) const = 0;
0076   
0077   //! Sets a Range for numbers, with a lower and a upper limits
0078   Standard_EXPORT void SetRange (const Handle(IFSelect_IntParam)& rankfrom, const Handle(IFSelect_IntParam)& rankto);
0079   
0080   //! Sets a unique number (only one Entity will be sorted as True)
0081   Standard_EXPORT void SetOne (const Handle(IFSelect_IntParam)& rank);
0082   
0083   //! Sets a Lower limit but no upper limit
0084   Standard_EXPORT void SetFrom (const Handle(IFSelect_IntParam)& rankfrom);
0085   
0086   //! Sets an Upper limit but no lower limit (equivalent to lower 1)
0087   Standard_EXPORT void SetUntil (const Handle(IFSelect_IntParam)& rankto);
0088   
0089   //! Returns True if a Lower limit is defined
0090   Standard_EXPORT Standard_Boolean HasLower() const;
0091   
0092   //! Returns Lower limit (if there is; else, value is senseless)
0093   Standard_EXPORT Handle(IFSelect_IntParam) Lower() const;
0094   
0095   //! Returns Integer Value of Lower Limit (0 if none)
0096   Standard_EXPORT Standard_Integer LowerValue() const;
0097   
0098   //! Returns True if a Lower limit is defined
0099   Standard_EXPORT Standard_Boolean HasUpper() const;
0100   
0101   //! Returns Upper limit (if there is; else, value is senseless)
0102   Standard_EXPORT Handle(IFSelect_IntParam) Upper() const;
0103   
0104   //! Returns Integer Value of Upper Limit (0 if none)
0105   Standard_EXPORT Standard_Integer UpperValue() const;
0106   
0107   //! Returns the list of selected entities (list of entities
0108   //! complying with rank criterium)
0109   //! Error if the input list has more than one Item
0110   Standard_EXPORT Interface_EntityIterator RootResult (const Interface_Graph& G) const Standard_OVERRIDE;
0111   
0112   //! Puts into <res>, the sub-entities of the list, from n1 to
0113   //! n2 included. Remark that adequation with Entity's type and
0114   //! length of list has already been made at this stage
0115   //! Called by RootResult
0116   Standard_EXPORT virtual void FillResult (const Standard_Integer n1, const Standard_Integer n2, const Handle(Standard_Transient)& ent, Interface_EntityIterator& res) const = 0;
0117   
0118   //! Returns a text defining the criterium : "Components of List "
0119   //! then Specific List Label, then, following cases :
0120   //! " From .. Until .." or "From .." or "Until .." or "Rank no .."
0121   //! Specific type is given by deferred method ListLabel
0122   Standard_EXPORT TCollection_AsciiString Label() const Standard_OVERRIDE;
0123   
0124   //! Returns the specific label for the list, which is included as
0125   //! a part of Label
0126   Standard_EXPORT virtual TCollection_AsciiString ListLabel() const = 0;
0127 
0128 
0129 
0130 
0131   DEFINE_STANDARD_RTTIEXT(IFSelect_SelectAnyList,IFSelect_SelectDeduct)
0132 
0133 protected:
0134 
0135 
0136 
0137 
0138 private:
0139 
0140 
0141   Handle(IFSelect_IntParam) thelower;
0142   Handle(IFSelect_IntParam) theupper;
0143 
0144 
0145 };
0146 
0147 
0148 
0149 
0150 
0151 
0152 
0153 #endif // _IFSelect_SelectAnyList_HeaderFile