Salome HOME
Merge branch 'master' into cgt/devCEA
[modules/shaper.git] / src / SketcherPrs / SketcherPrs_SensitivePoint.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        SketcherPrs_SensitivePoint.h
4 // Created:     24 March 2015
5 // Author:      Vitaly SMETANNIKOV
6
7 #ifndef SketcherPrs_SensitivePoint_H
8 #define SketcherPrs_SensitivePoint_H
9
10 #include <Select3D_SensitiveEntity.hxx>
11 #include <Standard_DefineHandle.hxx>
12
13
14 DEFINE_STANDARD_HANDLE(SketcherPrs_SensitivePoint, Select3D_SensitiveEntity)
15
16 /**
17 * \ingroup GUI
18 * This sensitive point is done in order to optimize process of the sinzitive area update
19 * It referes on point array directly and this lets to avoid procedure of the point synchronisation
20 */
21 class SketcherPrs_SensitivePoint : public Select3D_SensitiveEntity
22 {
23 public:
24   //! Constructs a sensitive point object defined by the
25   //! \param OwnerId an Id of the Owner.
26   //! \param theId and Id of its point
27   Standard_EXPORT SketcherPrs_SensitivePoint(const Handle(SelectBasics_EntityOwner)& OwnerId,
28                                              int theId);
29
30   /// Returns number of sub-elements
31   Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
32
33   //! Update location of the point
34   Standard_EXPORT virtual Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE;
35
36   //! Checks whether the point overlaps current selecting volume
37   //! \param theMgr selection manager
38   //! \param thePickResult returns pick result
39   Standard_EXPORT virtual Standard_Boolean Matches(SelectBasics_SelectingVolumeManager& theMgr,
40                                      SelectBasics_PickResult& thePickResult) Standard_OVERRIDE;
41
42   //! Returns the point used at the time of construction.
43   Standard_EXPORT gp_Pnt Point() const;
44
45   //! Returns center of point. If location transformation
46   //! is set, it will be applied
47   Standard_EXPORT virtual gp_Pnt CenterOfGeometry() const Standard_OVERRIDE;
48
49   //! Returns bounding box of the point. If location
50   //! transformation is set, it will be applied
51   Standard_EXPORT virtual Select3D_BndBox3d BoundingBox() Standard_OVERRIDE;
52
53   /// Clear sub-elements
54   Standard_EXPORT virtual void Clear() Standard_OVERRIDE;
55
56   DEFINE_STANDARD_RTTIEXT(SketcherPrs_SensitivePoint, Select3D_SensitiveEntity)
57
58 private:
59   int myId;
60 };
61
62
63 #endif