1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-04 18:06:22 +03:00

0030942: Draw Harness, ViewerTest - command vdefaults should abort script on unknown argument

This commit is contained in:
kgv 2019-09-05 06:57:33 +03:00 committed by bugmaster
parent 7a74087601
commit 14c7f553a9
2 changed files with 11 additions and 18 deletions

View File

@ -10467,7 +10467,7 @@ static int VDefaults (Draw_Interpretor& theDi,
const Handle(AIS_InteractiveContext)& aCtx = ViewerTest::GetAISContext();
if (aCtx.IsNull())
{
std::cerr << "No active viewer!\n";
std::cout << "Error: no active viewer\n";
return 1;
}
@ -10536,27 +10536,20 @@ static int VDefaults (Draw_Interpretor& theDi,
|| anArg == "-AUTOTRIANG"
|| anArg == "-AUTOTRIANGULATION")
{
if (++anArgIter >= theArgsNb)
++anArgIter;
bool toTurnOn = true;
if (anArgIter >= theArgsNb
|| !ViewerTest::ParseOnOff (theArgVec[anArgIter], toTurnOn))
{
std::cout << "Error: wrong syntax at " << anArg << "\n";
std::cout << "Syntax error at '" << anArg << "'\n";
return 1;
}
TCollection_AsciiString aValue (theArgVec[anArgIter]);
aValue.LowerCase();
if (aValue == "on"
|| aValue == "1")
{
aDefParams->SetAutoTriangulation (Standard_True);
}
else if (aValue == "off"
|| aValue == "0")
{
aDefParams->SetAutoTriangulation (Standard_False);
}
aDefParams->SetAutoTriangulation (toTurnOn);
}
else
{
std::cerr << "Warning, unknown argument '" << anArg.ToCString() << "'\n";
std::cout << "Syntax error: unknown argument '" << anArg << "'\n";
return 1;
}
}

View File

@ -13,12 +13,12 @@ tclean s
incmesh s 0.001
trinfo s
vinit View1
vclear
vinit View1
vaxo
vcaps -vbo 0
vsetdispmode 1
vdefaults absDefl=1.0
vdefaults -absDefl 1.0
vselprops -autoactivate 0
set aMemInit [meminfo h]