b311480e |
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 |
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 | |
7fd59977 |
21 | -- Modified by rob Sep 98 : a) Replace List by HArray1 |
22 | |
23 | -- SAV : 18/03/02 OCC189 - array was replaced with list |
24 | |
25 | -- san : 18/04/03 USE_MAP - additional datamap is used to speed up access |
26 | -- to certain owners in <myresult> list |
27 | |
28 | class Selection from AIS inherits TShared from MMgt |
29 | |
30 | uses |
31 | -- SAV : OCC189 HArray1OfTransient from TColStd, |
32 | AsciiString from TCollection, |
33 | SelectStatus from AIS, |
34 | -- san : USE_MAP |
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 |
40 | |
41 | is |
42 | |
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. |
48 | -- |
49 | -- Note that if a session has been created, a session with |
50 | -- the name "default" is created. |
51 | -- |
52 | -- In this case, the is always a current selection which |
53 | -- is the last one created until SetCurrentSelection is used. |
54 | -- |
55 | -- The class methods deals with the current selection. |
56 | -- |
57 | -- Warning : Better Call AIS_Selection::CreateSelection. |
58 | -- |
59 | |
60 | |
61 | Remove(myclass; aName: CString from Standard) |
62 | raises NoSuchObject from Standard; |
63 | ---Warning: raises NoSuchObject from Standard if no selection having this name |
64 | -- exists. |
65 | |
66 | Find(myclass; aName: CString from Standard) |
67 | ---Purpose: returns True if a selection having this name exsits. |
68 | |
69 | returns Boolean from Standard; |
70 | |
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. |
76 | |
77 | Selection(myclass; aName: CString from Standard) |
78 | ---Purpose: |
79 | returns mutable Selection from AIS; |
80 | |
81 | SetCurrentSelection(myclass; aName: CString from Standard) |
82 | ---Purpose: |
83 | returns Boolean from Standard; |
84 | ---Purpose: returns False if There is no selection of name <aName> |
85 | |
86 | CurrentSelection(myclass) |
87 | ---Purpose: |
88 | returns mutable Selection from AIS; |
89 | |
90 | |
91 | Select(myclass); |
92 | ---Purpose: removes all the object of the currentselection. |
93 | |
94 | Select(myclass; anObject: Transient from Standard) |
95 | returns SelectStatus from AIS; |
96 | ---Purpose: if the object is not yet in the current selection, it will be added. |
97 | -- if the object is already in the current selection, it will be removed. |
98 | |
99 | AddSelect(myclass; anObject: Transient from Standard) |
100 | returns SelectStatus from AIS; |
101 | ---Purpose: the object is always add int the selection. |
102 | -- faster when the number of objects selected is great. |
103 | |
104 | ClearAndSelect(myclass; anObject: Transient from Standard); |
105 | ---Purpose: clears the selection and adds the object in the selection. |
106 | |
107 | |
108 | IsSelected(myclass; anObject: Transient from Standard) |
109 | returns Boolean from Standard; |
110 | |
111 | |
112 | Extent(myclass) returns Integer from Standard; |
113 | ---Purpose: returns the number of objects selected. |
114 | |
115 | Single(myclass) returns Transient from Standard |
116 | ---Purpose: returns the single object selected. |
117 | -- Warning: raises TypeMismatch from Standard if Extent is not equal to 1. |
118 | |
119 | raises TypeMismatch from Standard; |
120 | |
121 | |
122 | ---Category: Instance Methods |
123 | |
124 | Init(me: mutable); |
125 | ---Purpose: |
126 | ---C++: inline |
127 | |
128 | More(me) returns Boolean from Standard; |
129 | ---Purpose: |
130 | ---C++: inline |
131 | |
132 | Next(me: mutable); |
133 | ---Purpose: |
134 | ---C++: inline |
135 | |
136 | Value(me) returns Transient from Standard; |
137 | ---Purpose: |
138 | ---C++: inline |
139 | ---C++: return const& |
140 | |
141 | NbStored(me) returns Integer from Standard; |
142 | ---C++: inline |
143 | |
144 | -- SAV : OCC189 Objects(me) returns HArray1OfTransient from TColStd; |
145 | Objects(me) returns NListTransient from AIS; |
146 | ---C++: inline |
147 | ---C++: return const& |
148 | |
149 | ---Category: private methods. |
150 | Index(myclass;aName:CString from Standard) |
151 | returns Integer from Standard; |
152 | |
153 | fields |
154 | myName : AsciiString from TCollection; |
155 | mycuri : Integer from Standard; |
156 | -- SAV : OCC189 myresult : HArray1OfTransient from TColStd; |
157 | myresult : NListTransient from AIS; |
158 | myIterator : NListIteratorOfListTransient from AIS; |
159 | -- san : USE_MAP |
160 | myResultMap: NDataMapOfTransientIteratorOfListTransient from AIS; |
161 | myNb : Integer from Standard; |
162 | end Selection from AIS; |
163 | |