1 // Copyright (C) 2014-2020 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef SketcherPrs_SensitivePoint_H
21 #define SketcherPrs_SensitivePoint_H
23 #include <SelectBasics_EntityOwner.hxx>
24 #include <Select3D_SensitiveEntity.hxx>
25 #include <Standard_DefineHandle.hxx>
26 #include <Standard_Version.hxx>
29 DEFINE_STANDARD_HANDLE(SketcherPrs_SensitivePoint, Select3D_SensitiveEntity)
33 * This sensitive point is done in order to optimize process of the sinzitive area update
34 * It referes on point array directly and this lets to avoid procedure of the point synchronisation
36 class SketcherPrs_SensitivePoint : public Select3D_SensitiveEntity
39 //! Constructs a sensitive point object defined by the
40 //! \param OwnerId an Id of the Owner.
41 //! \param theId and Id of its point
42 Standard_EXPORT SketcherPrs_SensitivePoint(const Handle(SelectBasics_EntityOwner)& OwnerId,
45 /// Returns number of sub-elements
46 #if OCC_VERSION_HEX > 0x070400
47 Standard_EXPORT virtual Standard_Integer NbSubElements() const Standard_OVERRIDE;
49 Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
51 //! Update location of the point
52 Standard_EXPORT virtual Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE;
54 //! Checks whether the point overlaps current selecting volume
55 //! \param theMgr selection manager
56 //! \param thePickResult returns pick result
57 Standard_EXPORT virtual Standard_Boolean Matches(SelectBasics_SelectingVolumeManager& theMgr,
58 SelectBasics_PickResult& thePickResult) Standard_OVERRIDE;
60 //! Returns the point used at the time of construction.
61 Standard_EXPORT gp_Pnt Point() const;
63 //! Returns center of point. If location transformation
64 //! is set, it will be applied
65 Standard_EXPORT virtual gp_Pnt CenterOfGeometry() const Standard_OVERRIDE;
67 //! Returns bounding box of the point. If location
68 //! transformation is set, it will be applied
69 Standard_EXPORT virtual Select3D_BndBox3d BoundingBox() Standard_OVERRIDE;
71 /// Clear sub-elements
72 Standard_EXPORT virtual void Clear() Standard_OVERRIDE;
74 DEFINE_STANDARD_RTTIEXT(SketcherPrs_SensitivePoint, Select3D_SensitiveEntity)