1 -- Created on: 1995-03-21
2 -- Created by: Jean-Louis Frenkel
3 -- Copyright (c) 1995-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
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.
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.
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.
21 -- Modified by rob Sep 98 : a) Replace List by HArray1
23 -- SAV : 18/03/02 OCC189 - array was replaced with list
25 -- san : 18/04/03 USE_MAP - additional datamap is used to speed up access
26 -- to certain owners in <myresult> list
28 class Selection from AIS inherits TShared from MMgt
31 -- SAV : OCC189 HArray1OfTransient from TColStd,
32 AsciiString from TCollection,
33 SelectStatus from AIS,
35 -- DataMapOfTransientListIteratorOfListOfTransient from AIS
36 NListTransient from AIS,
37 NListIteratorOfListTransient from AIS,
38 NDataMapOfTransientIteratorOfListTransient from AIS
39 raises NoSuchObject,MultiplyDefined from Standard,TypeMismatch from Standard
43 Create(aName: CString from Standard)
44 returns mutable Selection from AIS;
45 ---Purpose: creates a new selection and make it current in the session.
46 -- the selection will be accessible later through its name
47 -- to make it again current.
49 -- Note that if a session has been created, a session with
50 -- the name "default" is created.
52 -- In this case, the is always a current selection which
53 -- is the last one created until SetCurrentSelection is used.
55 -- The class methods deals with the current selection.
57 -- Warning : Better Call AIS_Selection::CreateSelection.
61 Remove(myclass; aName: CString from Standard)
62 raises NoSuchObject from Standard;
63 ---Warning: raises NoSuchObject from Standard if no selection having this name
66 Find(myclass; aName: CString from Standard)
67 ---Purpose: returns True if a selection having this name exsits.
69 returns Boolean from Standard;
71 CreateSelection(myclass;aName:CString from Standard)
72 returns Boolean from Standard;
73 ---Purpose: calls the private constructor and puts the new Selection
74 -- in the list of existing selections.
75 -- returns False if the selection exists.
77 Selection(myclass; aName: CString from Standard)
79 returns mutable Selection from AIS;
81 SetCurrentSelection(myclass; aName: CString from Standard)
83 returns Boolean from Standard;
84 ---Purpose: returns False if There is no selection of name <aName>
86 CurrentSelection(myclass)
88 returns mutable Selection from AIS;
90 ClearCurrentSelection(myclass);
91 ---Purpose: Clears selection.
94 ---Purpose: removes all the object of the currentselection.
96 Select(myclass; anObject: Transient from Standard)
97 returns SelectStatus from AIS;
98 ---Purpose: if the object is not yet in the current selection, it will be added.
99 -- if the object is already in the current selection, it will be removed.
101 AddSelect(myclass; anObject: Transient from Standard)
102 returns SelectStatus from AIS;
103 ---Purpose: the object is always add int the selection.
104 -- faster when the number of objects selected is great.
106 ClearAndSelect(myclass; anObject: Transient from Standard);
107 ---Purpose: clears the selection and adds the object in the selection.
110 IsSelected(myclass; anObject: Transient from Standard)
111 returns Boolean from Standard;
114 Extent(myclass) returns Integer from Standard;
115 ---Purpose: returns the number of objects selected.
117 Single(myclass) returns Transient from Standard
118 ---Purpose: returns the single object selected.
119 -- Warning: raises TypeMismatch from Standard if Extent is not equal to 1.
121 raises TypeMismatch from Standard;
124 ---Category: Instance Methods
130 More(me) returns Boolean from Standard;
138 Value(me) returns Transient from Standard;
141 ---C++: return const&
143 NbStored(me) returns Integer from Standard;
146 -- SAV : OCC189 Objects(me) returns HArray1OfTransient from TColStd;
147 Objects(me) returns NListTransient from AIS;
149 ---C++: return const&
151 ---Category: private methods.
152 Index(myclass;aName:CString from Standard)
153 returns Integer from Standard;
156 myName : AsciiString from TCollection;
157 -- SAV : OCC189 myresult : HArray1OfTransient from TColStd;
158 myresult : NListTransient from AIS;
159 myIterator : NListIteratorOfListTransient from AIS;
161 myResultMap: NDataMapOfTransientIteratorOfListTransient from AIS;
162 myNb : Integer from Standard;
163 end Selection from AIS;