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

0032725: Visualization - Graphic3d_Structure::SetDisplayPriority() should use public enumeration Graphic3d_DisplayPriority

Added new enumeration Graphic3d_DisplayPriority.
Graphic3d_Layer now defines a fixed-length array of priorities.
Properties Graphic3d_CStructure::Id, Priority, PreviousPriority have been wrapped into methods.
This commit is contained in:
kgv
2021-12-08 15:55:11 +03:00
committed by smoskvin
parent e3dae4a9f3
commit e463b2f685
39 changed files with 237 additions and 233 deletions

View File

@@ -6548,16 +6548,16 @@ static int VPriority (Draw_Interpretor& theDI,
}
TCollection_AsciiString aLastArg (theArgs[theArgNum - 1]);
Standard_Integer aPriority = -1;
Standard_Integer aPriority = Graphic3d_DisplayPriority_INVALID;
Standard_Integer aNbArgs = theArgNum;
if (aLastArg.IsIntegerValue())
{
aPriority = aLastArg.IntegerValue();
--aNbArgs;
if (aPriority < 0 || aPriority > 10)
if (aPriority < Graphic3d_DisplayPriority_Bottom || aPriority > Graphic3d_DisplayPriority_Topmost)
{
Message::SendFail() << "Syntax error: the specified display priority value '" << aLastArg
<< "' is outside the valid range [0..10]";
<< "' is outside the valid range [" << Graphic3d_DisplayPriority_Bottom << ".." << Graphic3d_DisplayPriority_Topmost << "]";
return 1;
}
}
@@ -6589,13 +6589,13 @@ static int VPriority (Draw_Interpretor& theDI,
return 1;
}
if (aPriority < 1)
if (aPriority == Graphic3d_DisplayPriority_INVALID)
{
theDI << aContext->DisplayPriority (anIObj) << " ";
}
else
{
aContext->SetDisplayPriority (anIObj, aPriority);
aContext->SetDisplayPriority (anIObj, (Graphic3d_DisplayPriority )aPriority);
}
}
return 0;