+bool PartSet_WidgetSketchLabel::processSelection()
+{
+ std::shared_ptr<GeomAPI_Pln> aPlane = plane();
+ if (aPlane.get())
+ return false;
+
+ QList<ModuleBase_ViewerPrsPtr> aSelected = getFilteredSelected();
+
+ if (aSelected.empty())
+ return false;
+ ModuleBase_ViewerPrsPtr aPrs = aSelected.first();
+ bool aDone = setSelectionInternal(aSelected, false);
+ if (aDone) {
+ updateByPlaneSelected(aPrs);
+ updateObject(myFeature);
+ }
+
+ return aDone;
+}
+
+void PartSet_WidgetSketchLabel::onShowConstraint(bool theOn)
+{
+ QCheckBox* aSenderCheckBox = qobject_cast<QCheckBox*>(sender());
+
+ QMap<PartSet_Tools::ConstraintVisibleState, QCheckBox*>::const_iterator
+ anIt = myShowConstraints.begin(), aLast = myShowConstraints.end();
+
+ PartSet_Tools::ConstraintVisibleState aState = PartSet_Tools::Geometrical;
+ bool aFound = false;
+ for (; anIt != aLast && !aFound; anIt++) {
+ aFound = anIt.value() == aSenderCheckBox;
+ if (aFound)
+ aState = anIt.key();
+ }
+ if (aFound)
+ emit showConstraintToggled(aState, theOn);
+}
+
+void PartSet_WidgetSketchLabel::blockAttribute(const AttributePtr& theAttribute,
+ const bool& theToBlock, bool& isFlushesActived,
+ bool& isAttributeSetInitializedBlocked,
+ bool& isAttributeSendUpdatedBlocked)
+{
+ ModuleBase_WidgetValidated::blockAttribute(theAttribute, theToBlock, isFlushesActived,
+ isAttributeSetInitializedBlocked,
+ isAttributeSendUpdatedBlocked);
+ // We do not restore the previous state of isAttributeSetInitializedBlocked for each of
+ // attributes. It it is necessary, these states should be append to the method attributes
+ // or stored in the widget
+
+ std::list<AttributePtr> anAttributes = myFeature->data()->attributes("");
+ std::list<AttributePtr>::const_iterator anIt = anAttributes.begin(), aLast = anAttributes.end();
+ QStringList aValues;
+ for(; anIt != aLast; anIt++) {
+ AttributePtr anAttribute = *anIt;
+ if (theToBlock)
+ anAttribute->blockSetInitialized(true);
+ else
+ anAttribute->blockSetInitialized(isAttributeSetInitializedBlocked);
+ }
+}
+
+bool PartSet_WidgetSketchLabel::setSelectionInternal(
+ const QList<ModuleBase_ViewerPrsPtr>& theValues,
+ const bool theToValidate)