f751596e |
1 | // Created on: 1995-04-13 |
2 | // Created by: Robert COUBLANC |
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 | #ifndef _Select3D_SensitiveBox_HeaderFile |
18 | #define _Select3D_SensitiveBox_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
ec357c5c |
21 | #include <Standard_Type.hxx> |
f751596e |
22 | #include <Standard_Type.hxx> |
23 | |
24 | #include <Bnd_Box.hxx> |
25 | #include <gp_Pnt.hxx> |
26 | #include <Select3D_SensitiveEntity.hxx> |
f751596e |
27 | #include <SelectMgr_SelectingVolumeManager.hxx> |
28 | #include <Standard_OStream.hxx> |
29 | |
30 | class SelectBasics_EntityOwner; |
31 | class Bnd_Box; |
32 | class TopLoc_Location; |
33 | |
34 | |
35 | //! A framework to define selection by a sensitive box. |
36 | class Select3D_SensitiveBox : public Select3D_SensitiveEntity |
37 | { |
38 | public: |
39 | |
40 | //! Constructs a sensitive box object defined by the |
41 | //! owner theOwnerId, and the box theBox. |
42 | Standard_EXPORT Select3D_SensitiveBox (const Handle(SelectBasics_EntityOwner)& theOwnerId, const Bnd_Box& theBox); |
43 | |
44 | //! Constructs a sensitive box object defined by the |
45 | //! owner theOwnerId, and the coordinates theXmin, theYMin, theZMin, theXMax, theYMax, theZMax. |
46 | //! theXmin, theYMin and theZMin define the minimum point in |
47 | //! the front lower left hand corner of the box, |
48 | //! and theXMax, theYMax and theZMax define the maximum |
49 | //! point in the back upper right hand corner of the box. |
50 | Standard_EXPORT Select3D_SensitiveBox (const Handle(SelectBasics_EntityOwner)& theOwnerId, |
51 | const Standard_Real theXMin, |
52 | const Standard_Real theYMin, |
53 | const Standard_Real theZMin, |
54 | const Standard_Real theXMax, |
55 | const Standard_Real theYMax, |
56 | const Standard_Real theZMax); |
57 | |
58 | //! Returns the amount of sub-entities in sensitive |
59 | Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE; |
60 | |
61 | Standard_EXPORT virtual Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE; |
62 | |
63 | //! Checks whether the box overlaps current selecting volume |
64 | Standard_EXPORT virtual Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr, |
65 | SelectBasics_PickResult& thePickResult) Standard_OVERRIDE; |
66 | |
67 | Bnd_Box Box() const; |
68 | |
69 | //! Returns center of the box. If location |
70 | //! transformation is set, it will be applied |
71 | Standard_EXPORT virtual gp_Pnt CenterOfGeometry() const Standard_OVERRIDE; |
72 | |
73 | //! Returns coordinates of the box. If location |
74 | //! transformation is set, it will be applied |
75 | Standard_EXPORT virtual Select3D_BndBox3d BoundingBox() Standard_OVERRIDE; |
76 | |
ec357c5c |
77 | DEFINE_STANDARD_RTTI(Select3D_SensitiveBox, Select3D_SensitiveEntity) |
f751596e |
78 | |
79 | private: |
80 | |
81 | Select3D_BndBox3d myBox; //!< 3d coordinates of box corners |
82 | gp_Pnt myCenter3d; //!< 3d coordinate of box's center |
83 | }; |
84 | |
85 | DEFINE_STANDARD_HANDLE(Select3D_SensitiveBox, Select3D_SensitiveEntity) |
86 | |
87 | #endif // _Select3D_SensitiveBox_HeaderFile |