0024650: Wrong intersection curves obtained for a surface of revolution and a plane.
[occt.git] / src / Select3D / Select3D_SensitiveEntity.cdl
CommitLineData
b311480e 1-- Created on: 1995-01-24
2-- Created by: Rob
3-- Copyright (c) 1995-1999 Matra Datavision
973c2be1 4-- Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5--
973c2be1 6-- This file is part of Open CASCADE Technology software library.
b311480e 7--
d5f74e42 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
973c2be1 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.
b311480e 13--
973c2be1 14-- Alternatively, this file may be used under the terms of Open CASCADE
15-- commercial license or contractual agreement.
b311480e 16
4952a30a 17-- modified by rob jul/ 21/ 97 : inserting locations ...
7fd59977 18-- modified by rob jan/ 29/ 98 : Sort by deph-> add a field to be able
4952a30a 19-- to compute a depth
7fd59977 20-- -> Virtual methods rather than
21-- Deferred for Project
4952a30a 22-- WARNING : Must be redefined for
7fd59977 23-- each kind of sensitive entity
7fd59977 24
25
4952a30a 26deferred class SensitiveEntity from Select3D inherits
7fd59977 27 SensitiveEntity from SelectBasics
28
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.
35
36
37uses
38
39 Projector from Select3D,
40 EntityOwner from SelectBasics,
41 Location from TopLoc,
42 Lin from gp,
4952a30a 43 Box2d from Bnd,
7fd59977 44 Array1OfPnt2d from TColgp
45
46is
47
48 Initialize(OwnerId : EntityOwner from SelectBasics);
49
50 NeedsConversion(me) returns Boolean is redefined static;
4952a30a 51 ---Level: Public
7fd59977 52 ---Purpose: Returns true if this framework needs conversion.
53 ---C++: inline
4952a30a 54
7fd59977 55 Is3D(me) returns Boolean from Standard is redefined static;
56 ---Purpose: Returns true if this framework provides 3D information.
57
4269bd1b 58 Project (me:mutable;aProjector : Projector from Select3D) is deferred;
4952a30a 59 ---Level: Public
4269bd1b 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.
7fd59977 64
65 MaxBoxes(me) returns Integer is redefined virtual;
4952a30a 66 ---Level: Public
67 ---Purpose: Returns the max number of sensitive areas returned
68 -- by this class is 1 by default.
7fd59977 69 -- Else on must redefine this method.
70
71
72 GetConnected(me:mutable;aLocation: Location from TopLoc)
73 returns SensitiveEntity from Select3D is virtual;
ac04d101
SA
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.
7fd59977 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.
4952a30a 83
4952a30a 84 Matches (me :mutable;
7fd59977 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.
4952a30a 96
97 Matches (me :mutable;
7fd59977 98 Polyline:Array1OfPnt2d from TColgp;
99 aBox:Box2d from Bnd;
100 aTol: Real from Standard)
101 returns Boolean from Standard is redefined virtual;
102 ---Purpose: prevents from hiding virtual methods...
103
7fd59977 104 ---Category: Location of sensitive entities...
4952a30a 105 -- Default implementations of HasLocation() and Location() rely on
7fd59977 106 -- location obtained from the entity owner, to minimize memory usage.
107 -- SetLocation() and ResetLocation() do nothing by default.
108
109 HasLocation(me) returns Boolean from Standard is virtual;
110 ---Purpose: Returns true if this framework has a location defined.
111
112 Location(me) returns Location from TopLoc is virtual;
113 ---C++: return const&
114
115 ResetLocation(me:mutable) is virtual;
116 ---Purpose: sets the location to Identity
117
118 SetLocation(me:mutable;aLoc :Location from TopLoc) is virtual;
119
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 ...
4952a30a 124
7fd59977 125 DumpBox(myclass; S: in out OStream;abox:Box2d from Bnd) ;
126
127 UpdateLocation(me:mutable;aLoc:Location from TopLoc);
128
7fd59977 129end SensitiveEntity;
130
131
132
133
134
135