00001 //--------------------------------------------------------------------------- 00002 // 00003 // File: TxqAxis.h 00004 // 00005 // Purpose: Base class for a TxqAxis 00006 // 00007 // Version: $Id: TxqAxis.h,v 1.19 2001/10/12 18:51:23 kgl Exp $ 00008 // 00009 // Copyright (c) 2000 by Tech-X Corporation. All rights reserved. 00010 // 00011 // Author: Kelly G. Luetkemeyer 00012 // 00013 //--------------------------------------------------------------------------- 00014 00015 #ifndef TXQ_AXIS_H 00016 #define TXQ_AXIS_H 00017 00018 // std includes 00019 #include <vector> 00020 00021 // Qt includes 00022 #include <qstring.h> 00023 #include <qcolor.h> 00024 #include <qfontmetrics.h> 00025 00026 // Tx includes 00027 #include "TxqDefines.h" 00028 #include "TxqSciNumberFormat.h" 00029 #include "TxqAxisAttribs.h" 00030 00044 class TxqAxis 00045 { 00046 00047 public: 00048 00052 TxqAxis(); 00053 00057 virtual ~TxqAxis(); 00058 00069 void setOrientation(QString direction); 00070 00079 QString getOrientation(); 00080 00085 void setBorderAxes(bool b); 00086 00091 void setScientificNotation(bool f); 00092 00097 bool getScientificNotation(); 00098 00104 void assign(TxqAxis r); 00105 00110 void autoSelectDataRanges(bool b); 00111 00116 void autoSelectDataRangeMin(bool b); 00117 00122 void autoSelectDataRangeMax(bool b); 00123 00128 void setDataRangeMin(double d); 00129 00134 double getDataRangeMin(); 00135 00140 void setDataRangeMax(double d); 00141 00145 double getDataRangeMax(); 00146 00151 void setMajorTickIncrement(double r); 00152 00157 void setMinorTickIncrement(double r); 00158 00163 double getMajorTickIncrement(); 00164 00169 double getMinorTickIncrement(); 00170 00175 void autoSelectMajorTickIncrement(bool b); 00176 00181 void autoSelectMinorTickIncrement(bool b); 00182 00187 bool isBorderAxes(); 00188 00194 bool isAutoSelectedMajorTickIncrement(); 00195 00201 bool isAutoSelectedMinorTickIncrement(); 00202 00207 void setTickType(int t); 00208 00213 int getTickType(); 00214 00219 void setTickLabelFont(QFont f); 00220 00225 QFont getTickLabelFont(); 00226 00231 void setTickLabelColor(QColor c); 00232 00237 QColor getTickLabelColor(); 00238 00243 void setTickLabelPattern(TxqSciNumberPattern f); 00244 00249 TxqSciNumberPattern getTickLabelPattern(); 00250 00255 TxqSciNumberFormat getTickLabelFormat(); 00256 00261 bool insideTick(); 00262 00267 bool outsideTick(); 00268 00273 virtual void setTitleLabel(QString label ); 00274 00281 virtual void setTitleLabel(QString lablel, double xpos, double ypos); 00282 00287 virtual QString getTitleLabel(); 00288 00293 virtual void setTitleLabelFont(QFont f); 00294 00299 virtual QFont getTitleLabelFont(); 00300 00305 virtual void setTitleLabelColor(QColor c); 00306 00311 virtual QColor getTitleLabelColor(); 00312 00317 void invertBW(bool white); 00318 00323 bool isAutoSelectedDataRangeMin(); 00324 00329 bool isAutoSelectedDataRangeMax(); 00330 00335 void setActualMin(double d); 00336 00341 void setActualMax(double d); 00342 00348 virtual int getAxisMaxWidth(); 00349 00355 virtual int getAxisMaxHeight(); 00356 00361 void setAutoSize(bool b); 00362 00367 bool isAutoSize(); 00368 00373 void setLogScale(bool scale); 00374 00379 bool getLogScale(); 00380 00381 #if !defined(_MSC_VER) 00382 const static int NO_TICKS = 0; 00383 const static int INSIDE_TICK = 1; 00384 const static int OUTSIDE_TICK = 2; 00385 #else 00386 #define NO_TICKS 0 00387 #define INSIDE_TICK 1 00388 #define OUTSIDE_TICK 2 00389 #endif 00390 00395 void setAxisAttribs(const TxqAxisAttribs& a); 00396 00401 void updateAxisAttribs(TxqAxisAttribs& a); 00402 00403 00404 protected: 00405 00410 virtual int getMaxLabelWidth(QFontMetrics fm); 00411 00416 virtual int getMaxLabelHeight(QFontMetrics fm); 00417 00422 int tickLength(QFontMetrics fm); 00423 00428 bool sciNotation; 00429 00430 00434 bool autoMajorTickIncr; 00435 00439 bool autoMinorTickIncr; 00440 00444 double actualMin; 00445 00449 double actualMax; 00450 00454 double selectedMin; 00455 00459 double selectedMax; 00460 00464 bool autoMin; 00465 00469 bool autoMax; 00470 00474 double majorTickIncr; 00475 00476 00480 double minorTickIncr; 00481 00485 int tickType; 00486 00490 QFont tickLabelFont; 00491 00495 QColor tickLabelColor; 00496 00500 TxqSciNumberPattern tickLabelPattern; 00501 00505 QString axisType; 00506 00510 bool borderAxes; 00511 00515 bool autoSize; 00516 00520 QFont titleLabelFont; 00521 00525 QColor titleLabelColor; 00526 00530 bool hasTitleLabel; 00531 00535 bool hasTitleLocation; 00536 00540 double dmin; 00541 00545 double dmax; 00546 00550 double dmag; 00551 00555 int axisLoc; 00556 00560 int axis1Loc; 00561 00565 int axis2Loc; 00566 00570 QRect plotRect; 00571 00576 bool log; 00577 00581 bool xAxis; 00582 00586 bool yAxis; 00587 00591 bool zAxis; 00592 00593 00594 }; 00595 #endif
Copyright Tech-X Corporation, all rights reserved.