#include <ModelAPI_ResultBody.h>
#include <ModelAPI_AttributeString.h>
#include <ModelAPI_AttributeSelectionList.h>
+#include <ModelAPI_Tools.h>
#include <GeomDataAPI_Point2D.h>
#include <GeomDataAPI_Point.h>
#include <SketchPlugin_ConstraintRadius.h>
#include <SketcherPrs_SymbolPrs.h>
+#include <SketcherPrs_Coincident.h>
#include <SketcherPrs_Tools.h>
#include <Events_Loop.h>
// the objects of the current operation should be deactivated
QObjectPtrList anObjects;
anObjects.append(aFeature);
- std::list<ResultPtr> aResults = aFeature->results();
+ std::list<ResultPtr> aResults;
+ ModelAPI_Tools::allResults(aFeature, aResults);
std::list<ResultPtr>::const_iterator aIt;
for (aIt = aResults.begin(); aIt != aResults.end(); ++aIt) {
anObjects.append(*aIt);
if (theActionId == "MOVE_CMD") {
FeaturePtr aFeature = ModelAPI_Feature::feature(theObject);
if (aFeature) {
+ ResultPtr aResult = ModuleBase_Tools::firstResult(aFeature);
// part features can not be moved in the history.
- if (aFeature->getKind() == PartSetPlugin_Part::ID())
+ if (aResult.get() && aResult->groupName() == ModelAPI_ResultPart::group())
aValid = false;
}
}
void PartSet_Module::onFeatureTriggered()
{
- QAction* aCmd = dynamic_cast<QAction*>(sender());
+ // is commented for imp: Unpressing the button of the current action must behave like
+ // a validation if the entity can be created (instead of Cancel, as currently)
+ /*QAction* aCmd = dynamic_cast<QAction*>(sender());
if (aCmd->isCheckable() && aCmd->isChecked()) {
// 1. check whether the delete should be processed in the module
ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
launchOperation(aCmd->data().toString());
}
}
- }
+ }*/
ModuleBase_IModule::onFeatureTriggered();
}
{
bool aCustomized = false;
- if (theResult.get())
- return aCustomized;
-
XGUI_Workshop* aWorkshop = getWorkshop();
XGUI_Displayer* aDisplayer = aWorkshop->displayer();
ObjectPtr anObject = aDisplayer->getObject(thePrs);
- if (anObject.get()) {
+ if (!anObject)
+ return aCustomized;
+
+ if (!theResult.get()) {
bool isConflicting = myOverconstraintListener->isConflictingObject(anObject);
// customize sketch symbol presentation
if (thePrs.get()) {
aPrs->SetConflictingConstraint(isConflicting, aColor);
aCustomized = true;
}
+ } else if (!Handle(SketcherPrs_Coincident)::DownCast(anAISIO).IsNull()) {
+ Handle(SketcherPrs_Coincident) aPrs = Handle(SketcherPrs_Coincident)::DownCast(anAISIO);
+ if (!aPrs.IsNull()) {
+ std::vector<int> aColor;
+ myOverconstraintListener->getConflictingColor(aColor);
+ aPrs->SetConflictingConstraint(isConflicting, aColor);
+ aCustomized = true;
+ }
}
}
}
aCustomized = thePrs->setColor(aColor[0], aColor[1], aColor[2]);
}
}
-
- // customize dimentional constrains
- sketchMgr()->customizePresentation(anObject);
}
+ // customize dimentional constrains
+ sketchMgr()->customizePresentation(anObject);
return aCustomized;
}