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

0027573: AIS_ColorScale::FindColor does not take into account custom colors

Modified AIS_ColorScale::FindColor (Standard_Real, Quantity_Color&) to take into account custom colors
This commit is contained in:
aba
2016-08-02 14:48:45 +03:00
committed by bugmaster
parent 8cea17de84
commit d5514578e8
4 changed files with 109 additions and 2 deletions

View File

@@ -3986,6 +3986,27 @@ static int VColorScale (Draw_Interpretor& theDI,
aCS->SetColorType (Aspect_TOCSD_AUTO);
aCS->SetLabelType (Aspect_TOCSD_AUTO);
}
else if (aFlag == "-findcolor")
{
if (anArgIter + 1 >= theArgNb)
{
std::cout << "Error: wrong syntax at argument '" << anArg << "'!\n";
return 1;
}
TCollection_AsciiString anArg1 (theArgVec[++anArgIter]);
if (!anArg1.IsRealValue())
{
std::cout << "Error: the value should be real!\n";
return 1;
}
Quantity_Color aColor;
aCS->FindColor (anArg1.RealValue(), aColor);
theDI << Quantity_Color::StringName (aColor.Name());
return 0;
}
else
{
std::cout << "Error: wrong syntax at " << anArg << " - unknown argument!\n";