1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +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

@@ -10754,6 +10754,14 @@ static int VLight (Draw_Interpretor& theDi,
const bool isZoomable = Draw::ParseOnOffIterator (theArgsNb, theArgVec, anArgIt);
aLightPrs->SetZoomable (isZoomable);
}
else if (!aLightPrs.IsNull()
&& (anArgCase == "-showdraggable"
|| anArgCase == "-prsdraggable"
|| anArgCase == "-draggable"))
{
const bool isDraggable = Draw::ParseOnOffIterator (theArgsNb, theArgVec, anArgIt);
aLightPrs->SetDraggable (isDraggable);
}
else if (!aLightPrs.IsNull()
&& (anArgCase == "-showname"
|| anArgCase == "-prsname"))
@@ -10786,6 +10794,23 @@ static int VLight (Draw_Interpretor& theDi,
aLightPrs->SetSize (aSize);
}
else if (!aLightPrs.IsNull()
&& (anArgCase == "-dirarcsize"
|| anArgCase == "-arcsize"
|| anArgCase == "-arc")
&& anArgIt + 1 < theArgsNb)
{
Standard_Integer aSize = 0;
if (!Draw::ParseInteger (theArgVec[anArgIt + 1], aSize)
|| aSize <= 0
|| aLightPrs->Light()->Type() != Graphic3d_TypeOfLightSource_Directional)
{
Message::SendFail() << "Syntax error at argument '" << anArg << "'";
return 1;
}
++anArgIt;
aLightPrs->SetArcSize (aSize);
}
else if (!aLightNew.IsNull()
&& aLightNew->Type() != Graphic3d_TypeOfLightSource_Ambient
&& (anArgCase == "-castshadow"
@@ -14887,6 +14912,7 @@ void ViewerTest::ViewerCommands(Draw_Interpretor& theCommands)
"\n\t\t: [-spotExponent value] [-spotAngle angleDeg]"
"\n\t\t: [-smoothAngle value] [-smoothRadius value]"
"\n\t\t: [-display] [-showName 1|0] [-showRange 1|0] [-prsZoomable 1|0] [-prsSize Value]"
"\n\t\t: [-arcSize Value]"
"\n\t\t: Command manages light sources. Without arguments shows list of lights."
"\n\t\t: Arguments affecting the list of defined/active lights:"
"\n\t\t: -clear remove all light sources"
@@ -14931,7 +14957,9 @@ void ViewerTest::ViewerCommands(Draw_Interpretor& theCommands)
"\n\t\t: -showName shows/hides the name of light source; 1 by default"
"\n\t\t: -showRange shows/hides the range of spot/positional light source; 1 by default"
"\n\t\t: -prsZoomable makes light presentation zoomable/non-zoomable"
"\n\t\t: -prsDraggable makes light presentation draggable/non-draggable"
"\n\t\t: -prsSize sets light presentation size"
"\n\t\t: -arcSize sets arc presentation size(in pixels) for rotation directional light source; 25 by default"
"\n\t\t: Examples:"
"\n\t\t: vlight redlight -type POSITIONAL -headlight 1 -pos 0 1 1 -color RED"
"\n\t\t: vlight redlight -delete",