1 // Created on: 1992-11-18
2 // Created by: Christian CAILLET
3 // Copyright (c) 1992-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _IFSelect_SelectRange_HeaderFile
18 #define _IFSelect_SelectRange_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <IFSelect_SelectExtract.hxx>
24 #include <Standard_Boolean.hxx>
25 #include <Standard_Integer.hxx>
26 class IFSelect_IntParam;
27 class Standard_DomainError;
28 class Standard_Transient;
29 class Interface_InterfaceModel;
30 class TCollection_AsciiString;
32 class IFSelect_SelectRange;
33 DEFINE_STANDARD_HANDLE(IFSelect_SelectRange, IFSelect_SelectExtract)
35 //! A SelectRange keeps or rejects a sub-set of the input set,
36 //! that is the Entities of which rank in the iteration list
37 //! is in a given range (for instance form 2nd to 6th, etc...)
38 class IFSelect_SelectRange : public IFSelect_SelectExtract
44 //! Creates a SelectRange. Default is Take all the input list
45 Standard_EXPORT IFSelect_SelectRange();
47 //! Sets a Range for numbers, with a lower and a upper limits
48 //! Error if rankto is lower then rankfrom
49 Standard_EXPORT void SetRange (const Handle(IFSelect_IntParam)& rankfrom, const Handle(IFSelect_IntParam)& rankto);
51 //! Sets a unique number (only one Entity will be sorted as True)
52 Standard_EXPORT void SetOne (const Handle(IFSelect_IntParam)& rank);
54 //! Sets a Lower limit but no upper limit
55 Standard_EXPORT void SetFrom (const Handle(IFSelect_IntParam)& rankfrom);
57 //! Sets an Upper limit but no lower limit (equivalent to lower 1)
58 Standard_EXPORT void SetUntil (const Handle(IFSelect_IntParam)& rankto);
60 //! Returns True if a Lower limit is defined
61 Standard_EXPORT Standard_Boolean HasLower() const;
63 //! Returns Lower limit (if there is; else, value is senseless)
64 Standard_EXPORT Handle(IFSelect_IntParam) Lower() const;
66 //! Returns Value of Lower Limit (0 if none is defined)
67 Standard_EXPORT Standard_Integer LowerValue() const;
69 //! Returns True if a Lower limit is defined
70 Standard_EXPORT Standard_Boolean HasUpper() const;
72 //! Returns Upper limit (if there is; else, value is senseless)
73 Standard_EXPORT Handle(IFSelect_IntParam) Upper() const;
75 //! Returns Value of Upper Limit (0 if none is defined)
76 Standard_EXPORT Standard_Integer UpperValue() const;
78 //! Returns True for an Entity of which occurrence number in the
79 //! iteration is inside the selected Range (considers <rank>)
80 Standard_EXPORT Standard_Boolean Sort (const Standard_Integer rank, const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model) const Standard_OVERRIDE;
82 //! Returns a text defining the criterium : following cases,
83 //! " From .. Until .." or "From .." or "Until .." or "Rank no .."
84 Standard_EXPORT TCollection_AsciiString ExtractLabel() const Standard_OVERRIDE;
86 DEFINE_STANDARD_RTTIEXT(IFSelect_SelectRange,IFSelect_SelectExtract)
90 Handle(IFSelect_IntParam) thelower;
91 Handle(IFSelect_IntParam) theupper;
95 #endif // _IFSelect_SelectRange_HeaderFile