Back to index

salome-gui  6.5.0
Plot2d_ViewWindow.h
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  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 // File   : Plot2d_ViewWindow.h
00024 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
00025 //
00026 #ifndef PLOT2D_VIEWWINDOW_H
00027 #define PLOT2D_VIEWWINDOW_H
00028 
00029 #include "Plot2d.h"
00030 #include <SUIT_ViewWindow.h>
00031 #include <QMap>
00032 
00033 
00034 #ifdef WIN32
00035 #pragma warning( disable:4251 )
00036 #endif
00037 
00038 class SUIT_Desktop;
00039 class Plot2d_Viewer;
00040 class Plot2d_ViewFrame;
00041 class QtxAction;
00042 class QImage;
00043 class QMenu;
00044 class QToolBar;
00045 
00046 class PLOT2D_EXPORT Plot2d_ViewWindow : public SUIT_ViewWindow  
00047 {
00048   Q_OBJECT
00049 
00050 public:
00051   enum { DumpId, 
00052          ScaleOpId, FitAllId, FitRectId, ZoomId,
00053          MoveOpId, PanId, GlobalPanId,
00054          PModeXLinearId, PModeXLogarithmicId, 
00055          PModeYLinearId, PModeYLogarithmicId,
00056          PModeNormLMaxId, PModeNormLMinId,
00057          PModeNormRMaxId, PModeNormRMinId,
00058         CurvPointsId, CurvLinesId, CurvSplinesId, 
00059         LegendId,
00060         CurvSettingsId,
00061         CloneId, PrintId,
00062         AnalyticalCurveId };
00063 
00064 public:
00065   Plot2d_ViewWindow( SUIT_Desktop*, Plot2d_Viewer* );
00066   virtual ~Plot2d_ViewWindow();
00067 
00068   Plot2d_Viewer*    getModel();
00069   void              putInfo( const QString&);
00070   Plot2d_ViewFrame* getViewFrame();
00071   QToolBar*         getToolBar();
00072   virtual void      initLayout();
00073   void              contextMenuPopup( QMenu* );
00074 
00075   virtual bool      eventFilter( QObject*, QEvent* );
00076 
00077   void              createActions();
00078   void              createToolBar();
00079 
00080   virtual QString   getVisualParameters();
00081   virtual void      setVisualParameters( const QString& );
00082   
00083   virtual void      RefreshDumpImage();
00084 
00085 public slots:
00086   void              onChangeHorMode();
00087   void              onChangeVerMode();
00088   void              onChangeCurveMode();
00089   void              onChangeLegendMode();
00090   void              onChangeNormLMode();
00091   void              onChangeNormRMode();
00092 
00093   
00094   void              onFitAll();
00095   void              onFitRect();
00096   void              onZoom();
00097   void              onPanning();
00098   void              onGlobalPanning();
00099   void              onViewHorMode();
00100   void              onViewVerMode();
00101   void              onViewNormLMode();
00102   void              onViewNormRMode();
00103   void              onLegend();
00104   void              onCurves();
00105 
00106   void              onDumpView();
00107   void              onPrintView();
00108 
00109 protected:
00110   virtual QImage    dumpView();
00111   virtual bool      dumpViewToFormat( const QImage&, 
00112                                       const QString&, 
00113                                       const QString& );
00114   virtual QString   filter() const;
00115 
00116 signals:
00117   void              cloneView();
00118 
00119 private:
00120   Plot2d_Viewer*    myModel;
00121   Plot2d_ViewFrame* myViewFrame;
00122   int               myToolBar;
00123   QImage            myDumpImage;
00124 };
00125 
00126 #ifdef WIN32
00127 #pragma warning( default:4251 )
00128 #endif
00129 
00130 #endif // PLOT2D_VIEWWINDOW_H