1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: SketcherPrs_SensitivePoint.h
4 // Created: 24 March 2015
5 // Author: Vitaly SMETANNIKOV
7 #ifndef SketcherPrs_SensitivePoint_H
8 #define SketcherPrs_SensitivePoint_H
10 #include <Select3D_SensitiveEntity.hxx>
11 #include <Graphic3d_ArrayOfPoints.hxx>
12 #include <Select3D_Pnt2d.hxx>
13 #include <Standard_DefineHandle.hxx>
16 DEFINE_STANDARD_HANDLE(SketcherPrs_SensitivePoint, Select3D_SensitiveEntity)
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
23 class SketcherPrs_SensitivePoint : public Select3D_SensitiveEntity
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);
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) ;
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) ;
39 //! Update location of the point
40 //! \param aLocation a new location
41 Standard_EXPORT Handle(Select3D_SensitiveEntity) GetConnected (const TopLoc_Location& aLocation) ;
43 //! Checks whether the sensitive entity matches the picking
44 //! detection area (close to the picking line).
45 //! For details please refer to base class declaration.
46 Standard_EXPORT Standard_Boolean Matches (const SelectBasics_PickArgs& thePickArgs, Standard_Real& theMatchDMin, Standard_Real& theMatchDepth) ;
48 /// Returns true if the current point is matches with given rectangle
49 /// \param XMin an X min coordinate
50 /// \param YMin an Y min coordinate
51 /// \param XMax an X max coordinate
52 /// \param YMax an Y max coordinate
53 /// \param aTol a tolerance
54 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) ;
56 Standard_EXPORT virtual Standard_Boolean Matches (const TColgp_Array1OfPnt2d& Polyline, const Bnd_Box2d& aBox, const Standard_Real aTol) ;
58 Standard_EXPORT Standard_Real ComputeDepth (const gp_Lin& EyeLine) const;
60 //! Returns the point used at the time of construction.
61 Standard_EXPORT gp_Pnt Point() const;
63 Standard_EXPORT virtual void Dump (Standard_OStream& S, const Standard_Boolean FullDump = Standard_True) const;
65 DEFINE_STANDARD_RTTI(SketcherPrs_SensitivePoint)
69 Handle(Graphic3d_ArrayOfPoints) myPntArray;
70 Select3D_Pnt2d myprojpt;