1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: SketcherPrs_SensitivePoint.cpp
4 // Created: 24 March 2015
5 // Author: Vitaly SMETANNIKOV
8 #include "SketcherPrs_SensitivePoint.h"
10 #include <Bnd_Box2d.hxx>
11 #include <CSLib_Class2d.hxx>
13 #include <TopLoc_Location.hxx>
15 IMPLEMENT_STANDARD_HANDLE(SketcherPrs_SensitivePoint, Select3D_SensitiveEntity);
16 IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_SensitivePoint, Select3D_SensitiveEntity);
18 SketcherPrs_SensitivePoint::SketcherPrs_SensitivePoint(const Handle(SelectBasics_EntityOwner)& anOwner,
19 const Handle(Graphic3d_ArrayOfPoints)& thePntArray,
21 :Select3D_SensitiveEntity(anOwner), myId(theId), myPntArray(thePntArray)
23 SetSensitivityFactor(12.);
26 Standard_Boolean SketcherPrs_SensitivePoint::Matches (SelectBasics_SelectingVolumeManager& theMgr,
27 SelectBasics_PickResult& thePickResult)
29 Standard_Real aDepth = RealLast();
30 Standard_Real aDistToCOG = RealLast();
31 gp_Pnt aPnt = myPntArray->Vertice(myId);
32 if (!theMgr.Overlaps (aPnt, aDepth))
34 thePickResult = SelectBasics_PickResult (aDepth, aDistToCOG);
35 return Standard_False;
39 thePickResult = SelectBasics_PickResult (aDepth, aDistToCOG);
43 gp_Pnt SketcherPrs_SensitivePoint::Point() const
45 return myPntArray->Vertice(myId);
48 Handle(Select3D_SensitiveEntity) SketcherPrs_SensitivePoint::GetConnected()
50 Handle(SketcherPrs_SensitivePoint) aNewEntity = new SketcherPrs_SensitivePoint (myOwnerId, myPntArray, myId);
54 gp_Pnt SketcherPrs_SensitivePoint::CenterOfGeometry() const
59 Select3D_BndBox3d SketcherPrs_SensitivePoint::BoundingBox()
61 gp_Pnt aPnt = myPntArray->Vertice(myId);
62 return Select3D_BndBox3d (SelectMgr_Vec3 (aPnt.X(), aPnt.Y(), aPnt.Z()),
63 SelectMgr_Vec3 (aPnt.X(), aPnt.Y(), aPnt.Z()));
66 Standard_Integer SketcherPrs_SensitivePoint::NbSubElements()