Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1996-02-06
0002 // Created by: Robert COUBLANC
0003 // Copyright (c) 1996-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_SensitiveCircle_HeaderFile
0018 #define _Select3D_SensitiveCircle_HeaderFile
0019 
0020 #include <Select3D_SensitiveEntity.hxx>
0021 
0022 #include <gp_Circ.hxx>
0023 
0024 //! A framework to define sensitive 3D circles.
0025 class Select3D_SensitiveCircle : public Select3D_SensitiveEntity
0026 {
0027   DEFINE_STANDARD_RTTIEXT(Select3D_SensitiveCircle, Select3D_SensitiveEntity)
0028 public:
0029 
0030   //! Constructs the sensitive circle object defined by the
0031   //! owner theOwnerId, the circle theCircle and the boolean theIsFilled.
0032   Standard_EXPORT Select3D_SensitiveCircle (const Handle(SelectMgr_EntityOwner)& theOwnerId,
0033                                             const gp_Circ& theCircle,
0034                                             const Standard_Boolean theIsFilled = Standard_False);
0035 
0036   //! Constructs the sensitive circle object defined by the
0037   //! owner theOwnerId, the circle theCircle, the boolean
0038   //! theIsFilled and the number of points theNbPnts.
0039   Standard_DEPRECATED("Deprecated constructor, theNbPnts parameter will be ignored")
0040   Select3D_SensitiveCircle (const Handle(SelectMgr_EntityOwner)& theOwnerId,
0041                             const gp_Circ& theCircle,
0042                             const Standard_Boolean theIsFilled,
0043                             const Standard_Integer /*theNbPnts*/)
0044   : Select3D_SensitiveCircle (theOwnerId, theCircle, theIsFilled)
0045   { }
0046 
0047   //! Checks whether the circle overlaps current selecting volume
0048   Standard_EXPORT  virtual Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr,
0049                                                      SelectBasics_PickResult& thePickResult) Standard_OVERRIDE;
0050 
0051   //! Returns a copy of this sensitive circle
0052   Standard_EXPORT virtual Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE;
0053 
0054   //! Returns bounding box of the circle.
0055   //! If location transformation is set, it will be applied
0056   Standard_EXPORT virtual Select3D_BndBox3d BoundingBox() Standard_OVERRIDE;
0057 
0058   //! Always returns Standard_False
0059   virtual Standard_Boolean ToBuildBVH() const Standard_OVERRIDE { return Standard_False; }
0060 
0061   //! Returns the amount of points
0062   virtual Standard_Integer NbSubElements() const Standard_OVERRIDE { return 1; }
0063 
0064   //! Returns center of the circle with transformation applied
0065   Standard_EXPORT virtual gp_Pnt CenterOfGeometry() const Standard_OVERRIDE;
0066 
0067   //! The transformation for gp::XOY() with center in gp::Origin(),
0068   //! it specifies the position and orientation of the circle.
0069   const gp_Trsf& Transformation() const { return myTrsf; }
0070 
0071   //! Returns circle
0072   gp_Circ Circle() const { return gp_Circ (gp::XOY().Transformed (myTrsf), myRadius); }
0073 
0074   //! Returns circle radius
0075   Standard_Real Radius() const { return myRadius; }
0076 
0077 private:
0078 
0079   Select3D_TypeOfSensitivity mySensType; //!< Type of sensitivity: boundary or interior
0080   gp_Trsf                    myTrsf;     //!< Circle transformation to apply
0081   Standard_Real              myRadius;   //!< Circle radius
0082 };
0083 
0084 DEFINE_STANDARD_HANDLE(Select3D_SensitiveCircle, Select3D_SensitiveEntity)
0085 
0086 #endif // _Select3D_SensitiveCircle_HeaderFile