1 -- Created on: 1995-01-24
3 -- Copyright (c) 1995-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
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.
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.
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.
21 -- modified by rob jul/ 21/ 97 : inserting locations ...
22 -- modified by rob jan/ 29/ 98 : Sort by deph-> add a field to be able
24 -- -> Virtual methods rather than
25 -- Deferred for Project
26 -- WARNING : Must be redefined for
27 -- each kind of sensitive entity
30 deferred class SensitiveEntity from Select3D inherits
31 SensitiveEntity from SelectBasics
33 ---Purpose: Abstract framework to define 3D sensitive entities.
34 -- As the selection process uses the principle of a
35 -- projection of 3D shapes onto a 2D view where
36 -- nearness to a rectangle determines whether a shape
37 -- is picked or not, all 3D shapes need to be converted
38 -- into 2D ones in order to be selected.
43 Projector from Select3D,
44 EntityOwner from SelectBasics,
48 Array1OfPnt2d from TColgp
52 Initialize(OwnerId : EntityOwner from SelectBasics);
54 NeedsConversion(me) returns Boolean is redefined static;
56 ---Purpose: Returns true if this framework needs conversion.
59 Is3D(me) returns Boolean from Standard is redefined static;
60 ---Purpose: Returns true if this framework provides 3D information.
62 Project (me:mutable;aProjector : Projector from Select3D) is deferred;
64 ---Purpose: In classes inheriting this framework, you must
65 -- redefine this function in order to get a sensitive 2D
66 -- rectangle from a 3D entity. This rectangle is the
67 -- sensitive zone which makes the 3D entity selectable.
69 MaxBoxes(me) returns Integer is redefined virtual;
71 ---Purpose: Returns the max number of sensitive areas returned
72 -- by this class is 1 by default.
73 -- Else on must redefine this method.
76 GetConnected(me:mutable;aLocation: Location from TopLoc)
77 returns SensitiveEntity from Select3D is virtual;
78 ---Purpose: Originally this method intended to return sensitive
79 -- entity with new location aLocation, but currently sensitive
80 -- entities do not hold a location, instead HasLocation() and
81 -- Location() methods call corresponding entity owner's methods.
82 -- Thus all entities returned by GetConnected() share the same
83 -- location propagated from corresponding selectable object.
84 -- You must redefine this function for any type of
85 -- sensitive entity which can accept another connected
86 -- sensitive entity.//can be connected to another sensitive entity.
89 XMin,YMin,XMax,YMax : Real from Standard;
90 aTol: Real from Standard)
91 returns Boolean from Standard is redefined virtual;
92 ---Purpose: Matches the box defined by the coordinates Xmin,
93 -- Ymin, Xmax, Ymax with the entity found at that point
94 -- within the tolerance aTol.
95 -- Xmin, YMin define the minimum point in the lower left
96 -- hand corner of the box, and XMax, YMax define the
97 -- maximum point in the upper right hand corner of the box.
98 -- You must redefine this function for every inheriting entity.
99 -- You will have to call this framework inside the redefined function.
101 Matches (me :mutable;
102 Polyline:Array1OfPnt2d from TColgp;
104 aTol: Real from Standard)
105 returns Boolean from Standard is redefined virtual;
106 ---Purpose: prevents from hiding virtual methods...
108 ---Category: Location of sensitive entities...
109 -- Default implementations of HasLocation() and Location() rely on
110 -- location obtained from the entity owner, to minimize memory usage.
111 -- SetLocation() and ResetLocation() do nothing by default.
113 HasLocation(me) returns Boolean from Standard is virtual;
114 ---Purpose: Returns true if this framework has a location defined.
116 Location(me) returns Location from TopLoc is virtual;
117 ---C++: return const&
119 ResetLocation(me:mutable) is virtual;
120 ---Purpose: sets the location to Identity
122 SetLocation(me:mutable;aLoc :Location from TopLoc) is virtual;
124 Dump(me; S: in out OStream;FullDump : Boolean from Standard = Standard_True) is virtual;
125 ---Purpose: 2 options :
126 -- <FullDump> = False -> general information
127 -- <FullDump> = True -> whole informtion 3D +2d ...
129 DumpBox(myclass; S: in out OStream;abox:Box2d from Bnd) ;
131 UpdateLocation(me:mutable;aLoc:Location from TopLoc);