It should be shown and filled with the parameters of the selected object.
The second regression: select a line, grab and try to drag any other object. The initially selected is moved as a result.
}
}
ObjectPtr aObject;
- if (!aSelected.empty()) {
+ /*if (!aSelected.empty()) {
aObject = aSelected.first().object();
} else {
if (!aHighlighted.empty())
aObject = aHighlighted.first().object();
+ }*/
+ // the priority to a highlighted object in order to edit it, even if the selected object is
+ // the feature of this operation. Otherwise, the highlighting is ignored and the selected
+ // object is moved
+ if (!aHighlighted.empty()) {
+ aObject = aHighlighted.front().object();
}
- //if (!theHighlighted.empty())
- // aObject = theHighlighted.front().object();
- //if (!aObject && !theSelected.empty()) // changed for a constrain
- // aObject = theSelected.front().object();
+ if (!aObject && !aSelected.empty()) // changed for a constrain
+ aObject = aSelected.front().object();
FeaturePtr aFeature = ModelAPI_Feature::feature(aObject);
if (!aFeature || aFeature != feature() || (aSelected.size() > 1)) {
//if (aHasShift && aSelected.size() > 0)
// return;
- if (aSelected.size() > 0) {
+ // there should be a start of operation, which uses the pre-highlighted objects,
+ // the selected ones are collected here and are processed by a mouse move
+ if (aHighlighted.size() == 1) {
+ //if (aSelected.size() > 0) {
ObjectPtr aFeature = aSelected.first().object();
if (aFeature) {
std::string anOperationType =
PartSet_OperationFeatureEditMulti::Type() : PartSet_OperationFeatureEdit::Type();
restartOperation(anOperationType, aFeature);
}
- } //else
+ }
+ else
+ myFeatures = aHighlighted;
+ //else
//myFeatures = aSelected;
}
QList<ModuleBase_ViewerPrs> XGUI_Selection::getHighlighted(int theShapeTypeToSkip) const
{
- std::set<ObjectPtr> aPrsFeatures;
+ //std::set<ObjectPtr> aPrsFeatures;
QList<ModuleBase_ViewerPrs> aPresentations;
XGUI_Displayer* aDisplayer = myWorkshop->displayer();
aPrs.setInteractive(anIO);
ObjectPtr aResult = aDisplayer->getObject(anIO);
- if (aPrsFeatures.find(aResult) == aPrsFeatures.end()) {
+ // we should not check the appearance of this feature because there can be some selected shapes
+ // for one feature
+ //if (aPrsFeatures.find(aResult) == aPrsFeatures.end()) {
aPrs.setFeature(aResult);
- aPrsFeatures.insert(aResult);
- }
+ //aPrsFeatures.insert(aResult);
+ //}
if (aContext->HasOpenedContext()) {
TopoDS_Shape aShape = aContext->DetectedShape();
if (!aShape.IsNull() && aShape.ShapeType() != theShapeTypeToSkip)