Salome HOME
Copyright update 2022
[modules/shaper.git] / src / XGUI / XGUI_Workshop.h
old mode 100755 (executable)
new mode 100644 (file)
index 2955efa..35cca71
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  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
 //
 // 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<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #ifndef XGUI_WORKSHOP_H
@@ -25,6 +24,7 @@
 
 #include <ModelAPI_Document.h>
 #include <ModelAPI_Feature.h>
+#include <ModelAPI_ResultBody.h>
 
 #include <ModuleBase_ActionInfo.h>
 #include <ModuleBase_ActionType.h>
@@ -186,7 +186,7 @@ Q_OBJECT
   bool canMoveFeature();
 
   /// Move selected features to be after the current feature
-  void moveObjects();
+  void moveObjects(const bool theSplit);
 
   /// Returns true if the object can be shaded. If the object is a compsolid result, the method
   /// checks subobjects of the result
@@ -203,6 +203,11 @@ Q_OBJECT
   /// theObjects a list of selected objects
   void changeColor(const QObjectPtrList& theObjects);
 
+  /// Change Autocolor of the results if it is possible
+  /// The operation is available for group results
+  /// theObjects a list of selected objects
+  void changeAutoColor(const QObjectPtrList& theObjects);
+
   /// Change deflection of the results if it is possible
   /// The operation is available for construction, body and group results
   /// theObjects a list of selected objects
@@ -213,6 +218,10 @@ Q_OBJECT
   /// theObjects a list of selected objects
   void changeTransparency(const QObjectPtrList& theObjects);
 
+  /// Change number of iso-lines for the given objects
+  /// theObjects a list of selected objects
+  void changeIsoLines(const QObjectPtrList& theObjects);
+
   /// Show the given features in 3d Viewer
   void showObjects(const QObjectPtrList& theList, bool isVisible);
 
@@ -282,12 +291,12 @@ Q_OBJECT
   /// Has to be called in order to display objects from a specifed group
   /// with visibility status = true
   /// \param theDoc the document for objects synchronisation
-  /// \param theGroup the group name
   /// \param theUpdateViewer update viewer flag
   void synchronizeGroupInViewer(const DocumentPtr& theDoc,
-                                const std::string& theGroup,
                                 bool theUpdateViewer);
 
+  void synchronizeResultTree(const ResultBodyPtr& theRes, bool theUpdateViewer);
+
 #endif
   /// Update the property panel content by the XML description of the operation and set the panel
   /// into the operation
@@ -316,6 +325,9 @@ Q_OBJECT
   /// A constant string used for "Move to end" command definition
   /// It is used for specific processing of Undo/Redo for this command.
   static QString MOVE_TO_END_COMMAND;
+  /// A constant string used for "Move to end and split" command definition
+  /// It is used for specific processing of Undo/Redo for this command.
+  static QString MOVE_TO_END_SPLIT_COMMAND;
 
   /// Closes all in the current session and load the directory
   /// \param theDirectory a path to directory
@@ -323,6 +335,13 @@ Q_OBJECT
 
   void updateAutoComputeState();
 
+  void deactivateCurrentSelector();
+
+  /// The method updates a Color Scale object in the viewer
+  void updateColorScaleVisibility();
+
+  void showHelpPage(const QString& thePage) const;
+
 signals:
   /// Emitted when selection happens in Salome viewer
   void salomeViewerSelection();
@@ -390,6 +409,21 @@ signals:
   /// Create a new document
   void onNew();
 
+  /// Import part structure from a file
+  void onImportPart();
+
+  /// Import shape from a file
+  void onImportShape();
+
+  /// Import  image from a file
+  void onImportImage();
+
+  /// Export features to a file
+  void onExportPart();
+
+  /// Export a shape to a file
+  void onExportShape();
+
 #ifndef HAVE_SALOME
   /// Exit application
   void onExit();
@@ -407,14 +441,11 @@ signals:
   /// Apply the current transparency value if preview in transparency dialog is switched on
   void onTransparencyValueChanged();
 
-  /// Switch on/off preview of transparency change
-  void onPreviewStateChanged();
-
  protected:
   /// Sets the granted operations for the parameter operation. Firstly, it finds the nested features
   /// and set them into the operation. Secondly, it asks the module about ids of granted operations.
   /// \param theOperation an operation
-   void setGrantedFeatures(ModuleBase_Operation* theOperation);
+  void setGrantedFeatures(ModuleBase_Operation* theOperation);
 
 private:
   /// Display results from document
@@ -473,7 +504,10 @@ private:
   void onPreviewActionClicked();
 
   /// Called on help button clicked in the property panel.
-  void onHelpActionClicked();
+  void onHelpActionClicked() const;
+
+  //! The slot is called only once on resizing of Object Browser
+  void onDockSizeChanged();
 
  private:
   /// Init menu
@@ -497,7 +531,7 @@ private:
   void createDockWidgets();
 
   /// Extends undo/redo toolbutton's with history menu
-  /// \param theObject - in the OpenParts it is a QToolButton by itself,
+  /// \param theObject - in the CADBuilder 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
@@ -514,6 +548,10 @@ private:
   /// Clear content of temporary directory
   void clearTemporaryDir();
 
+  /// Set current point of view normal to selected planar face
+  /// \param toInvert invert the normal vector
+  void setNormalView(bool toInvert = false);
+
 private:
 #ifndef HAVE_SALOME
   AppElements_MainWindow* myMainWindow; ///< desktop window