X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_Tools.cpp;h=3ef5b735f9fd6124b25fce78ca250a7aff826e6d;hb=e9f4528b0dab3feb440ad33f9da48bbb9b5979b1;hp=0d91654e57e91d2ebc2bfbff1bdc5115b4a96510;hpb=52efadfed323becb5367f41c4d49c0d6317d94c2;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_Tools.cpp b/src/PartSet/PartSet_Tools.cpp old mode 100755 new mode 100644 index 0d91654e5..3ef5b735f --- a/src/PartSet/PartSet_Tools.cpp +++ b/src/PartSet/PartSet_Tools.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// Copyright (C) 2014-2019 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 @@ -12,10 +12,9 @@ // // 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 +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include @@ -312,6 +311,17 @@ std::shared_ptr PartSet_Tools::sketchPlane(CompositeFeaturePtr theS return aPlane; } +void PartSet_Tools::nullifySketchPlane(CompositeFeaturePtr theSketch) +{ + std::shared_ptr anOrigin = std::dynamic_pointer_cast( + theSketch->data()->attribute(SketchPlugin_Sketch::ORIGIN_ID())); + std::shared_ptr aNormal = std::dynamic_pointer_cast( + theSketch->data()->attribute(SketchPlugin_Sketch::NORM_ID())); + + aNormal->reset(); + anOrigin->reset(); +} + std::shared_ptr PartSet_Tools::point3D(std::shared_ptr thePoint2D, CompositeFeaturePtr theSketch) { @@ -773,14 +783,10 @@ void PartSet_Tools::getFirstAndLastIndexInFolder(const ObjectPtr& theFolder, if (!aFirstFeatureInFolder.get()) return; - AttributeReferencePtr aLastFeatAttr = - aFolder->data()->reference(ModelAPI_Folder::LAST_FEATURE_ID()); - if (!aLastFeatAttr.get()) - return; - FeaturePtr aLastFeatureInFolder = ModelAPI_Feature::feature(aLastFeatAttr->value()); + FeaturePtr aLastFeatureInFolder = aFolder->lastVisibleFeature(); if (!aLastFeatureInFolder.get()) return; theFirst = aDoc->index(aFirstFeatureInFolder); theLast = aDoc->index(aLastFeatureInFolder); -} \ No newline at end of file +}