| 1 | -- Created on: 1992-12-09 |
| 2 | -- Created by: Christian CAILLET |
| 3 | -- Copyright (c) 1992-1999 Matra Datavision |
| 4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS |
| 5 | -- |
| 6 | -- The content of this file is subject to the Open CASCADE Technology Public |
| 7 | -- License Version 6.5 (the "License"). You may not use the content of this file |
| 8 | -- except in compliance with the License. Please obtain a copy of the License |
| 9 | -- at http://www.opencascade.org and read it completely before using this file. |
| 10 | -- |
| 11 | -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
| 12 | -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
| 13 | -- |
| 14 | -- The Original Code and all software distributed under the License is |
| 15 | -- distributed on an "AS IS" basis, without warranty of any kind, and the |
| 16 | -- Initial Developer hereby disclaims all such warranties, including without |
| 17 | -- limitation, any warranties of merchantability, fitness for a particular |
| 18 | -- purpose or non-infringement. Please see the License for the specific terms |
| 19 | -- and conditions governing the rights and limitations under the License. |
| 20 | |
| 21 | |
| 22 | |
| 23 | deferred class SelectAnyList from IFSelect inherits SelectDeduct |
| 24 | |
| 25 | |
| 26 | ---Purpose : A SelectAnyList kind Selection selects a List of an Entity, as |
| 27 | -- well as this Entity contains some. A List contains sub-entities |
| 28 | -- as one per Item, or several (for instance if an Entity binds |
| 29 | -- couples of sub-entities, each item is one of these couples). |
| 30 | -- Remark that only Entities are taken into account (neither |
| 31 | -- Reals, nor Strings, etc...) |
| 32 | -- |
| 33 | -- To define the list on which to work, SelectAnyList has two |
| 34 | -- deferred methods : NbItems (which gives the length of the |
| 35 | -- list), FillResult (which fills an EntityIterator). They are |
| 36 | -- intended to get a List in an Entity of the required Type (and |
| 37 | -- consider that list is empty if Entity has not required Type) |
| 38 | -- |
| 39 | -- In addition, remark that some types of Entity define more than |
| 40 | -- one list in each instance : a given sub-class of SelectAnyList |
| 41 | -- must be attached to one list |
| 42 | -- |
| 43 | -- SelectAnyList keeps or rejects a sub-set of the list, |
| 44 | -- that is the Items of which rank in the list is in a given |
| 45 | -- range (for instance form 2nd to 6th, etc...) |
| 46 | -- Range is defined by two Integer values. In order to allow |
| 47 | -- external control of them, these values are not directly |
| 48 | -- defined as fields, but accessed through IntParams, that is, |
| 49 | -- referenced as Transient (Handle) objects |
| 50 | -- |
| 51 | -- Warning : the Input can be any kind of Selection, BUT its |
| 52 | -- RootResult must have zero (empty) or one Entity maximum |
| 53 | |
| 54 | uses AsciiString from TCollection, Transient, EntityIterator, Graph, IntParam |
| 55 | |
| 56 | raises OutOfRange, InterfaceError |
| 57 | |
| 58 | is |
| 59 | |
| 60 | KeepInputEntity (me; iter : in out EntityIterator) is deferred; |
| 61 | ---Purpose : Keeps Input Entity, as having required type. It works by |
| 62 | -- keeping in <iter>, only suitable Entities (SelectType can be |
| 63 | -- used). Called by RootResult (which waits for ONE ENTITY MAX) |
| 64 | |
| 65 | NbItems (me; ent : Transient) returns Integer is deferred; |
| 66 | ---Purpose : Returns count of Items in the list in the Entity <ent> |
| 67 | -- If <ent> has not required type, returned value must be Zero |
| 68 | |
| 69 | |
| 70 | SetRange (me : mutable; rankfrom, rankto : mutable IntParam); |
| 71 | ---Purpose : Sets a Range for numbers, with a lower and a upper limits |
| 72 | |
| 73 | SetOne (me : mutable; rank : mutable IntParam); |
| 74 | ---Purpose : Sets a unique number (only one Entity will be sorted as True) |
| 75 | |
| 76 | SetFrom (me : mutable; rankfrom : mutable IntParam); |
| 77 | ---Purpose : Sets a Lower limit but no upper limit |
| 78 | |
| 79 | SetUntil (me : mutable; rankto : mutable IntParam); |
| 80 | ---Purpose : Sets an Upper limit but no lower limit (equivalent to lower 1) |
| 81 | |
| 82 | HasLower (me) returns Boolean; |
| 83 | ---Purpose : Returns True if a Lower limit is defined |
| 84 | |
| 85 | Lower (me) returns mutable IntParam; |
| 86 | ---Purpose : Returns Lower limit (if there is; else, value is senseless) |
| 87 | |
| 88 | LowerValue (me) returns Integer; |
| 89 | ---Purpose : Returns Integer Value of Lower Limit (0 if none) |
| 90 | |
| 91 | HasUpper (me) returns Boolean; |
| 92 | ---Purpose : Returns True if a Lower limit is defined |
| 93 | |
| 94 | Upper (me) returns mutable IntParam; |
| 95 | ---Purpose : Returns Upper limit (if there is; else, value is senseless) |
| 96 | |
| 97 | UpperValue (me) returns Integer; |
| 98 | ---Purpose : Returns Integer Value of Upper Limit (0 if none) |
| 99 | |
| 100 | |
| 101 | RootResult (me; G : Graph) returns EntityIterator raises InterfaceError; |
| 102 | ---Purpose : Returns the list of selected entities (list of entities |
| 103 | -- complying with rank criterium) |
| 104 | -- Error if the input list has more than one Item |
| 105 | |
| 106 | FillResult (me; n1,n2 : Integer; ent : Transient; |
| 107 | res : in out EntityIterator) is deferred; |
| 108 | ---Purpose : Puts into <res>, the sub-entities of the list, from n1 to |
| 109 | -- n2 included. Remark that adequation with Entity's type and |
| 110 | -- length of list has already been made at this stage |
| 111 | -- Called by RootResult |
| 112 | |
| 113 | |
| 114 | Label (me) returns AsciiString from TCollection; |
| 115 | ---Purpose : Returns a text defining the criterium : "Componants of List " |
| 116 | -- then Specific List Label, then, following cases : |
| 117 | -- " From .. Until .." or "From .." or "Until .." or "Rank no .." |
| 118 | -- Specific type is given by deferred method ListLabel |
| 119 | |
| 120 | ListLabel (me) returns AsciiString from TCollection is deferred; |
| 121 | ---Purpose : Returns the specific label for the list, which is included as |
| 122 | -- a part of Label |
| 123 | |
| 124 | fields |
| 125 | |
| 126 | thelower : IntParam; |
| 127 | theupper : IntParam; |
| 128 | |
| 129 | end SelectAnyList; |