Salome HOME
Issue #1079: Make Apply and Cancel buttons independent on enable/disable of complex...
[modules/shaper.git] / src / NewGeom / NewGeom_SalomeViewer.h
index 1d471d1dcc97ea11d04d0479e291c804aae2b6c6..ee250cae0e704739a7c5f8bd15ba22f6b4ae9b13 100644 (file)
@@ -9,6 +9,8 @@
 #include <ModuleBase_IViewer.h>
 #include <ModuleBase_IViewWindow.h>
 
+#include <OCCViewer_ViewWindow.h>
+
 #include <V3d_View.hxx>
 
 class SUIT_ViewWindow;
@@ -29,10 +31,13 @@ class NewGeom_SalomeView: public ModuleBase_IViewWindow
 public:
   /// Constructor
   /// \param theViewer a reference to a viewer
-  NewGeom_SalomeView(OCCViewer_Viewer* theViewer) { myViewer = theViewer; }
+  NewGeom_SalomeView(OCCViewer_Viewer* theViewer);
 
   virtual Handle(V3d_View) v3dView() const;
 
+  /// Returns the view window view port
+  virtual QWidget* viewPort() const;
+
   /// Set the current viewer
   /// \param theViewer a viewer instance
   void setViewer(OCCViewer_Viewer* theViewer) { myViewer = theViewer; }
@@ -40,9 +45,13 @@ public:
   /// Returns current viewer
   OCCViewer_Viewer* viewer() const { return myViewer; }
 
+  /// Sets the current view
+  void setCurrentView(SUIT_ViewWindow* theView) { myCurrentView = theView; }
+
 private:
   /// A reference to a viewer
   OCCViewer_Viewer* myViewer;
+  SUIT_ViewWindow* myCurrentView;
 };
 
 
@@ -82,6 +91,9 @@ Q_OBJECT
   //! Returns true if multiselection is enabled
   virtual bool isMultiSelectionEnabled() const;
 
+  //! Enable or disable draw mode in the viewer
+  virtual bool enableDrawMode(bool isEnabled);
+
   //! Perfroms the fit all for the active view
   virtual void fitAll();
 
@@ -89,7 +101,9 @@ Q_OBJECT
   /// \param theX the X projection value
   /// \param theY the Y projection value
   /// \param theZ the Z projection value
-  virtual void setViewProjection(double theX, double theY, double theZ);
+  /// \param theTwist the twist angle in radians
+  virtual void setViewProjection( double theX, double theY, double theZ,
+                                  double theTwist );
 
   /// Set selector
   /// \param theSel a selector instance
@@ -101,6 +115,10 @@ Q_OBJECT
   /// Remove selection filter from the viewer
   virtual void removeSelectionFilter(const Handle(SelectMgr_Filter)& theFilter);
 
+  /// Returns true if the selection filter is set to the viewer
+  /// \param theFilter a selection filter
+  virtual bool hasSelectionFilter(const Handle(SelectMgr_Filter)& theFilter);
+
   /// Remove all selection filters from the viewer
   virtual void clearSelectionFilters();
 
@@ -117,6 +135,13 @@ Q_OBJECT
   /// by mouse drugging. If this is impossible thet it has to return False.
   virtual bool canDragByMouse() const;
 
+  /// Activate or deactivate viewer
+  /// \param toActivate - activation flag
+  void activateViewer(bool toActivate);
+
+  // Fit all along Z (perpendicular to display)
+  virtual void Zfitall();
+
  private slots:
   void onMousePress(SUIT_ViewWindow*, QMouseEvent*);
   void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);
@@ -128,9 +153,10 @@ Q_OBJECT
   void onTryCloseView(SUIT_ViewWindow*);
   void onDeleteView(SUIT_ViewWindow*);
   void onViewCreated(SUIT_ViewWindow*);
-  void onActivated(SUIT_ViewWindow*);
+  void onActivated(SUIT_ViewManager*);
 
   void onSelectionChanged();
+  void onViewTransformed(OCCViewer_ViewWindow::OperationType);
 
  private:
   NewGeom_OCCSelector* mySelector;