1 -- Created on: 1995-01-24
3 -- Copyright (c) 1995-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
8 -- This library is free software; you can redistribute it and/or modify it under
9 -- the terms of the GNU Lesser General Public License version 2.1 as published
10 -- by the Free Software Foundation, with special exception defined in the file
11 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 -- distribution for complete text of the license and disclaimer of any warranty.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 -- modified by rob jul/ 21/ 97 : inserting locations ...
18 -- modified by rob jan/ 29/ 98 : Sort by deph-> add a field to be able
20 -- -> Virtual methods rather than
21 -- Deferred for Project
22 -- WARNING : Must be redefined for
23 -- each kind of sensitive entity
26 deferred class SensitiveEntity from Select3D inherits
27 SensitiveEntity from SelectBasics
29 ---Purpose: Abstract framework to define 3D sensitive entities.
30 -- As the selection process uses the principle of a
31 -- projection of 3D shapes onto a 2D view where
32 -- nearness to a rectangle determines whether a shape
33 -- is picked or not, all 3D shapes need to be converted
34 -- into 2D ones in order to be selected.
39 Projector from Select3D,
40 EntityOwner from SelectBasics,
44 Array1OfPnt2d from TColgp
48 Initialize(OwnerId : EntityOwner from SelectBasics);
50 NeedsConversion(me) returns Boolean is redefined static;
52 ---Purpose: Returns true if this framework needs conversion.
55 Is3D(me) returns Boolean from Standard is redefined static;
56 ---Purpose: Returns true if this framework provides 3D information.
58 Project (me:mutable;aProjector : Projector from Select3D) is deferred;
60 ---Purpose: In classes inheriting this framework, you must
61 -- redefine this function in order to get a sensitive 2D
62 -- rectangle from a 3D entity. This rectangle is the
63 -- sensitive zone which makes the 3D entity selectable.
65 MaxBoxes(me) returns Integer is redefined virtual;
67 ---Purpose: Returns the max number of sensitive areas returned
68 -- by this class is 1 by default.
69 -- Else on must redefine this method.
72 GetConnected(me:mutable;aLocation: Location from TopLoc)
73 returns SensitiveEntity from Select3D is virtual;
74 ---Purpose: Originally this method intended to return sensitive
75 -- entity with new location aLocation, but currently sensitive
76 -- entities do not hold a location, instead HasLocation() and
77 -- Location() methods call corresponding entity owner's methods.
78 -- Thus all entities returned by GetConnected() share the same
79 -- location propagated from corresponding selectable object.
80 -- You must redefine this function for any type of
81 -- sensitive entity which can accept another connected
82 -- sensitive entity.//can be connected to another sensitive entity.
85 XMin,YMin,XMax,YMax : Real from Standard;
86 aTol: Real from Standard)
87 returns Boolean from Standard is redefined virtual;
88 ---Purpose: Matches the box defined by the coordinates Xmin,
89 -- Ymin, Xmax, Ymax with the entity found at that point
90 -- within the tolerance aTol.
91 -- Xmin, YMin define the minimum point in the lower left
92 -- hand corner of the box, and XMax, YMax define the
93 -- maximum point in the upper right hand corner of the box.
94 -- You must redefine this function for every inheriting entity.
95 -- You will have to call this framework inside the redefined function.
98 Polyline:Array1OfPnt2d from TColgp;
100 aTol: Real from Standard)
101 returns Boolean from Standard is redefined virtual;
102 ---Purpose: prevents from hiding virtual methods...
104 ---Category: Location of sensitive entities...
105 -- Default implementations of HasLocation() and Location() rely on
106 -- location obtained from the entity owner, to minimize memory usage.
107 -- SetLocation() and ResetLocation() do nothing by default.
109 HasLocation(me) returns Boolean from Standard is virtual;
110 ---Purpose: Returns true if this framework has a location defined.
112 Location(me) returns Location from TopLoc is virtual;
113 ---C++: return const&
115 ResetLocation(me:mutable) is virtual;
116 ---Purpose: sets the location to Identity
118 SetLocation(me:mutable;aLoc :Location from TopLoc) is virtual;
120 Dump(me; S: in out OStream;FullDump : Boolean from Standard = Standard_True) is virtual;
121 ---Purpose: 2 options :
122 -- <FullDump> = False -> general information
123 -- <FullDump> = True -> whole informtion 3D +2d ...
125 DumpBox(myclass; S: in out OStream;abox:Box2d from Bnd) ;
127 UpdateLocation(me:mutable;aLoc:Location from TopLoc);