Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-10 09:17:03

0001 // Created on: 1992-11-18
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_SelectRange_HeaderFile
0018 #define _IFSelect_SelectRange_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <IFSelect_SelectExtract.hxx>
0024 #include <Standard_Integer.hxx>
0025 class IFSelect_IntParam;
0026 class Standard_Transient;
0027 class Interface_InterfaceModel;
0028 class TCollection_AsciiString;
0029 
0030 class IFSelect_SelectRange;
0031 DEFINE_STANDARD_HANDLE(IFSelect_SelectRange, IFSelect_SelectExtract)
0032 
0033 //! A SelectRange keeps or rejects a sub-set of the input set,
0034 //! that is the Entities of which rank in the iteration list
0035 //! is in a given range (for instance form 2nd to 6th, etc...)
0036 class IFSelect_SelectRange : public IFSelect_SelectExtract
0037 {
0038 
0039 public:
0040   //! Creates a SelectRange. Default is Take all the input list
0041   Standard_EXPORT IFSelect_SelectRange();
0042 
0043   //! Sets a Range for numbers, with a lower and a upper limits
0044   //! Error if rankto is lower then rankfrom
0045   Standard_EXPORT void SetRange(const Handle(IFSelect_IntParam)& rankfrom,
0046                                 const Handle(IFSelect_IntParam)& rankto);
0047 
0048   //! Sets a unique number (only one Entity will be sorted as True)
0049   Standard_EXPORT void SetOne(const Handle(IFSelect_IntParam)& rank);
0050 
0051   //! Sets a Lower limit but no upper limit
0052   Standard_EXPORT void SetFrom(const Handle(IFSelect_IntParam)& rankfrom);
0053 
0054   //! Sets an Upper limit but no lower limit (equivalent to lower 1)
0055   Standard_EXPORT void SetUntil(const Handle(IFSelect_IntParam)& rankto);
0056 
0057   //! Returns True if a Lower limit is defined
0058   Standard_EXPORT Standard_Boolean HasLower() const;
0059 
0060   //! Returns Lower limit (if there is; else, value is senseless)
0061   Standard_EXPORT Handle(IFSelect_IntParam) Lower() const;
0062 
0063   //! Returns Value of Lower Limit (0 if none is defined)
0064   Standard_EXPORT Standard_Integer LowerValue() const;
0065 
0066   //! Returns True if a Lower limit is defined
0067   Standard_EXPORT Standard_Boolean HasUpper() const;
0068 
0069   //! Returns Upper limit (if there is; else, value is senseless)
0070   Standard_EXPORT Handle(IFSelect_IntParam) Upper() const;
0071 
0072   //! Returns Value of Upper Limit (0 if none is defined)
0073   Standard_EXPORT Standard_Integer UpperValue() const;
0074 
0075   //! Returns True for an Entity of which occurrence number in the
0076   //! iteration is inside the selected Range (considers <rank>)
0077   Standard_EXPORT Standard_Boolean
0078     Sort(const Standard_Integer                  rank,
0079          const Handle(Standard_Transient)&       ent,
0080          const Handle(Interface_InterfaceModel)& model) const Standard_OVERRIDE;
0081 
0082   //! Returns a text defining the criterium : following cases,
0083   //! " From .. Until .." or "From .." or "Until .." or "Rank no .."
0084   Standard_EXPORT TCollection_AsciiString ExtractLabel() const Standard_OVERRIDE;
0085 
0086   DEFINE_STANDARD_RTTIEXT(IFSelect_SelectRange, IFSelect_SelectExtract)
0087 
0088 private:
0089   Handle(IFSelect_IntParam) thelower;
0090   Handle(IFSelect_IntParam) theupper;
0091 };
0092 
0093 #endif // _IFSelect_SelectRange_HeaderFile