b311480e |
1 | -- Created on: 1995-03-21 |
2 | -- Created by: Jean-Louis Frenkel |
3 | -- Copyright (c) 1995-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
7 | -- |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
b311480e |
16 | |
7fd59977 |
17 | -- Modified by rob Sep 98 : a) Replace List by HArray1 |
18 | |
19 | -- SAV : 18/03/02 OCC189 - array was replaced with list |
20 | |
21 | -- san : 18/04/03 USE_MAP - additional datamap is used to speed up access |
22 | -- to certain owners in <myresult> list |
23 | |
24 | class Selection from AIS inherits TShared from MMgt |
25 | |
26 | uses |
27 | -- SAV : OCC189 HArray1OfTransient from TColStd, |
28 | AsciiString from TCollection, |
29 | SelectStatus from AIS, |
30 | -- san : USE_MAP |
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 |
36 | |
37 | is |
38 | |
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. |
44 | -- |
45 | -- Note that if a session has been created, a session with |
46 | -- the name "default" is created. |
47 | -- |
48 | -- In this case, the is always a current selection which |
49 | -- is the last one created until SetCurrentSelection is used. |
50 | -- |
51 | -- The class methods deals with the current selection. |
52 | -- |
53 | -- Warning : Better Call AIS_Selection::CreateSelection. |
54 | -- |
55 | |
56 | |
57 | Remove(myclass; aName: CString from Standard) |
58 | raises NoSuchObject from Standard; |
59 | ---Warning: raises NoSuchObject from Standard if no selection having this name |
60 | -- exists. |
61 | |
62 | Find(myclass; aName: CString from Standard) |
63 | ---Purpose: returns True if a selection having this name exsits. |
64 | |
65 | returns Boolean from Standard; |
66 | |
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. |
72 | |
73 | Selection(myclass; aName: CString from Standard) |
74 | ---Purpose: |
75 | returns mutable Selection from AIS; |
76 | |
77 | SetCurrentSelection(myclass; aName: CString from Standard) |
78 | ---Purpose: |
79 | returns Boolean from Standard; |
80 | ---Purpose: returns False if There is no selection of name <aName> |
81 | |
82 | CurrentSelection(myclass) |
83 | ---Purpose: |
84 | returns mutable Selection from AIS; |
85 | |
30bf45dc |
86 | ClearCurrentSelection(myclass); |
87 | ---Purpose: Clears selection. |
7fd59977 |
88 | |
89 | Select(myclass); |
90 | ---Purpose: removes all the object of the currentselection. |
91 | |
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. |
96 | |
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. |
101 | |
102 | ClearAndSelect(myclass; anObject: Transient from Standard); |
103 | ---Purpose: clears the selection and adds the object in the selection. |
104 | |
105 | |
106 | IsSelected(myclass; anObject: Transient from Standard) |
107 | returns Boolean from Standard; |
108 | |
109 | |
110 | Extent(myclass) returns Integer from Standard; |
111 | ---Purpose: returns the number of objects selected. |
112 | |
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. |
116 | |
117 | raises TypeMismatch from Standard; |
118 | |
119 | |
120 | ---Category: Instance Methods |
121 | |
122 | Init(me: mutable); |
123 | ---Purpose: |
124 | ---C++: inline |
125 | |
126 | More(me) returns Boolean from Standard; |
127 | ---Purpose: |
128 | ---C++: inline |
129 | |
130 | Next(me: mutable); |
131 | ---Purpose: |
132 | ---C++: inline |
133 | |
134 | Value(me) returns Transient from Standard; |
135 | ---Purpose: |
136 | ---C++: inline |
137 | ---C++: return const& |
138 | |
139 | NbStored(me) returns Integer from Standard; |
140 | ---C++: inline |
141 | |
142 | -- SAV : OCC189 Objects(me) returns HArray1OfTransient from TColStd; |
143 | Objects(me) returns NListTransient from AIS; |
144 | ---C++: inline |
145 | ---C++: return const& |
146 | |
147 | ---Category: private methods. |
148 | Index(myclass;aName:CString from Standard) |
149 | returns Integer from Standard; |
150 | |
151 | fields |
152 | myName : AsciiString from TCollection; |
7fd59977 |
153 | -- SAV : OCC189 myresult : HArray1OfTransient from TColStd; |
154 | myresult : NListTransient from AIS; |
155 | myIterator : NListIteratorOfListTransient from AIS; |
156 | -- san : USE_MAP |
157 | myResultMap: NDataMapOfTransientIteratorOfListTransient from AIS; |
158 | myNb : Integer from Standard; |
159 | end Selection from AIS; |
160 | |