f751596e |
1 | // Created on: 2005-01-21 |
2 | // Created by: Alexander SOLOVYOV |
3 | // Copyright (c) 2005-2014 OPEN CASCADE SAS |
4 | // |
5 | // This file is part of Open CASCADE Technology software library. |
6 | // |
7 | // This library is free software; you can redistribute it and/or modify it under |
8 | // the terms of the GNU Lesser General Public License version 2.1 as published |
9 | // by the Free Software Foundation, with special exception defined in the file |
10 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
11 | // distribution for complete text of the license and disclaimer of any warranty. |
12 | // |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
15 | |
16 | #ifndef _MeshVS_SensitivePolyhedron_HeaderFile |
17 | #define _MeshVS_SensitivePolyhedron_HeaderFile |
18 | |
19 | #include <Standard.hxx> |
ec357c5c |
20 | #include <Standard_Type.hxx> |
f751596e |
21 | |
b7c077b9 |
22 | #include <TColgp_HArray1OfPnt.hxx> |
23 | #include <TColgp_HArray1OfPnt2d.hxx> |
24 | #include <MeshVS_HArray1OfSequenceOfInteger.hxx> |
f751596e |
25 | #include <gp_XY.hxx> |
26 | #include <NCollection_List.hxx> |
27 | #include <Select3D_SensitiveEntity.hxx> |
f751596e |
28 | #include <Select3D_SensitiveEntity.hxx> |
29 | #include <Select3D_BndBox3d.hxx> |
30 | |
f751596e |
31 | class SelectBasics_EntityOwner; |
f751596e |
32 | class Select3D_SensitiveEntity; |
33 | class TopLoc_Location; |
f751596e |
34 | class Bnd_Box2d; |
f751596e |
35 | class gp_Lin; |
36 | class SelectBasics_ListOfBox2d; |
37 | |
38 | typedef NCollection_List<Handle(TColgp_HArray1OfPnt)> MeshVS_PolyhedronVerts; |
39 | typedef NCollection_List<Handle(TColgp_HArray1OfPnt)>::Iterator MeshVS_PolyhedronVertsIter; |
40 | |
41 | //! This class is used to detect selection of a polyhedron. The main |
42 | //! principle of detection algorithm is to search for overlap with |
43 | //! each polyhedron's face separately, treating them as planar convex |
44 | //! polygons. |
45 | class MeshVS_SensitivePolyhedron : public Select3D_SensitiveEntity |
46 | { |
47 | public: |
48 | |
49 | Standard_EXPORT MeshVS_SensitivePolyhedron (const Handle(SelectBasics_EntityOwner)& theOwner, |
50 | const TColgp_Array1OfPnt& theNodes, |
51 | const Handle(MeshVS_HArray1OfSequenceOfInteger)& theTopo); |
52 | |
35c0599a |
53 | Standard_EXPORT virtual Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE; |
f751596e |
54 | |
55 | Standard_EXPORT virtual Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr, |
56 | SelectBasics_PickResult& thePickResult) Standard_OVERRIDE; |
57 | |
58 | //! Returns the amount of nodes of polyhedron |
59 | Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE; |
60 | |
61 | Standard_EXPORT virtual Select3D_BndBox3d BoundingBox() Standard_OVERRIDE; |
62 | |
63 | Standard_EXPORT virtual gp_Pnt CenterOfGeometry() const Standard_OVERRIDE; |
64 | |
92efcf78 |
65 | DEFINE_STANDARD_RTTIEXT(MeshVS_SensitivePolyhedron,Select3D_SensitiveEntity) |
f751596e |
66 | |
67 | private: |
68 | |
69 | MeshVS_PolyhedronVerts myTopology; |
70 | gp_XYZ myCenter; |
71 | Select3D_BndBox3d myBndBox; |
72 | Handle(TColgp_HArray1OfPnt) myNodes; |
73 | Handle(MeshVS_HArray1OfSequenceOfInteger) myTopo; |
74 | }; |
75 | |
76 | DEFINE_STANDARD_HANDLE(MeshVS_SensitivePolyhedron, Select3D_SensitiveEntity) |
77 | |
78 | #endif // _MeshVS_SensitivePolyhedron_HeaderFile |