label="Main objects"
icon=":icons/cut_shape.png"
tooltip="Select a solid objects"
- type_choice="Compounds Solids"
+ type_choice="Objects Solids"
use_choice="false"
concealment="true">
<validator id="GeomValidators_PartSet"/>
label="Select a solid objects"
icon=":icons/cut_shape.png"
tooltip="Select a solid objects"
- type_choice="Solids"
+ type_choice="Objects Solids"
concealment="true" >
+ <validator id="GeomValidators_PartSet"/>
</multi_selector>
<shape_selector id="placement_start_face"
label="Select an object"
label="Main objects"
icon=":icons/cut_shape.png"
tooltip="Select a solid objects"
- type_choice="Solids"
+ type_choice="Objects Solids"
concealment="true">
+ <validator id="GeomValidators_PartSet"/>
</multi_selector>
<shape_selector id="axis_object"
icon=":icons/axis.png"
bool aValid = false;
SessionPtr aMgr = ModelAPI_Session::get();
bool isPartSetDocument = aMgr->activeDocument() == aMgr->moduleDocument();
-
- if (theAttribute->attributeType() == ModelAPI_AttributeSelectionList::typeId()) {
- AttributeSelectionListPtr aSelectionListAttr =
- std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
- // all context objects should be sketch entities
- for (int i = 0, aSize = aSelectionListAttr->size(); i < aSize; i++) {
- AttributeSelectionPtr aSelectAttr = aSelectionListAttr->value(i);
-
- GeomShapePtr aShape = aSelectAttr->value();
- if (!aShape.get()) {
- ResultPtr aResult = aSelectAttr->context();
- if (aResult.get())
- aShape = aResult->shape();
- }
- TopoDS_Shape aTopoShape = aShape->impl<TopoDS_Shape>();
- TopAbs_ShapeEnum aShapeType = aTopoShape.ShapeType();
-
- if (isPartSetDocument)
- aValid = aShapeType == TopAbs_COMPOUND;
- else {
- TopoDS_Shape aTopoShape = aShape->impl<TopoDS_Shape>();
- aShapeType = GeomValidators_Tools::getCompoundSubType(aTopoShape);
-
- aValid = aShapeType == TopAbs_SOLID;
+ if (!isPartSetDocument)
+ aValid = true;
+ else {
+ // only hole objects should be selected in PartSet document, there is no decomposition
+ if (theAttribute->attributeType() == ModelAPI_AttributeSelectionList::typeId()) {
+ AttributeSelectionListPtr aSelectionListAttr =
+ std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
+ for (int i = 0, aSize = aSelectionListAttr->size(); i < aSize; i++) {
+ AttributeSelectionPtr aSelectAttr = aSelectionListAttr->value(i);
+ GeomShapePtr aShape = aSelectAttr->value();
+ aValid = !aShape.get();
}
}
}
MyShapeTypes["shell"] = TopAbs_SHELL;
MyShapeTypes["solid"] = TopAbs_SOLID;
MyShapeTypes["solids"] = TopAbs_SOLID;
- MyShapeTypes["compounds"] = TopAbs_COMPOUND;
+ MyShapeTypes["objects"] = TopAbs_SHAPE;
}
QString aType = theType.toLower();
if (MyShapeTypes.contains(aType))
// redisplayed before this update, the feature presentation jumps from reset value to current.
myIsMouseOverWindow = true;
myIsResetCurrentValue = false;
- operationMgr()->onValidateOperation();
+ // it is important to validate operation here only if sketch entity create operation is active
+ // because at this operation we reacts to the mouse leave/enter view port
+ //operationMgr()->onValidateOperation();
#ifdef DEBUG_MOUSE_OVER_WINDOW_FLAGS
qDebug(QString("onEnterViewPort: %1").arg(mouseOverWindowFlagsInfo()).toStdString().c_str());
#endif
if (!isNestedCreateOperation(getCurrentOperation()))
return;
+ operationMgr()->onValidateOperation();
+
// we need change displayed state of the current operation feature
// if the feature is presentable, e.g. distance construction. It has no results, so workshop does
// not accept a signal about the result created. Nothing is shown until mouse is moved out/in view
// Convert shape types to selection types
QIntList aModes;
foreach(int aType, theModes) {
- if (aType > TopAbs_SHAPE)
+ if (aType >= TopAbs_SHAPE)
aModes.append(aType);
else
aModes.append(AIS_Shape::SelectionMode((TopAbs_ShapeEnum)aType));