1 // Created on: 2005-01-21
2 // Created by: Alexander SOLOVYOV
3 // Copyright (c) 2005-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef _MeshVS_SensitivePolyhedron_HeaderFile
17 #define _MeshVS_SensitivePolyhedron_HeaderFile
19 #include <Standard.hxx>
20 #include <Standard_Type.hxx>
22 #include <TColgp_HArray1OfPnt.hxx>
23 #include <TColgp_HArray1OfPnt2d.hxx>
24 #include <MeshVS_HArray1OfSequenceOfInteger.hxx>
26 #include <NCollection_List.hxx>
27 #include <Select3D_SensitiveEntity.hxx>
28 #include <Select3D_SensitiveEntity.hxx>
29 #include <Select3D_BndBox3d.hxx>
31 class SelectBasics_EntityOwner;
32 class Select3D_SensitiveEntity;
33 class TopLoc_Location;
36 class SelectBasics_ListOfBox2d;
38 typedef NCollection_List<Handle(TColgp_HArray1OfPnt)> MeshVS_PolyhedronVerts;
39 typedef NCollection_List<Handle(TColgp_HArray1OfPnt)>::Iterator MeshVS_PolyhedronVertsIter;
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
45 class MeshVS_SensitivePolyhedron : public Select3D_SensitiveEntity
49 Standard_EXPORT MeshVS_SensitivePolyhedron (const Handle(SelectBasics_EntityOwner)& theOwner,
50 const TColgp_Array1OfPnt& theNodes,
51 const Handle(MeshVS_HArray1OfSequenceOfInteger)& theTopo);
53 Standard_EXPORT virtual Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE;
55 Standard_EXPORT virtual Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr,
56 SelectBasics_PickResult& thePickResult) Standard_OVERRIDE;
58 //! Returns the amount of nodes of polyhedron
59 Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
61 Standard_EXPORT virtual Select3D_BndBox3d BoundingBox() Standard_OVERRIDE;
63 Standard_EXPORT virtual gp_Pnt CenterOfGeometry() const Standard_OVERRIDE;
65 DEFINE_STANDARD_RTTI(MeshVS_SensitivePolyhedron, Select3D_SensitiveEntity)
69 MeshVS_PolyhedronVerts myTopology;
71 Select3D_BndBox3d myBndBox;
72 Handle(TColgp_HArray1OfPnt) myNodes;
73 Handle(MeshVS_HArray1OfSequenceOfInteger) myTopo;
76 DEFINE_STANDARD_HANDLE(MeshVS_SensitivePolyhedron, Select3D_SensitiveEntity)
78 #endif // _MeshVS_SensitivePolyhedron_HeaderFile