1 -- Created on: 1995-03-21
2 -- Created by: Jean-Louis Frenkel
3 -- Copyright (c) 1995-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
9 -- under the terms of the GNU Lesser General Public 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 -- Modified by rob Sep 98 : a) Replace List by HArray1
19 -- SAV : 18/03/02 OCC189 - array was replaced with list
21 -- san : 18/04/03 USE_MAP - additional datamap is used to speed up access
22 -- to certain owners in <myresult> list
24 class Selection from AIS inherits TShared from MMgt
27 -- SAV : OCC189 HArray1OfTransient from TColStd,
28 AsciiString from TCollection,
29 SelectStatus from AIS,
31 -- DataMapOfTransientListIteratorOfListOfTransient from AIS
32 NListTransient from AIS,
33 NListIteratorOfListTransient from AIS,
34 NDataMapOfTransientIteratorOfListTransient from AIS
35 raises NoSuchObject,MultiplyDefined from Standard,TypeMismatch from Standard
39 Create(aName: CString from Standard)
40 returns mutable Selection from AIS;
41 ---Purpose: creates a new selection and make it current in the session.
42 -- the selection will be accessible later through its name
43 -- to make it again current.
45 -- Note that if a session has been created, a session with
46 -- the name "default" is created.
48 -- In this case, the is always a current selection which
49 -- is the last one created until SetCurrentSelection is used.
51 -- The class methods deals with the current selection.
53 -- Warning : Better Call AIS_Selection::CreateSelection.
57 Remove(myclass; aName: CString from Standard)
58 raises NoSuchObject from Standard;
59 ---Warning: raises NoSuchObject from Standard if no selection having this name
62 Find(myclass; aName: CString from Standard)
63 ---Purpose: returns True if a selection having this name exsits.
65 returns Boolean from Standard;
67 CreateSelection(myclass;aName:CString from Standard)
68 returns Boolean from Standard;
69 ---Purpose: calls the private constructor and puts the new Selection
70 -- in the list of existing selections.
71 -- returns False if the selection exists.
73 Selection(myclass; aName: CString from Standard)
75 returns mutable Selection from AIS;
77 SetCurrentSelection(myclass; aName: CString from Standard)
79 returns Boolean from Standard;
80 ---Purpose: returns False if There is no selection of name <aName>
82 CurrentSelection(myclass)
84 returns mutable Selection from AIS;
86 ClearCurrentSelection(myclass);
87 ---Purpose: Clears selection.
90 ---Purpose: removes all the object of the currentselection.
92 Select(myclass; anObject: Transient from Standard)
93 returns SelectStatus from AIS;
94 ---Purpose: if the object is not yet in the current selection, it will be added.
95 -- if the object is already in the current selection, it will be removed.
97 AddSelect(myclass; anObject: Transient from Standard)
98 returns SelectStatus from AIS;
99 ---Purpose: the object is always add int the selection.
100 -- faster when the number of objects selected is great.
102 ClearAndSelect(myclass; anObject: Transient from Standard);
103 ---Purpose: clears the selection and adds the object in the selection.
106 IsSelected(myclass; anObject: Transient from Standard)
107 returns Boolean from Standard;
110 Extent(myclass) returns Integer from Standard;
111 ---Purpose: returns the number of objects selected.
113 Single(myclass) returns Transient from Standard
114 ---Purpose: returns the single object selected.
115 -- Warning: raises TypeMismatch from Standard if Extent is not equal to 1.
117 raises TypeMismatch from Standard;
120 ---Category: Instance Methods
126 More(me) returns Boolean from Standard;
134 Value(me) returns Transient from Standard;
137 ---C++: return const&
139 NbStored(me) returns Integer from Standard;
142 -- SAV : OCC189 Objects(me) returns HArray1OfTransient from TColStd;
143 Objects(me) returns NListTransient from AIS;
145 ---C++: return const&
147 ---Category: private methods.
148 Index(myclass;aName:CString from Standard)
149 returns Integer from Standard;
152 myName : AsciiString from TCollection;
153 -- SAV : OCC189 myresult : HArray1OfTransient from TColStd;
154 myresult : NListTransient from AIS;
155 myIterator : NListIteratorOfListTransient from AIS;
157 myResultMap: NDataMapOfTransientIteratorOfListTransient from AIS;
158 myNb : Integer from Standard;
159 end Selection from AIS;