0024276: Memory leak due to a static variable
[occt.git] / src / AIS / AIS_Selection.cdl
CommitLineData
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
28class Selection from AIS inherits TShared from MMgt
29
30uses
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
39raises NoSuchObject,MultiplyDefined from Standard,TypeMismatch from Standard
40
41is
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
30bf45dc 90 ClearCurrentSelection(myclass);
91 ---Purpose: Clears selection.
7fd59977 92
93 Select(myclass);
94 ---Purpose: removes all the object of the currentselection.
95
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.
100
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.
105
106 ClearAndSelect(myclass; anObject: Transient from Standard);
107 ---Purpose: clears the selection and adds the object in the selection.
108
109
110 IsSelected(myclass; anObject: Transient from Standard)
111 returns Boolean from Standard;
112
113
114 Extent(myclass) returns Integer from Standard;
115 ---Purpose: returns the number of objects selected.
116
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.
120
121 raises TypeMismatch from Standard;
122
123
124 ---Category: Instance Methods
125
126 Init(me: mutable);
127 ---Purpose:
128 ---C++: inline
129
130 More(me) returns Boolean from Standard;
131 ---Purpose:
132 ---C++: inline
133
134 Next(me: mutable);
135 ---Purpose:
136 ---C++: inline
137
138 Value(me) returns Transient from Standard;
139 ---Purpose:
140 ---C++: inline
141 ---C++: return const&
142
143 NbStored(me) returns Integer from Standard;
144 ---C++: inline
145
146-- SAV : OCC189 Objects(me) returns HArray1OfTransient from TColStd;
147 Objects(me) returns NListTransient from AIS;
148 ---C++: inline
149 ---C++: return const&
150
151---Category: private methods.
152 Index(myclass;aName:CString from Standard)
153 returns Integer from Standard;
154
155fields
156 myName : AsciiString from TCollection;
7fd59977 157-- SAV : OCC189 myresult : HArray1OfTransient from TColStd;
158 myresult : NListTransient from AIS;
159 myIterator : NListIteratorOfListTransient from AIS;
160-- san : USE_MAP
161 myResultMap: NDataMapOfTransientIteratorOfListTransient from AIS;
162 myNb : Integer from Standard;
163end Selection from AIS;
164