aDimAIS->DimensionAspect()->SetCommonColor(aColor);
}
Handle(AIS_InteractiveContext) aContext = anAIS->GetContext();
- aContext->SetColor(anAIS, aColor, false);
+ if (!aContext.IsNull())
+ aContext->SetColor(anAIS, aColor, false);
+ else
+ anAIS->SetColor(aColor);
}
double GeomAPI_AISObject::width()
aDimAIS->DimensionAspect()->SetCommonColor(aColor);
}
Handle(AIS_InteractiveContext) aContext = anAIS->GetContext();
- aContext->SetColor(anAIS, aColor, false);
+ if (!aContext.IsNull())
+ aContext->SetColor(anAIS, aColor, false);
+ else
+ anAIS->SetColor(aColor);
return true;
}
if (aDrawer->HasOwnWireAspect()) {
aLineAspect = aDrawer->WireAspect();
}
- Quantity_Color aCurrentColor;
- Aspect_TypeOfLine aCurrentType;
- Standard_Real aCurrentWidth;
- aLineAspect->Aspect()->Values(aCurrentColor, aCurrentType, aCurrentWidth);
- isChanged = aType != aCurrentType;
- if (isChanged) {
- aLineAspect->SetTypeOfLine(aType);
+ if (!aLineAspect.IsNull()) {
+ Handle(Graphic3d_AspectLine3d) aGraphicAspect = aLineAspect->Aspect();
+ Aspect_TypeOfLine aCurrentType = aGraphicAspect->Type();
+ isChanged = aType != aCurrentType;
+ if (isChanged) {
+ aLineAspect->SetTypeOfLine(aType);
+ }
}
}
return isChanged;