Salome HOME
9daf62d47121ade5f950a8c052b8a3c0b337c36f
[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 <Graphic3d_ArrayOfPoints.hxx>
12 #include <Select3D_Pnt2d.hxx>
13 #include <Standard_DefineHandle.hxx>
14
15
16 DEFINE_STANDARD_HANDLE(SketcherPrs_SensitivePoint, Select3D_SensitiveEntity)
17
18 /**
19 * \ingroup GUI
20 * This sensitive point is done in order to optimize process of the sinzitive area update
21 * It referes on point array directly and this lets to avoid procedure of the point synchronisation
22 */
23 class SketcherPrs_SensitivePoint : public Select3D_SensitiveEntity
24 {
25 public: 
26   //! Constructs a sensitive point object defined by the
27   //! owner OwnerId and the point Point.
28   Standard_EXPORT SketcherPrs_SensitivePoint(const Handle(SelectBasics_EntityOwner)& OwnerId, 
29     const Handle(Graphic3d_ArrayOfPoints)& thePntArray, int theId);
30   
31   //! Converts the stored 3D point into a 2D point according
32   //! to <aProjector> ; this method is called by the selection Manager.
33   Standard_EXPORT   void Project (const Handle(Select3D_Projector)& aProjector) ;
34   
35   //! stores in <aresult> the 2D sensitive box which represents
36   //! the point area in the selection process.
37   Standard_EXPORT   void Areas (SelectBasics_ListOfBox2d& aresult) ;
38   
39   Standard_EXPORT   Handle(Select3D_SensitiveEntity) GetConnected (const TopLoc_Location& aLocation) ;
40   
41   //! Checks whether the sensitive entity matches the picking
42   //! detection area (close to the picking line).
43   //! For details please refer to base class declaration.
44   Standard_EXPORT   Standard_Boolean Matches (const SelectBasics_PickArgs& thePickArgs, Standard_Real& theMatchDMin, Standard_Real& theMatchDepth) ;
45   
46   Standard_EXPORT   Standard_Boolean Matches (const Standard_Real XMin, const Standard_Real YMin, const Standard_Real XMax, const Standard_Real YMax, const Standard_Real aTol) ;
47   
48   Standard_EXPORT virtual   Standard_Boolean Matches (const TColgp_Array1OfPnt2d& Polyline, const Bnd_Box2d& aBox, const Standard_Real aTol) ;
49   
50   Standard_EXPORT   Standard_Real ComputeDepth (const gp_Lin& EyeLine)  const;
51   
52   //! Returns the point used at the time of construction.
53   Standard_EXPORT   gp_Pnt Point()  const;
54
55   Standard_EXPORT virtual   void Dump (Standard_OStream& S, const Standard_Boolean FullDump = Standard_True)  const;
56
57   DEFINE_STANDARD_RTTI(SketcherPrs_SensitivePoint)
58
59 private: 
60   int myId;
61   Handle(Graphic3d_ArrayOfPoints) myPntArray;
62   Select3D_Pnt2d myprojpt;
63 };
64
65
66 #endif