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 <Graphic3d_ArrayOfPoints.hxx>
11 #include "SketcherPrs_SymbolPrs.h"
13 IMPLEMENT_STANDARD_HANDLE(SketcherPrs_SensitivePoint, Select3D_SensitiveEntity);
14 IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_SensitivePoint, Select3D_SensitiveEntity);
16 SketcherPrs_SensitivePoint::SketcherPrs_SensitivePoint(const Handle(SelectBasics_EntityOwner)& anOwner,
18 :Select3D_SensitiveEntity(anOwner), myId(theId)
20 SetSensitivityFactor(12.);
23 Standard_Boolean SketcherPrs_SensitivePoint::Matches (SelectBasics_SelectingVolumeManager& theMgr,
24 SelectBasics_PickResult& thePickResult)
26 Standard_Real aDepth = RealLast();
27 Standard_Real aDistToCOG = RealLast();
28 gp_Pnt aPnt = Point();
29 if (!theMgr.Overlaps (aPnt, aDepth))
31 thePickResult = SelectBasics_PickResult (aDepth, aDistToCOG);
32 return Standard_False;
36 thePickResult = SelectBasics_PickResult (aDepth, aDistToCOG);
40 gp_Pnt SketcherPrs_SensitivePoint::Point() const
42 const Handle(SelectMgr_EntityOwner)& anOwner =
43 Handle(SelectMgr_EntityOwner)::DownCast(OwnerId());
44 const Handle(SketcherPrs_SymbolPrs)& aSymbPrs =
45 Handle(SketcherPrs_SymbolPrs)::DownCast(anOwner->Selectable());
46 return aSymbPrs->pointsArray()->Vertice(myId);
49 Handle(Select3D_SensitiveEntity) SketcherPrs_SensitivePoint::GetConnected()
51 Handle(SketcherPrs_SensitivePoint) aNewEntity = new SketcherPrs_SensitivePoint (myOwnerId, myId);
55 gp_Pnt SketcherPrs_SensitivePoint::CenterOfGeometry() const
60 Select3D_BndBox3d SketcherPrs_SensitivePoint::BoundingBox()
62 gp_Pnt aPnt = Point();
63 return Select3D_BndBox3d (SelectMgr_Vec3 (aPnt.X(), aPnt.Y(), aPnt.Z()),
64 SelectMgr_Vec3 (aPnt.X(), aPnt.Y(), aPnt.Z()));
67 Standard_Integer SketcherPrs_SensitivePoint::NbSubElements()
72 void SketcherPrs_SensitivePoint::Clear()