From 5b0181824b3e43792cd4487f6ba8fdf04f569bfc Mon Sep 17 00:00:00 2001 From: vsv Date: Wed, 11 Jul 2018 15:16:16 +0300 Subject: [PATCH] Issue #2566: Set color on attribute if color of presentation has to be not default --- src/PartSet/PartSet_Module.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index 329eb0bf5..bd06498f2 100755 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -71,6 +71,7 @@ #include #include #include +#include #include #include @@ -1218,6 +1219,11 @@ bool PartSet_Module::afterCustomisePresentation(std::shared_ptr // customize sketch dimension constraint presentation if (!aCustomized) { if (!aColor.empty()) { // otherwise presentation has the default color + AttributeIntArrayPtr aColorAttr = theResult->data()->intArray(ModelAPI_Result::COLOR_ID()); + aColorAttr->setSize(3); + // Set the color attribute in order do not use default colors in the perasentation object + for (int i = 0; i < 3; i++) + aColorAttr->setValue(i, aColor[i]); aCustomized = thePrs->setColor(aColor[0], aColor[1], aColor[2]); } } -- 2.39.2