0024623: Visualization - improve selection mechanism
[occt.git] / src / SelectBasics / SelectBasics_SensitiveEntity.cdl
1 -- Created on: 1995-01-23
2 -- Created by: Mister rmi
3 -- Copyright (c) 1995-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
5 --
6 -- This file is part of Open CASCADE Technology software library.
7 --
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.
13 --
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
16
17 deferred class SensitiveEntity from SelectBasics inherits TShared from MMgt
18
19   ---Purpose: root class; the inheriting classes will be able to give
20   --          sensitive Areas for the dynamic selection algorithms
21
22 uses 
23     EntityOwner,
24     BndBox3d from Select3D,
25     PickResult,
26     SelectingVolumeManager
27
28 is
29
30
31     Initialize (theOwnerId       : EntityOwner;
32                 theSensFactor    : Real from Standard = 2.0);
33
34     Set (me : mutable;
35          theOwnerId : EntityOwner)
36       is virtual;
37     ---Level: Public
38     ---Purpose: Sets owner of the entity
39
40
41     OwnerId (me)
42       returns any EntityOwner
43       is static;
44     ---Level: Public 
45     ---C++: return const&
46     ---Purpose: Returns pointer to owner of the entity
47
48
49     Matches (me           : mutable;
50             theMgr        : out SelectingVolumeManager from SelectBasics;
51             thePickResult : out PickResult from SelectBasics)
52     returns Boolean is deferred;
53     ---Level: Public
54     ---Purpose: Checks whether the sensitive entity is overlapped by
55     --          current selecting volume
56
57     SetSensitivityFactor (me : mutable;
58                           theSensFactor :Real from Standard);
59     ---C++: inline
60     ---Purpose: Allows to manage the sensitivity of the entity
61
62     SensitivityFactor (me)
63       returns Real from Standard;
64     ---C++: inline
65     ---Purpose: allows a better sensitivity for
66     --          a specific entity in selection algorithms
67     --          useful for small sized entities.
68
69     NbSubElements (me : mutable) returns Integer from Standard
70     is deferred;
71     ---Purpose: Returns the number of sub-entities or elements in
72     --          sensitive entity. Is used to determine if entity is
73     --          complex and needs to pre-build BVH at the creation of
74     --          sensitive entity step or is light-weighted so the tree
75     --          can be build on demand with unnoticeable delay
76
77     BoundingBox (me : mutable) returns BndBox3d from Select3D is deferred;
78     ---Purpose: Returns bounding box of sensitive entity
79
80     BVH (me : mutable) is deferred;
81     ---Purpose: Builds BVH tree for sensitive if it is needed
82
83     Clear (me : mutable) is deferred;
84     ---Purpose: Clears up all the resources and memory allocated
85
86
87 fields
88     
89     myOwnerId       : EntityOwner from SelectBasics is protected;
90     mySFactor       : Real from Standard;
91 end SensitiveEntity;