Salome HOME
Merge branch 'Pre_2.8.0_development'
[modules/shaper.git] / src / Model / Model_Update.h
index c9fe39ab7178ee1e1f01d07e215b22eafd17b654..cef7c0b49c4484241fb791aa0b132bee4b7dacbc 100644 (file)
@@ -1,8 +1,22 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-// File:        Model_Update.hxx
-// Created:     25 Jun 2014
-// Author:      Mikhail PONIKAROV
+// 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<mailto:webmaster.salome@opencascade.com>
+//
 
 #ifndef Model_Update_H_
 #define Model_Update_H_
@@ -29,6 +43,11 @@ class Model_Update : public Events_Listener
   /// The second set is the objects that causes this object is modified
   std::map<std::shared_ptr<ModelAPI_Feature>, std::set<std::shared_ptr<ModelAPI_Feature> > >
     myModified;
+  /// Features which arguments were modified by not-persistent changes.
+  /// So, these referencing arguments must be updated
+  /// due to these features info also before execution).
+  std::map<std::shared_ptr<ModelAPI_Feature>, std::set<std::shared_ptr<ModelAPI_Feature> > >
+    myNotPersistentRefs;
   /// features that must be additionally processed after execution of finish operation
   std::set<std::shared_ptr<ModelAPI_Feature> > myWaitForFinish;
   /// to know that some parameter was changed during this operation (to enable update expressions)
@@ -41,6 +60,9 @@ class Model_Update : public Events_Listener
   std::set<std::shared_ptr<ModelAPI_Feature> > myProcessOnFinish;
   /// to avoid infinitive cycling: feature -> count of the processing periods during this update
   std::map<std::shared_ptr<ModelAPI_Feature>, int > myProcessed;
+  /// if preview in hte property panel is blocked and
+  /// any update is postponed until the end of operation
+  bool myIsPreviewBlocked;
 
  public:
   /// Is called only once, on startup of the application
@@ -66,12 +88,12 @@ protected:
   void updateArguments(std::shared_ptr<ModelAPI_Feature> theFeature);
 
   /// Sends the redisplay events for feature and results, updates the updated status
-  void redisplayWithResults(std::shared_ptr<ModelAPI_Feature> theFeature, 
+  void redisplayWithResults(std::shared_ptr<ModelAPI_Feature> theFeature,
     const ModelAPI_ExecState theState);
 
   /// On operation start/end/abort the "Just" fileds must be cleared and processed in the right way
-  /// \param theFinish is true for start, close or abort transaction: all objects must be processed
-  void processFeatures();
+  //! \param theFlushRedisplay a boolean value if the redisplay signal should be flushed
+  void processFeatures(const bool theFlushRedisplay = true);
 
   /// Performs the feature execution
   /// \returns the status of execution
@@ -80,9 +102,15 @@ protected:
   /// Updates the properties of object because of stability state changes
   void updateStability(void* theSender);
 
-  /// Returns true if theFeature modification was caused by theReason (may be feature of result of this feature)
+  /// Returns true if theFeature modification was caused by theReason
+  /// (may be feature of result of this feature)
   bool isReason(
     std::shared_ptr<ModelAPI_Feature>& theFeature, std::shared_ptr<ModelAPI_Object> theReason);
+
+  /// Updates a selection attributes for the features that possible were affected by creation
+  /// or reorder of features upper in the history line (issue #1757)
+  void updateSelection(const std::set<std::shared_ptr<ModelAPI_Object> >& theObjects);
+
 };
 
 #endif