Salome HOME
0023450: Fields are not displayed in GEOM
[modules/gui.git] / src / OCCViewer / OCCViewer_ViewModel.h
index 5ca95ef263c4f5a70746d9c00cef6ddd9983b605..6e80da203a4445d60673929e59faf2369306c6e0 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016  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
 #include "SUIT_ViewModel.h"
 
 #include <V3d_View.hxx>
+#include <AIS_ColorScale.hxx>
 #include <AIS_Trihedron.hxx>
 #include <AIS_InteractiveContext.hxx>
-#include <Basics_OCCTVersion.hxx>
+#include <AIS_ListOfInteractive.hxx>
 #include <Graphic3d_SequenceOfHClipPlane.hxx>
 
 class QKeyEvent;
@@ -48,8 +49,6 @@ class OCCViewer_ClippingDlg;
 class OCCViewer_ViewWindow;
 class OCCViewer_ViewPort3d;
 
-class AIS_ListOfInteractive;
-
 class QtxAction;
 
 
@@ -70,9 +69,17 @@ public:
     Corner3Gradient,    Corner4Gradient,
     LastGradient = Corner4Gradient
   };
+  /*! supported stereo types */
+  enum {
+    QuadBufferType,    AnaglyphType,
+    RowInterlacedType, ColumnInterlacedType,
+    ChessBoardType,    SideBySideType,
+    OverUnderType
+  };
   
   static QString           Type() { return "OCCViewer"; }
   static QString           backgroundData( QStringList&, QIntList&, QIntList& );
+  static void              stereoData( QStringList&, QIntList&);
 
   OCCViewer_Viewer( bool DisplayTrihedron = true);
   virtual ~OCCViewer_Viewer();
@@ -88,11 +95,13 @@ public:
   
   void                            getSelectedObjects(AIS_ListOfInteractive& theList);
   void                            setObjectsSelected(const AIS_ListOfInteractive& theList);
-  void                            setSelected(const Handle(AIS_InteractiveObject)& theIO) { myAISContext->SetSelected(theIO);}
+  void                            setSelected(const Handle(AIS_InteractiveObject)& theIO) { myAISContext->SetSelected(theIO,Standard_True);}
 
   void                            performSelectionChanged();
   // emit signal selectionChanged
 
+  void                            setDefaultLights();
+
   QColor                          backgroundColor() const;                              // obsolete
   void                            setBackgroundColor( const QColor& );                  // obsolete
   Qtx::BackgroundData             background() const;
@@ -103,6 +112,9 @@ public:
   Qtx::BackgroundData             background(int theViewId) const;
   void                            setBackground( int theViewId, const Qtx::BackgroundData& );
 
+  bool                            isColorScaleVisible() const;
+  virtual void                    setColorScaleShown( const bool );
+
   //! returns true if 3d Trihedron in viewer was created
   bool                            trihedronActivated() const { return !myTrihedron.IsNull(); }
 
@@ -124,9 +136,13 @@ public:
 
   virtual OCCViewer_ViewWindow*   createSubWindow();
 
+  void                            setUseLocalSelection(bool theIsUseLocalSelection);
+  bool                            useLocalSelection() const;
+
 public:
   Handle(V3d_Viewer)              getViewer3d()    const { return myV3dViewer;}
   Handle(AIS_InteractiveContext)  getAISContext()  const { return myAISContext; }
+  Handle(AIS_ColorScale)          getColorScale()  const { return myColorScale; }
   Handle(AIS_Trihedron)           getTrihedron()   const { return myTrihedron; }
 
   int                             getTopLayerId();
@@ -134,6 +150,30 @@ public:
   int                             interactionStyle() const;
   void                            setInteractionStyle( const int );
 
+  int                             projectionType() const;
+  void                            setProjectionType( const int );
+  int                             stereoType() const;
+  void                            setStereoType( const int );
+
+  int                             anaglyphFilter() const;
+  void                            setAnaglyphFilter( const int );
+
+  void                            setStereographicFocus( const int, const double );
+  int                             stereographicFocusType() const;
+  double                          stereographicFocusValue() const;
+
+  void                            setInterocularDistance( const int, const double );
+  int                             interocularDistanceType() const;
+  double                          interocularDistanceValue() const;
+
+  bool                            isReverseStereo() const;
+  void                            setReverseStereo( const bool );
+
+  bool                            isVSync() const;
+  void                            setVSync( const bool );
+
+  bool                            isQuadBufferSupport() const;
+  void                            setQuadBufferSupport( const bool );
   int                             zoomingStyle() const;
   void                            setZoomingStyle( const int );
 
@@ -148,6 +188,17 @@ public:
   void                            enableMultiselection(bool isEnable);
   bool                            isMultiSelectionEnabled() const { return myMultiSelectionEnabled; }
 
+  bool                            enableDrawMode( bool on );
+
+  void                            setClippingColor( const QColor& );
+  QColor                          clippingColor() const;
+
+  void                            setClippingTextureParams( const bool, const QString&, const bool, const double );
+  bool                            isDefaultTextureUsed() const;
+  QString                         clippingTexture() const;
+  bool                            isTextureModulated() const;
+  double                          clippingTextureScale() const;
+
   int                             getSelectionCount() const { return (!myAISContext.IsNull())? myAISContext->NbSelected():0; }
 
   void                            setStaticTrihedronDisplayed(const bool on);
@@ -192,18 +243,30 @@ protected slots:
   void onChangeBackground();
 
 protected:
-  Handle(V3d_Viewer)              myV3dViewer;
 
+  Handle(V3d_Viewer)              myV3dViewer;
+  Handle(AIS_ColorScale)          myColorScale;
   Handle(AIS_Trihedron)           myTrihedron;
   Handle(AIS_InteractiveContext)  myAISContext;
 
   int                             myInteractionStyle;
   int                             myZoomingStyle;
+  int                             myProjectionType;
+  int                             myStereoType;
+  int                             myAnaglyphFilter;
+  int                             myStereographicFocusType;
+  int                             myInterocularDistanceType;
+
+  double                          myStereographicFocusValue;
+  double                          myInterocularDistanceValue;
 
   bool                            myPreselectionEnabled;
   bool                            mySelectionEnabled;
   bool                            myMultiSelectionEnabled;
   bool                            myIsRelative;
+  bool                            myToReverseStereo;
+  bool                            myVSyncMode;
+  bool                            myQuadBufferSupport;
 
   int                             myTopLayerId;
 
@@ -218,6 +281,13 @@ protected:
 
   ClipPlanesList                  myClipPlanes;
   Graphic3d_SequenceOfHClipPlane  myInternalClipPlanes;
+
+  QColor                          myClippingColor;
+  bool                            myDefaultTextureUsed;
+  QString                         myClippingTexture;
+  bool                            myTextureModulated;
+  double                          myClippingTextureScale;
+  bool                            myIsUseLocalSelection;
 };
 
 #ifdef WIN32