Salome HOME
The code comment
[modules/shaper.git] / src / XGUI / XGUI_Workshop.h
index a79b8e20970b8477fd6fafb4161d5f22d3820b7f..ff4a8708a336473849d6f8f4e0f2cdeb36e6103d 100644 (file)
@@ -164,7 +164,16 @@ Q_OBJECT
   void activatePart(std::shared_ptr<ModelAPI_ResultPart> theFeature);
 
   //! Delete features
-  void deleteObjects(const QObjectPtrList& theList);
+  void deleteObjects();
+
+  //! Returns true if there is at least one selected body/construction/group result
+  //! \return boolean value
+  bool canChangeColor() const;
+
+  //! Change color of the features if it is possible
+  //! The operation is available for construction, body and group results
+  //! theObjects a list of selected objects
+  void changeColor(const QObjectPtrList& theObjects);
 
   //! Show the given features in 3d Viewer
   void showObjects(const QObjectPtrList& theList, bool isVisible);
@@ -204,6 +213,19 @@ Q_OBJECT
    */
   bool isActiveOperationAborted();
 
+  //! Delete features. Delete the referenced features. There can be a question with a list of referenced
+  //! objects.
+  //! \param theList an objects to be deleted
+  //! \param theIgnoredFeatures a list of features to be ignored during delete
+  //! \param theParent a parent widget for the question message box
+  //! \param theAskAboutDeleteReferences if true, the message box with a list of references to the
+  //! objects features appear. If the user chose do not continue, the deletion is not performed
+  //! \return the success of the delete 
+  static bool deleteFeatures(const QObjectPtrList& theList,
+                             std::set<FeaturePtr> theIgnoredFeatures = std::set<FeaturePtr>(),
+                             QWidget* theParent = 0,
+                             const bool theAskAboutDeleteReferences = false);
+
 signals:
   /// Emitted when selection happens in Salome viewer
   void salomeViewerSelection();
@@ -217,7 +239,9 @@ signals:
   //! the application is started
   void applicationStarted();
 
+  //! Signal to update Undo history list
   void updateUndoHistory(const QList<ActionInfo>&);
+  //! Signal to update Redo history list
   void updateRedoHistory(const QList<ActionInfo>&);
 
  public slots:
@@ -351,9 +375,6 @@ signals:
   /// \param isChecked a state of toggle if the action is checkable
   void onContextMenuCommand(const QString& theId, bool isChecked);
 
-  /// Processing of values changed in model widget
-  void onWidgetValuesChanged();
-
   /// Set waiting cursor
   void onStartWaiting();
 
@@ -383,7 +404,20 @@ signals:
   void createDockWidgets();
 
   /// Displaus object and fit all viewer if the object is first (update viewer will not be called)
-  void displayObject(ObjectPtr theObj);
+  /// Asks the module whether the object can be displayed
+  /// \param theObj an object
+  /// \return true if the object is displayed
+  bool displayObject(ObjectPtr theObj);
+
+  //! Extends undo/redo toolbutton's with history menu
+  //! \param theObject - in the OpenParts it is a QToolButton by itself,
+  //! in salome mode - QAction that creates a button.
+  //! \param theSignal - void "updateUndoHistory" or "updateRedoHistory" SIGNAL;
+  //! \param theSlot - onUndo(int) or onRedo(int) SLOT
+  void addHistoryMenu(QObject* theObject, const char* theSignal, const char* theSlot);
+
+  //! Creates list of actions (commands) by given history list from session
+  QList<ActionInfo> processHistoryList(const std::list<std::string>&) const;
 
 private:
   AppElements_MainWindow* myMainWindow;