std::vector<int>& theColor)
{
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.);
+ theColor = Config_PropManager::color("Visualization", "sketch_overconstraint_color");
}
if (myIsFullyConstrained) {
FeaturePtr aFeature = ModelAPI_Feature::feature(theObject);
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()*0.);
- theColor.push_back(aColor.Green()*255.);
- theColor.push_back(aColor.Blue()*0.);
- }
+ if (ModelAPI_Tools::compositeOwner(aFeature) == aCompositeFeature)
+ theColor = Config_PropManager::color("Visualization", "sketch_fully_constrained_color");
}
}
}
std::shared_ptr<ModuleBase_ViewerPrs> aSelectedPrs;
if (!aPreSelected.empty())
aSelectedPrs = aPreSelected.front();
+ if (!aSelectedPrs.get() && aSelectedPrs->object().get()
+ && !aSelectedPrs->object()->data()->isValid()) {
+ // the selected object was removed diring restart, e.g. presentable macro feature
+ // there are created objects to replace the object depending on created feature kind
+ aSelectedPrs = generatePreSelection();
+ }
aMouseProcessor->setPreSelection(aSelectedPrs, theWnd, theEvent);
//aPoint2DWdg->mouseReleased(theWnd, theEvent);
//if (!aPreSelected.empty())
ModuleBase_Tools::blockUpdateViewer(false);
}
}
-
return aProcessed;
}
if (!myIsFlagsBlocked) // we need to collect objects only when launch operation is called
return;
+ FeaturePtr aCurrentFeature;
+ ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
+ (myWorkshop->currentOperation());
+ if (aFOperation)
+ aCurrentFeature = aFOperation->feature();
+
+
for (std::set<ObjectPtr>::const_iterator anIt = theObjects.begin();
anIt != theObjects.end(); ++anIt) {
FeaturePtr aFeature = ModelAPI_Feature::feature(*anIt);
- if (myCreatedFeatures.find(aFeature) != myCreatedFeatures.end())
+ if (aFeature == aCurrentFeature)
+ continue;
+ if (myCreatedFeatures.find(aFeature) == myCreatedFeatures.end())
myCreatedFeatures.insert(aFeature);
}
}
return aTangentArc;
}
+std::shared_ptr<ModuleBase_ViewerPrs> PartSet_SketcherReentrantMgr::generatePreSelection()
+{
+ std::shared_ptr<ModuleBase_ViewerPrs> aPrs;
+
+ return aPrs;
+}
+
void PartSet_SketcherReentrantMgr::updateAcceptAllAction()
{
CompositeFeaturePtr aSketch = module()->sketchMgr()->activeSketch();
class XGUI_Workshop;
class PartSet_Module;
+class ModuleBase_ViewerPrs;
/// \ingroup PartSet_SketcherReentrantMgr
/// It provides reentrant create operations in sketch, that is when all inputs are valid,
bool isTangentArc(ModuleBase_Operation* theOperation,
const std::shared_ptr<ModelAPI_CompositeFeature>& /*theSketch*/) const;
+ /// Creates selection instance by the current feature and created by restart objects
+ /// \returns viewer selection presentation
+ std::shared_ptr<ModuleBase_ViewerPrs> generatePreSelection();
+
/// Accept All action is enabled if an internal edit is started.
/// It updates the state of the button
void updateAcceptAllAction();
if (theSelectedPrs.get() && theSelectedPrs->object().get())
anObject = theSelectedPrs->object();
+ if (!anObject.get())
+ return aFilled;
+
gp_Pnt aPnt = PartSet_Tools::convertClickToPoint(theEvent->pos(), theWindow->v3dView());
double aX, anY;
Handle(V3d_View) aView = theWindow->v3dView();
#define SKETCH_EXTERNAL_COLOR "170,0,225"
#define SKETCH_AUXILIARY_COLOR "0,85,0"
#define SKETCH_OVERCONSTRAINT_COLOR "0,0,0"
-#define SKETCH_FULLY_CONSTRAINED_COLOR "150,150,150"
+#define SKETCH_FULLY_CONSTRAINED_COLOR "0,150,0"
//#define SET_PLANES_COLOR_IN_PREFERENCES