Salome HOME
#26454 [EDF] (2021) SMESH: interactive mesh modification
[modules/gui.git] / src / SVTK / SVTK_ViewWindow.h
old mode 100755 (executable)
new mode 100644 (file)
index abb6c09..b928286
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2021  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -6,7 +6,7 @@
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -33,6 +33,7 @@
 #include "SUIT_ViewWindow.h"
 
 #include "SALOME_InteractiveObject.hxx"
+#include "SALOME_ListIO.hxx"
 
 #include <QImage>
 #include <vtkSmartPointer.h>
@@ -66,7 +67,10 @@ class SVTK_KeyFreeInteractorStyle;
 class SVTK_ViewParameterDlg;
 class SVTK_Recorder;
 
-class vtkPVAxesWidget;
+namespace salomevtk
+{
+  class vtkPVAxesWidget;
+}
 
 class vtkObject;
 class QtxAction;
@@ -80,7 +84,7 @@ namespace SVTK
 //! Define a container for SALOME VTK view window
 class SVTK_EXPORT SVTK_ViewWindow : public SUIT_ViewWindow
 {
-  Q_OBJECT;
+  Q_OBJECT
 
  public:
   //! To construct #SVTK_ViewWindow instance
@@ -216,10 +220,10 @@ class SVTK_EXPORT SVTK_ViewWindow : public SUIT_ViewWindow
   SVTK_CubeAxesActor2D* GetCubeAxes();
 
   //! Redirect the request to #SVTK_Renderer::GetTrihedronSize
-  vtkFloatingPointType GetTrihedronSize() const;
+  double GetTrihedronSize() const;
 
   //! Redirect the request to #SVTK_Renderer::SetTrihedronSize
-  virtual void SetTrihedronSize( const vtkFloatingPointType, const bool = true );
+  virtual void SetTrihedronSize( const double, const bool = true );
 
   //! Set incremental speed
   virtual void SetIncrementalSpeed( const int, const int = 0 );
@@ -227,14 +231,26 @@ class SVTK_EXPORT SVTK_ViewWindow : public SUIT_ViewWindow
   //! Set current projection mode
   virtual void SetProjectionMode( const int );
 
+  //! Sets stereo type
+  virtual void SetStereoType( const int );
+
+  //! Sets anaglyph filter
+  virtual void SetAnaglyphFilter( const int );
+
+  //! Set support quad-buffered stereo
+  virtual void SetQuadBufferSupport( const bool );
+
   //! Set interactive style
   virtual void SetInteractionStyle( const int );
 
   //! Set zooming style
   virtual void SetZoomingStyle( const int );
 
-  //! Set dynamic preselection on/off
-  virtual void SetDynamicPreSelection( bool );
+  //! Set preselection mode
+  virtual void SetPreSelectionMode( Preselection_Mode );
+
+  //! Enable/disable selection
+  virtual void SetSelectionEnabled( bool );
 
   //! Customize space mouse buttons
   virtual void SetSpacemouseButtons( const int, const int, const int );
@@ -291,7 +307,7 @@ public slots:
 
   void activateSetRotationGravity();
   void activateSetRotationSelected(void* theData);
-  void activateStartPointSelection();
+  void activateStartPointSelection( Selection_Mode );
 
   void onUpdateRate(bool theIsActivate);
   void onNonIsometric(bool theIsActivate);
@@ -303,19 +319,25 @@ public slots:
   void activatePanning(); 
   void activateGlobalPanning(); 
 
-  void onPerspectiveMode();
+  void onProjectionMode( QAction* theAction );
+  void onStereoMode( bool activate );
+  void onProjectionMode();
 
   void activateProjectionMode(int);
 
   void activateSetFocalPointGravity();
   void activateSetFocalPointSelected();
   void activateStartFocalPointSelection();
+  void activateInteractiveSelection();
+  void deactivateCurrectOperation();
 
   void onViewParameters(bool theIsActivate);
 
   void onSwitchInteractionStyle(bool theOn);
   void onSwitchZoomingStyle(bool theOn);
-  void onSwitchDynamicPreSelection(bool theOn);
+
+  void onSwitchPreSelectionMode(int theMode);
+  void onEnableSelection(bool theOn);
 
   void onStartRecording();
   void onPlayRecording();
@@ -359,8 +381,14 @@ public slots:
   //! Redirect the request to #SVTK_Renderer::OnFitAll
   virtual void onFitAll();
 
+  //! Redirect the request to #SVTK_Renderer::OnFitSelection
+  virtual void onFitSelection();
+
+  //! Redirect the request to #SVTK_Renderer::OnFitIObjects
+  virtual void onFitIObjects(const SALOME_ListIO&);
+
   //! Redirect the request to #SVTK_Renderer::OnViewTrihedron
-  virtual void onViewTrihedron(); 
+  virtual void onViewTrihedron(bool); 
 
   //! Redirect the request to #SVTK_Renderer::OnViewCubeAxes
   virtual void onViewCubeAxes();
@@ -382,7 +410,17 @@ protected slots:
   void onMouseReleased(QMouseEvent* event);
   void onMouseMoving(QMouseEvent* event);
 
+public:
+  enum ProjectionType { Parallel, Projection, Stereo };
+
+  enum StereoType { CrystalEyes, RedBlue, Interlaced, Left, Right, Dresden, Anaglyph, Checkerboard, SplitViewPortHorizontal };
+
+  enum AnaglyphFilter { RedCyan, YellowBlue, GreenMagenta };
+
 protected:
+  
+  virtual void resizeEvent( QResizeEvent* );
+  
   virtual void Initialize(SVTK_View* theView,
                           SVTK_ViewModelBase* theModel);
 
@@ -392,6 +430,8 @@ protected:
                             void* clientdata,
                             void* calldata);
 
+  bool isOpenGlStereoSupport() const;
+
   void doSetVisualParameters( const QString&, bool = false );
   void SetEventDispatcher(vtkObject* theDispatcher);
 
@@ -406,12 +446,14 @@ protected:
   void createToolBar();
   void createActions(SUIT_ResourceMgr* theResourceMgr);
 
-  enum { DumpId, FitAllId, FitRectId, ZoomId, PanId, GlobalPanId, 
+  enum { DumpId, FitAllId, FitRectId, FitSelectionId, ZoomId, PanId, GlobalPanId,
          ChangeRotationPointId, RotationId,
          FrontId, BackId, TopId, BottomId, LeftId, RightId, ClockWiseId, AntiClockWiseId, ResetId,
-        ViewTrihedronId, NonIsometric, GraduatedAxes, UpdateRate,
-         ParallelModeId, ProjectionModeId, ViewParametersId, SynchronizeId, SwitchInteractionStyleId,
-         SwitchZoomingStyleId,SwitchDynamicPreselectionId,
+         ViewTrihedronId, NonIsometric, GraduatedAxes, UpdateRate,
+         ParallelModeId, ProjectionModeId, StereoModeId, ViewParametersId, SynchronizeId, SwitchInteractionStyleId,
+         SwitchZoomingStyleId, 
+        PreselectionId, StandardPreselectionId, DynamicPreselectionId, DisablePreselectionId, 
+        EnableSelectionId,
          StartRecordingId, PlayRecordingId, PauseRecordingId, StopRecordingId };
 
   SVTK_View* myView;
@@ -446,7 +488,7 @@ protected:
   int myToolBar;
   int myRecordingToolBar;
 
-  vtkPVAxesWidget* myAxesWidget;
+  salomevtk::vtkPVAxesWidget* myAxesWidget;
   Qtx::BackgroundData myBackground;
 
 private: