Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-03 09:16:52

0001 // Created on: 2005-01-21
0002 // Created by: Alexander SOLOVYOV
0003 // Copyright (c) 2005-2014 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_SensitivePolyhedron_HeaderFile
0017 #define _MeshVS_SensitivePolyhedron_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 
0021 #include <Standard_Integer.hxx>
0022 #include <NCollection_Sequence.hxx>
0023 #include <NCollection_Array1.hxx>
0024 #include <NCollection_HArray1.hxx>
0025 #include <NCollection_List.hxx>
0026 #include <Select3D_SensitiveEntity.hxx>
0027 #include <Select3D_BndBox3d.hxx>
0028 
0029 //! This class is used to detect selection of a polyhedron. The main
0030 //! principle of detection algorithm is to search for overlap with
0031 //! each polyhedron's face separately, treating them as planar convex
0032 //! polygons.
0033 class MeshVS_SensitivePolyhedron : public Select3D_SensitiveEntity
0034 {
0035 public:
0036   Standard_EXPORT MeshVS_SensitivePolyhedron(
0037     const occ::handle<SelectMgr_EntityOwner>&                          theOwner,
0038     const NCollection_Array1<gp_Pnt>&                                  theNodes,
0039     const occ::handle<NCollection_HArray1<NCollection_Sequence<int>>>& theTopo);
0040 
0041   Standard_EXPORT occ::handle<Select3D_SensitiveEntity> GetConnected() override;
0042 
0043   Standard_EXPORT bool Matches(SelectBasics_SelectingVolumeManager& theMgr,
0044                                SelectBasics_PickResult&             thePickResult) override;
0045 
0046   //! Returns the amount of nodes of polyhedron
0047   Standard_EXPORT int NbSubElements() const override;
0048 
0049   Standard_EXPORT Select3D_BndBox3d BoundingBox() override;
0050 
0051   Standard_EXPORT gp_Pnt CenterOfGeometry() const override;
0052 
0053   DEFINE_STANDARD_RTTIEXT(MeshVS_SensitivePolyhedron, Select3D_SensitiveEntity)
0054 
0055 private:
0056   NCollection_List<occ::handle<NCollection_HArray1<gp_Pnt>>>  myTopology;
0057   gp_XYZ                                                      myCenter;
0058   Select3D_BndBox3d                                           myBndBox;
0059   occ::handle<NCollection_HArray1<gp_Pnt>>                    myNodes;
0060   occ::handle<NCollection_HArray1<NCollection_Sequence<int>>> myTopo;
0061 };
0062 
0063 #endif // _MeshVS_SensitivePolyhedron_HeaderFile