📄 qgsgrassmodule.h
字号:
//! Current value QString value(); //! Does this options causes use of region? // Raster input/output uses region by default // Use of region can be forced by 'region' attribute in qgm bool usesRegion() { return mUsesRegion; }public slots: // Add new line edit for multiple options void addLineEdit(); // Remove one line edit for multiple options void removeLineEdit();private: //! Control type ControlType mControlType; //! Value type ValueType mValueType; //! Output type OutputType mOutputType; //! If have defined value limits bool mHaveLimits; double mMin, mMax; //! Combobox QComboBox *mComboBox; //! Vector of values for combobox std::vector<QString> mValues; //! Check boxes std::vector<QCheckBox*> mCheckBoxes; //! Line std::vector<QLineEdit*> mLineEdits; //! True if this option is GRASS output bool mIsOutput; //! Output element QString mOutputElement; //! Line input validator QValidator *mValidator; // Layout inside box QVBoxLayout *mLayout; //! Uses region bool mUsesRegion;};/********************** QgsGrassModuleFlag ************************//*! \class QgsGrassModuleFlag * \brief GRASS flag */class QgsGrassModuleFlag: public QCheckBox, public QgsGrassModuleItem{ Q_OBJECT;public: /*! \brief Constructor * \param qdesc option element in QGIS module description XML file * \param gdesc GRASS module XML description file */ QgsGrassModuleFlag ( QgsGrassModule *module, QString key, QDomElement &qdesc, QDomElement &gdesc, QDomNode &gnode, QWidget * parent = 0 ); //! Destructor ~QgsGrassModuleFlag(); //! Retruns list of options which will be passed to module virtual QStringList options(); private:};/************************ QgsGrassModuleInput **********************//*! \class QgsGrassModuleInput * \brief Class representing raster or vector module input */class QgsGrassModuleInput: public QGroupBox, public QgsGrassModuleItem{ Q_OBJECT;public: /*! \brief Constructor * \param qdesc option element in QGIS module description XML file * \param gdesc GRASS module XML description file */ QgsGrassModuleInput ( QgsGrassModule *module, QgsGrassModuleStandardOptions *options, QString key, QDomElement &qdesc, QDomElement &gdesc, QDomNode &gnode, QWidget * parent = 0 ); //! Destructor ~QgsGrassModuleInput(); enum Type { Vector, Raster }; //! Retruns list of options which will be passed to module virtual QStringList options(); // ! Return vector of attribute fields of current vector std::vector<QgsField> currentFields(); //! Returns pointer to currently selected layer or null QgsMapLayer * currentLayer(); QString currentMap(); QString ready() ; //! Does this options causes use of region? // Raster input/output uses region by default // Use of region can be forced by 'region' attribute in qgm bool usesRegion() { return mUsesRegion; } //! Should be used region of this input bool useRegion(); int type() { return mType; }public slots: //! Fill combobox with currently available maps in QGIS canvas void updateQgisLayers(); void changed(int);signals: // emited when value changed/selected void valueChanged();private: //! Input type Type mType; // Module options QgsGrassModuleStandardOptions *mModuleStandardOptions; //! Vector type mask read from option defined by "typeoption" tag, used for QGIS layers in combo // + type mask defined in configuration fil int mVectorTypeMask; //! Name of vector type option associated with this input QString mVectorTypeOption; //! Name of vector layer option associated with this input QString mVectorLayerOption; //! Combobox for QGIS layers QComboBox *mLayerComboBox; //! Region button QPushButton *mRegionButton; //! Optional map option id, if defined, only the layers from the // map currently selected in that option are available. // This is used by nodes layer option for networks. QString mMapId; //! Vector of map@mapset in the combobox std::vector<QString> mMaps; //! Type of vector in the combobox std::vector<QString> mVectorTypes; //! Layer names in the combobox std::vector<QString> mVectorLayerNames; //! Pointers to vector layers in combobox std::vector<QgsMapLayer*> mMapLayers; //! Attribute fields of layers in the combobox std::vector< std::vector<QgsField> > mVectorFields; //! The imput map will be updated -> must be from current mapset bool mUpdate; //! Uses region bool mUsesRegion;};/*********************** QgsGrassModuleGdalInput **********************//*! \class QgsGrassModuleGdalInput * \brief GDAL/OGR module input */class QgsGrassModuleGdalInput: public Q3GroupBox, public QgsGrassModuleItem{ Q_OBJECT;public: /*! \brief Constructor * \param qdesc option element in QGIS module description XML file * \param gdesc GRASS module XML description file */ QgsGrassModuleGdalInput ( QgsGrassModule *module, int type, QString key, QDomElement &qdesc, QDomElement &gdesc, QDomNode &gnode, QWidget * parent = 0 ); //! Destructor ~QgsGrassModuleGdalInput(); enum Type { Gdal, Ogr }; //! Reimplemented QStringList options(); QString ready();public slots: //! Fill combobox with currently available maps in QGIS canvas void updateQgisLayers();private: //! Input type int mType; //! Ogr layer option associated with this input QString mOgrLayerOption; //! Ogr sql option associated with this input QString mOgrWhereOption; //! Combobox for QGIS layers QComboBox *mLayerComboBox; //! Vector of URI in the combobox std::vector<QString> mUri; //! Ogr layer options std::vector<QString> mOgrLayers; //! Ogr where clauses std::vector<QString> mOgrWheres;};/*********************** QgsGrassModuleField **********************//*! \class QgsGrassModuleField * \brief GRASS vector attribute column. */class QgsGrassModuleField: public Q3GroupBox, public QgsGrassModuleItem{ Q_OBJECT;public: /*! \brief Constructor * \param qdesc option element in QGIS module description XML file * \param gdesc GRASS module XML description file */ QgsGrassModuleField ( QgsGrassModule *module, QgsGrassModuleStandardOptions *options, QString key, QDomElement &qdesc, QDomElement &gdesc, QDomNode &gnode, QWidget * parent = 0 ); //! Destructor ~QgsGrassModuleField(); //! Retruns list of options which will be passed to module virtual QStringList options(); public slots: //! Fill combobox with currently available maps in QGIS canvas void updateFields();private: // Module options QgsGrassModuleStandardOptions *mModuleStandardOptions; //! Layer key QString mLayerId; //! Pointer to layer input QgsGrassModuleInput *mLayerInput; // ! Field type (integer,double,string,datetime) QString mType; //! Combobox for QGIS layer fields QComboBox *mFieldComboBox;};/*********************** QgsGrassModuleSelection **********************//*! \class QgsGrassModuleSelection * \brief List of categories taken from current layer selection. */class QgsGrassModuleSelection: public Q3GroupBox, public QgsGrassModuleItem{ Q_OBJECT;public: /*! \brief Constructor * \param qdesc option element in QGIS module description XML file * \param gdesc GRASS module XML description file */ QgsGrassModuleSelection ( QgsGrassModule *module, QgsGrassModuleStandardOptions *options, QString key, QDomElement &qdesc, QDomElement &gdesc, QDomNode &gnode, QWidget * parent = 0 ); //! Destructor ~QgsGrassModuleSelection(); //! Retruns list of options which will be passed to module virtual QStringList options(); public slots: //! Set selection list to currently selected features void updateSelection();private: // Module options QgsGrassModuleStandardOptions *mModuleStandardOptions; //! Layer key QString mLayerId; //! Pointer to layer input QgsGrassModuleInput *mLayerInput; //! Currently connected layer QgsVectorLayer *mVectorLayer; // ! Field type (integer,double,string,datetime) QString mType; //! Line QLineEdit *mLineEdit;};/*********************** QgsGrassModuleFile **********************//*! \class QgsGrassModuleSelection * \brief Input/output file. */class QgsGrassModuleFile: public QGroupBox, public QgsGrassModuleItem{ Q_OBJECT;public: /*! \brief Constructor * \param qdesc option element in QGIS module description XML file * \param gdesc GRASS module XML description file */ QgsGrassModuleFile ( QgsGrassModule *module, QString key, QDomElement &qdesc, QDomElement &gdesc, QDomNode &gnode, QWidget * parent = 0 ); //! Destructor ~QgsGrassModuleFile(); //! File type enum Type { Old, New }; // Reimplemented methods from QgsGrassModuleOptions QStringList options(); QString ready() ;public slots: // browse files void browse();private: // ! File type (New, Old) int mType; // ! Optionaly split file to dir and file path QString mFileOption; // ! Default suffix QString mSuffix; //! Line QLineEdit *mLineEdit; //! Browse button QPushButton *mBrowseButton; //! File filters QStringList mFilters;};#endif // QGSGRASSMODULE_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -