const CompositeFeaturePtr& theSketch,
const bool theTemporary);
+ /// Returns created external object or NULL
+ /// \return an object instance
+ ObjectPtr getExternalObjectValidated() const { return myExternalObjectValidated; }
+
// Removes the external presentation from the model
/// \param theSketch a current sketch
/// \param theFeature a current feature
//
#include "PartSet_SketcherReentrantMgr.h"
+#include "PartSet_ExternalObjectsMgr.h"
#include "PartSet_Module.h"
#include "PartSet_SketcherMgr.h"
#include "PartSet_WidgetPoint2d.h"
myClickedSketchPoint = PartSet_Tools::getPnt2d(theEvent, theWindow,
module()->sketchMgr()->activeSketch());
+ FeaturePtr anExternalCreatedFeature;
if (!aPreSelected.empty()) {
ModuleBase_ViewerPrsPtr aValue = aPreSelected.first();
module()->getGeomSelection(aValue, mySelectedObject, mySelectedAttribute);
if (aPointWidget) {
GeomShapePtr aShape;
aPointWidget->getGeomSelection_(aValue, mySelectedObject, aShape);
+ ObjectPtr anExternalObject = aPointWidget->getExternalObjectMgr()->getExternalObjectValidated();
+ // if external object has been created before staring new operation and is used as a parameter,
+ // it should be removed after the operation is restarted. (Circle feature, Projection)
+ if (anExternalObject.get())
+ anExternalCreatedFeature = ModelAPI_Feature::feature(anExternalObject);
}
}
restartOperation();
+ // remove created external feature
+ if (anExternalCreatedFeature.get()) {
+ QObjectPtrList anObjects;
+ anObjects.append(anExternalCreatedFeature);
+ workshop()->deleteFeatures(anObjects);
+ }
+
myClickedSketchPoint = std::shared_ptr<GeomAPI_Pnt2d>();
mySelectedObject = ObjectPtr();
mySelectedAttribute = AttributePtr();
std::shared_ptr<ModelAPI_Object>& theObject,
std::shared_ptr<GeomAPI_Shape>& theShape);
+ /// Return reference to external objects manager
+ /// \return manager instance
+ PartSet_ExternalObjectsMgr* getExternalObjectMgr() const { return myExternalObjectMgr; }
+
signals:
/// Signal about selection of an existing vertex from an object
void vertexSelected();