[Kst] branches/work/kst/portto4/kst/src
Mike Fenton
mike at staikos.net
Fri Jun 13 16:40:06 CEST 2008
SVN commit 820192 by fenton:
Cleanup of PlotDefines.h.
M +6 -6 libkstapp/axistab.cpp
M +4 -4 libkstapp/axistab.h
M +11 -11 libkstapp/plotaxis.cpp
M +11 -11 libkstapp/plotaxis.h
M +5 -27 libkstmath/plotdefines.h
M +4 -4 libkstmath/settings.cpp
M +4 -4 libkstmath/settings.h
--- branches/work/kst/portto4/kst/src/libkstapp/axistab.cpp #820191:820192
@@ -252,22 +252,22 @@
}
-KstAxisDisplay AxisTab::axisDisplay() const {
- return KstAxisDisplay(_scaleDisplayType->itemData(_scaleDisplayType->currentIndex()).toInt());
+AxisDisplayType AxisTab::axisDisplay() const {
+ return AxisDisplayType(_scaleDisplayType->itemData(_scaleDisplayType->currentIndex()).toInt());
}
-void AxisTab::setAxisDisplay(KstAxisDisplay display) {
+void AxisTab::setAxisDisplay(AxisDisplayType display) {
_scaleDisplayType->setCurrentIndex(_scaleDisplayType->findData(QVariant(display)));
}
-KstAxisInterpretation AxisTab::axisInterpretation() const {
- return KstAxisInterpretation(_scaleInterpretType->itemData(_scaleInterpretType->currentIndex()).toInt());
+AxisInterpretationType AxisTab::axisInterpretation() const {
+ return AxisInterpretationType(_scaleInterpretType->itemData(_scaleInterpretType->currentIndex()).toInt());
}
-void AxisTab::setAxisInterpretation(KstAxisInterpretation interpret) {
+void AxisTab::setAxisInterpretation(AxisInterpretationType interpret) {
_scaleInterpretType->setCurrentIndex(_scaleInterpretType->findData(QVariant(interpret)));
}
--- branches/work/kst/portto4/kst/src/libkstapp/axistab.h #820191:820192
@@ -72,11 +72,11 @@
bool isInterpret() const;
void setInterpret(const bool enabled);
- KstAxisDisplay axisDisplay() const;
- void setAxisDisplay(KstAxisDisplay display);
+ AxisDisplayType axisDisplay() const;
+ void setAxisDisplay(AxisDisplayType display);
- KstAxisInterpretation axisInterpretation() const;
- void setAxisInterpretation(KstAxisInterpretation interpretation);
+ AxisInterpretationType axisInterpretation() const;
+ void setAxisInterpretation(AxisInterpretationType interpretation);
public Q_SLOTS:
void update();
--- branches/work/kst/portto4/kst/src/libkstapp/plotaxis.cpp #820191:820192
@@ -57,7 +57,7 @@
}
-QString PlotAxis::interpretLabel(KstAxisInterpretation axisInterpretation, KstAxisDisplay axisDisplay, double base, double lastValue) {
+QString PlotAxis::interpretLabel(AxisInterpretationType axisInterpretation, AxisDisplayType axisDisplay, double base, double lastValue) {
double value = convertTimeValueToJD(axisInterpretation, base);
double scaleValue = convertTimeValueToJD(axisInterpretation, lastValue) - value;
@@ -126,7 +126,7 @@
}
-double PlotAxis::interpretOffset(KstAxisInterpretation axisInterpretation, KstAxisDisplay axisDisplay, double base, double value) {
+double PlotAxis::interpretOffset(AxisInterpretationType axisInterpretation, AxisDisplayType axisDisplay, double base, double value) {
double offset;
offset = value - base;
@@ -152,7 +152,7 @@
}
-double PlotAxis::convertTimeValueToJD(KstAxisInterpretation axisInterpretation, double valueIn) {
+double PlotAxis::convertTimeValueToJD(AxisInterpretationType axisInterpretation, double valueIn) {
double value = valueIn;
switch (axisInterpretation) {
@@ -189,7 +189,7 @@
}
-double PlotAxis::convertTimeDiffValueToDays(KstAxisInterpretation axisInterpretation, double offsetIn) {
+double PlotAxis::convertTimeDiffValueToDays(AxisInterpretationType axisInterpretation, double offsetIn) {
double offset = offsetIn;
switch (axisInterpretation) {
@@ -214,7 +214,7 @@
}
-QString PlotAxis::convertJDToDateString(KstAxisInterpretation axisInterpretation, KstAxisDisplay axisDisplay, double dJD) {
+QString PlotAxis::convertJDToDateString(AxisInterpretationType axisInterpretation, AxisDisplayType axisDisplay, double dJD) {
QString label;
QDate date;
@@ -515,22 +515,22 @@
}
-KstAxisDisplay PlotAxis::axisDisplay() const {
+AxisDisplayType PlotAxis::axisDisplay() const {
return _axisDisplay;
}
-void PlotAxis::setAxisDisplay(const KstAxisDisplay display) {
+void PlotAxis::setAxisDisplay(const AxisDisplayType display) {
_axisDisplay = display;
}
-KstAxisInterpretation PlotAxis::axisInterpretation() const {
+AxisInterpretationType PlotAxis::axisInterpretation() const {
return _axisInterpretation;
}
-void PlotAxis::setAxisInterpretation(const KstAxisInterpretation display) {
+void PlotAxis::setAxisInterpretation(const AxisInterpretationType display) {
_axisInterpretation = display;
}
@@ -850,11 +850,11 @@
}
av = attrs.value("interpretation");
if (!av.isNull()) {
- setAxisInterpretation((KstAxisInterpretation)QVariant(av.toString()).toInt());
+ setAxisInterpretation((AxisInterpretationType)QVariant(av.toString()).toInt());
}
av = attrs.value("display");
if (!av.isNull()) {
- setAxisDisplay((KstAxisDisplay)QVariant(av.toString()).toInt());
+ setAxisDisplay((AxisDisplayType)QVariant(av.toString()).toInt());
}
av = attrs.value("majortickmode");
if (!av.isNull()) {
--- branches/work/kst/portto4/kst/src/libkstapp/plotaxis.h #820191:820192
@@ -90,11 +90,11 @@
bool axisInterpret() const;
void setAxisInterpret(const bool enabled);
- KstAxisDisplay axisDisplay() const;
- void setAxisDisplay(const KstAxisDisplay display);
+ AxisDisplayType axisDisplay() const;
+ void setAxisDisplay(const AxisDisplayType display);
- KstAxisInterpretation axisInterpretation() const;
- void setAxisInterpretation(const KstAxisInterpretation interpret);
+ AxisInterpretationType axisInterpretation() const;
+ void setAxisInterpretation(const AxisInterpretationType interpret);
PlotMarkers axisPlotMarkers() { return _axisPlotMarkers; }
void setAxisPlotMarkers(const PlotMarkers &plotMarkers) { _axisPlotMarkers = plotMarkers; }
@@ -117,11 +117,11 @@
private:
- QString interpretLabel(KstAxisInterpretation axisInterpretation, KstAxisDisplay axisDisplay, double base, double lastValue);
- double convertTimeValueToJD(KstAxisInterpretation axisInterpretation, double valueIn);
- QString convertJDToDateString(KstAxisInterpretation axisInterpretation, KstAxisDisplay axisDisplay, double dJD);
- double convertTimeDiffValueToDays(KstAxisInterpretation axisInterpretation, double offsetIn);
- double interpretOffset(KstAxisInterpretation axisInterpretation, KstAxisDisplay axisDisplay, double base, double value);
+ QString interpretLabel(AxisInterpretationType axisInterpretation, AxisDisplayType axisDisplay, double base, double lastValue);
+ double convertTimeValueToJD(AxisInterpretationType axisInterpretation, double valueIn);
+ QString convertJDToDateString(AxisInterpretationType axisInterpretation, AxisDisplayType axisDisplay, double dJD);
+ double convertTimeDiffValueToDays(AxisInterpretationType axisInterpretation, double offsetIn);
+ double interpretOffset(AxisInterpretationType axisInterpretation, AxisDisplayType axisDisplay, double base, double value);
qreal computedMajorTickSpacing(MajorTickMode majorTickCount, Qt::Orientation orientation);
void computeLogTicks(QList<qreal> *MajorTicks, QList<qreal> *MinorTicks, QMap<qreal, QString> *Labels, qreal min, qreal max, MajorTickMode tickMode);
@@ -149,8 +149,8 @@
bool _axisBaseOffsetOverride;
bool _axisInterpret;
- KstAxisDisplay _axisDisplay;
- KstAxisInterpretation _axisInterpretation;
+ AxisDisplayType _axisDisplay;
+ AxisInterpretationType _axisInterpretation;
MajorTickMode _axisMajorTickMode;
MajorTickMode _axisOverrideMajorTicks;
--- branches/work/kst/portto4/kst/src/libkstmath/plotdefines.h #820191:820192
@@ -15,10 +15,9 @@
#define MARKER_LABEL_PRECISION 15
-#include <qstringlist.h>
#include "kst_i18n.h"
-enum KstAxisInterpretation {
+enum AxisInterpretationType {
AXIS_INTERP_YEAR,
AXIS_INTERP_CTIME,
AXIS_INTERP_JD,
@@ -26,7 +25,7 @@
AXIS_INTERP_RJD,
AXIS_INTERP_AIT };
-enum KstAxisDisplay {
+enum AxisDisplayType {
AXIS_DISPLAY_YEAR,
AXIS_DISPLAY_YYMMDDHHMMSS_SS,
AXIS_DISPLAY_DDMMYYHHMMSS_SS,
@@ -38,12 +37,12 @@
struct AxisInterpretation {
const char *label;
- KstAxisInterpretation type;
+ AxisInterpretationType type;
};
struct AxisDisplay {
const char *label;
- KstAxisDisplay type;
+ AxisDisplayType type;
};
const AxisInterpretation AxisInterpretations[] = {
@@ -53,7 +52,7 @@
{ I18N_NOOP2("Modified Julian Date", "MJD"), AXIS_INTERP_MJD },
{ I18N_NOOP2("Reduced Julian Date", "RJD"), AXIS_INTERP_RJD },
{ I18N_NOOP2("Temps Atomique International", "TAI"), AXIS_INTERP_AIT }
-};
+};
const AxisDisplay AxisDisplays[] = {
{ I18N_NOOP("Julian Year"), AXIS_DISPLAY_YEAR },
@@ -66,27 +65,6 @@
{ I18N_NOOP2("Reduced Julian Date", "RJD"), AXIS_DISPLAY_RJD }
};
-class TickParameters {
- public:
- // FIXME: use reasonable defaults
- TickParameters() : org(0.0), tick(0.0), delta(false), maxWidth(0.0),
- maxHeight(0.0), iHi(0), iLo(0), oppMaxWidth(0.0),
- oppMaxHeight(0.0)
- {}
-
- double org;
- double tick;
- bool delta;
- double maxWidth;
- double maxHeight;
- QStringList labels;
- int iHi;
- int iLo;
- QStringList oppLabels; // labels for the opposite axis
- double oppMaxWidth;
- double oppMaxHeight;
-};
-
const unsigned int numAxisInterpretations = sizeof( AxisInterpretations ) / sizeof( AxisInterpretation );
const unsigned int numAxisDisplays = sizeof( AxisDisplays ) / sizeof( AxisDisplay );
--- branches/work/kst/portto4/kst/src/libkstmath/settings.cpp #820191:820192
@@ -244,14 +244,14 @@
cfg.beginGroup("X Axis");
xAxisInterpret = cfg.value("Interpret", false).toBool();
- xAxisInterpretation = (KstAxisInterpretation)cfg.value("Interpretation", (int)AXIS_INTERP_CTIME).toInt();
- xAxisDisplay = (KstAxisDisplay)cfg.value("Display", static_cast<int>(AXIS_DISPLAY_QTLOCALDATEHHMMSS_SS)).toInt();
+ xAxisInterpretation = (AxisInterpretationType)cfg.value("Interpretation", (int)AXIS_INTERP_CTIME).toInt();
+ xAxisDisplay = (AxisDisplayType)cfg.value("Display", static_cast<int>(AXIS_DISPLAY_QTLOCALDATEHHMMSS_SS)).toInt();
cfg.endGroup();
cfg.beginGroup("Y Axis");
yAxisInterpret = cfg.value("Interpret", false).toBool();
- yAxisInterpretation = (KstAxisInterpretation)cfg.value("Interpretation", (int)AXIS_INTERP_CTIME).toInt();
- yAxisDisplay = (KstAxisDisplay)cfg.value("Display", static_cast<int>(AXIS_DISPLAY_QTLOCALDATEHHMMSS_SS)).toInt();
+ yAxisInterpretation = (AxisInterpretationType)cfg.value("Interpretation", (int)AXIS_INTERP_CTIME).toInt();
+ yAxisDisplay = (AxisDisplayType)cfg.value("Display", static_cast<int>(AXIS_DISPLAY_QTLOCALDATEHHMMSS_SS)).toInt();
cfg.endGroup();
cfg.beginGroup("Curve");
--- branches/work/kst/portto4/kst/src/libkstmath/settings.h #820191:820192
@@ -71,10 +71,10 @@
QColor majorColor;
QColor minorColor;
- KstAxisInterpretation xAxisInterpretation;
- KstAxisDisplay xAxisDisplay;
- KstAxisInterpretation yAxisInterpretation;
- KstAxisDisplay yAxisDisplay;
+ AxisInterpretationType xAxisInterpretation;
+ AxisDisplayType xAxisDisplay;
+ AxisInterpretationType yAxisInterpretation;
+ AxisDisplayType yAxisDisplay;
int defaultLineWeight;
More information about the Kst
mailing list