Salome HOME
Merge branch 'master' into Dev_1.1.0
[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 class SketcherPrs_SensitivePoint : public Select3D_SensitiveEntity
19 {
20 public: 
21   //! Constructs a sensitive point object defined by the
22   //! owner OwnerId and the point Point.
23   Standard_EXPORT SketcherPrs_SensitivePoint(const Handle(SelectBasics_EntityOwner)& OwnerId, 
24     const Handle(Graphic3d_ArrayOfPoints)& thePntArray, int theId);
25   
26   //! Converts the stored 3D point into a 2D point according
27   //! to <aProjector> ; this method is called by the selection Manager.
28   Standard_EXPORT   void Project (const Handle(Select3D_Projector)& aProjector) ;
29   
30   //! stores in <aresult> the 2D sensitive box which represents
31   //! the point area in the selection process.
32   Standard_EXPORT   void Areas (SelectBasics_ListOfBox2d& aresult) ;
33   
34   Standard_EXPORT   Handle(Select3D_SensitiveEntity) GetConnected (const TopLoc_Location& aLocation) ;
35   
36   //! Checks whether the sensitive entity matches the picking
37   //! detection area (close to the picking line).
38   //! For details please refer to base class declaration.
39   Standard_EXPORT   Standard_Boolean Matches (const SelectBasics_PickArgs& thePickArgs, Standard_Real& theMatchDMin, Standard_Real& theMatchDepth) ;
40   
41   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) ;
42   
43   Standard_EXPORT virtual   Standard_Boolean Matches (const TColgp_Array1OfPnt2d& Polyline, const Bnd_Box2d& aBox, const Standard_Real aTol) ;
44   
45   Standard_EXPORT   Standard_Real ComputeDepth (const gp_Lin& EyeLine)  const;
46   
47   //! Returns the point used at the time of construction.
48   Standard_EXPORT   gp_Pnt Point()  const;
49
50   Standard_EXPORT virtual   void Dump (Standard_OStream& S, const Standard_Boolean FullDump = Standard_True)  const;
51
52   DEFINE_STANDARD_RTTI(SketcherPrs_SensitivePoint)
53
54 private: 
55   int myId;
56   Handle(Graphic3d_ArrayOfPoints) myPntArray;
57   Select3D_Pnt2d myprojpt;
58 };
59
60
61 #endif