X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelAPI%2FModelAPI_ResultBody.cpp;h=0a291ae486bd13ed486ae86ba8558e60faeec8dd;hb=d5c7ad3c50f89a2ddc2de1866ffb7f09397f3be2;hp=22284d1ee6c0443a738c72d37d7b12cb148c67e5;hpb=bc80cc95e126484f9da128cd640ab245c6ac1ee6;p=modules%2Fshaper.git diff --git a/src/ModelAPI/ModelAPI_ResultBody.cpp b/src/ModelAPI/ModelAPI_ResultBody.cpp index 22284d1ee..0a291ae48 100644 --- a/src/ModelAPI/ModelAPI_ResultBody.cpp +++ b/src/ModelAPI/ModelAPI_ResultBody.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 "ModelAPI_ResultBody.h" @@ -67,6 +66,21 @@ void ModelAPI_ResultBody::storeGenerated(const GeomShapePtr& theFromShape, updateSubs(theToShape); } +void ModelAPI_ResultBody::storeGenerated( + const std::list& theFromShapes, const GeomShapePtr& theToShape, + const std::shared_ptr theMakeShape) +{ + myBuilder->storeGenerated(theFromShapes, theToShape, theMakeShape); + myConnect = ConnectionNotComputed; + + static Events_Loop* aLoop = Events_Loop::loop(); + static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY); + static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get(); + aECreator->sendUpdated(data()->owner(), aRedispEvent); + + updateSubs(theToShape, theFromShapes, theMakeShape, true); +} + void ModelAPI_ResultBody::storeModified(const GeomShapePtr& theOldShape, const GeomShapePtr& theNewShape, const bool theIsCleanStored) @@ -82,15 +96,24 @@ void ModelAPI_ResultBody::storeModified(const GeomShapePtr& theOldShape, updateSubs(theNewShape); } -GeomShapePtr ModelAPI_ResultBody::shape() +void ModelAPI_ResultBody::storeModified( + const std::list& theOldShapes, const GeomShapePtr& theNewShape, + const std::shared_ptr theMakeShape) { - return myBuilder->shape(); + myBuilder->storeModified(theOldShapes, theNewShape, theMakeShape); + myConnect = ConnectionNotComputed; + + static Events_Loop* aLoop = Events_Loop::loop(); + static Events_ID aRedispEvent = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY); + static const ModelAPI_EventCreator* aECreator = ModelAPI_EventCreator::get(); + aECreator->sendUpdated(data()->owner(), aRedispEvent); + + updateSubs(theNewShape, theOldShapes, theMakeShape, false); } -bool ModelAPI_ResultBody::generated(const GeomShapePtr& theNewShape, - const std::string& theName, const bool theCheckIsInResult) +GeomShapePtr ModelAPI_ResultBody::shape() { - return myBuilder->generated(theNewShape, theName, theCheckIsInResult); + return myBuilder->shape(); } void ModelAPI_ResultBody::generated(const GeomShapePtr& theOldShape, @@ -116,28 +139,7 @@ void ModelAPI_ResultBody::loadDeletedShapes(const GeomMakeShapePtr& theAlgo, myBuilder->loadDeletedShapes(theAlgo, theOldShape, theShapeTypeToExplore, theShapesToExclude); } -void ModelAPI_ResultBody::loadModifiedShapes(const GeomMakeShapePtr& theAlgo, - const GeomShapePtr& theOldShape, - const GeomAPI_Shape::ShapeType theShapeTypeToExplore, - const std::string& theName) -{ - myBuilder->loadModifiedShapes(theAlgo, theOldShape, theShapeTypeToExplore, theName); -} - -void ModelAPI_ResultBody::loadGeneratedShapes(const GeomMakeShapePtr& theAlgo, - const GeomShapePtr& theOldShape, - const GeomAPI_Shape::ShapeType theShapeTypeToExplore, - const std::string& theName) -{ - myBuilder->loadGeneratedShapes(theAlgo, theOldShape, theShapeTypeToExplore, theName); -} - -void ModelAPI_ResultBody::loadFirstLevel(GeomShapePtr theShape, - const std::string& theName) -{ - myBuilder->loadFirstLevel(theShape, theName); -} - +// LCOV_EXCL_START bool ModelAPI_ResultBody::isConnectedTopology() { if (myConnect == ConnectionNotComputed) { @@ -152,3 +154,4 @@ void ModelAPI_ResultBody::setDisplayed(const bool theDisplay) for (int i = 0; i < numberOfSubs(); i++) subResult(i)->setDisplayed(theDisplay); } +// LCOV_EXCL_STOP