diff --git a/src/AIS/AIS_Manipulator.cxx b/src/AIS/AIS_Manipulator.cxx index 0692d19074..6413b1f7a7 100644 --- a/src/AIS/AIS_Manipulator.cxx +++ b/src/AIS/AIS_Manipulator.cxx @@ -297,7 +297,7 @@ void AIS_Manipulator::SetPart (const Standard_Integer theAxisIndex, const AIS_Ma //======================================================================= void AIS_Manipulator::SetPart (const AIS_ManipulatorMode theMode, const Standard_Boolean theIsEnabled) { - for (Standard_Integer anIt = 0; anIt < 4; ++anIt) + for (Standard_Integer anIt = 0; anIt < 3; ++anIt) { SetPart (anIt, theMode, theIsEnabled); } diff --git a/src/ViewerTest/ViewerTest_ViewerCommands.cxx b/src/ViewerTest/ViewerTest_ViewerCommands.cxx index f52df39bb8..08edc43825 100644 --- a/src/ViewerTest/ViewerTest_ViewerCommands.cxx +++ b/src/ViewerTest/ViewerTest_ViewerCommands.cxx @@ -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 (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(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", diff --git a/tests/v3d/manipulator/disable_parts b/tests/v3d/manipulator/disable_parts index def2450d3e..66e980f779 100644 --- a/tests/v3d/manipulator/disable_parts +++ b/tests/v3d/manipulator/disable_parts @@ -23,3 +23,9 @@ vmanipulator m -detach vmanipulator m -attach b -part 0 3 0 vdump $imagedir/${casename}_3.png +vmanipulator m -detach + +vmanipulator m -attach b -parts 1 0 +vdump $imagedir/${casename}_4.png + +set to_dump_screen 0