Salome HOME
Correction of the path to XML file.
[modules/gui.git] / src / OCCViewer / OCCViewer_ViewModel.h
index fe8703b5607dd75d1aa6f4ea580c6c73078da169..0779d3aefe9d15f8cb3c333275b5095f9e9b3380 100755 (executable)
@@ -1,6 +1,25 @@
+// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
+// 
+// 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.
+// 
+// This library is distributed in the hope that it will be useful 
+// but WITHOUT ANY WARRANTY; without even the implied warranty of 
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public  
+// License along with this library; if not, write to the Free Software 
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/
+//
 #ifndef OCCVIEWER_VIEWMODEL_H
 #define OCCVIEWER_VIEWMODEL_H
 
+#include <qcolor.h>
 #include <qcursor.h>
 
 #include "OCCViewer.h"
@@ -14,6 +33,7 @@
 
 class SUIT_ViewWindow;
 class SUIT_Desktop;
+class OCCViewer_ViewWindow;
 
 struct viewAspect
 {
@@ -48,7 +68,7 @@ public:
   static QString Type() { return "OCCViewer"; }
 
   OCCViewer_Viewer( bool DisplayTrihedron = true );
-       virtual ~OCCViewer_Viewer();
+  virtual ~OCCViewer_Viewer();
 
   void update();
 
@@ -72,9 +92,22 @@ public:
   virtual void                    updateViewAspects( const viewAspectList& );
   virtual void                    clearViewAspects();
 
-public slots:
-       void onClearViewAspects();
+  QColor                          backgroundColor() const;
+  void                            setBackgroundColor( const QColor& );
+
+  //! returns true if 3d Trihedron in viewer was created
+  bool                            trihedronActivated() const { return !myTrihedron.IsNull(); }
+
+  void                            toggleTrihedron();
+  bool                            isTrihedronVisible() const;
+  virtual void                    setTrihedronShown( const bool );
 
+  int                             trihedronSize() const;
+  virtual void                    setTrihedronSize( const int );
+
+public slots:
+  void                            onClearViewAspects();
 public:
   Handle(V3d_Viewer)              getViewer3d()    const { return myV3dViewer;}
   Handle(V3d_Viewer)              getCollector3d() const { return myV3dCollector; }
@@ -101,30 +134,38 @@ public:
   void    setColor( const Handle(AIS_InteractiveObject)&, const QColor&, bool=true );
   void    switchRepresentation( const Handle(AIS_InteractiveObject)&, int, bool=true );
   void    setTransparency( const Handle(AIS_InteractiveObject)&, float, bool=true );
+  void    setIsos( const int u, const int v ); // number of isolines
+  void    isos( int& u, int& v ) const;
 
 signals:
   void selectionChanged();
 
+protected:
+  void initView( OCCViewer_ViewWindow* view );
+
 protected slots:
   void onMousePress(SUIT_ViewWindow*, QMouseEvent*);
   void onMouseMove(SUIT_ViewWindow*, QMouseEvent*);
   void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);
 
-  void onChangeBgColor();
+  void onDumpView();
   void onShowToolbar();
+  void onChangeBgColor();
 
 private:
   Handle(V3d_Viewer)              myV3dViewer;
   Handle(V3d_Viewer)              myV3dCollector;
-  Handle(AIS_InteractiveContext)  myAISContext;
+
   Handle(AIS_Trihedron)           myTrihedron;
+  Handle(AIS_InteractiveContext)  myAISContext;
 
   viewAspectList                  myViewAspects;
 
-  bool mySelectionEnabled;
-  bool myMultiSelectionEnabled;
+  bool                            mySelectionEnabled;
+  bool                            myMultiSelectionEnabled;
 
-  QPoint myStartPnt, myEndPnt;
+  QColor                          myBgColor;
+  QPoint                          myStartPnt, myEndPnt;
 };
 
 #ifdef WIN32