0024276: Memory leak due to a static variable
[occt.git] / src / Visual3d / Visual3d_PickDescriptor.cdl
1 -- Created on: 1991-11-21
2 -- Created by: NW,JPB,CAL
3 -- Copyright (c) 1991-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
21
22 class PickDescriptor from Visual3d
23
24         ---Version:
25
26         ---Purpose: This class contains the pick information.
27         --          It contains a certain number of PickPaths.
28
29         ---Keywords: Pick Descriptor, Path, Structure, PickId
30
31         ---Warning:
32         ---References:
33
34 uses
35
36         Structure               from Graphic3d,
37         ContextPick             from Visual3d,
38         PickPath                from Visual3d,
39         HSequenceOfPickPath     from Visual3d
40
41 raises
42
43         PickError               from Visual3d
44
45 is
46
47         Create ( CTX : ContextPick from Visual3d )
48                 returns PickDescriptor from Visual3d;
49         ---Level: Public
50         ---Purpose: Creates a PickDescriptor <me>.
51
52         ---------------------------------------------------
53         -- Category: Methods to modify the class definition
54         ---------------------------------------------------
55
56         AddPickPath ( me        : in out;
57                       APickPath : PickPath from Visual3d )
58                 is static;
59         ---Level: Public
60         ---Purpose: Adds a PickPath to PickDescriptor <me>.
61         ---Category: Methods to modify the class definition
62
63         Clear ( me : in out )
64                 is static;
65         ---Level: Public
66         ---Purpose: Erases all the information in <me>.
67         ---Category: Methods to modify the class definition
68
69         ----------------------------
70         -- Category: Inquire methods
71         ----------------------------
72
73         Depth ( me )
74                 returns Integer from Standard
75                 is static;
76         ---Level: Public
77         ---Purpose: Returns the pick depth, that is the
78         --          number of PickPaths available in the PickDescriptor.
79         ---Category: Inquire methods
80
81         PickPath ( me )
82                 returns HSequenceOfPickPath from Visual3d
83                 is static;
84         ---Level: Internal
85         ---Purpose: Returns the group of PickPaths of <me>.
86         ---Category: Inquire methods
87
88         TopStructure ( me )
89                 returns Structure from Graphic3d
90         ---Level: Public
91         ---Purpose: Returns the root structure.
92         --          If the pick order was of the type TOO_TOPFIRST
93         --          then it's the first structure.
94         --          If the pick order was of the type TOO_BOTTOMFIRST
95         --          Then it's the last structure.
96         --          The pick order is set by the method SetOrder
97         --          from ContextPick.
98         --  Category: Inquire methods
99         --  Warning: Raises PickError if Depth == 0 (no picked structure).
100         raises PickError from Visual3d is static;
101
102         TopPickId ( me )
103                 returns Integer from Standard
104         ---Level: Public
105         ---Purpose: Returns the root structure pickid.
106         --          If the pick order was of the type TOO_TOPFIRST
107         --          then it's the first pickid.
108         --          If the pick order was of the type TOO_BOTTOMFIRST
109         --          then it's the last pickid.
110         --          The pick order is set by the method SetOrder
111         --          from ContextPick.
112         --  Category: Inquire methods
113         --  Warning: Raises PickError if Depth == 0 (no picked structure).
114         raises PickError from Visual3d is static;
115
116         TopElementNumber ( me )
117                 returns Integer from Standard
118         ---Level: Public
119         ---Purpose: Returns the root structure element number.
120         --          If the pick order was of the type TOO_TOPFIRST
121         --          then it's the first element number.
122         --          If the pick order was of the type TOO_BOTTOMFIRST
123         --          then it's the last element number.
124         --          The pick order is set by the method SetOrder
125         --          from ContextPick.
126         --  Category: Inquire methods
127         --  Warning: Raises PickError if Depth == 0 (no picked structure).
128         raises PickError from Visual3d is static;
129
130 --\f
131
132 fields
133
134 --
135 -- Class        :       Visual3d_PickDescriptor
136 --
137 -- Purpose      :       Declaration of variables specific to the class
138 --                      describing a pick.
139 --
140 -- Reminders    :       A pick return is defined by:
141 --                      - a sequence of (Elem_number, Pick_Id, Struct_Id)
142 --                      - a depth
143
144         -- pick sequence
145         MyPickPathSequence      :       HSequenceOfPickPath from Visual3d;
146
147         -- context associated to a pick
148         MyContext               :       ContextPick from Visual3d;
149
150 end PickDescriptor;