Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1995-03-27
0002 // Created by: Robert COUBLANC
0003 // Copyright (c) 1995-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _Select3D_SensitiveFace_HeaderFile
0018 #define _Select3D_SensitiveFace_HeaderFile
0019 
0020 #include <Select3D_TypeOfSensitivity.hxx>
0021 #include <Select3D_SensitiveSet.hxx>
0022 #include <TColgp_HArray1OfPnt.hxx>
0023 #include <SelectBasics_SelectingVolumeManager.hxx>
0024 
0025 
0026 //! Sensitive Entity to make a face selectable.
0027 //! In some cases this class can raise Standard_ConstructionError and
0028 //! Standard_OutOfRange exceptions. For more details see Select3D_SensitivePoly.
0029 class Select3D_SensitiveFace : public Select3D_SensitiveEntity
0030 {
0031   DEFINE_STANDARD_RTTIEXT(Select3D_SensitiveFace, Select3D_SensitiveEntity)
0032 public:
0033 
0034   //! Constructs a sensitive face object defined by the
0035   //! owner theOwnerId, the array of points thePoints, and
0036   //! the sensitivity type theType.
0037   //! The array of points is the outer polygon of the geometric face.
0038   Standard_EXPORT Select3D_SensitiveFace (const Handle(SelectMgr_EntityOwner)& theOwnerId,
0039                                           const TColgp_Array1OfPnt& thePoints,
0040                                           const Select3D_TypeOfSensitivity theType);
0041 
0042   //! Constructs a sensitive face object defined by the
0043   //! owner theOwnerId, the array of points thePoints, and
0044   //! the sensitivity type theType.
0045   //! The array of points is the outer polygon of the geometric face.
0046   Standard_EXPORT Select3D_SensitiveFace (const Handle(SelectMgr_EntityOwner)& theOwnerId,
0047                                           const Handle(TColgp_HArray1OfPnt)& thePoints,
0048                                           const Select3D_TypeOfSensitivity theType);
0049 
0050   //! Initializes the given array theHArrayOfPnt by 3d
0051   //! coordinates of vertices of the face
0052   Standard_EXPORT void GetPoints (Handle(TColgp_HArray1OfPnt)& theHArrayOfPnt);
0053 
0054   //! Checks whether the face overlaps current selecting volume
0055   Standard_EXPORT virtual Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr,
0056                                                     SelectBasics_PickResult& thePickResult) Standard_OVERRIDE;
0057 
0058   Standard_EXPORT virtual Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE;
0059 
0060   //! Returns bounding box of the face. If location transformation
0061   //! is set, it will be applied
0062   Standard_EXPORT virtual Select3D_BndBox3d BoundingBox() Standard_OVERRIDE;
0063 
0064   //! Returns center of the face. If location transformation
0065   //! is set, it will be applied
0066   Standard_EXPORT virtual gp_Pnt CenterOfGeometry() const Standard_OVERRIDE;
0067 
0068   //! Builds BVH tree for the face
0069   Standard_EXPORT virtual void BVH() Standard_OVERRIDE;
0070 
0071   //! Returns TRUE if BVH tree is in invalidated state
0072   virtual Standard_Boolean ToBuildBVH() const Standard_OVERRIDE { return myFacePoints->ToBuildBVH(); }
0073 
0074   //! Returns the amount of sub-entities (points or planar convex polygons)
0075   Standard_EXPORT virtual Standard_Integer NbSubElements() const Standard_OVERRIDE;
0076 
0077   //! Dumps the content of me into the stream
0078   Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
0079 
0080 private:
0081 
0082   Select3D_TypeOfSensitivity    mySensType;       //!< Type of sensitivity: interior or boundary
0083   Handle(Select3D_SensitiveSet) myFacePoints;     //!< Wrapper for overlap detection created depending on sensitivity type
0084 };
0085 
0086 DEFINE_STANDARD_HANDLE(Select3D_SensitiveFace, Select3D_SensitiveEntity)
0087 
0088 #endif // _Select3D_SensitiveFace_HeaderFile