0026159: Visualization - revise tolerance implementation for selection
[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     SensitivityFactor (me)
58       returns Real from Standard;
59     ---C++: inline
60     ---Purpose: allows a better sensitivity for
61     --          a specific entity in selection algorithms
62     --          useful for small sized entities.
63
64     NbSubElements (me : mutable) returns Integer from Standard
65     is deferred;
66     ---Purpose: Returns the number of sub-entities or elements in
67     --          sensitive entity. Is used to determine if entity is
68     --          complex and needs to pre-build BVH at the creation of
69     --          sensitive entity step or is light-weighted so the tree
70     --          can be build on demand with unnoticeable delay
71
72     BoundingBox (me : mutable) returns BndBox3d from Select3D is deferred;
73     ---Purpose: Returns bounding box of sensitive entity
74
75     BVH (me : mutable) is deferred;
76     ---Purpose: Builds BVH tree for sensitive if it is needed
77
78     Clear (me : mutable) is deferred;
79     ---Purpose: Clears up all the resources and memory allocated
80
81     SetSensitivityFactor (me : mutable;
82                           theSensFactor :Real from Standard)
83       is protected;
84     ---C++: inline
85     ---Purpose: Allows to manage the sensitivity of the entity
86
87
88 fields
89     
90     myOwnerId       : EntityOwner from SelectBasics is protected;
91     mySFactor       : Real from Standard;
92 end SensitiveEntity;