Back to home page

EIC code displayed by LXR

 
 

    


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

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 <MeshVS_HArray1OfSequenceOfInteger.hxx>
0022 #include <NCollection_List.hxx>
0023 #include <Select3D_SensitiveEntity.hxx>
0024 #include <Select3D_BndBox3d.hxx>
0025 
0026 
0027 typedef NCollection_List<Handle(TColgp_HArray1OfPnt)> MeshVS_PolyhedronVerts;
0028 typedef NCollection_List<Handle(TColgp_HArray1OfPnt)>::Iterator MeshVS_PolyhedronVertsIter;
0029 
0030 //! This class is used to detect selection of a polyhedron. The main
0031 //! principle of detection algorithm is to search for overlap with
0032 //! each polyhedron's face separately, treating them as planar convex
0033 //! polygons.
0034 class MeshVS_SensitivePolyhedron : public Select3D_SensitiveEntity
0035 {
0036 public:
0037 
0038   Standard_EXPORT MeshVS_SensitivePolyhedron (const Handle(SelectMgr_EntityOwner)& theOwner,
0039                                               const TColgp_Array1OfPnt& theNodes,
0040                                               const Handle(MeshVS_HArray1OfSequenceOfInteger)& theTopo);
0041 
0042   Standard_EXPORT virtual Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE;
0043 
0044   Standard_EXPORT virtual Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr,
0045                                                     SelectBasics_PickResult& thePickResult) Standard_OVERRIDE;
0046 
0047   //! Returns the amount of nodes of polyhedron
0048   Standard_EXPORT virtual Standard_Integer NbSubElements() const Standard_OVERRIDE;
0049 
0050   Standard_EXPORT virtual Select3D_BndBox3d BoundingBox() Standard_OVERRIDE;
0051 
0052   Standard_EXPORT virtual gp_Pnt CenterOfGeometry() const Standard_OVERRIDE;
0053 
0054   DEFINE_STANDARD_RTTIEXT(MeshVS_SensitivePolyhedron,Select3D_SensitiveEntity)
0055 
0056 private:
0057 
0058   MeshVS_PolyhedronVerts myTopology;
0059   gp_XYZ myCenter;
0060   Select3D_BndBox3d myBndBox;
0061   Handle(TColgp_HArray1OfPnt) myNodes;
0062   Handle(MeshVS_HArray1OfSequenceOfInteger) myTopo;
0063 };
0064 
0065 DEFINE_STANDARD_HANDLE(MeshVS_SensitivePolyhedron, Select3D_SensitiveEntity)
0066 
0067 #endif // _MeshVS_SensitivePolyhedron_HeaderFile