X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_Module.cpp;h=4382fca68cb83d42f93e640f775004b734061e97;hb=787e0f26ba0c38ea246c0757cbb1ea244f494185;hp=edd895a4089d50860f52b487be3509433a71a010;hpb=f68074b0f3e013e10a9d06016ceac84827a5cdc2;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index edd895a40..4382fca68 100755 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -1014,36 +1014,11 @@ bool PartSet_Module::customisePresentation(ResultPtr theResult, AISObjectPtr the if (!anObject) return aCustomized; - std::vector aColor; - //bool aCustomColor = myOverconstraintListener->hasCustomColor(anObject, aColor); - if (!theResult.get()) { - /*// customize sketch symbol presentation - if (thePrs.get()) { - Handle(AIS_InteractiveObject) anAISIO = thePrs->impl(); - if (!anAISIO.IsNull()) { - if (!Handle(SketcherPrs_SymbolPrs)::DownCast(anAISIO).IsNull()) { - Handle(SketcherPrs_SymbolPrs) aPrs = Handle(SketcherPrs_SymbolPrs)::DownCast(anAISIO); - if (!aPrs.IsNull()) { - aPrs->SetCustomColor(aColor); - aCustomized = true; - } - } else if (!Handle(SketcherPrs_Coincident)::DownCast(anAISIO).IsNull()) { - Handle(SketcherPrs_Coincident) aPrs = Handle(SketcherPrs_Coincident)::DownCast(anAISIO); - if (!aPrs.IsNull()) { - aPrs->SetCustomColor(aColor); - aCustomized = true; - } - } - } - }*/ - // customize sketch dimension constraint presentation - //if (!aCustomized) { - // if (!aCustomColor) + std::vector aColor; XGUI_CustomPrs::getDefaultColor(anObject, true, aColor); if (!aColor.empty()) { aCustomized = thePrs->setColor(aColor[0], aColor[1], aColor[2]); - // } } } // customize dimentional constrains @@ -1065,47 +1040,32 @@ bool PartSet_Module::afterCustomisePresentation(std::shared_ptr return aCustomized; std::vector aColor; - bool aCustomColorChanged = myOverconstraintListener->isNeedUpdateCustomColor(); - if (aCustomColorChanged) { - bool aUseCustomColor = true; - // do not use fully constrained color if create operation is started - /*if (aWorkshop->operationMgr()->hasOperation()) { - ModuleBase_OperationFeature* aFOperation = dynamic_cast - (aWorkshop->operationMgr()->currentOperation()); - if (aFOperation && !aFOperation->isEditOperation()) - aUseCustomColor = false; - }*/ - if (aUseCustomColor) - myOverconstraintListener->getCustomColor(anObject, aColor); - //if (!theResult.get()) { - // customize sketch symbol presentation - //if (thePrs.get()) { - Handle(AIS_InteractiveObject) anAISIO = thePrs->impl(); - if (!anAISIO.IsNull()) { - if (!Handle(SketcherPrs_SymbolPrs)::DownCast(anAISIO).IsNull()) { - Handle(SketcherPrs_SymbolPrs) aPrs = Handle(SketcherPrs_SymbolPrs)::DownCast(anAISIO); - if (!aPrs.IsNull()) { - aPrs->SetCustomColor(aColor); - aCustomized = true; - } - } else if (!Handle(SketcherPrs_Coincident)::DownCast(anAISIO).IsNull()) { - Handle(SketcherPrs_Coincident) aPrs = Handle(SketcherPrs_Coincident)::DownCast(anAISIO); - if (!aPrs.IsNull()) { - aPrs->SetCustomColor(aColor); - aCustomized = true; - } - } + bool aUseCustomColor = true; + if (aUseCustomColor) + myOverconstraintListener->getCustomColor(anObject, aColor); + // customize sketch symbol presentation + Handle(AIS_InteractiveObject) anAISIO = thePrs->impl(); + if (!anAISIO.IsNull()) { + if (!Handle(SketcherPrs_SymbolPrs)::DownCast(anAISIO).IsNull()) { + Handle(SketcherPrs_SymbolPrs) aPrs = Handle(SketcherPrs_SymbolPrs)::DownCast(anAISIO); + if (!aPrs.IsNull()) { + aPrs->SetCustomColor(aColor); + aCustomized = true; } - //} - // customize sketch dimension constraint presentation - if (!aCustomized) { - //if (!aCustomColor) - // XGUI_CustomPrs::getDefaultColor(anObject, true, aColor); - if (!aColor.empty()) { // otherwise presentation has the default color - aCustomized = thePrs->setColor(aColor[0], aColor[1], aColor[2]); + } else if (!Handle(SketcherPrs_Coincident)::DownCast(anAISIO).IsNull()) { + Handle(SketcherPrs_Coincident) aPrs = Handle(SketcherPrs_Coincident)::DownCast(anAISIO); + if (!aPrs.IsNull()) { + aPrs->SetCustomColor(aColor); + aCustomized = true; } } } + // customize sketch dimension constraint presentation + if (!aCustomized) { + if (!aColor.empty()) { // otherwise presentation has the default color + aCustomized = thePrs->setColor(aColor[0], aColor[1], aColor[2]); + } + } return aCustomized; }