X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_WidgetPoint2d.cpp;h=37d9fb01599b1bef5cfcb10f85d3e9520247a064;hb=26a7489eb80cc314d2719eb88c243affff2d7428;hp=f099f04a309c099dc65dc3a6afd1c3d0c439e0e7;hpb=da6240e298b73b4bc534fc6bcbfca5cbed0389d0;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_WidgetPoint2d.cpp b/src/PartSet/PartSet_WidgetPoint2d.cpp index f099f04a3..37d9fb015 100644 --- a/src/PartSet/PartSet_WidgetPoint2d.cpp +++ b/src/PartSet/PartSet_WidgetPoint2d.cpp @@ -1,8 +1,22 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -// File: PartSet_WidgetPoint2D.cpp -// Created: 25 Apr 2014 -// Author: Natalia ERMOLAEVA +// Copyright (C) 2014-2017 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 +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// 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 +// +// See http://www.salome-platform.org/ or +// email : webmaster.salome@opencascade.com +// #include "PartSet_WidgetPoint2d.h" #include @@ -344,14 +358,24 @@ bool PartSet_WidgetPoint2D::storeValueCustom() // myYSpin->hasVariable() ? myYSpin->text().toStdString() : ""); //aPoint->setValue(!myXSpin->hasVariable() ? myXSpin->value() : aPoint->x(), // !myYSpin->hasVariable() ? myYSpin->value() : aPoint->y()); - aPoint->setValue(myXSpin->value(), myYSpin->value()); - - // after movement the solver will call the update event: optimization -#ifndef SUPPORT_NEW_MOVE - moveObject(myFeature); -#else - updateObject(myFeature); -#endif + + if (myFeature->isMacro()) { + // Moving points of macro-features has been processed directly (without solver) + aPoint->setValue(myXSpin->value(), myYSpin->value()); + updateObject(myFeature); + + } else { + if (!aPoint->isInitialized()) + aPoint->setValue(0., 0.); + + std::shared_ptr aMessage( + new ModelAPI_ObjectMovedMessage(this)); + aMessage->setMovedAttribute(aPoint); + aMessage->setOriginalPosition(aPoint->pnt()); + aMessage->setCurrentPosition(myXSpin->value(), myYSpin->value()); + Events_Loop::loop()->send(aMessage); + } + aPoint->setImmutable(isImmutable); that->blockSignals(isBlocked); @@ -594,7 +618,11 @@ void PartSet_WidgetPoint2D::mouseReleased(ModuleBase_IViewWindow* theWindow, QMo else { anExternal = true; if (!aFixedObject.get()) - aFixedObject = PartSet_Tools::createFixedObjectByExternal(aShape, aObject, mySketch); + { + FeaturePtr aCreatedFeature; + aFixedObject = PartSet_Tools::createFixedObjectByExternal(aGeomShape, aObject, mySketch, + false, aCreatedFeature); + } } } if (anExternal) { @@ -873,10 +901,13 @@ bool PartSet_WidgetPoint2D::isOrphanPoint(const FeaturePtr& theFeature, if (aCoincidence.get()) { QList aCoinsideLines; QList aCoins; + QList anIsAttributes; PartSet_Tools::findCoincidences(aCoincidence, aCoinsideLines, aCoins, - SketchPlugin_ConstraintCoincidence::ENTITY_A()); + SketchPlugin_ConstraintCoincidence::ENTITY_A(), + anIsAttributes); PartSet_Tools::findCoincidences(aCoincidence, aCoinsideLines, aCoins, - SketchPlugin_ConstraintCoincidence::ENTITY_B()); + SketchPlugin_ConstraintCoincidence::ENTITY_B(), + anIsAttributes); QList::const_iterator anIt = aCoinsideLines.begin(), aLast = aCoinsideLines.end(); for (; anIt != aLast && anOrphanPoint; anIt++) {