mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0028726: Quantity_NameOfColor should be replaced by Quantity_Color in function input argument
AIS_InteractiveObject, virtual methods ::SetColor(), ::Color() returning/accepting Quantity_NameOfColor have been removed. Virtual method ::SetMaterial() accepting Graphic3d_NameOfMaterial has been also removed. V3d_View, V3d_Viewer, V3d_AmbientLight, V3d_DirectionalLight, V3d_Light, V3d_PositionalLight, V3d_SpotLight, Aspect_Window, methods accepting Quantity_NameOfColor have been removed (duplicates) or color argument(s) replaced with Quantity_Color.
This commit is contained in:
@@ -386,8 +386,17 @@ void TPrsStd_AISPresentation::SetColor(const Quantity_NameOfColor theColor)
|
||||
{
|
||||
Backup();
|
||||
if ( getData()->HasOwnColor() && getData()->Color() == theColor )
|
||||
if ( !myAIS.IsNull() && myAIS->HasColor() && myAIS->Color() == theColor )
|
||||
return;
|
||||
{
|
||||
if (!myAIS.IsNull() && myAIS->HasColor())
|
||||
{
|
||||
Quantity_Color aColor;
|
||||
myAIS->Color (aColor);
|
||||
if (aColor.Name() == theColor)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
getData()->SetColor(theColor);
|
||||
|
||||
@@ -396,8 +405,15 @@ void TPrsStd_AISPresentation::SetColor(const Quantity_NameOfColor theColor)
|
||||
|
||||
if ( !myAIS.IsNull() )
|
||||
{
|
||||
if ( myAIS->HasColor() && myAIS->Color() == theColor )
|
||||
return; // AIS has already had that color
|
||||
if (myAIS->HasColor())
|
||||
{
|
||||
Quantity_Color aColor;
|
||||
myAIS->Color (aColor);
|
||||
if (aColor.Name() == theColor)
|
||||
{
|
||||
return; // AIS has already had that color
|
||||
}
|
||||
}
|
||||
|
||||
Handle(AIS_InteractiveContext) aContext = getAISContext();
|
||||
|
||||
@@ -801,7 +817,9 @@ void TPrsStd_AISPresentation::AISUpdate()
|
||||
if ( HasOwnColor() )
|
||||
{
|
||||
Quantity_NameOfColor aColor = Color();
|
||||
if ( !(myAIS->HasColor()) || (myAIS->HasColor() && myAIS->Color() != aColor) )
|
||||
Quantity_Color aPrsColor;
|
||||
myAIS->Color (aPrsColor);
|
||||
if ( !(myAIS->HasColor()) || (myAIS->HasColor() && aPrsColor.Name() != aColor) )
|
||||
{
|
||||
if ( !aContext.IsNull() )
|
||||
aContext->SetColor(myAIS, aColor, Standard_False);
|
||||
|
@@ -50,7 +50,12 @@ Standard_Boolean TPrsStd_ConstraintDriver::Update (const TDF_Label& aLabel,
|
||||
if (!anAISObject.IsNull() && anAISObject->HasInteractiveContext()) {
|
||||
if (!apConstraint->Verified()) {
|
||||
TPrsStd_ConstraintTools::UpdateOnlyValue(apConstraint,anAISObject);
|
||||
if (anAISObject->Color() != Quantity_NOC_RED) anAISObject->SetColor(Quantity_NOC_RED);
|
||||
Quantity_Color aColor;
|
||||
anAISObject->Color (aColor);
|
||||
if (aColor.Name() != Quantity_NOC_RED)
|
||||
{
|
||||
anAISObject->SetColor(Quantity_NOC_RED);
|
||||
}
|
||||
return Standard_True;
|
||||
}
|
||||
}
|
||||
@@ -180,16 +185,17 @@ Standard_Boolean TPrsStd_ConstraintDriver::Update (const TDF_Label& aLabel,
|
||||
}
|
||||
|
||||
if (anAISObject->HasInteractiveContext()) {
|
||||
Quantity_NameOfColor originColor = anAISObject->Color();
|
||||
Quantity_Color originColor;
|
||||
anAISObject->Color (originColor);
|
||||
if (!apConstraint->Verified()) {
|
||||
if (originColor != Quantity_NOC_RED)
|
||||
if (originColor.Name() != Quantity_NOC_RED)
|
||||
anAISObject->SetColor(Quantity_NOC_RED);
|
||||
}
|
||||
else if (apConstraint->IsDimension() && apConstraint->GetValue()->IsCaptured()) {
|
||||
if (originColor != Quantity_NOC_PURPLE)
|
||||
if (originColor.Name() != Quantity_NOC_PURPLE)
|
||||
anAISObject->SetColor(Quantity_NOC_PURPLE);
|
||||
}
|
||||
else if (!apConstraint->IsPlanar() && (originColor != Quantity_NOC_YELLOW))
|
||||
else if (!apConstraint->IsPlanar() && (originColor.Name() != Quantity_NOC_YELLOW))
|
||||
anAISObject->SetColor(Quantity_NOC_YELLOW);
|
||||
}
|
||||
else {
|
||||
|
Reference in New Issue
Block a user