00001 //------------------------------------------------------------------------------ 00002 // This file is part of the OpenStructure project <www.openstructure.org> 00003 // 00004 // Copyright (C) 2008-2010 by the OpenStructure authors 00005 // 00006 // This library is free software; you can redistribute it and/or modify it under 00007 // the terms of the GNU Lesser General Public License as published by the Free 00008 // Software Foundation; either version 3.0 of the License, or (at your option) 00009 // any later version. 00010 // This library is distributed in the hope that it will be useful, but WITHOUT 00011 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00012 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00013 // details. 00014 // 00015 // You should have received a copy of the GNU Lesser General Public License 00016 // along with this library; if not, write to the Free Software Foundation, Inc., 00017 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00018 //------------------------------------------------------------------------------ 00019 #ifndef PLOTAXIS_BASE_HH_ 00020 #define PLOTAXIS_BASE_HH_ 00021 00022 /* 00023 Author: Andreas Schenk 00024 */ 00025 00026 #include <QWidget> 00027 00028 #include "plot_ticker.hh" 00029 00030 namespace ost { namespace gui { 00031 00032 class DLLEXPORT_OST_GUI PlotAxisBase: public QWidget 00033 { 00034 Q_OBJECT 00035 public: 00036 PlotAxisBase(QWidget * parent = 0); 00037 virtual ~PlotAxisBase(); 00038 const static unsigned int AXISWIDTH=60; 00039 void SetMinimum(Real min); 00040 void SetMaximum(Real max); 00041 signals: 00042 void zoom(int delta,QPoint pos); 00043 void translate(Real deltax,Real deltay); 00044 protected: 00045 int GetSeparation(); 00046 void SetSeparation(int separation); 00047 void SetStart(int start); 00048 void SetEnd(int end); 00049 virtual void wheelEvent ( QWheelEvent * e ); 00050 virtual void mousePressEvent ( QMouseEvent * event ); 00051 TickList GetTicks(); 00052 PlotTickerLinear ticker_; 00053 QPoint global_mouse_pos_; 00054 }; 00055 00056 00057 }}//ns 00058 00059 #endif /*PLOTAXIS_BASE_HH_*/
1.5.8