Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:16

0001 // Created on: 2016-03-02
0002 // Created by: Varvara POSKONINA
0003 // Copyright (c) 2016 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _MeshVS_SensitiveQuad_HeaderFile
0017 #define _MeshVS_SensitiveQuad_HeaderFile
0018 
0019 #include <SelectMgr_EntityOwner.hxx>
0020 
0021 #include <TColgp_Array1OfPnt.hxx>
0022 
0023 //! This class contains description of planar quadrangle and defines methods
0024 //! for its detection by OCCT BVH selection mechanism
0025 class MeshVS_SensitiveQuad : public Select3D_SensitiveEntity
0026 {
0027 public:
0028 
0029   //! Creates a new instance and initializes quadrangle vertices with the given points
0030   Standard_EXPORT MeshVS_SensitiveQuad (const Handle(SelectMgr_EntityOwner)& theOwner, const TColgp_Array1OfPnt& theQuadVerts);
0031 
0032   //! Creates a new instance and initializes quadrangle vertices with the given points
0033   Standard_EXPORT MeshVS_SensitiveQuad (const Handle(SelectMgr_EntityOwner)& theOwner,
0034                                         const gp_Pnt& thePnt1,
0035                                         const gp_Pnt& thePnt2,
0036                                         const gp_Pnt& thePnt3,
0037                                         const gp_Pnt& thePnt4);
0038 
0039   //! Returns the amount of sub-entities in sensitive
0040   virtual Standard_Integer NbSubElements() const Standard_OVERRIDE
0041   {
0042     return 1;
0043   };
0044 
0045   //! Returns a copy of this sensitive quadrangle
0046   Standard_EXPORT virtual Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE;
0047 
0048   //! Checks whether the box overlaps current selecting volume
0049   Standard_EXPORT virtual Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr,
0050                                                     SelectBasics_PickResult& thePickResult) Standard_OVERRIDE;
0051 
0052   //! Returns center of the box
0053   Standard_EXPORT virtual gp_Pnt CenterOfGeometry() const Standard_OVERRIDE;
0054 
0055   //! Returns coordinates of the box
0056   Standard_EXPORT virtual Select3D_BndBox3d BoundingBox() Standard_OVERRIDE;
0057 
0058   DEFINE_STANDARD_RTTIEXT (MeshVS_SensitiveQuad, Select3D_SensitiveEntity)
0059 
0060 private:
0061 
0062   gp_Pnt myVertices[4];     //!< 3d coordinates of quad's corners
0063 };
0064 
0065 DEFINE_STANDARD_HANDLE (MeshVS_SensitiveQuad, Select3D_SensitiveEntity)
0066 
0067 #endif // _MeshVS_SensitiveQuad_HeaderFile