1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0032183: Visualization - implement AIS_LightSource::ProcessDragging() for rotating directional light

- Added sensitive sphere for a light source
- Implemented AIS_LightSource::ProcessDragging() interface for rotating directional light source
- Added possibility to turn on/off directional light source dragging
- Added test
This commit is contained in:
mkrylova
2021-03-26 12:31:22 +03:00
committed by bugmaster
parent b7344f5d72
commit a3b2aaefac
7 changed files with 310 additions and 15 deletions

View File

@@ -26,6 +26,7 @@ Select3D_SensitiveSphere::Select3D_SensitiveSphere (const Handle(SelectMgr_Entit
const Standard_Real theRadius)
: Select3D_SensitiveEntity (theOwnerId),
myCenter (theCenter),
myLastDetectedPoint (RealLast(), RealLast(), RealLast()),
myRadius (theRadius)
{
}
@@ -37,6 +38,7 @@ Select3D_SensitiveSphere::Select3D_SensitiveSphere (const Handle(SelectMgr_Entit
Standard_Boolean Select3D_SensitiveSphere::Matches (SelectBasics_SelectingVolumeManager& theMgr,
SelectBasics_PickResult& thePickResult)
{
myLastDetectedPoint = gp_Pnt (RealLast(), RealLast(), RealLast());
if (theMgr.GetActiveSelectionType() != SelectMgr_SelectionType_Point)
{
if (!theMgr.IsOverlapAllowed())
@@ -53,7 +55,7 @@ Standard_Boolean Select3D_SensitiveSphere::Matches (SelectBasics_SelectingVolume
{
return Standard_False;
}
myLastDetectedPoint = thePickResult.PickedPoint();
thePickResult.SetDistToGeomCenter (theMgr.DistToGeometryCenter (myCenter));
return Standard_True;
}

View File

@@ -55,8 +55,12 @@ public:
//! Returns center of the sphere with transformation applied
virtual gp_Pnt CenterOfGeometry() const Standard_OVERRIDE { return myCenter; };
//! Returns the position of detected point on the sphere.
const gp_Pnt& LastDetectedPoint() const { return myLastDetectedPoint; }
protected:
gp_Pnt myCenter;
gp_Pnt myLastDetectedPoint;
Standard_Real myRadius;
};