Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-23 09:18: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 <gp_Pnt.hxx>
0022 #include <NCollection_Array1.hxx>
0023 
0024 //! This class contains description of planar quadrangle and defines methods
0025 //! for its detection by OCCT BVH selection mechanism
0026 class MeshVS_SensitiveQuad : public Select3D_SensitiveEntity
0027 {
0028 public:
0029   //! Creates a new instance and initializes quadrangle vertices with the given points
0030   Standard_EXPORT MeshVS_SensitiveQuad(const occ::handle<SelectMgr_EntityOwner>& theOwner,
0031                                        const NCollection_Array1<gp_Pnt>&         theQuadVerts);
0032 
0033   //! Creates a new instance and initializes quadrangle vertices with the given points
0034   Standard_EXPORT MeshVS_SensitiveQuad(const occ::handle<SelectMgr_EntityOwner>& theOwner,
0035                                        const gp_Pnt&                             thePnt1,
0036                                        const gp_Pnt&                             thePnt2,
0037                                        const gp_Pnt&                             thePnt3,
0038                                        const gp_Pnt&                             thePnt4);
0039 
0040   //! Returns the amount of sub-entities in sensitive
0041   int NbSubElements() const override { return 1; };
0042 
0043   //! Returns a copy of this sensitive quadrangle
0044   Standard_EXPORT occ::handle<Select3D_SensitiveEntity> GetConnected() override;
0045 
0046   //! Checks whether the box overlaps current selecting volume
0047   Standard_EXPORT bool Matches(SelectBasics_SelectingVolumeManager& theMgr,
0048                                SelectBasics_PickResult&             thePickResult) override;
0049 
0050   //! Returns center of the box
0051   Standard_EXPORT gp_Pnt CenterOfGeometry() const override;
0052 
0053   //! Returns coordinates of the box
0054   Standard_EXPORT Select3D_BndBox3d BoundingBox() override;
0055 
0056   DEFINE_STANDARD_RTTIEXT(MeshVS_SensitiveQuad, Select3D_SensitiveEntity)
0057 
0058 private:
0059   gp_Pnt myVertices[4]; //!< 3d coordinates of quad's corners
0060 };
0061 
0062 #endif // _MeshVS_SensitiveQuad_HeaderFile