Salome HOME
Fix for selection point of transformation constraint presentation
[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   //! owner OwnerId and the point Point.
26   Standard_EXPORT SketcherPrs_SensitivePoint(const Handle(SelectBasics_EntityOwner)& OwnerId, int theId);
27   
28   Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE;
29
30   //! Update location of the point
31   //! \param aLocation a new location
32   Standard_EXPORT virtual Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE;
33
34   //! Checks whether the point overlaps current selecting volume
35   Standard_EXPORT virtual Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr,
36                                                     SelectBasics_PickResult& thePickResult) Standard_OVERRIDE;
37
38   //! Returns the point used at the time of construction.
39   Standard_EXPORT gp_Pnt Point() const;
40
41   //! Returns center of point. If location transformation
42   //! is set, it will be applied
43   Standard_EXPORT virtual gp_Pnt CenterOfGeometry() const Standard_OVERRIDE;
44
45   //! Returns bounding box of the point. If location
46   //! transformation is set, it will be applied
47   Standard_EXPORT virtual Select3D_BndBox3d BoundingBox() Standard_OVERRIDE;
48   
49
50   DEFINE_STANDARD_RTTI(SketcherPrs_SensitivePoint)
51
52 private: 
53   int myId;
54 };
55
56
57 #endif