+ raisePanel();
+ }
+ updateSelectionName();
+ emit valuesChanged();
+}
+
+//********************************************************************
+//bool ModuleBase_WidgetShapeSelector::acceptObjectShape(const ObjectPtr theResult) const
+//{
+// ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(theResult);
+//
+// // Check that the shape of necessary type
+// std::shared_ptr<GeomAPI_Shape> aShapePtr = ModelAPI_Tools::shape(aResult);
+// if (!aShapePtr)
+// return false;
+// TopoDS_Shape aShape = aShapePtr->impl<TopoDS_Shape>();
+// if (aShape.IsNull())
+// return false;
+//
+// TopAbs_ShapeEnum aShapeType = aShape.ShapeType();
+// if (aShapeType == TopAbs_COMPOUND) {
+// foreach (QString aType,
+// myShapeTypes) {
+// TopExp_Explorer aEx(aShape, shapeType(aType));
+// if (aEx.More())
+// return true;
+// }
+// } else {
+// foreach (QString aType, myShapeTypes) {
+// if (shapeType(aType) == aShapeType)
+// return true;
+// }
+// }
+// return false;
+//}
+
+//********************************************************************
+bool ModuleBase_WidgetShapeSelector::acceptSubShape(std::shared_ptr<GeomAPI_Shape> theShape) const
+{
+ TopoDS_Shape aShape = theShape->impl<TopoDS_Shape>();
+ foreach (QString aType, myShapeTypes) {
+ if (aShape.ShapeType() == shapeType(aType))
+ return true;
+ }
+ return false;
+}
+
+//********************************************************************
+bool ModuleBase_WidgetShapeSelector::acceptObjectType(const ObjectPtr theObject) const
+{
+ // Definition of types is not obligatory. If types are not defined then
+ // it means that accepted any type
+ if (myObjectTypes.isEmpty())
+ return true;
+
+ foreach (QString aType, myObjectTypes) {
+ if (aType.toLower() == "construction") {
+ ResultConstructionPtr aConstr =
+ std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(theObject);
+ return (aConstr != NULL);
+ } // ToDo: Process other types of objects
+ }
+ // Object type is defined but not found
+ return false;
+}
+
+
+//********************************************************************
+void ModuleBase_WidgetShapeSelector::updateSelectionName()
+{
+ DataPtr aData = myFeature->data();
+ bool isNameUpdated = false;
+ if (aData.get() != NULL) {
+ AttributeSelectionPtr aSelect = aData->selection(attributeID());
+ if (aSelect) {
+ myTextLine->setText(QString::fromStdString(aSelect->namingName()));
+ isNameUpdated = true;
+ }
+ }
+ if (!isNameUpdated) {
+ if (mySelectedObject) {
+ std::string aName = mySelectedObject->data()->name();
+ myTextLine->setText(QString::fromStdString(aName));
+ } else {
+ if (myIsActive) {
+ myTextLine->setText("");