An attempt to remove external objects, created by moving over the line/edges from another sketch.
//********************************************************************
bool ModuleBase_WidgetShapeSelector::storeAttributeValues(ObjectPtr theSelectedObject,
- GeomShapePtr theShape) const
+ GeomShapePtr theShape)
{
bool isChanged = false;
FeaturePtr aSelectedFeature = ModelAPI_Feature::feature(theSelectedObject);
myIsObject = aRefAttr->isObject();
myRefAttribute = aRefAttr->attr();
}
+ myExternalObject = NULL;
}
else {
storeAttributeValues(myObject, myShape);
if (!myIsObject)
aRefAttr->setAttr(myRefAttribute);
}
+ if (myExternalObject.get()) {
+ /*DocumentPtr aDoc = myExternalObject->document();
+ FeaturePtr aFeature = ModelAPI_Feature::feature(myExternalObject);
+ if (aFeature.get() != NULL) {
+ aDoc->removeFeature(aFeature);
+ }*/
+ }
}
}
/// the specific type and set the given values
/// \param theSelectedObject an object
/// \param theShape a selected shape, which is used in the selection attribute
- virtual bool storeAttributeValues(ObjectPtr theSelectedObject, GeomShapePtr theShape) const;
+ virtual bool storeAttributeValues(ObjectPtr theSelectedObject, GeomShapePtr theShape);
//----------- Class members -------------
protected:
AttributePtr myRefAttribute;
/// A boolean value whether refAttr uses reference of object
bool myIsObject;
+ /// An external object
+ ObjectPtr myExternalObject;
};
#endif
/// Set the given wrapped value to the current widget
/// This value should be processed in the widget according to the needs
+ /// The method is called by the current operation to process the operation preselection.
+ /// It is redefined to check the value validity and if it is, fill the attribute with by value
/// \param theValue the wrapped widget value
virtual bool setSelection(ModuleBase_ViewerPrs theValue);
#include <PartSet_Tools.h>
#include <SketchPlugin_Feature.h>
-bool PartSet_WidgetConstraintShapeSelector::storeAttributeValues(ObjectPtr theSelectedObject, GeomShapePtr theShape) const
+bool PartSet_WidgetConstraintShapeSelector::storeAttributeValues(ObjectPtr theSelectedObject, GeomShapePtr theShape)
{
ObjectPtr aSelectedObject = theSelectedObject;
aSelectedObject, mySketch);
if (aObj) {
aSelectedObject = aObj;
+ myExternalObject = aObj;
} else
return false;
}
/// the specific type and set the given values
/// \param theSelectedObject an object
/// \param theShape a selected shape, which is used in the selection attribute
- virtual bool storeAttributeValues(ObjectPtr theSelectedObject, GeomShapePtr theShape) const;
+ virtual bool storeAttributeValues(ObjectPtr theSelectedObject, GeomShapePtr theShape);
private:
/// Pointer to a sketch
#include <PartSet_Tools.h>
#include <SketchPlugin_Feature.h>
-bool PartSet_WidgetShapeSelector::storeAttributeValues(ObjectPtr theSelectedObject, GeomShapePtr theShape) const
+bool PartSet_WidgetShapeSelector::storeAttributeValues(ObjectPtr theSelectedObject, GeomShapePtr theShape)
{
ObjectPtr aSelectedObject = theSelectedObject;
GeomShapePtr aShape = theShape;
if (aObj) {
PartSet_WidgetShapeSelector* that = (PartSet_WidgetShapeSelector*) this;
aSelectedObject = aObj;
+ myExternalObject = aObj;
} else
return false;
} else {
/// the specific type and set the given values
/// \param theSelectedObject an object
/// \param theShape a selected shape, which is used in the selection attribute
- virtual bool storeAttributeValues(ObjectPtr theSelectedObject, GeomShapePtr theShape) const;
+ virtual bool storeAttributeValues(ObjectPtr theSelectedObject, GeomShapePtr theShape);
private:
/// Pointer to a sketch