if (!aData->isValid())
return aShape;
- AttributeSelectionPtr aSelect = aData->selection(attributeID());
- if (aSelect)
- aShape = aSelect->value();
+ std::string aType = aData->attribute(attributeID())->attributeType();
+ if (aType == ModelAPI_AttributeReference::typeId()) {
+ } else if (aType == ModelAPI_AttributeRefAttr::typeId()) {
+ AttributeRefAttrPtr aRefAttr = aData->refattr(attributeID());
+ aShape = myWorkshop->module()->findShape(aRefAttr);
+ } else if (aType == ModelAPI_AttributeSelection::typeId()) {
+ AttributeSelectionPtr aSelectAttr = aData->selection(attributeID());
+ aShape = aSelectAttr->value();
+ }
return aShape;
}
#include <ModuleBase_Definitions.h>
#include <Config_WidgetAPI.h>
-#include <PartSet_Tools.h>
#include <PartSet_ExternalObjectsMgr.h>
#include <SketchPlugin_Feature.h>
-#include <SketchPlugin_ConstraintRigid.h>
-
#include <XGUI_Workshop.h>
#include <XGUI_ModuleConnector.h>
#include <XGUI_Displayer.h>
#include <XGUI_SelectionMgr.h>
#include <XGUI_Selection.h>
-#include <SelectMgr_IndexedMapOfOwner.hxx>
-#include <StdSelect_BRepOwner.hxx>
PartSet_WidgetShapeSelector::PartSet_WidgetShapeSelector(QWidget* theParent,
ModuleBase_IWorkshop* theWorkshop,
}
}
-//********************************************************************
-GeomShapePtr PartSet_WidgetShapeSelector::getShape() const
-{
- // an empty shape by default
- DataPtr aData = myFeature->data();
- AttributePtr anAttribute = aData->attribute(attributeID());
- GeomShapePtr aShape = PartSet_Tools::findShapeBy2DPoint(anAttribute, myWorkshop);
-
- if (!aShape.get())
- aShape = ModuleBase_WidgetShapeSelector::getShape();
- return aShape;
-}
-
//********************************************************************
void PartSet_WidgetShapeSelector::restoreAttributeValue(const bool theValid)
{
ObjectPtr& theObject,
GeomShapePtr& theShape);
- /// Get the shape from the attribute if the attribute contain a shape
- /// It processes the ref attr type of attributes. It obtains the referenced attribute,
- /// results of the attribute feature. And it founds a vertes in the owners of the results
- /// If the vertex is found, it creates a geom shape on it.
- /// \return a shape
- virtual GeomShapePtr getShape() const;
-
/// Creates a backup of the current values of the attribute
/// It should be realized in the specific widget because of different
/// parameters of the current attribute