mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0022632: Visualization - provide logarithmic scale for Aspect_ColorScale class
Option "-logarithmic" is provided for draw command vcolorscale. It changes color scale's labels to logarithmic values due to the min and max range and the number of intervals of the color scale. New test case added. Fixed error when command vcolorscale was called without arguments.
This commit is contained in:
@@ -3448,6 +3448,11 @@ static int VColorScale (Draw_Interpretor& theDI,
|
||||
std::cout << "Error: no active view!\n";
|
||||
return 1;
|
||||
}
|
||||
if (theArgNb <= 1)
|
||||
{
|
||||
std::cout << "Error: wrong syntax at command '" << theArgVec[0] << "'!\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
Handle(AIS_ColorScale) aCS;
|
||||
// find object
|
||||
@@ -3488,11 +3493,6 @@ static int VColorScale (Draw_Interpretor& theDI,
|
||||
|
||||
ViewerTest_AutoUpdater anUpdateTool (aContext, aView);
|
||||
|
||||
if (theArgNb <= 1)
|
||||
{
|
||||
std::cout << "Error: wrong syntax at command '" << theArgVec[0] << "'!\n";
|
||||
return 1;
|
||||
}
|
||||
if (theArgNb <= 2)
|
||||
{
|
||||
theDI << "Color scale parameters for '"<< theArgVec[1] << "':\n"
|
||||
@@ -3609,6 +3609,22 @@ static int VColorScale (Draw_Interpretor& theDI,
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else if (aFlag == "-logarithmic"
|
||||
|| aFlag == "-log")
|
||||
{
|
||||
if (anArgIter + 1 >= theArgNb)
|
||||
{
|
||||
std::cout << "Error: wrong syntax at argument '" << anArg << "'!\n";
|
||||
return 1;
|
||||
}
|
||||
Standard_Boolean IsLog;
|
||||
if (!ViewerTest::ParseOnOff(theArgVec[++anArgIter], IsLog))
|
||||
{
|
||||
std::cout << "Error: wrong syntax at argument '" << anArg << "'!\n";
|
||||
return 1;
|
||||
}
|
||||
aCS->SetLogarithmic (IsLog);
|
||||
}
|
||||
else if (aFlag == "-xy")
|
||||
{
|
||||
if (anArgIter + 2 >= theArgNb)
|
||||
|
Reference in New Issue
Block a user