0030686: Visualization, SelectMgr_ViewerSelector - sorting issues of transformation...
[occt.git] / src / IFSelect / IFSelect_SelectRange.hxx
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
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _IFSelect_SelectRange_HeaderFile
18 #define _IFSelect_SelectRange_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
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;
31
32
33 class IFSelect_SelectRange;
34 DEFINE_STANDARD_HANDLE(IFSelect_SelectRange, IFSelect_SelectExtract)
35
36 //! A SelectRange keeps or rejects a sub-set of the input set,
37 //! that is the Entities of which rank in the iteration list
38 //! is in a given range (for instance form 2nd to 6th, etc...)
39 class IFSelect_SelectRange : public IFSelect_SelectExtract
40 {
41
42 public:
43
44   
45   //! Creates a SelectRange. Default is Take all the input list
46   Standard_EXPORT IFSelect_SelectRange();
47   
48   //! Sets a Range for numbers, with a lower and a upper limits
49   //! Error if rankto is lower then rankfrom
50   Standard_EXPORT void SetRange (const Handle(IFSelect_IntParam)& rankfrom, const Handle(IFSelect_IntParam)& rankto);
51   
52   //! Sets a unique number (only one Entity will be sorted as True)
53   Standard_EXPORT void SetOne (const Handle(IFSelect_IntParam)& rank);
54   
55   //! Sets a Lower limit but no upper limit
56   Standard_EXPORT void SetFrom (const Handle(IFSelect_IntParam)& rankfrom);
57   
58   //! Sets an Upper limit but no lower limit (equivalent to lower 1)
59   Standard_EXPORT void SetUntil (const Handle(IFSelect_IntParam)& rankto);
60   
61   //! Returns True if a Lower limit is defined
62   Standard_EXPORT Standard_Boolean HasLower() const;
63   
64   //! Returns Lower limit (if there is; else, value is senseless)
65   Standard_EXPORT Handle(IFSelect_IntParam) Lower() const;
66   
67   //! Returns Value of Lower Limit (0 if none is defined)
68   Standard_EXPORT Standard_Integer LowerValue() const;
69   
70   //! Returns True if a Lower limit is defined
71   Standard_EXPORT Standard_Boolean HasUpper() const;
72   
73   //! Returns Upper limit (if there is; else, value is senseless)
74   Standard_EXPORT Handle(IFSelect_IntParam) Upper() const;
75   
76   //! Returns Value of Upper Limit (0 if none is defined)
77   Standard_EXPORT Standard_Integer UpperValue() const;
78   
79   //! Returns True for an Entity of which occurence number in the
80   //! iteration is inside the selected Range (considers <rank>)
81   Standard_EXPORT Standard_Boolean Sort (const Standard_Integer rank, const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model) const Standard_OVERRIDE;
82   
83   //! Returns a text defining the criterium : following cases,
84   //! " From .. Until .." or "From .." or "Until .." or "Rank no .."
85   Standard_EXPORT TCollection_AsciiString ExtractLabel() const Standard_OVERRIDE;
86
87
88
89
90   DEFINE_STANDARD_RTTIEXT(IFSelect_SelectRange,IFSelect_SelectExtract)
91
92 protected:
93
94
95
96
97 private:
98
99
100   Handle(IFSelect_IntParam) thelower;
101   Handle(IFSelect_IntParam) theupper;
102
103
104 };
105
106
107
108
109
110
111
112 #endif // _IFSelect_SelectRange_HeaderFile