X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_CustomPrs.cpp;h=10125e574301d1c8d8cb228a97bb071bd20721f2;hb=75708cdfd8653e625bfb7aee667a7bb31867f292;hp=171baa8465bb73e8b61291b7743a9eb0a7558db5;hpb=6b9d5077eb26984c647ebee5183b5ecbb298f827;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_CustomPrs.cpp b/src/XGUI/XGUI_CustomPrs.cpp index 171baa846..10125e574 100644 --- a/src/XGUI/XGUI_CustomPrs.cpp +++ b/src/XGUI/XGUI_CustomPrs.cpp @@ -30,7 +30,7 @@ void getColor(ResultPtr theResult, std::vector& theColor) } } -void getDefaultColor(ResultPtr theResult, AISObjectPtr thePrs, std::vector& theColor) +void getDefaultColor(ResultPtr theResult, std::vector& theColor) { theColor.clear(); // get default color from the preferences manager for the given result @@ -49,14 +49,19 @@ void getDefaultColor(ResultPtr theResult, AISObjectPtr thePrs, std::vector& } } +void XGUI_CustomPrs::getResultColor(ResultPtr theResult, std::vector& theColor) +{ + getColor(theResult, theColor); + if (theColor.empty()) + getDefaultColor(theResult, theColor); +} + bool XGUI_CustomPrs::customisePresentation(ResultPtr theResult, AISObjectPtr thePrs, std::shared_ptr theCustomPrs) { std::vector aColor; - getColor(theResult, aColor); - if (aColor.empty()) - getDefaultColor(theResult, thePrs, aColor); + getResultColor(theResult, aColor); SessionPtr aMgr = ModelAPI_Session::get(); if (aMgr->activeDocument() != theResult->document()) {