X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_SketcherMgr.cpp;h=6e5a2d3850ca4651198483d0729182a70ee02be3;hb=c856f50b73f4a8ac6c13cc657f0b68cbcd5ae76f;hp=b1095873f46ead0e9b88b0e585019c5a97b8cdd7;hpb=daf31b7eb192ac4a1376c895a19a40fa35616d63;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_SketcherMgr.cpp b/src/PartSet/PartSet_SketcherMgr.cpp index b1095873f..6e5a2d385 100644 --- a/src/PartSet/PartSet_SketcherMgr.cpp +++ b/src/PartSet/PartSet_SketcherMgr.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2020 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 @@ -102,9 +102,8 @@ #include #include -//#include #include -#include +#include #include #include @@ -368,7 +367,7 @@ bool PartSet_SketcherMgr::isDragModeCreation() const // Acceptable features; QStringList aList; aList << "SketchLine" << "SketchMacroCircle" << "SketchMacroArc" << - "SketchMacroEllipse" << "SketchMacroEllipticArc" << "SketchRectangle"; + "SketchMacroEllipse" << "SketchMacroEllipticArc" << "SketchMacroRectangle"; return aList.contains(aId); } @@ -504,6 +503,10 @@ void PartSet_SketcherMgr::onMousePressed(ModuleBase_IViewWindow* theWnd, QMouseE myPreviousDrawModeEnabled = aViewer->enableDrawMode(false); if (isRelaunchEditing) launchEditing(); + else { + if (myCurrentSelection.size() > 1) + aFOperation->propertyPanel()->cleanContent(); + } myIsEditLaunching = aPrevLaunchingState; if (aFeature.get() != NULL) { std::shared_ptr aSketchFeature = @@ -1092,6 +1095,8 @@ void PartSet_SketcherMgr::startSketch(ModuleBase_Operation* theOperation) myCurrentSketch = std::dynamic_pointer_cast(aFOperation->feature()); double aSizeOfView = 0; std::shared_ptr aCentralPoint; + // Reset size of view from previous launches + mySketchPlane->setSizeOfView(aSizeOfView, false, aCentralPoint); if (aFOperation->isEditOperation() && mySketchPlane->getDefaultSizeOfView(myCurrentSketch, aSizeOfView, aCentralPoint)) { mySketchPlane->setSizeOfView(aSizeOfView, true, aCentralPoint); @@ -1130,7 +1135,7 @@ void PartSet_SketcherMgr::startSketch(ModuleBase_Operation* theOperation) for (; anIt != aLast; anIt++) { FeaturePtr aFeature = *anIt; if (aFeature.get()) - anInvalidFeatureNames.append(aFeature->name().c_str()); + anInvalidFeatureNames.append(QString::fromStdWString(aFeature->name())); } std::string aPrefixInfo = QString("Invalid features of the sketch will be deleted: %1.\n\n"). arg(anInvalidFeatureNames.join(", ")).toStdString().c_str(); @@ -1701,7 +1706,7 @@ bool PartSet_SketcherMgr::setDistanceValueByPreselection(ModuleBase_Operation* t anAISIO = anAIS->impl(); if (!anAISIO.IsNull()) { - Handle(AIS_Dimension) aDim = Handle(AIS_Dimension)::DownCast(anAISIO); + Handle(PrsDim_Dimension) aDim = Handle(PrsDim_Dimension)::DownCast(anAISIO); if (!aDim.IsNull()) { gp_Pnt aPosition = aDim->GetTextPosition(); @@ -2249,7 +2254,7 @@ bool isIncludeToResult(const ObjectPtr& theObject) for (aIt = aRefsToMe.cbegin(); aIt != aRefsToMe.cend(); ++aIt) { if ((*aIt)->id() == SketchPlugin_Projection::PROJECTED_FEATURE_ID()) { FeaturePtr aFeature = std::dynamic_pointer_cast((*aIt)->owner()); - if (aFeature.get()) { + if (aFeature.get() && !aFeature->isMacro()) { anAttr = aFeature->data()->boolean(SketchPlugin_Projection::INCLUDE_INTO_RESULT()); if (anAttr.get()) return anAttr->value(); @@ -2345,7 +2350,7 @@ void PartSet_SketcherMgr::customizeSketchPresentation(const ObjectPtr& theObject thePrs->setWidth(17); // thePrs->setPointMarker(1, 1.); // Set point as a '+' symbol } - if (isCopy(aFeature) && !isIncludeToResult(aFeature)) { + if (isCopy(aFeature) || !isIncludeToResult(aFeature)) { double aPrsWidth = thePrs->width(); thePrs->setWidth(aPrsWidth / 2.5); }