- Quantity_Color aColor = ModuleBase_Tools::color("Visualization", "sketch_overconstraint_color");
- theColor.push_back(aColor.Red()*255.);
- theColor.push_back(aColor.Green()*255.);
- theColor.push_back(aColor.Blue()*255.);
+ if (myConflictingObjects.find(theObject) != myConflictingObjects.end()) {
+ Quantity_Color aColor = ModuleBase_Tools::color("Visualization",
+ "sketch_overconstraint_color");
+ theColor.push_back(aColor.Red()*255.);
+ theColor.push_back(aColor.Green()*255.);
+ theColor.push_back(aColor.Blue()*255.);
+ return true;
+ }
+ if (myIsFullyConstrained) {
+ FeaturePtr aFeature = ModelAPI_Feature::feature(theObject);
+ if (aFeature.get()) {
+ PartSet_Module* aModule = dynamic_cast<PartSet_Module*>(myWorkshop->module());
+ CompositeFeaturePtr aCompositeFeature = aModule->sketchMgr()->activeSketch();
+ // the given object is sub feature of the current sketch(created or edited)
+ if (ModelAPI_Tools::compositeOwner(aFeature) == aCompositeFeature) {
+ Quantity_Color aColor = ModuleBase_Tools::color("Visualization",
+ "sketch_fully_constrained_color");
+ theColor.push_back(aColor.Red()*255.);
+ theColor.push_back(aColor.Green()*255.);
+ theColor.push_back(aColor.Blue()*255.);
+ return true;
+ }
+ }
+ }
+ return false;