Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-23 09:18:47

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   //! Constructs the sensitive circle object defined by the
0030   //! owner theOwnerId, the circle theCircle and the boolean theIsFilled.
0031   Standard_EXPORT Select3D_SensitiveCircle(const occ::handle<SelectMgr_EntityOwner>& theOwnerId,
0032                                            const gp_Circ&                            theCircle,
0033                                            const bool theIsFilled = false);
0034 
0035   //! Constructs the sensitive circle object defined by the
0036   //! owner theOwnerId, the circle theCircle, the boolean
0037   //! theIsFilled and the number of points theNbPnts.
0038   Standard_DEPRECATED("Deprecated constructor, theNbPnts parameter will be ignored")
0039   Select3D_SensitiveCircle(const occ::handle<SelectMgr_EntityOwner>& theOwnerId,
0040                            const gp_Circ&                            theCircle,
0041                            const bool                                theIsFilled,
0042                            const int /*theNbPnts*/)
0043       : Select3D_SensitiveCircle(theOwnerId, theCircle, theIsFilled)
0044   {
0045   }
0046 
0047   //! Checks whether the circle overlaps current selecting volume
0048   Standard_EXPORT bool Matches(SelectBasics_SelectingVolumeManager& theMgr,
0049                                SelectBasics_PickResult&             thePickResult) override;
0050 
0051   //! Returns a copy of this sensitive circle
0052   Standard_EXPORT occ::handle<Select3D_SensitiveEntity> GetConnected() override;
0053 
0054   //! Returns bounding box of the circle.
0055   //! If location transformation is set, it will be applied
0056   Standard_EXPORT Select3D_BndBox3d BoundingBox() override;
0057 
0058   //! Always returns false
0059   bool ToBuildBVH() const override { return false; }
0060 
0061   //! Returns the amount of points
0062   int NbSubElements() const override { return 1; }
0063 
0064   //! Returns center of the circle with transformation applied
0065   Standard_EXPORT gp_Pnt CenterOfGeometry() const 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   double Radius() const { return myRadius; }
0076 
0077 private:
0078   Select3D_TypeOfSensitivity mySensType; //!< Type of sensitivity: boundary or interior
0079   gp_Trsf                    myTrsf;     //!< Circle transformation to apply
0080   double                     myRadius;   //!< Circle radius
0081 };
0082 
0083 #endif // _Select3D_SensitiveCircle_HeaderFile