Back to home page

EIC code displayed by LXR

 
 

    


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

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 
0041   
0042   //! Creates a SelectRange. Default is Take all the input list
0043   Standard_EXPORT IFSelect_SelectRange();
0044   
0045   //! Sets a Range for numbers, with a lower and a upper limits
0046   //! Error if rankto is lower then rankfrom
0047   Standard_EXPORT void SetRange (const Handle(IFSelect_IntParam)& rankfrom, const Handle(IFSelect_IntParam)& rankto);
0048   
0049   //! Sets a unique number (only one Entity will be sorted as True)
0050   Standard_EXPORT void SetOne (const Handle(IFSelect_IntParam)& rank);
0051   
0052   //! Sets a Lower limit but no upper limit
0053   Standard_EXPORT void SetFrom (const Handle(IFSelect_IntParam)& rankfrom);
0054   
0055   //! Sets an Upper limit but no lower limit (equivalent to lower 1)
0056   Standard_EXPORT void SetUntil (const Handle(IFSelect_IntParam)& rankto);
0057   
0058   //! Returns True if a Lower limit is defined
0059   Standard_EXPORT Standard_Boolean HasLower() const;
0060   
0061   //! Returns Lower limit (if there is; else, value is senseless)
0062   Standard_EXPORT Handle(IFSelect_IntParam) Lower() const;
0063   
0064   //! Returns Value of Lower Limit (0 if none is defined)
0065   Standard_EXPORT Standard_Integer LowerValue() const;
0066   
0067   //! Returns True if a Lower limit is defined
0068   Standard_EXPORT Standard_Boolean HasUpper() const;
0069   
0070   //! Returns Upper limit (if there is; else, value is senseless)
0071   Standard_EXPORT Handle(IFSelect_IntParam) Upper() const;
0072   
0073   //! Returns Value of Upper Limit (0 if none is defined)
0074   Standard_EXPORT Standard_Integer UpperValue() const;
0075 
0076   //! Returns True for an Entity of which occurrence number in the
0077   //! iteration is inside the selected Range (considers <rank>)
0078   Standard_EXPORT Standard_Boolean Sort (const Standard_Integer rank, const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model) const Standard_OVERRIDE;
0079 
0080   //! Returns a text defining the criterium : following cases,
0081   //! " From .. Until .." or "From .." or "Until .." or "Rank no .."
0082   Standard_EXPORT TCollection_AsciiString ExtractLabel() const Standard_OVERRIDE;
0083 
0084   DEFINE_STANDARD_RTTIEXT(IFSelect_SelectRange,IFSelect_SelectExtract)
0085 
0086 private:
0087 
0088   Handle(IFSelect_IntParam) thelower;
0089   Handle(IFSelect_IntParam) theupper;
0090 
0091 };
0092 
0093 #endif // _IFSelect_SelectRange_HeaderFile