1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0030626: Visualization - manipulator crashes when is attached with scaling mode disabled

AIS_Manipulator crashes on SetPart method when 2 inputs (AIS_ManipulatorMode, Standard_Boolean) has been fixed up.
Test case for this bug has been added.
This commit is contained in:
iko
2019-04-02 13:58:32 +03:00
committed by apn
parent 33defc7121
commit 84b904bc36
3 changed files with 21 additions and 1 deletions

View File

@@ -12002,6 +12002,7 @@ static int VManipulator (Draw_Interpretor& theDi,
aCmd.AddOption ("followDragging", "... {0|1} - set following dragging transform");
aCmd.AddOption ("gap", "... value - set gap between sub-parts");
aCmd.AddOption ("part", "... axis mode {0|1} - set visual part");
aCmd.AddOption ("parts", "... all axes mode {0|1} - set visual part");
aCmd.AddOption ("pos", "... x y z [nx ny nz [xx xy xz]] - set position of manipulator");
aCmd.AddOption ("size", "... size - set size of manipulator");
aCmd.AddOption ("zoomable", "... {0|1} - set zoom persistence");
@@ -12109,6 +12110,18 @@ static int VManipulator (Draw_Interpretor& theDi,
aManipulator->SetPart (anAxis, static_cast<AIS_ManipulatorMode> (aMode), aOnOff);
}
if (aCmd.HasOption("parts", 2, Standard_True))
{
Standard_Integer aMode = aCmd.ArgInt("parts", 0);
Standard_Boolean aOnOff = aCmd.ArgBool("parts", 1);
if (aMode < 1 || aMode > 4)
{
std::cerr << theArgVec[0] << " error: mode value should be in range [1, 4].\n";
return 1;
}
aManipulator->SetPart(static_cast<AIS_ManipulatorMode>(aMode), aOnOff);
}
if (aCmd.HasOption ("pos", 3, Standard_True))
{
gp_Pnt aLocation = aCmd.ArgPnt ("pos", 0);
@@ -13365,6 +13378,7 @@ void ViewerTest::ViewerCommands(Draw_Interpretor& theCommands)
"\n '-followDragging {0|1}' - set following dragging transform"
"\n '-gap value' - set gap between sub-parts"
"\n '-part axis mode {0|1}' - set visual part"
"\n '-parts axis mode {0|1}' - set visual part"
"\n '-pos x y z [nx ny nz [xx xy xz]' - set position of manipulator"
"\n '-size value' - set size of manipulator"
"\n '-zoomable {0|1}' - set zoom persistence",