7fd59977 |
1 | -- File: AIS_Selection.cdl |
2 | -- Created: Tue Mar 21 07:41:28 1995 |
3 | -- Author: Jean-Louis Frenkel |
4 | -- <rmi@pernox> |
5 | ---Copyright: Matra Datavision 1995 |
6 | -- Modified by rob Sep 98 : a) Replace List by HArray1 |
7 | |
8 | -- SAV : 18/03/02 OCC189 - array was replaced with list |
9 | |
10 | -- san : 18/04/03 USE_MAP - additional datamap is used to speed up access |
11 | -- to certain owners in <myresult> list |
12 | |
13 | class Selection from AIS inherits TShared from MMgt |
14 | |
15 | uses |
16 | -- SAV : OCC189 HArray1OfTransient from TColStd, |
17 | AsciiString from TCollection, |
18 | SelectStatus from AIS, |
19 | -- san : USE_MAP |
20 | -- DataMapOfTransientListIteratorOfListOfTransient from AIS |
21 | NListTransient from AIS, |
22 | NListIteratorOfListTransient from AIS, |
23 | NDataMapOfTransientIteratorOfListTransient from AIS |
24 | raises NoSuchObject,MultiplyDefined from Standard,TypeMismatch from Standard |
25 | |
26 | is |
27 | |
28 | Create(aName: CString from Standard) |
29 | returns mutable Selection from AIS; |
30 | ---Purpose: creates a new selection and make it current in the session. |
31 | -- the selection will be accessible later through its name |
32 | -- to make it again current. |
33 | -- |
34 | -- Note that if a session has been created, a session with |
35 | -- the name "default" is created. |
36 | -- |
37 | -- In this case, the is always a current selection which |
38 | -- is the last one created until SetCurrentSelection is used. |
39 | -- |
40 | -- The class methods deals with the current selection. |
41 | -- |
42 | -- Warning : Better Call AIS_Selection::CreateSelection. |
43 | -- |
44 | |
45 | |
46 | Remove(myclass; aName: CString from Standard) |
47 | raises NoSuchObject from Standard; |
48 | ---Warning: raises NoSuchObject from Standard if no selection having this name |
49 | -- exists. |
50 | |
51 | Find(myclass; aName: CString from Standard) |
52 | ---Purpose: returns True if a selection having this name exsits. |
53 | |
54 | returns Boolean from Standard; |
55 | |
56 | CreateSelection(myclass;aName:CString from Standard) |
57 | returns Boolean from Standard; |
58 | ---Purpose: calls the private constructor and puts the new Selection |
59 | -- in the list of existing selections. |
60 | -- returns False if the selection exists. |
61 | |
62 | Selection(myclass; aName: CString from Standard) |
63 | ---Purpose: |
64 | returns mutable Selection from AIS; |
65 | |
66 | SetCurrentSelection(myclass; aName: CString from Standard) |
67 | ---Purpose: |
68 | returns Boolean from Standard; |
69 | ---Purpose: returns False if There is no selection of name <aName> |
70 | |
71 | CurrentSelection(myclass) |
72 | ---Purpose: |
73 | returns mutable Selection from AIS; |
74 | |
75 | |
76 | Select(myclass); |
77 | ---Purpose: removes all the object of the currentselection. |
78 | |
79 | Select(myclass; anObject: Transient from Standard) |
80 | returns SelectStatus from AIS; |
81 | ---Purpose: if the object is not yet in the current selection, it will be added. |
82 | -- if the object is already in the current selection, it will be removed. |
83 | |
84 | AddSelect(myclass; anObject: Transient from Standard) |
85 | returns SelectStatus from AIS; |
86 | ---Purpose: the object is always add int the selection. |
87 | -- faster when the number of objects selected is great. |
88 | |
89 | ClearAndSelect(myclass; anObject: Transient from Standard); |
90 | ---Purpose: clears the selection and adds the object in the selection. |
91 | |
92 | |
93 | IsSelected(myclass; anObject: Transient from Standard) |
94 | returns Boolean from Standard; |
95 | |
96 | |
97 | Extent(myclass) returns Integer from Standard; |
98 | ---Purpose: returns the number of objects selected. |
99 | |
100 | Single(myclass) returns Transient from Standard |
101 | ---Purpose: returns the single object selected. |
102 | -- Warning: raises TypeMismatch from Standard if Extent is not equal to 1. |
103 | |
104 | raises TypeMismatch from Standard; |
105 | |
106 | |
107 | ---Category: Instance Methods |
108 | |
109 | Init(me: mutable); |
110 | ---Purpose: |
111 | ---C++: inline |
112 | |
113 | More(me) returns Boolean from Standard; |
114 | ---Purpose: |
115 | ---C++: inline |
116 | |
117 | Next(me: mutable); |
118 | ---Purpose: |
119 | ---C++: inline |
120 | |
121 | Value(me) returns Transient from Standard; |
122 | ---Purpose: |
123 | ---C++: inline |
124 | ---C++: return const& |
125 | |
126 | NbStored(me) returns Integer from Standard; |
127 | ---C++: inline |
128 | |
129 | -- SAV : OCC189 Objects(me) returns HArray1OfTransient from TColStd; |
130 | Objects(me) returns NListTransient from AIS; |
131 | ---C++: inline |
132 | ---C++: return const& |
133 | |
134 | ---Category: private methods. |
135 | Index(myclass;aName:CString from Standard) |
136 | returns Integer from Standard; |
137 | |
138 | fields |
139 | myName : AsciiString from TCollection; |
140 | mycuri : Integer from Standard; |
141 | -- SAV : OCC189 myresult : HArray1OfTransient from TColStd; |
142 | myresult : NListTransient from AIS; |
143 | myIterator : NListIteratorOfListTransient from AIS; |
144 | -- san : USE_MAP |
145 | myResultMap: NDataMapOfTransientIteratorOfListTransient from AIS; |
146 | myNb : Integer from Standard; |
147 | end Selection from AIS; |
148 | |