From 971793965fa89a05ceb60b4bc0b35d5cf837c88f Mon Sep 17 00:00:00 2001 From: gsherman Date: Sat, 13 Jul 2002 06:27:41 +0000 Subject: [PATCH] documention update git-svn-id: http://svn.osgeo.org/qgis/trunk@29 c8812cc2-4d05-0410-92ff-de0c093fc19c --- src/qgisapp.h | 20 +++++++---- src/qgsdatabaselayer.h | 23 ++++++++++--- src/qgsdbsourceselect.h | 18 +++++++++- src/qgsmapcanvas.h | 14 ++++++-- src/qgsmaplayer.h | 75 +++++++++++++++++++++++++++-------------- src/qgsnewconnection.h | 9 ++++- src/qgsrasterlayer.h | 17 +++++----- src/qgsshapefilelayer.h | 9 +++-- src/qgstable.h | 9 +++-- 9 files changed, 138 insertions(+), 56 deletions(-) diff --git a/src/qgisapp.h b/src/qgisapp.h index 34a1239c5ea..5812fc5fd1f 100644 --- a/src/qgisapp.h +++ b/src/qgisapp.h @@ -22,29 +22,37 @@ class QRect; class QCanvasView; class QStringList; #include "qgisappbase.h" -/** - *@author Gary E.Sherman - */ -class QgsMapCanvas; +class QgsMapCanvas; +/*! \class QgisApp + * \brief Main window for the Qgis application + */ class QgisApp : public QgisAppBase { public: QgisApp(QWidget *parent=0, const char * name=0, WFlags fl = WType_TopLevel ); ~QgisApp(); //public slots: + //! Add a layer to the map void addLayer(); + //! Exit Qgis void fileExit(); + //! Zoom out void zoomOut(); + //! Zoom int void zoomIn(); + //! Read Well Known Binary stream from PostGIS void readWKB(const char *, QStringList tables); + //! Draw a point on the map canvas void drawPoint(double x, double y); private: - //QCanvasView *cv; -//QCanvas *canvas; + //! Map canvase QgsMapCanvas *mapCanvas; +//! Table of contents (legend) for the map QWidget *mapToc; +//! scale factor double scaleFactor; + //! Current map window extent in real-world coordinates QRect *mapWindow; }; diff --git a/src/qgsdatabaselayer.h b/src/qgsdatabaselayer.h index b4b52e5c4b3..cea5c6bb8f9 100644 --- a/src/qgsdatabaselayer.h +++ b/src/qgsdatabaselayer.h @@ -20,19 +20,32 @@ class QString; #include "qgsmaplayer.h" -/** - *@author Gary E.Sherman - */ - +/*! \class QgsDatabaseLayer + * \brief A map layer based on data stored in a relational database. + * + * At present Qgis supports PostGIS "layers" in PostgresQL. + */ class QgsDatabaseLayer : public QgsMapLayer { public: + /*! Constructor + * @param conninfo Pointer to the connection information required to + * connect to PostgresQl + *@param table Name of the table in the database that this layer + * represents + */ QgsDatabaseLayer(const char *conninfo=0, QString table=QString::null); + //! Destructor ~QgsDatabaseLayer(); private: + //! Calculates extent of the layer using SQL and PostGIS functions void calculateExtent(); - QString type; // maps to one of the OGIS Simple geometry types + //! Type geometry contained in the layer. This corresponds to one of the OGIS Simple geometry types + QString type; + //! Name of the database containing the layer (table) QString database; + //! Name of the table containing the features QString tableName; + //! Name of the columen in the table that contains the geometry for the features QString geometryColumn; diff --git a/src/qgsdbsourceselect.h b/src/qgsdbsourceselect.h index bffb124e7b0..85f6fd3bb77 100644 --- a/src/qgsdbsourceselect.h +++ b/src/qgsdbsourceselect.h @@ -1,17 +1,33 @@ #ifndef QGSDBSOURCESELECT_H #define QGSDBSOURCESELECT_H #include "qgsdbsourceselectbase.h" - +/*! \class QgsDbSourceSelect + * \brief Dialog to create connections and add tables from PostgresQL. + * + * This dialog allows the user to define and save connection information + * for PostGIS enabled PostgresQL databases. The user can then connect and add + * tables from the database to the map canvas. + */ class QgsDbSourceSelect : public QgsDbSourceSelectBase { public: + //! Constructor QgsDbSourceSelect(); + //! Destructor ~QgsDbSourceSelect(); + //! Opens the create connection dialog to build a new connection void addNewConnection(); + //! Opens a dialog to edit an existing connection void editConnection(); + //! Determines the tables the user selected and closes the dialog void addTables(); + /*! Connects to the database using the stored connection parameters. + * Once connected, available layers are displayed. + */ void dbConnect(); + //! String list containing the selected tables QStringList selectedTables(); + //! Connection info (database, host, user, password) QString connInfo(); private: QString m_connInfo; diff --git a/src/qgsmapcanvas.h b/src/qgsmapcanvas.h index 8b7998882a6..9e6d093ce8d 100644 --- a/src/qgsmapcanvas.h +++ b/src/qgsmapcanvas.h @@ -22,18 +22,26 @@ class QgsMapLayer; -/**Map canvas class for displaying all GIS data types - *@author Gary E.Sherman - */ +/*! \class QgsMapCanvas + * \brief Map canvas class for displaying all GIS data types. + */ class QgsMapCanvas : public QWidget { Q_OBJECT public: + //! Constructor QgsMapCanvas(QWidget *parent=0, const char *name=0); + //! Destructor ~QgsMapCanvas(); + /*! Adds a layer to the map canvas. + * @param lyr Pointer to a layer derived from QgsMapLayer + */ void addLayer(QgsMapLayer *lyr); + /*! Draw the map using the symbology set for each layer + */ void render(); private: + //! map containing the layers by name map layers; }; diff --git a/src/qgsmaplayer.h b/src/qgsmaplayer.h index 5bfb470618d..f43642aa26e 100644 --- a/src/qgsmaplayer.h +++ b/src/qgsmaplayer.h @@ -20,43 +20,66 @@ #include #include "qgsdatasource.h" -/** - *@author Gary E.Sherman - */ + class QRect; + +/** \class QgsMapLayer + * \brief Base class for all map layer types. + * This class is the base class for all map layer types (shapefile, + * raster, database). + */ class QgsMapLayer : public QgsDataSource { - public: + public: + /*! Constructor + * @param type Type of layer as defined in LAYERS enum + * @param lyrname Display Name of the layer + */ QgsMapLayer(int type=0, QString lyrname=QString::null ); + //! Destructor virtual ~QgsMapLayer(); - /** Read property of int layerType. */ - const int type(); - /** Write property of QString layerName. */ - void setlayerName( const QString& _newVal); - /** Read property of QString layerName. */ - const QString name(); - virtual void calculateExtent(); - const QRect extent(); + /*! Get the type of the layer + * @return Integer matching a value in the LAYERS enum + */ + const int type(); + /*! Set the name of the layer + # @param name New name for the layer + */ + void setlayerName( const QString& name); + /*! Get the name of the layer + * @return the layer name + */ + const QString name(); + /*! Virtual function to calculate the extent of the current layer. + * This function must be overridden in all child classes and implemented + * based on the layer type + */ + virtual void calculateExtent(); + /*! Return the extent of the layer as a QRect + */ + const QRect extent(); -public: // Public attributes -enum LAYERS { + public: // Public attributes + //! Layers enum defining the types of layers that can be added to a map + enum LAYERS { VECTOR, RASTER, -DATABASE -} ; + DATABASE + } ; protected: - QRect layerExtent; - //! Position in the map stack - int zpos; -private: // Private attributes - /** Name of the layer - used for display */ - QString layerName; - /** Type of the layer (eg. vector, raster, database */ - int layerType; + //! Extent of the layer + QRect layerExtent; + //! Position in the map stack + int zpos; + private: // Private attributes + /** Name of the layer - used for display */ + QString layerName; + /** Type of the layer (eg. vector, raster, database */ + int layerType; - //! Tag for embedding additional information - QString tag; + //! Tag for embedding additional information + QString tag; }; diff --git a/src/qgsnewconnection.h b/src/qgsnewconnection.h index 7048e061e8e..65e895a0af2 100644 --- a/src/qgsnewconnection.h +++ b/src/qgsnewconnection.h @@ -1,13 +1,20 @@ #ifndef QGSNEWCONNECTION_H #define QGSNEWCONNECTION_H #include "qgsnewconnectionbase.h" - +/*! \class QgsNewConnection + * \brief Dialog to allow the user to configure and save connection + * information for a PostgresQl database + */ class QgsNewConnection : public QgsNewConnectionBase { public: + //! Constructor QgsNewConnection(); + //! Destructor ~QgsNewConnection(); + //! Tests the connection using the parameters supplied void testConnection(); + //! Saves the connection to ~/.qt/qgisrc void saveConnection(); }; diff --git a/src/qgsrasterlayer.h b/src/qgsrasterlayer.h index 6151dd6cc0b..aa605755e8b 100644 --- a/src/qgsrasterlayer.h +++ b/src/qgsrasterlayer.h @@ -4,7 +4,7 @@ begin : Fri Jun 28 2002 copyright : (C) 2002 by Gary E.Sherman email : sherman@mrcc.com - ***************************************************************************/ +***************************************************************************/ /*************************************************************************** * * @@ -19,15 +19,16 @@ #define QGSRASTERLAYER_H #include "qgsmaplayer.h" - -/** - *@author Gary E.Sherman - */ +/*! \class QgsRasterLayer + * \brief Raster layer class + */ class QgsRasterLayer : public QgsMapLayer { -public: - QgsRasterLayer(); - ~QgsRasterLayer(); + public: + //! Constructor + QgsRasterLayer(); + //! Destructor + ~QgsRasterLayer(); }; #endif diff --git a/src/qgsshapefilelayer.h b/src/qgsshapefilelayer.h index 7b1dc16785f..80b46d7f9b6 100644 --- a/src/qgsshapefilelayer.h +++ b/src/qgsshapefilelayer.h @@ -20,14 +20,17 @@ #include -/** - *@author Gary E.Sherman - */ +/*! \class QgsShapeFileLayer + * \brief Shapefile layer + */ class QgsShapeFileLayer : public QgsMapLayer { public: + //! Constructor QgsShapeFileLayer(); + //! Destructor ~QgsShapeFileLayer(); + enum SHAPETYPE { Point, Line, diff --git a/src/qgstable.h b/src/qgstable.h index dde1baf2984..dc753999e33 100644 --- a/src/qgstable.h +++ b/src/qgstable.h @@ -20,13 +20,16 @@ #include -/** - *@author Gary E.Sherman - */ +/*! \class QgsTable + * \brief Class to represent an attribute table related + * to a map layer of any type + */ class QgsTable : public QgsDataSource { public: + //! Constructor QgsTable(); + //! Destructor ~QgsTable(); };