Salome HOME
Selector implementation for OCC viewer.
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_CalculationOp.h
index 0ca60d2ffeb791d7a7ea5b3a4552729a1af35b36..17cebaff607581ea15f04bfbe34c0df16c1a16aa 100644 (file)
 
 #include "HYDROGUI_Operation.h"
 
+#include "HYDROGUI_SplitZonesTool.h"
+#include "HYDROGUI_Shape.h"
+
 #include <HYDROData_Calculation.h>
+#include <HYDROData_Region.h>
+
+class SUIT_ViewManager;
+class OCCViewer_ViewManager;
 
 class HYDROGUI_CalculationOp : public HYDROGUI_Operation
 {
   Q_OBJECT
 
+  struct Region
+  {
+    QString                            RegionName;
+    QColor                             FillingColor;
+    QColor                             BorderColor;
+    HYDROGUI_SplitZonesTool::SplitData SplitData;
+    HYDROGUI_Shape*                    Shape;
+    Handle(HYDROData_Region)           DataRegion;
+
+    Region()
+    : Shape( NULL ),
+      FillingColor( Qt::green ),
+      BorderColor( Qt::transparent )
+    { }
+
+    ~Region()
+    {
+      if ( Shape )
+      {
+        delete Shape;
+        Shape = NULL;
+      }
+    }
+  };
+
+  typedef QList<Region>         RegionsList;
+
 public:
   HYDROGUI_CalculationOp( HYDROGUI_Module* theModule, bool theIsEdit );
   virtual ~HYDROGUI_CalculationOp();
@@ -44,10 +78,22 @@ protected:
 
   virtual bool                    processApply( int& theUpdateFlags, QString& theErrorMsg );
 
+protected slots:
+  void                            onSplitZones();
+  void                            onLastViewClosed( SUIT_ViewManager* );
+
+private:
+  void                            createPreview();
+  void                            closePreview();
+
 private:
   bool                            myIsEdit;
   Handle(HYDROData_Calculation)   myEditedObject;
 
+  SUIT_ViewManager*               myActiveViewManager;
+
+  OCCViewer_ViewManager*          myPreviewViewManager;
+  RegionsList                     myRegionsList;
 };
 
 #endif