File indexing completed on 2025-01-05 04:12:16

0001 /***************************************************************************
0002  *                                                                         *
0003  *   copyright : (C) 2007 The University of Toronto                        *
0004  *                   netterfield@astro.utoronto.ca                         *
0005  *                                                                         *
0006  *   This program is free software; you can redistribute it and/or modify  *
0007  *   it under the terms of the GNU General Public License as published by  *
0008  *   the Free Software Foundation; either version 2 of the License, or     *
0009  *   (at your option) any later version.                                   *
0010  *                                                                         *
0011  ***************************************************************************/
0012 
0013 #ifndef CURVEDIALOG_H
0014 #define CURVEDIALOG_H
0015 
0016 #include "datadialog.h"
0017 #include "datatab.h"
0018 #include "plotitem.h"
0019 
0020 #include "ui_curvetab.h"
0021 
0022 #include <QPointer>
0023 
0024 #include "kst_export.h"
0025 
0026 namespace Kst {
0027 
0028 class CurveTab : public DataTab, Ui::CurveTab {
0029   Q_OBJECT
0030   public:
0031     explicit CurveTab(QWidget *parent = 0);
0032     virtual ~CurveTab();
0033 
0034     VectorPtr xVector() const;
0035     bool xVectorDirty() const;
0036     void setXVector(VectorPtr vector);
0037     bool xVectorSelected() const;
0038 
0039     VectorPtr yVector() const;
0040     bool yVectorDirty() const;
0041     void setYVector(VectorPtr vector);
0042     bool yVectorSelected() const;
0043 
0044     VectorPtr xError() const;
0045     bool xErrorDirty() const;
0046     void setXError(VectorPtr vector);
0047 
0048     VectorPtr yError() const;
0049     bool yErrorDirty() const;
0050     void setYError(VectorPtr vector);
0051 
0052     VectorPtr xMinusError() const;
0053     bool xMinusErrorDirty() const;
0054     void setXMinusError(VectorPtr vector);
0055 
0056     VectorPtr yMinusError() const;
0057     bool yMinusErrorDirty() const;
0058     void setYMinusError(VectorPtr vector);
0059 
0060     CurveAppearance* curveAppearance() const;
0061     CurvePlacement* curvePlacement() const;
0062 
0063     bool ignoreAutoScale() const;
0064     bool ignoreAutoScaleDirty() const;
0065     void setIgnoreAutoScale(bool ignoreAutoScale);
0066 
0067 
0068     void setObjectStore(ObjectStore *store);
0069     void hidePlacementOptions();
0070     void clearTabValues();
0071 
0072     void setToLastX() {_xVector->setToLastX();}
0073 
0074     void setPlotMode(PlotItem *plot);
0075 
0076     QString manualLegendName() const;
0077     void setManualLegendNameText(const QString &name);
0078     void setLegendAuto(bool is_auto);
0079     void setLegendNameVisible(bool visible);
0080 
0081   Q_SIGNALS:
0082     void vectorsChanged();
0083 
0084   public Q_SLOTS:
0085     void xCheckboxClicked();
0086     void yCheckboxClicked();
0087     void xErrorChanged();
0088     void yErrorChanged();
0089     void updateVectorCombos();
0090 };
0091 
0092 class CurveDialog : public DataDialog {
0093   Q_OBJECT
0094   public:
0095     explicit CurveDialog(ObjectPtr dataObject, QWidget *parent = 0);
0096     virtual ~CurveDialog();
0097 
0098     void setVector(VectorPtr vector);
0099     void setPlotMode(PlotItem *plot);
0100 
0101   protected:
0102     virtual ObjectPtr createNewDataObject();
0103     virtual ObjectPtr editExistingDataObject() const;
0104     virtual bool dialogValid() const;
0105 
0106   private Q_SLOTS:
0107     void updateButtons();
0108     void editMultipleMode();
0109     void editSingleMode();
0110 
0111   private:
0112     void configureTab(ObjectPtr curve=0);
0113 
0114     CurveTab *_curveTab;
0115 };
0116 
0117 }
0118 
0119 #endif
0120 
0121 // vim: ts=2 sw=2 et