Version: 6.3.1

src/VTKViewer/VTKViewer_ViewModel.h

Go to the documentation of this file.
00001 // Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 #ifndef VTKVIEWER_VIEWMODEL_H
00024 #define VTKVIEWER_VIEWMODEL_H
00025 
00026 #include "VTKViewer.h"
00027 #include "SUIT_ViewModel.h"
00028 
00029 #include <QColor>
00030 
00031 class QMouseEvent;
00032 
00033 class SUIT_ViewWindow;
00034 class SUIT_Desktop;
00035 
00036 class VTKVIEWER_EXPORT VTKViewer_Viewer: public SUIT_ViewModel
00037 {
00038   Q_OBJECT
00039 
00040 public:
00042   static QString Type() { return "VTKViewer"; }
00043 
00044   VTKViewer_Viewer();
00045   virtual ~VTKViewer_Viewer();
00046 
00047   virtual SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop);
00048 
00049   virtual void             setViewManager(SUIT_ViewManager* theViewManager);
00050   virtual void             contextMenuPopup( QMenu* );
00052   virtual QString          getType() const { return Type(); }
00053 
00054 public:
00055   void enableSelection(bool isEnabled);
00057   bool isSelectionEnabled() const { return mySelectionEnabled; }
00058 
00059   void enableMultiselection(bool isEnable);
00061   bool isMultiSelectionEnabled() const { return myMultiSelectionEnabled; }
00062 
00063   int  getSelectionCount() const;
00064 
00065   QColor backgroundColor() const;
00066   void   setBackgroundColor( const QColor& );
00067 
00068 signals:
00069   void selectionChanged();
00070 
00071 protected slots:
00072   void onMousePress(SUIT_ViewWindow*, QMouseEvent*);
00073   void onMouseMove(SUIT_ViewWindow*, QMouseEvent*);
00074   void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);
00075 
00076   void onDumpView();
00077   void onShowToolbar();
00078   void onChangeBgColor();
00079 
00080 private:
00081   QColor myBgColor;
00082   bool   mySelectionEnabled;
00083   bool   myMultiSelectionEnabled;
00084 };
00085 
00086 #endif
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS