Main Page | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages

qwt_dimap.h

Go to the documentation of this file.
00001 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
00002  * Qwt Widget Library
00003  * Copyright (C) 1997   Josef Wilgen
00004  * Copyright (C) 2002   Uwe Rathmann
00005  * 
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the Qwt License, Version 1.0
00008  *****************************************************************************/
00009 
00010 #ifndef QWT_DIMAP_H
00011 #define QWT_DIMAP_H
00012 
00013 #include "qwt_global.h"
00014 
00045 class QWT_EXPORT QwtDiMap
00046 {
00047 public:
00048   QwtDiMap();
00049   QwtDiMap(int i1, int i2, double d1, double d2, bool lg = FALSE);
00050   ~QwtDiMap();
00051 
00052   bool contains(double x) const;
00053   bool contains(int x) const;
00054 
00055   void setIntRange(int i1, int i2);
00056   void setDblRange(double d1, double d2, bool lg = FALSE);
00057 
00058   int transform(double x) const;
00059   double invTransform(int i) const;
00060 
00061   int limTransform(double x) const;
00062   double xTransform(double x) const;
00063 
00064   inline double d1() const;
00065   inline double d2() const;
00066   inline int i1() const;
00067   inline int i2() const;
00068   inline bool logarithmic() const;
00069 
00070   QT_STATIC_CONST double LogMin;
00071   QT_STATIC_CONST double LogMax;
00072 
00073 private:
00074   void newFactor(); 
00075 
00076   double d_x1, d_x2;  // double interval boundaries
00077   int d_y1, d_y2;     // integer interval boundaries
00078   double d_cnv;       // conversion factor
00079   bool d_log;   // logarithmic scale?
00080 };
00081 
00085 inline double QwtDiMap::d1() const 
00086 {
00087   return d_x1;
00088 }
00089 
00093 inline double QwtDiMap::d2() const 
00094 {
00095   return d_x2;
00096 }
00097 
00101 inline int QwtDiMap::i1() const 
00102 {
00103   return d_y1;
00104 }
00105 
00109 inline int QwtDiMap::i2() const 
00110 {
00111   return d_y2;
00112 }
00113 
00117 inline bool QwtDiMap::logarithmic() const 
00118 {
00119   return d_log;
00120 }
00121 
00122 #endif

Generated on Fri Nov 7 14:11:45 2003 for Qwt Developer's Guide by doxygen 1.3.2