~ubuntu-branches/ubuntu/natty/qgis/natty

« back to all changes in this revision

Viewing changes to src/plugins/grid_maker/graticulecreator.h

  • Committer: Bazaar Package Importer
  • Author(s): Johan Van de Wauw
  • Date: 2010-07-11 20:23:24 UTC
  • mfrom: (3.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100711202324-5ktghxa7hracohmr
Tags: 1.4.0+12730-3ubuntu1
* Merge from Debian unstable (LP: #540941).
* Fix compilation issues with QT 4.7
* Add build-depends on libqt4-webkit-dev 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef _GRATICULECREATOR_H_
2
 
#define _GRATICULECREATOR_H_
3
 
 
4
 
#include "shapefile.h"
5
 
#include "utils.h"
6
 
 
7
 
//qt includes
8
 
#include <QString>
9
 
//#include <qfile.h>
10
 
 
11
 
class GraticuleCreator
12
 
{
13
 
    public:
14
 
        enum ShapeType { POINT, LINE, POLYGON };
15
 
        GraticuleCreator(QString theOutputFileName, ShapeType theType);
16
 
        ~GraticuleCreator() ;
17
 
        void generatePointGraticule(
18
 
                               double theXIntervalDouble,
19
 
                               double theYIntervalDouble,
20
 
                               double theXOriginDouble,
21
 
                               double theYOriginDouble,
22
 
                               double theXEndPointDouble,
23
 
                               double theYEndPointDouble);
24
 
        void generateLineGraticule(
25
 
                               double theXIntervalDouble,
26
 
                               double theYIntervalDouble,
27
 
                               double theXOriginDouble,
28
 
                               double theYOriginDouble,
29
 
                               double theXEndPointDouble,
30
 
                               double theYEndPointDouble);
31
 
        void generatePolygonGraticule(
32
 
                               double theXIntervalDouble,
33
 
                               double theYIntervalDouble,
34
 
                               double theXOriginDouble,
35
 
                               double theYOriginDouble,
36
 
                               double theXEndPointDouble,
37
 
                               double theYEndPointDouble);
38
 
        void generatePoints (QString theInputFileName );
39
 
 
40
 
    private:
41
 
        DBFHandle mDbfHandle; 
42
 
        SHPHandle mShapeHandle;
43
 
        void createDbf (QString theDbfName ) ;
44
 
        void createShapeFile(QString theFileNamei, ShapeType theType ); 
45
 
        void writeDbfRecord ( int theRecordIdInt, QString theLabel) ;
46
 
        void writePoint(int theRecordInt, double theXDouble, double y ); 
47
 
        //! Writes a WGS 84 .prj file for the generated grid
48
 
        void writeProjectionFile(QString theFileName);
49
 
        void writePoint(
50
 
                int theRecordInt, 
51
 
                int theCoordinateCountInt, 
52
 
                double * theXArrayDouble, 
53
 
                double * theYArrayDouble ); 
54
 
        void writeLine(
55
 
                int theRecordInt, 
56
 
                int theCoordinateCountInt, 
57
 
                double * theXArrayDouble, 
58
 
                double * theYArrayDouble ); 
59
 
        void writePolygon(
60
 
                int theRecordInt, 
61
 
                int theCoordinateCountInt, 
62
 
                double * theXArrayDouble, 
63
 
                double * theYArrayDouble ); 
64
 
};
65
 
#endif