File indexing completed on 2024-12-22 04:18:07
0001 /*************************************************************************** 0002 * * 0003 * copyright : (C) 2007 The University of Toronto * 0004 * netterfield@astro.utoronto.ca * 0005 * copyright : (C) 2005 University of British Columbia * 0006 * dscott@phas.ubc.ca * 0007 * * 0008 * This program is free software; you can redistribute it and/or modify * 0009 * it under the terms of the GNU General Public License as published by * 0010 * the Free Software Foundation; either version 2 of the License, or * 0011 * (at your option) any later version. * 0012 * * 0013 ***************************************************************************/ 0014 0015 #ifndef STATISTICSPLUGIN_H 0016 #define STATISTICSPLUGIN_H 0017 0018 #include <QFile> 0019 0020 #include <basicplugin.h> 0021 #include <dataobjectplugin.h> 0022 0023 class StatisticsSource : public Kst::BasicPlugin { 0024 Q_OBJECT 0025 0026 public: 0027 virtual QString _automaticDescriptiveName() const; 0028 0029 Kst::VectorPtr vector() const; 0030 0031 virtual void change(Kst::DataObjectConfigWidget *configWidget); 0032 0033 void setupOutputs(); 0034 virtual bool algorithm(); 0035 0036 virtual QStringList inputVectorList() const; 0037 virtual QStringList inputScalarList() const; 0038 virtual QStringList inputStringList() const; 0039 virtual QStringList outputVectorList() const; 0040 virtual QStringList outputScalarList() const; 0041 virtual QStringList outputStringList() const; 0042 0043 virtual void saveProperties(QXmlStreamWriter &s); 0044 0045 protected: 0046 StatisticsSource(Kst::ObjectStore *store); 0047 ~StatisticsSource(); 0048 0049 private: 0050 void swap( double* pData, int iOne, int iTwo ); 0051 void quicksort( double* pData, int iLeft, int iRight ); 0052 0053 friend class Kst::ObjectStore; 0054 0055 0056 }; 0057 0058 0059 class StatisticsPlugin : public QObject, public Kst::DataObjectPluginInterface { 0060 Q_OBJECT 0061 Q_INTERFACES(Kst::DataObjectPluginInterface) 0062 Q_PLUGIN_METADATA(IID "com.kst.DataObjectPluginInterface/2.0") 0063 public: 0064 virtual ~StatisticsPlugin() {} 0065 0066 virtual QString pluginName() const; 0067 virtual QString pluginDescription() const; 0068 0069 virtual DataObjectPluginInterface::PluginTypeID pluginType() const { return Generic; } 0070 0071 virtual bool hasConfigWidget() const { return true; } 0072 0073 virtual Kst::DataObject *create(Kst::ObjectStore *store, Kst::DataObjectConfigWidget *configWidget, bool setupInputsOutputs = true) const; 0074 0075 virtual Kst::DataObjectConfigWidget *configWidget(QSettings *settingsObject) const; 0076 }; 0077 0078 #endif 0079 // vim: ts=2 sw=2 et