Salome HOME
Merge branch 'Dev_1.2.0' of newgeom:newgeom into Dev_1.2.0
[modules/shaper.git] / src / XGUI / XGUI_Displayer.h
index d0153925ad2cca11b0725bc8c61588ae5575a19f..cf35c008302d2284daa9baae23e467d37da95e93 100644 (file)
@@ -27,6 +27,7 @@
 #include <QString>
 #include <QMap>
 #include <QObject>
+#include <QColor>
 
 class ModelAPI_Feature;
 class XGUI_Workshop;
@@ -71,12 +72,20 @@ class XGUI_EXPORT XGUI_Displayer: public QObject
   /// \param isUpdate the parameter whether the viewer should be update immediatelly
   void displayAIS(AISObjectPtr theAIS, bool isUpdate = true);
 
+  /** Redisplay the shape if it was displayed
+   * \param theObject an object instance
+   * \param isUpdateViewer the parameter whether the viewer should be update immediatelly
+   */
+  void redisplay(ObjectPtr theObject, bool isUpdateViewer = true);
+
   /**
-   * Add presentations which corresponds to the given features to current selection
-   * \param theFeatures a list of features to be selected
+   * Add presentations to current selection. It unhighlight and deselect the current selection.
+   * The shape and result components are processed in the values. If the presentation shape is not
+   * empty, select it, otherwise select the result.
+   * \param theValues a list of presentation to be selected
    * \param isUpdateViewer the parameter whether the viewer should be update immediatelly
    */
-  void setSelected(const QObjectPtrList& theFeatures, bool isUpdateViewer = true);
+  void setSelected(const  QList<ModuleBase_ViewerPrs>& theValues, bool isUpdateViewer = true);
 
 
   /// Unselect all objects
@@ -119,7 +128,7 @@ class XGUI_EXPORT XGUI_Displayer: public QObject
   bool enableUpdateViewer(const bool isEnabled);
 
   /// Updates the viewer
-  void updateViewer();
+  void updateViewer() const;
 
   /// Searches the interactive object by feature
   /// \param theObject the object or presentable feature
@@ -190,6 +199,12 @@ class XGUI_EXPORT XGUI_Displayer: public QObject
   /// \param theObject object to check
   bool canBeShaded(ObjectPtr theObject) const;
 
+  /// Set color on presentation of an object if it is displayed
+  /// \param theObject an object 
+  /// \param theColor a color which has to be set
+  /// \param toUpdate update viewer flag
+  /// \return previously defined color on the object
+  QColor setObjectColor(ObjectPtr theObject, const QColor& theColor, bool toUpdate = true);
 
 signals:
   /// Signal on object display
@@ -219,12 +234,7 @@ signals:
   void display(ObjectPtr theObject, AISObjectPtr theAIS, bool isShading,
                bool isUpdateViewer = true);
 
-  /** Redisplay the shape if it was displayed
-   * \param theObject an object instance
-   * \param isUpdateViewer the parameter whether the viewer should be update immediatelly
-   */
-  void redisplay(ObjectPtr theObject, bool isUpdateViewer = true);
-
+private:
   /// Activates the interactive object in the local context.
   /// \param theIO an interactive object
   /// \param theModes - modes on which it has to be activated (can be empty)
@@ -241,6 +251,15 @@ signals:
    */
   bool customizeObject(ObjectPtr theObject);
 
+  /// Append the objects in the internal map. Checks whether the map already contains the object
+  /// \param theObject an object to display
+  /// \param theAIS AIOS object to display
+  void appendResultObject(ObjectPtr theObject, AISObjectPtr theAIS);
+
+  /// Returns an information about alredy displayed objects
+  /// \return a string representation
+  std::string getResult2AISObjectMapInfo() const;
+
  protected:
    /// Reference to workshop
   XGUI_Workshop* myWorkshop;