void FeaturesAPI_Extrusion::setNestedSketch(const ModelHighAPI_Reference& theSketch)
{
mysketch->setValue(theSketch.feature());
+ // to inform that the history is updated due to the sketch moved under the composite feature
+ if (theSketch.feature().get())
+ theSketch.feature()->document()->updateHistory(ModelAPI_Feature::group());
mybaseObjects->clear();
mybaseObjects->append(theSketch.feature()->firstResult(), GeomShapePtr());
void FeaturesAPI_ExtrusionBoolean::setNestedSketch(const ModelHighAPI_Reference& theSketch)
{
mysketch->setValue(theSketch.feature());
+ // to inform that the history is updated due to the sketch moved under the composite feature
+ if (theSketch.feature().get())
+ theSketch.feature()->document()->updateHistory(ModelAPI_Feature::group());
mybaseObjects->clear();
mybaseObjects->append(theSketch.feature()->firstResult(), GeomShapePtr());
void FeaturesAPI_Revolution::setNestedSketch(const ModelHighAPI_Reference& theSketch)
{
mysketch->setValue(theSketch.feature());
+ // to inform that the history is updated due to the sketch moved under the composite feature
+ if (theSketch.feature().get())
+ theSketch.feature()->document()->updateHistory(ModelAPI_Feature::group());
mybaseObjects->clear();
mybaseObjects->append(theSketch.feature()->firstResult(), GeomShapePtr());
void FeaturesAPI_RevolutionBoolean::setNestedSketch(const ModelHighAPI_Reference& theSketch)
{
mysketch->setValue(theSketch.feature());
+ // to inform that the history is updated due to the sketch moved under the composite feature
+ if (theSketch.feature().get())
+ theSketch.feature()->document()->updateHistory(ModelAPI_Feature::group());
mybaseObjects->clear();
mybaseObjects->append(theSketch.feature()->firstResult(), GeomShapePtr());
virtual bool isLater(std::shared_ptr<ModelAPI_Feature> theLater,
std::shared_ptr<ModelAPI_Feature> theCurrent) const = 0;
+ //! Internally makes document know that feature was removed or added in history after creation
+ MODELAPI_EXPORT virtual void updateHistory(const std::string theGroup) = 0;
+
protected:
//! Only for SWIG wrapping it is here
MODELAPI_EXPORT ModelAPI_Document();
//! Internally makes document know that feature was removed or added in history after creation
MODELAPI_EXPORT virtual void updateHistory(const std::shared_ptr<ModelAPI_Object> theObject) = 0;
- //! Internally makes document know that feature was removed or added in history after creation
- MODELAPI_EXPORT virtual void updateHistory(const std::string theGroup) = 0;
friend class ModelAPI_Object; // to add or remove from the history
friend class ModelAPI_Result; // to add or remove from the history