b311480e |
1 | -- Created on: 1995-02-06 |
2 | -- Created by: Mister rmi |
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 | |
22 | class Selection from SelectMgr inherits TShared from MMgt |
23 | |
24 | ---Purpose: Represents the state of a given selection mode for a |
25 | -- Selectable Object. Contains all the sensitive entities available for this mode. |
26 | -- An interactive object can have an indefinite number of |
27 | -- modes of selection, each representing a |
28 | -- "decomposition" into sensitive primitives; each |
29 | -- primitive has an Owner (SelectMgr_EntityOwner) |
30 | -- which allows us to identify the exact entity which has |
31 | -- been detected. Each Selection mode is identified by |
32 | -- an index. The set of sensitive primitives which |
33 | -- correspond to a given mode is stocked in a |
34 | -- SelectMgr_Selection object. By Convention, the |
35 | -- default selection mode which allows us to grasp the |
36 | -- Interactive object in its entirety will be mode 0. |
37 | -- AIS_Trihedron : 4 selection modes |
38 | -- - mode 0 : selection of a trihedron |
39 | -- - mode 1 : selection of the origin of the trihedron |
40 | -- - mode 2 : selection of the axes |
41 | -- - mode 3 : selection of the planes XOY, YOZ, XOZ |
42 | -- when you activate one of modes 1 2 3 4 , you pick AIS objects of type: |
43 | -- - AIS_Point |
44 | -- - AIS_Axis (and information on the type of axis) |
45 | -- - AIS_Plane (and information on the type of plane). |
46 | -- AIS_PlaneTrihedron offers 3 selection modes: |
47 | -- - mode 0 : selection of the whole trihedron |
48 | -- - mode 1 : selection of the origin of the trihedron |
49 | -- - mode 2 : selection of the axes - same remarks as for the Trihedron. |
50 | -- AIS_Shape : 7 maximum selection modes, depending |
51 | -- on the complexity of the shape : |
52 | -- - mode 0 : selection of the AIS_Shape |
53 | -- - mode 1 : selection of the vertices |
54 | -- - mode 2 : selection of the edges |
55 | -- - mode 3 : selection of the wires |
56 | -- - mode 4 : selection of the faces |
57 | -- - mode 5 : selection of the shells |
58 | -- - mode 6 : selection of the constituent solids. |
59 | |
60 | uses |
61 | SensitiveEntity from SelectBasics, |
62 | ListOfSensitive from SelectBasics, |
63 | ListIteratorOfListOfSensitive from SelectBasics, |
64 | TypeOfUpdate from SelectMgr |
65 | |
66 | raises |
67 | NullObject |
68 | |
69 | is |
70 | |
71 | |
72 | Create (IdMode : Integer = 0) returns mutable Selection; |
73 | --- Purpose: Constructs a selection object defined by the selection mode IdMode. |
74 | -- The default setting 0 is the selection mode for a shape in its entirety. |
75 | |
76 | Add (me : mutable; |
77 | aprimitive : SensitiveEntity from SelectBasics) |
78 | ---Purpose: Adds the sensitive primitive aprimitive to the list of |
79 | -- stored entities in this object. |
80 | -- Raises NullObject if the primitive is a null handle. |
81 | raises NullObject |
82 | is static; |
83 | |
84 | Clear(me :mutable) is static; |
85 | ---Purpose: empties the selection from all the stored entities |
86 | |
87 | IsEmpty(me) returns Boolean is static; |
88 | ---Purpose: returns true if no sensitive entity is stored. |
89 | |
90 | Mode (me) returns Integer; |
91 | ---Purpose: returns the selection mode represented by this selection |
92 | ---C++: inline |
93 | |
94 | |
95 | ---Category: get the sensitive entities inside the Selection |
96 | |
97 | Init(me:mutable) is static; |
98 | ---Purpose: Begins an iteration scanning for sensitive primitives. |
99 | ---C++: inline |
100 | |
101 | More(me) returns Boolean is static; |
102 | ---Purpose: Continues the iteration scanning for sensitive |
103 | -- primitives with the mode defined in this framework. |
104 | ---C++: inline |
105 | |
106 | |
107 | Next(me:mutable) is static; |
108 | ---Purpose: Returns the next sensitive primitive found in the |
109 | -- iteration. This is a scan for entities with the mode |
110 | -- defined in this framework. |
111 | ---C++: inline |
112 | |
113 | Sensitive (me) returns any SensitiveEntity from SelectBasics is static; |
114 | ---Purpose: Returns any sensitive primitive in this framework. |
115 | ---C++: return const& |
116 | ---C++: inline |
117 | |
118 | ---Category: Internal Methods for Management |
119 | -- |
120 | -- sets and gets the update status of a selection |
121 | |
122 | |
123 | |
124 | UpdateStatus(me) returns TypeOfUpdate from SelectMgr; |
125 | ---C++: inline |
126 | ---Purpose: Returns the flag UpdateFlag. |
127 | -- This flage gives the update status of this framework |
128 | -- in a ViewerSelector object: |
129 | -- - full |
130 | -- - partial, or |
131 | -- - none. |
132 | |
133 | |
134 | UpdateStatus(me:mutable;UpdateFlag : TypeOfUpdate from SelectMgr); |
135 | ---C++: inline |
136 | |
137 | |
138 | |
139 | |
140 | fields |
141 | |
142 | myentities : ListOfSensitive from SelectBasics; |
143 | myit : ListIteratorOfListOfSensitive from SelectBasics; |
144 | myMode : Integer from Standard; |
145 | myUpdateStatus : TypeOfUpdate from SelectMgr; |
146 | |
147 | |
148 | end Selection; |
149 | |
150 | |