-// Copyright (C) 2014-2017 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2022 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "SketchPlugin_Feature.h"
return mySketch;
}
+void SketchPlugin_Feature::keepCurrentFeature()
+{
+ FeaturePtr aCurFeature = document()->currentFeature(true);
+ std::shared_ptr<SketchPlugin_Feature> aSketchFeature =
+ std::dynamic_pointer_cast<SketchPlugin_Feature>(aCurFeature);
+ std::shared_ptr<SketchPlugin_Sketch> aSketch =
+ std::dynamic_pointer_cast<SketchPlugin_Sketch>(aCurFeature);
+ if ((!aSketchFeature || aSketchFeature->sketch() != sketch()) &&
+ (!aSketch || aSketch.get() != sketch()))
+ myCurrentFeature = aCurFeature;
+}
+
+void SketchPlugin_Feature::restoreCurrentFeature()
+{
+ if (myCurrentFeature)
+ document()->setCurrentFeature(myCurrentFeature, true);
+ myCurrentFeature = FeaturePtr();
+}