File indexing completed on 2024-12-22 04:18:10
0001 /*************************************************************************** 0002 * * 0003 * copyright : (C) 2016 C. Barth Netterfield * 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 FILTERFLAG_H 0014 #define FILTERFLAG_H 0015 0016 #include <QFile> 0017 0018 #include <basicplugin.h> 0019 #include <dataobjectplugin.h> 0020 0021 class FilterFlagSource : public Kst::BasicPlugin { 0022 Q_OBJECT 0023 0024 public: 0025 virtual QString _automaticDescriptiveName() const; 0026 0027 virtual QString descriptionTip() const; 0028 0029 Kst::VectorPtr vector() const; 0030 Kst::VectorPtr flagVector() const; 0031 0032 virtual void change(Kst::DataObjectConfigWidget *configWidget); 0033 0034 void setupOutputs(); 0035 virtual bool algorithm(); 0036 0037 virtual QStringList inputVectorList() const; 0038 virtual QStringList inputScalarList() const; 0039 virtual QStringList inputStringList() const; 0040 virtual QStringList outputVectorList() const; 0041 virtual QStringList outputScalarList() const; 0042 virtual QStringList outputStringList() const; 0043 0044 virtual void setProperty(const QString &key, const QString &val); 0045 0046 virtual void saveProperties(QXmlStreamWriter &s); 0047 0048 unsigned long long mask() {return _mask;} 0049 void setMask(unsigned long long mask) {_mask = mask;} 0050 0051 bool validIsZero() {return _validIsZero;} 0052 void setValidIsZero(bool valid_is_zero) {_validIsZero = valid_is_zero;} 0053 0054 protected: 0055 FilterFlagSource(Kst::ObjectStore *store); 0056 ~FilterFlagSource(); 0057 unsigned long long _mask; 0058 bool _validIsZero; 0059 0060 friend class Kst::ObjectStore; 0061 0062 0063 }; 0064 0065 0066 class FilterFlagPlugin : public QObject, public Kst::DataObjectPluginInterface { 0067 Q_OBJECT 0068 Q_INTERFACES(Kst::DataObjectPluginInterface) 0069 Q_PLUGIN_METADATA(IID "com.kst.DataObjectPluginInterface/2.0") 0070 public: 0071 virtual ~FilterFlagPlugin() {} 0072 0073 virtual QString pluginName() const; 0074 virtual QString pluginDescription() const; 0075 0076 virtual DataObjectPluginInterface::PluginTypeID pluginType() const { return Filter; } 0077 0078 virtual bool hasConfigWidget() const { return true; } 0079 0080 virtual Kst::DataObject *create(Kst::ObjectStore *store, Kst::DataObjectConfigWidget *configWidget, bool setupInputsOutputs = true) const; 0081 0082 virtual Kst::DataObjectConfigWidget *configWidget(QSettings *settingsObject) const; 0083 }; 0084 0085 #endif // FILTERFLAG_H 0086 // vim: ts=2 sw=2 et 0087 0088