mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-21 10:13:43 +03:00
0030942: Draw Harness, ViewerTest - command vdefaults should abort script on unknown argument
This commit is contained in:
parent
7a74087601
commit
14c7f553a9
@ -10467,7 +10467,7 @@ static int VDefaults (Draw_Interpretor& theDi,
|
|||||||
const Handle(AIS_InteractiveContext)& aCtx = ViewerTest::GetAISContext();
|
const Handle(AIS_InteractiveContext)& aCtx = ViewerTest::GetAISContext();
|
||||||
if (aCtx.IsNull())
|
if (aCtx.IsNull())
|
||||||
{
|
{
|
||||||
std::cerr << "No active viewer!\n";
|
std::cout << "Error: no active viewer\n";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -10536,27 +10536,20 @@ static int VDefaults (Draw_Interpretor& theDi,
|
|||||||
|| anArg == "-AUTOTRIANG"
|
|| anArg == "-AUTOTRIANG"
|
||||||
|| anArg == "-AUTOTRIANGULATION")
|
|| 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;
|
return 1;
|
||||||
}
|
}
|
||||||
TCollection_AsciiString aValue (theArgVec[anArgIter]);
|
aDefParams->SetAutoTriangulation (toTurnOn);
|
||||||
aValue.LowerCase();
|
|
||||||
if (aValue == "on"
|
|
||||||
|| aValue == "1")
|
|
||||||
{
|
|
||||||
aDefParams->SetAutoTriangulation (Standard_True);
|
|
||||||
}
|
|
||||||
else if (aValue == "off"
|
|
||||||
|| aValue == "0")
|
|
||||||
{
|
|
||||||
aDefParams->SetAutoTriangulation (Standard_False);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::cerr << "Warning, unknown argument '" << anArg.ToCString() << "'\n";
|
std::cout << "Syntax error: unknown argument '" << anArg << "'\n";
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,12 +13,12 @@ tclean s
|
|||||||
incmesh s 0.001
|
incmesh s 0.001
|
||||||
trinfo s
|
trinfo s
|
||||||
|
|
||||||
vinit View1
|
|
||||||
vclear
|
vclear
|
||||||
|
vinit View1
|
||||||
vaxo
|
vaxo
|
||||||
vcaps -vbo 0
|
vcaps -vbo 0
|
||||||
vsetdispmode 1
|
vsetdispmode 1
|
||||||
vdefaults absDefl=1.0
|
vdefaults -absDefl 1.0
|
||||||
vselprops -autoactivate 0
|
vselprops -autoactivate 0
|
||||||
set aMemInit [meminfo h]
|
set aMemInit [meminfo h]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user