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:
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user