-ObjectPtr ModuleBase_WidgetShapeSelector::getObject(const AttributePtr& theAttribute)
-{
- ObjectPtr anObject;
- std::string anAttrType = theAttribute->attributeType();
- if (anAttrType == ModelAPI_AttributeRefAttr::type()) {
- AttributeRefAttrPtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
- if (anAttr != NULL && anAttr->isObject())
- anObject = anAttr->object();
- }
- if (anAttrType == ModelAPI_AttributeSelection::type()) {
- AttributeSelectionPtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(theAttribute);
- if (anAttr != NULL && anAttr->isInitialized())
- anObject = anAttr->context();
- }
- if (anAttrType == ModelAPI_AttributeReference::type()) {
- AttributeReferencePtr anAttr = std::dynamic_pointer_cast<ModelAPI_AttributeReference>(theAttribute);
- if (anAttr.get() != NULL && anAttr->isInitialized())
- anObject = anAttr->value();
- }
- return anObject;
-}
-
-