1 // Created on: 2016-03-02
2 // Created by: Varvara POSKONINA
3 // Copyright (c) 2016 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_SensitiveQuad_HeaderFile
17 #define _MeshVS_SensitiveQuad_HeaderFile
19 #include <Select3D_SensitiveEntity.hxx>
20 #include <SelectMgr_EntityOwner.hxx>
22 #include <TColgp_Array1OfPnt.hxx>
24 //! This class contains description of planar quadrangle and defines methods
25 //! for its detection by OCCT BVH selection mechanism
26 class MeshVS_SensitiveQuad : public Select3D_SensitiveEntity
30 //! Creates a new instance and initializes quadrangle vertices with the given points
31 Standard_EXPORT MeshVS_SensitiveQuad (const Handle(SelectMgr_EntityOwner)& theOwner, const TColgp_Array1OfPnt& theQuadVerts);
33 //! Creates a new instance and initializes quadrangle vertices with the given points
34 Standard_EXPORT MeshVS_SensitiveQuad (const Handle(SelectMgr_EntityOwner)& theOwner,
35 const gp_Pnt& thePnt1,
36 const gp_Pnt& thePnt2,
37 const gp_Pnt& thePnt3,
38 const gp_Pnt& thePnt4);
40 //! Returns the amount of sub-entities in sensitive
41 virtual Standard_Integer NbSubElements() const Standard_OVERRIDE
46 //! Returns a copy of this sensitive quadrangle
47 Standard_EXPORT virtual Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE;
49 //! Checks whether the box overlaps current selecting volume
50 Standard_EXPORT virtual Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr,
51 SelectBasics_PickResult& thePickResult) Standard_OVERRIDE;
53 //! Returns center of the box
54 Standard_EXPORT virtual gp_Pnt CenterOfGeometry() const Standard_OVERRIDE;
56 //! Returns coordinates of the box
57 Standard_EXPORT virtual Select3D_BndBox3d BoundingBox() Standard_OVERRIDE;
59 DEFINE_STANDARD_RTTIEXT (MeshVS_SensitiveQuad, Select3D_SensitiveEntity)
63 gp_Pnt myVertices[4]; //!< 3d coordinates of quad's corners
66 DEFINE_STANDARD_HANDLE (MeshVS_SensitiveQuad, Select3D_SensitiveEntity)
68 #endif // _MeshVS_SensitiveQuad_HeaderFile