| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| class NormVecDecorator : TriDecorator | ||
| { | ||
| %TypeHeaderCode | ||
| #include <NormVecDecorator.h> | ||
| %End | ||
|
|
||
| public: | ||
| /**Enumeration for the state of a point. NORMAL means, that the point is not on a breakline, BREAKLINE means that the point is on a breakline (but not an endpoint of it) and ENDPOINT means, that it is an endpoint of a breakline*/ | ||
| enum pointState {NORMAL, BREAKLINE, ENDPOINT}; | ||
| NormVecDecorator(); | ||
| NormVecDecorator( Triangulation* tin ); | ||
| virtual ~NormVecDecorator(); | ||
| /**Adds a point to the triangulation*/ | ||
| int addPoint( Point3D* p ); | ||
| /**Calculates the normal at a point on the surface and assigns it to 'result'. Returns true in case of success and false in case of failure*/ | ||
| bool calcNormal( double x, double y, Vector3D* result ); | ||
| /**Calculates the normal of a triangle-point for the point with coordinates x and y. This is needed, if a point is on a break line and there is no unique normal stored in 'mNormVec'. Returns false, it something went wrong and true otherwise*/ | ||
| bool calcNormalForPoint( double x, double y, int point, Vector3D* result ); | ||
| /**Calculates x-, y and z-value of the point on the surface and assigns it to 'result'. Returns true in case of success and flase in case of failure*/ | ||
| bool calcPoint( double x, double y, Point3D* result ); | ||
| /**Eliminates the horizontal triangles by swapping or by insertion of new points. If alreadyestimated is true, a re-estimation of the normals will be done*/ | ||
| virtual void eliminateHorizontalTriangles(); | ||
| /**Estimates the first derivative a point. Return true in case of succes and false otherwise*/ | ||
| bool estimateFirstDerivative( int pointno ); | ||
| /**This method adds the functionality of estimating normals at the data points. Return true in the case of success and false otherwise*/ | ||
| bool estimateFirstDerivatives( QProgressDialog* d = 0 ); | ||
| /**Returns a pointer to the normal vector for the point with the number n*/ | ||
| Vector3D* getNormal( int n ) const; | ||
| /**Finds out, in which triangle a point with coordinates x and y is and assigns the triangle points to p1, p2, p3 and the estimated normals to v1, v2, v3. The vectors are normaly taken from 'mNormVec', exept if p1, p2 or p3 is a point on a breakline. In this case, the normal is calculated on-the-fly. Returns false, if something went wrong and true otherwise*/ | ||
| bool getTriangle( double x, double y, Point3D* p1, Vector3D* v1, Point3D* p2, Vector3D* v2, Point3D* p3, Vector3D* v3 ); | ||
| /**This function behaves similar to the one above. Additionally, the numbers of the points are returned (ptn1, ptn2, ptn3) as well as the pointStates of the triangle points (state1, state2, state3)*/ | ||
| //! @note not available in python bindings | ||
| // bool getTriangle( double x, double y, Point3D* p1, int* ptn1, Vector3D* v1, pointState* state1, Point3D* p2, int* ptn2, Vector3D* v2, pointState* state2, Point3D* p3, int* ptn3, Vector3D* v3, pointState* state3 ); | ||
| /**Returns the state of the point with the number 'pointno'*/ | ||
| pointState getState( int pointno ) const; | ||
| /**Sets an interpolator*/ | ||
| void setTriangleInterpolator( TriangleInterpolator* inter ); | ||
| /**Swaps the edge which is closest to the point with x and y coordinates (if this is possible) and forces recalculation of the concerned normals (if alreadyestimated is true)*/ | ||
| virtual bool swapEdge( double x, double y ); | ||
| /**Saves the triangulation as a (line) shapefile | ||
| @return true in case of success*/ | ||
| virtual bool saveAsShapefile( const QString& fileName ) const; | ||
|
|
||
| protected: | ||
| /**Sets the state (BREAKLINE, NORMAL, ENDPOINT) of a point*/ | ||
| void setState( int pointno, pointState s ); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| class ParametricLine | ||
| { | ||
| %TypeHeaderCode | ||
| #include <ParametricLine.h> | ||
| %End | ||
| public: | ||
| /**Default constructor*/ | ||
| ParametricLine(); | ||
| /**Constructor, par is a pointer to the parent object, controlpoly the controlpolygon | ||
| @note not available in python binding */ | ||
| // ParametricLine( ParametricLine* par /Transfer/, QVector<Point3D*>* controlpoly ); | ||
| /**Destructor*/ | ||
| virtual ~ParametricLine(); | ||
| virtual void add( ParametricLine* pl ) = 0; | ||
| virtual void calcFirstDer( float t, Vector3D* v ) = 0; | ||
| virtual void calcSecDer( float t, Vector3D* v ) = 0; | ||
| //virtual Point3D calcPoint(float t); | ||
| virtual void calcPoint( float t, Point3D* ) = 0; | ||
| virtual void changeDirection() = 0; | ||
| //virtual void draw(QPainter* p); | ||
| virtual const Point3D* getControlPoint( int number ) const = 0; | ||
| // virtual const QVector<Point3D*>* getControlPoly() const = 0; | ||
| virtual int getDegree() const = 0; | ||
| virtual ParametricLine* getParent() const = 0; | ||
| //virtual bool intersects(ParametricLine* pal); | ||
| virtual void remove( int i ) = 0; | ||
| //virtual void setControlPoly( QVector<Point3D*>* cp ) = 0; | ||
| virtual void setParent( ParametricLine* paral ) = 0; | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| class Point3D | ||
| { | ||
| %TypeHeaderCode | ||
| #include <Point3D.h> | ||
| %End | ||
| public: | ||
| Point3D(); | ||
| /**Constructor with the x-, y- and z-coordinate as arguments*/ | ||
| Point3D( double x, double y, double z ); | ||
| Point3D( const Point3D& p ); | ||
| ~Point3D(); | ||
| // Point3D& operator=( const Point3D& p ); | ||
| bool operator==( const Point3D& p ); | ||
| bool operator!=( const Point3D& p ); | ||
| /**calculates the three-dimensional distance to another point*/ | ||
| double dist3D( Point3D* p ) const; | ||
| /**Returns the x-coordinate of the point*/ | ||
| double getX() const; | ||
| /**Returns the y-coordinate of the point*/ | ||
| double getY() const; | ||
| /**Returns the z-coordinate of the point*/ | ||
| double getZ() const; | ||
| /**Sets the x-coordinate of the point*/ | ||
| void setX( double x ); | ||
| /**Sets the y-coordinate of the point*/ | ||
| void setY( double y ); | ||
| /**Sets the z-coordinate of the point*/ | ||
| void setZ( double z ); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| /**Decorator class for Triangulations (s. Decorator pattern in Gamma et al.)*/ | ||
| class TriDecorator : Triangulation | ||
| { | ||
| %TypeHeaderCode | ||
| #include "Triangulation.h" | ||
| %End | ||
|
|
||
| public: | ||
| TriDecorator(); | ||
| TriDecorator( Triangulation* t ); | ||
| virtual ~TriDecorator(); | ||
| virtual void addLine( Line3D* line, bool breakline ); | ||
| virtual int addPoint( Point3D* p ); | ||
| /**Adds an association to a triangulation*/ | ||
| virtual void addTriangulation( Triangulation* t ); | ||
| /**Performs a consistency check, remove this later*/ | ||
| virtual void performConsistencyTest(); | ||
| virtual bool calcNormal( double x, double y, Vector3D* result ); | ||
| virtual bool calcPoint( double x, double y, Point3D* result ); | ||
| virtual Point3D* getPoint( unsigned int i ) const; | ||
| virtual int getNumberOfPoints() const; | ||
| // bool getTriangle( double x, double y, Point3D* p1, int* n1, Point3D* p2, int* n2, Point3D* p3, int* n3 ); | ||
| bool getTriangle( double x, double y, Point3D* p1, Point3D* p2, Point3D* p3 ); | ||
| virtual int getOppositePoint( int p1, int p2 ); | ||
| virtual QList<int>* getSurroundingTriangles( int pointno ); | ||
| virtual double getXMax() const; | ||
| virtual double getXMin() const; | ||
| virtual double getYMax() const; | ||
| virtual double getYMin() const; | ||
| virtual void setForcedCrossBehaviour( Triangulation::forcedCrossBehaviour b ); | ||
| virtual void setEdgeColor( int r, int g, int b ); | ||
| virtual void setForcedEdgeColor( int r, int g, int b ); | ||
| virtual void setBreakEdgeColor( int r, int g, int b ); | ||
| virtual void setTriangleInterpolator( TriangleInterpolator* interpolator ); | ||
| virtual void eliminateHorizontalTriangles(); | ||
| virtual void ruppertRefinement(); | ||
| virtual bool pointInside( double x, double y ); | ||
| virtual bool swapEdge( double x, double y ); | ||
| virtual QList<int>* getPointsAroundEdge( double x, double y ); | ||
| }; | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| class TriangleInterpolator | ||
| { | ||
| %TypeHeaderCode | ||
| #include <TriangleInterpolator.h> | ||
| %End | ||
| public: | ||
| virtual ~TriangleInterpolator(); | ||
| /**Calculates the normal vector and assigns it to vec*/ | ||
| virtual bool calcNormVec( double x, double y, Vector3D* result ) = 0; | ||
| /**Performs a linear interpolation in a triangle and assigns the x-,y- and z-coordinates to point*/ | ||
| virtual bool calcPoint( double x, double y, Point3D* result ) = 0; | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| class Triangulation | ||
| { | ||
| %TypeHeaderCode | ||
| #include <Triangulation.h> | ||
| %End | ||
|
|
||
| public: | ||
| /**Enumeration describing the behaviour, if two forced lines cross. SnappingType_VERTICE means, that the second inserted forced line is snapped to the closest vertice of the first inserted forced line. DELETE_FIRST means, that the status of the first inserted forced line is reset to that of a normal edge (so that the second inserted forced line remain and the first not*/ | ||
| enum forcedCrossBehaviour {SnappingType_VERTICE, DELETE_FIRST, INSERT_VERTICE}; | ||
| virtual ~Triangulation(); | ||
| /**Adds a line (e.g. a break-, structure- or an isoline) to the triangulation. The class takes ownership of the line object and its points*/ | ||
| virtual void addLine( Line3D* line, bool breakline ) = 0; | ||
| /**Adds a point to the triangulation*/ | ||
| virtual int addPoint( Point3D* p ) = 0; | ||
| /**Calculates the normal at a point on the surface and assigns it to 'result'. Returns true in case of success and flase in case of failure*/ | ||
| virtual bool calcNormal( double x, double y, Vector3D* result ) = 0; | ||
| /**Performs a consistency check, remove this later*/ | ||
| virtual void performConsistencyTest() = 0; | ||
| /**Calculates x-, y and z-value of the point on the surface and assigns it to 'result'. Returns true in case of success and flase in case of failure*/ | ||
| virtual bool calcPoint( double x, double y, Point3D* result ) = 0; | ||
| /**Returns a pointer to the point with number i. Any virtual points must have the number -1*/ | ||
| virtual Point3D* getPoint( unsigned int i ) const = 0; | ||
| /**Finds out, in which triangle the point with coordinates x and y is and assigns the numbers of the vertices to 'n1', 'n2' and 'n3' and the vertices to 'p1', 'p2' and 'p3'*/ | ||
| // virtual bool getTriangle( double x, double y, Point3D* p1, int* n1, Point3D* p2, int* n2, Point3D* p3, int* n3 ) = 0; | ||
| /**Finds out, in which triangle the point with coordinates x and y is and assigns the points at the vertices to 'p1', 'p2' and 'p3*/ | ||
| virtual bool getTriangle( double x, double y, Point3D* p1 /Out/, Point3D* p2 /Out/, Point3D* p3 /Out/ ) = 0; | ||
| /**Returns the number of the point opposite to the triangle points p1, p2 (which have to be on a halfedge)*/ | ||
| virtual int getOppositePoint( int p1, int p2 ) = 0; | ||
| /**Returns the largest x-coordinate value of the bounding box*/ | ||
| virtual double getXMax() const = 0; | ||
| /**Returns the smallest x-coordinate value of the bounding box*/ | ||
| virtual double getXMin() const = 0; | ||
| /**Returns the largest y-coordinate value of the bounding box*/ | ||
| virtual double getYMax() const = 0; | ||
| /**Returns the smallest x-coordinate value of the bounding box*/ | ||
| virtual double getYMin() const = 0; | ||
| /**Returns the number of points*/ | ||
| virtual int getNumberOfPoints() const = 0; | ||
| /**Returns a pointer to a value list with the information of the triangles surrounding (counterclockwise) a point. Four integer values describe a triangle, the first three are the number of the half edges of the triangle and the fourth is -10, if the third (and most counterclockwise) edge is a breakline, and -20 otherwise. The value list has to be deleted by the code which called the method. Any virtual point needs to have the number -1*/ | ||
| virtual QList<int>* getSurroundingTriangles( int pointno ) = 0; | ||
| /**Returns a value list with the numbers of the four points, which would be affected by an edge swap. This function is e.g. needed by NormVecDecorator to know the points, for which the normals have to be recalculated. The list has to be deleted by the code which calls this method*/ | ||
| virtual QList<int>* getPointsAroundEdge( double x, double y ) = 0; | ||
| /**draws the points, edges and the forced lines*/ | ||
| //virtual void draw(QPainter* p, double xlowleft, double ylowleft, double xupright, double yupright, double width, double height) const=0; | ||
| /**Sets the behaviour of the triangulation in case of crossing forced lines*/ | ||
| virtual void setForcedCrossBehaviour( Triangulation::forcedCrossBehaviour b ) = 0; | ||
| /**Sets the color of the normal edges*/ | ||
| virtual void setEdgeColor( int r, int g, int b ) = 0; | ||
| /**Sets the color of the forced edges*/ | ||
| virtual void setForcedEdgeColor( int r, int g, int b ) = 0; | ||
| /**Sets the color of the breaklines*/ | ||
| virtual void setBreakEdgeColor( int r, int g, int b ) = 0; | ||
| /**Sets an interpolator object*/ | ||
| virtual void setTriangleInterpolator( TriangleInterpolator* interpolator ) = 0; | ||
| /**Eliminates the horizontal triangles by swapping*/ | ||
| virtual void eliminateHorizontalTriangles() = 0; | ||
| /**Adds points to make the triangles better shaped (algorithm of ruppert)*/ | ||
| virtual void ruppertRefinement() = 0; | ||
| /**Returns true, if the point with coordinates x and y is inside the convex hull and false otherwise*/ | ||
| virtual bool pointInside( double x, double y ) = 0; | ||
| /**Reads the content of a taff-file*/ | ||
| //virtual bool readFromTAFF(QString fileName)=0; | ||
| /**Saves the content to a taff file*/ | ||
| //virtual bool saveToTAFF(QString fileName) const=0; | ||
| /**Swaps the edge which is closest to the point with x and y coordinates (if this is possible)*/ | ||
| virtual bool swapEdge( double x, double y ) = 0; | ||
| /**Saves the triangulation as a (line) shapefile | ||
| @return true in case of success*/ | ||
| virtual bool saveAsShapefile( const QString& fileName ) const = 0; | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| class Vector3D | ||
| { | ||
| %TypeHeaderCode | ||
| #include <Vector3D.h> | ||
| %End | ||
|
|
||
| public: | ||
| /**Constructor taking the three components as arguments*/ | ||
| Vector3D( double x, double y, double z ); | ||
| /**Default constructor*/ | ||
| Vector3D(); | ||
| /**Copy constructor*/ | ||
| Vector3D( const Vector3D& v ); | ||
| /**Destructor*/ | ||
| ~Vector3D(); | ||
| //Vector3D& operator=( const Vector3D& v ); | ||
| bool operator==( const Vector3D& v ); | ||
| bool operator!=( const Vector3D& v ); | ||
| /**Returns the x-component of the vector*/ | ||
| double getX() const; | ||
| /**Returns the y-component of the vector*/ | ||
| double getY() const; | ||
| /**Returns the z-component of the vector*/ | ||
| double getZ() const; | ||
| /**Returns the length of the vector*/ | ||
| double getLength() const; | ||
| /**Sets the x-component of the vector*/ | ||
| void setX( double x ); | ||
| /**Sets the y-component of the vector*/ | ||
| void setY( double y ); | ||
| /**Sets the z-component of the vector*/ | ||
| void setZ( double z ); | ||
| /**Standardises the vector*/ | ||
| void standardise(); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| class QgsGridFileWriter | ||
| { | ||
| %TypeHeaderCode | ||
| #include <qgsgridfilewriter.h> | ||
| %End | ||
|
|
||
| public: | ||
| QgsGridFileWriter( QgsInterpolator* i, QString outputPath, QgsRectangle extent, int nCols, int nRows, double cellSizeX, double cellSizeY ); | ||
| ~QgsGridFileWriter(); | ||
|
|
||
| /**Writes the grid file. | ||
| @param showProgressDialog shows a dialog with the possibility to cancel | ||
| @return 0 in case of success*/ | ||
|
|
||
| int writeFile( bool showProgressDialog = false ); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| class QgsIDWInterpolator: QgsInterpolator | ||
| { | ||
| %TypeHeaderCode | ||
| #include <qgsidwinterpolator.h> | ||
| %End | ||
| public: | ||
| QgsIDWInterpolator( const QList<QgsInterpolator::LayerData>& layerData ); | ||
| ~QgsIDWInterpolator(); | ||
|
|
||
| /**Calculates interpolation value for map coordinates x, y | ||
| @param x x-coordinate (in map units) | ||
| @param y y-coordinate (in map units) | ||
| @param result out: interpolation result | ||
| @return 0 in case of success*/ | ||
| int interpolatePoint( double x, double y, double& result ); | ||
|
|
||
| void setDistanceCoefficient( double p ); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| /**Interface class for interpolations. Interpolators take | ||
| the vertices of a vector layer as base data. The z-Value | ||
| can be an attribute or the z-coordinates in case of 25D types*/ | ||
| class QgsInterpolator | ||
| { | ||
| %TypeHeaderCode | ||
| #include "qgsinterpolator.h" | ||
| %End | ||
|
|
||
| public: | ||
| /**Describes the type of input data*/ | ||
| enum InputType | ||
| { | ||
| POINTS, | ||
| STRUCTURE_LINES, | ||
| BREAK_LINES | ||
| }; | ||
|
|
||
| /**A layer together with the information about interpolation attribute / z-coordinate interpolation and the type (point, structure line, breakline)*/ | ||
| struct LayerData | ||
| { | ||
| QgsVectorLayer* vectorLayer; | ||
| bool zCoordInterpolation; | ||
| int interpolationAttribute; | ||
| int mInputType; | ||
| }; | ||
|
|
||
| QgsInterpolator( const QList<QgsInterpolator::LayerData>& layerData ); | ||
|
|
||
| virtual ~QgsInterpolator(); | ||
|
|
||
| /**Calculates interpolation value for map coordinates x, y | ||
| @param x x-coordinate (in map units) | ||
| @param y y-coordinate (in map units) | ||
| @param result out: interpolation result | ||
| @return 0 in case of success*/ | ||
| virtual int interpolatePoint( double x, double y, double& result ) = 0; | ||
|
|
||
| protected: | ||
| /**Caches the vertex and value data from the provider. All the vertex data | ||
| will be held in virtual memory | ||
| @return 0 in case of success*/ | ||
| int cacheBaseData(); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| class QgsTINInterpolator: QgsInterpolator | ||
| { | ||
| %TypeHeaderCode | ||
| #include <qgstininterpolator.h> | ||
| %End | ||
| public: | ||
| //describes the type of interpolation | ||
| enum TIN_INTERPOLATION | ||
| { | ||
| Linear, | ||
| CloughTocher | ||
| }; | ||
| QgsTINInterpolator( const QList<QgsInterpolator::LayerData>& inputData, TIN_INTERPOLATION interpolation = Linear, bool showProgressDialog = false ); | ||
| ~QgsTINInterpolator(); | ||
|
|
||
| /**Calculates interpolation value for map coordinates x, y | ||
| @param x x-coordinate (in map units) | ||
| @param y y-coordinate (in map units) | ||
| @param result out: interpolation result | ||
| @return 0 in case of success*/ | ||
| int interpolatePoint( double x, double y, double& result ); | ||
|
|
||
| void setExportTriangulationToFile( bool e ); | ||
| void setTriangulationFilePath( const QString& filepath ); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| class QgsAspectFilter: QgsDerivativeFilter | ||
| { | ||
| %TypeHeaderCode | ||
| #include <qgsaspectfilter.h> | ||
| %End | ||
|
|
||
| public: | ||
| QgsAspectFilter( const QString& inputFile, const QString& outputFile, const QString& outputFormat ); | ||
| ~QgsAspectFilter(); | ||
|
|
||
| /**Calculates output value from nine input values. The input values and the output value can be equal to the | ||
| nodata value if not present or outside of the border. Must be implemented by subclasses*/ | ||
| float processNineCellWindow( float* x11, float* x21, float* x31, | ||
| float* x12, float* x22, float* x32, | ||
| float* x13, float* x23, float* x33 ); | ||
|
|
||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| /**Adds the ability to calculate derivatives in x- and y-directions. Needs to be subclassed (e.g. for slope and aspect)*/ | ||
| class QgsDerivativeFilter : QgsNineCellFilter | ||
| { | ||
| %TypeHeaderCode | ||
| #include <qgsderivativefilter.h> | ||
| %End | ||
|
|
||
| public: | ||
| QgsDerivativeFilter( const QString& inputFile, const QString& outputFile, const QString& outputFormat ); | ||
| virtual ~QgsDerivativeFilter(); | ||
| //to be implemented by subclasses | ||
| virtual float processNineCellWindow( float* x11, float* x21, float* x31, | ||
| float* x12, float* x22, float* x32, | ||
| float* x13, float* x23, float* x33 ) = 0; | ||
|
|
||
| protected: | ||
| /**Calculates the first order derivative in x-direction according to Horn (1981)*/ | ||
| float calcFirstDerX( float* x11, float* x21, float* x31, float* x12, float* x22, float* x32, float* x13, float* x23, float* x33 ); | ||
| /**Calculates the first order derivative in y-direction according to Horn (1981)*/ | ||
| float calcFirstDerY( float* x11, float* x21, float* x31, float* x12, float* x22, float* x32, float* x13, float* x23, float* x33 ); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| class QgsHillshadeFilter: QgsDerivativeFilter | ||
| { | ||
| %TypeHeaderCode | ||
| #include <qgshillshadefilter.h> | ||
| %End | ||
|
|
||
| public: | ||
| QgsHillshadeFilter( const QString& inputFile, const QString& outputFile, const QString& outputFormat, double lightAzimuth = 300, | ||
| double lightAngle = 40 ); | ||
| ~QgsHillshadeFilter(); | ||
|
|
||
| /**Calculates output value from nine input values. The input values and the output value can be equal to the | ||
| nodata value if not present or outside of the border. Must be implemented by subclasses*/ | ||
| float processNineCellWindow( float* x11, float* x21, float* x31, | ||
| float* x12, float* x22, float* x32, | ||
| float* x13, float* x23, float* x33 ); | ||
|
|
||
| float lightAzimuth() const; | ||
| void setLightAzimuth( float azimuth ); | ||
| float lightAngle() const; | ||
| void setLightAngle( float angle ); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| class QgsNineCellFilter | ||
| { | ||
| %TypeHeaderCode | ||
| #include <qgsninecellfilter.h> | ||
| %End | ||
| public: | ||
| /**Constructor that takes input file, output file and output format (GDAL string)*/ | ||
| QgsNineCellFilter( const QString& inputFile, const QString& outputFile, const QString& outputFormat ); | ||
| virtual ~QgsNineCellFilter(); | ||
| /**Starts the calculation, reads from mInputFile and stores the result in mOutputFile | ||
| @param p progress dialog that receives update and that is checked for abort. 0 if no progress bar is needed. | ||
| @return 0 in case of success*/ | ||
| int processRaster( QProgressDialog* p ); | ||
|
|
||
| double cellSizeX() const; | ||
| void setCellSizeX( double size ); | ||
| double cellSizeY() const; | ||
| void setCellSizeY( double size ); | ||
|
|
||
| double zFactor() const; | ||
| void setZFactor( double factor ); | ||
|
|
||
| double inputNodataValue() const; | ||
| void setInputNodataValue( double value ); | ||
| double outputNodataValue() const; | ||
| void setOutputNodataValue( double value ); | ||
|
|
||
| /**Calculates output value from nine input values. The input values and the output value can be equal to the | ||
| nodata value if not present or outside of the border. Must be implemented by subclasses*/ | ||
| virtual float processNineCellWindow( float* x11, float* x21, float* x31, | ||
| float* x12, float* x22, float* x32, | ||
| float* x13, float* x23, float* x33 ) = 0; | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| class QgsRasterCalcNode | ||
| { | ||
| %TypeHeaderCode | ||
| #include <qgsrastercalcnode.h> | ||
| %End | ||
| public: | ||
| //! defines possible types of node | ||
| enum Type | ||
| { | ||
| tOperator = 1, | ||
| tNumber, | ||
| tRasterRef | ||
| }; | ||
|
|
||
| //! possible operators | ||
| enum Operator | ||
| { | ||
| opPLUS, | ||
| opMINUS, | ||
| opMUL, | ||
| opDIV, | ||
| opPOW, | ||
| opSQRT, | ||
| opSIN, | ||
| opCOS, | ||
| opTAN, | ||
| opASIN, | ||
| opACOS, | ||
| opATAN, | ||
| opEQ, // = | ||
| opNE, //!= | ||
| opGT, // > | ||
| opLT, // < | ||
| opGE, // >= | ||
| opLE, // <= | ||
| opAND, | ||
| opOR, | ||
| opSIGN //change sign | ||
| }; | ||
|
|
||
| QgsRasterCalcNode(); | ||
| QgsRasterCalcNode( double number ); | ||
| QgsRasterCalcNode( Operator op, QgsRasterCalcNode* left, QgsRasterCalcNode* right ); | ||
| QgsRasterCalcNode( const QString& rasterName ); | ||
| ~QgsRasterCalcNode(); | ||
|
|
||
| Type type() const; | ||
|
|
||
| //set left node | ||
| void setLeft( QgsRasterCalcNode* left ); | ||
| void setRight( QgsRasterCalcNode* right ); | ||
|
|
||
| /**Calculates result (might be real matrix or single number)*/ | ||
| bool calculate( QMap<QString, QgsRasterMatrix*>& rasterData, QgsRasterMatrix& result ) const; | ||
|
|
||
| static QgsRasterCalcNode* parseRasterCalcString( const QString& str, QString& parserErrorMsg ) /Factory/; | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| struct QgsRasterCalculatorEntry | ||
| { | ||
| %TypeHeaderCode | ||
| #include <qgsrastercalculator.h> | ||
| %End | ||
|
|
||
| QString ref; //name | ||
| QgsRasterLayer* raster; //pointer to rasterlayer | ||
| int bandNumber; //raster band number | ||
| }; | ||
|
|
||
| /**Raster calculator class*/ | ||
| class QgsRasterCalculator | ||
| { | ||
| %TypeHeaderCode | ||
| #include <qgsrastercalculator.h> | ||
| %End | ||
|
|
||
| public: | ||
| QgsRasterCalculator( const QString& formulaString, const QString& outputFile, const QString& outputFormat, | ||
| const QgsRectangle& outputExtent, int nOutputColumns, int nOutputRows, const QVector<QgsRasterCalculatorEntry>& rasterEntries ); | ||
| ~QgsRasterCalculator(); | ||
|
|
||
| /**Starts the calculation and writes new raster | ||
| @param p progress bar (or 0 if called from non-gui code) | ||
| @return 0 in case of success*/ | ||
| int processCalculation( QProgressDialog* p = 0 ); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| class QgsRasterMatrix | ||
| { | ||
| %TypeHeaderCode | ||
| #include <qgsrastermatrix.h> | ||
| %End | ||
|
|
||
| public: | ||
|
|
||
| enum TwoArgOperator | ||
| { | ||
| opPLUS, | ||
| opMINUS, | ||
| opMUL, | ||
| opDIV, | ||
| opPOW, | ||
| opEQ, // = | ||
| opNE, // != resp. <> | ||
| opGT, // > | ||
| opLT, // < | ||
| opGE, // >= | ||
| opLE, // <= | ||
| opAND, | ||
| opOR | ||
| }; | ||
|
|
||
| enum OneArgOperator | ||
| { | ||
| opSQRT, | ||
| opSIN, | ||
| opCOS, | ||
| opTAN, | ||
| opASIN, | ||
| opACOS, | ||
| opATAN, | ||
| opSIGN | ||
| }; | ||
|
|
||
| /**Takes ownership of data array*/ | ||
| QgsRasterMatrix(); | ||
| // QgsRasterMatrix( int nCols, int nRows, float* data, double nodataValue ); | ||
| QgsRasterMatrix( const QgsRasterMatrix& m ); | ||
| ~QgsRasterMatrix(); | ||
|
|
||
| /**Returns true if matrix is 1x1 (=scalar number)*/ | ||
| bool isNumber() const; | ||
| double number() const; | ||
|
|
||
| /**Returns data array (but not ownership)*/ | ||
| // float* data(); | ||
| /**Returns data and ownership. Sets data and nrows, ncols of this matrix to 0*/ | ||
| // float* takeData(); | ||
|
|
||
| void setData( int cols, int rows, float* data, double nodataValue ); | ||
|
|
||
| int nColumns() const; | ||
| int nRows() const; | ||
|
|
||
| double nodataValue() const; | ||
| void setNodataValue( double d ); | ||
|
|
||
| // QgsRasterMatrix& operator=( const QgsRasterMatrix& m ); | ||
| /**Adds another matrix to this one*/ | ||
| bool add( const QgsRasterMatrix& other ); | ||
| /**Subtracts another matrix from this one*/ | ||
| bool subtract( const QgsRasterMatrix& other ); | ||
| bool multiply( const QgsRasterMatrix& other ); | ||
| bool divide( const QgsRasterMatrix& other ); | ||
| bool power( const QgsRasterMatrix& other ); | ||
| bool equal( const QgsRasterMatrix& other ); | ||
| bool notEqual( const QgsRasterMatrix& other ); | ||
| bool greaterThan( const QgsRasterMatrix& other ); | ||
| bool lesserThan( const QgsRasterMatrix& other ); | ||
| bool greaterEqual( const QgsRasterMatrix& other ); | ||
| bool lesserEqual( const QgsRasterMatrix& other ); | ||
| bool logicalAnd( const QgsRasterMatrix& other ); | ||
| bool logicalOr( const QgsRasterMatrix& other ); | ||
|
|
||
| bool squareRoot(); | ||
| bool sinus(); | ||
| bool asinus(); | ||
| bool cosinus(); | ||
| bool acosinus(); | ||
| bool tangens(); | ||
| bool atangens(); | ||
| bool changeSign(); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| class QgsRelief | ||
| { | ||
| %TypeHeaderCode | ||
| #include <qgsrelief.h> | ||
| %End | ||
|
|
||
| public: | ||
| struct ReliefColor | ||
| { | ||
| ReliefColor( const QColor& c, double min, double max ); | ||
| QColor color; | ||
| double minElevation; | ||
| double maxElevation; | ||
| }; | ||
|
|
||
| QgsRelief( const QString& inputFile, const QString& outputFile, const QString& outputFormat ); | ||
| ~QgsRelief(); | ||
|
|
||
| /**Starts the calculation, reads from mInputFile and stores the result in mOutputFile | ||
| @param p progress dialog that receives update and that is checked for abort. 0 if no progress bar is needed. | ||
| @return 0 in case of success*/ | ||
| int processRaster( QProgressDialog* p ); | ||
|
|
||
| double zFactor() const; | ||
| void setZFactor( double factor ); | ||
|
|
||
| void clearReliefColors(); | ||
| void addReliefColorClass( const QgsRelief::ReliefColor& color ); | ||
| const QList< QgsRelief::ReliefColor >& reliefColors() const; | ||
| void setReliefColors( const QList< QgsRelief::ReliefColor >& c ); | ||
|
|
||
| /**Calculates class breaks according with the method of Buenzli (2011) using an iterative algorithm for segmented regression | ||
| @return true in case of success*/ | ||
| QList< QgsRelief::ReliefColor > calculateOptimizedReliefClasses(); | ||
|
|
||
| /**Write frequency of elevation values to file for manual inspection*/ | ||
| bool exportFrequencyDistributionToCsv( const QString& file ); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| class QgsRuggednessFilter: QgsNineCellFilter | ||
| { | ||
| %TypeHeaderCode | ||
| #include <qgsruggednessfilter.h> | ||
| %End | ||
|
|
||
| public: | ||
| QgsRuggednessFilter( const QString& inputFile, const QString& outputFile, const QString& outputFormat ); | ||
| ~QgsRuggednessFilter(); | ||
|
|
||
| protected: | ||
| /**Calculates output value from nine input values. The input values and the output value can be equal to the | ||
| nodata value if not present or outside of the border. Must be implemented by subclasses*/ | ||
| float processNineCellWindow( float* x11, float* x21, float* x31, | ||
| float* x12, float* x22, float* x32, | ||
| float* x13, float* x23, float* x33 ); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| class QgsSlopeFilter: QgsDerivativeFilter | ||
| { | ||
| %TypeHeaderCode | ||
| #include <qgsslopefilter.h> | ||
| %End | ||
|
|
||
| public: | ||
| QgsSlopeFilter( const QString& inputFile, const QString& outputFile, const QString& outputFormat ); | ||
| ~QgsSlopeFilter(); | ||
|
|
||
| /**Calculates output value from nine input values. The input values and the output value can be equal to the | ||
| nodata value if not present or outside of the border. Must be implemented by subclasses*/ | ||
| float processNineCellWindow( float* x11, float* x21, float* x31, | ||
| float* x12, float* x22, float* x32, | ||
| float* x13, float* x23, float* x33 ); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| class QgsTotalCurvatureFilter: QgsNineCellFilter | ||
| { | ||
| %TypeHeaderCode | ||
| #include <qgstotalcurvaturefilter.h> | ||
| %End | ||
|
|
||
| public: | ||
| QgsTotalCurvatureFilter( const QString& inputFile, const QString& outputFile, const QString& outputFormat ); | ||
| ~QgsTotalCurvatureFilter(); | ||
|
|
||
| protected: | ||
| /**Calculates total curvature from nine input values. The input values and the output value can be equal to the | ||
| nodata value if not present or outside of the border. Must be implemented by subclasses*/ | ||
| float processNineCellWindow( float* x11, float* x21, float* x31, | ||
| float* x12, float* x22, float* x32, | ||
| float* x13, float* x23, float* x33 ); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| class QgsAddRemoveMultiFrameCommand : QUndoCommand | ||
| { | ||
| %TypeHeaderCode | ||
| #include <qgsaddremovemultiframecommand.h> | ||
| %End | ||
|
|
||
| public: | ||
|
|
||
| enum State | ||
| { | ||
| Added = 0, | ||
| Removed | ||
| }; | ||
|
|
||
| QgsAddRemoveMultiFrameCommand( State s, QgsComposerMultiFrame* multiFrame, QgsComposition* c, const QString& text, QUndoCommand* parent = 0 ); | ||
| ~QgsAddRemoveMultiFrameCommand(); | ||
| void redo(); | ||
| void undo(); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| class QgsComposerArrow: QgsComposerItem | ||
| { | ||
| %TypeHeaderCode | ||
| #include <qgscomposerarrow.h> | ||
| %End | ||
| public: | ||
|
|
||
| enum MarkerMode | ||
| { | ||
| DefaultMarker, | ||
| NoMarker, | ||
| SVGMarker | ||
| }; | ||
|
|
||
| QgsComposerArrow( QgsComposition* c ); | ||
| QgsComposerArrow( const QPointF& startPoint, const QPointF& stopPoint, QgsComposition* c ); | ||
| ~QgsComposerArrow(); | ||
|
|
||
| /** return correct graphics item type. Added in v1.7 */ | ||
| virtual int type() const; | ||
|
|
||
| /** \brief Reimplementation of QCanvasItem::paint - draw on canvas */ | ||
| void paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget ); | ||
|
|
||
| /**Modifies position of start and endpoint and calls QgsComposerItem::setSceneRect*/ | ||
| void setSceneRect( const QRectF& rectangle ); | ||
|
|
||
| /**Sets the width of the arrow head in mm*/ | ||
| void setArrowHeadWidth( double width ); | ||
| double arrowHeadWidth() const; | ||
|
|
||
| void setOutlineWidth( double width ); | ||
| double outlineWidth() const; | ||
|
|
||
| void setStartMarker( const QString& svgPath ); | ||
| QString startMarker() const; | ||
| void setEndMarker( const QString& svgPath ); | ||
| QString endMarker() const; | ||
|
|
||
| QColor arrowColor() const; | ||
| void setArrowColor( const QColor& c ); | ||
|
|
||
| MarkerMode markerMode() const; | ||
| void setMarkerMode( MarkerMode mode ); | ||
|
|
||
| /** stores state in Dom element | ||
| * @param elem is Dom element corresponding to 'Composer' tag | ||
| * @param doc document | ||
| */ | ||
| bool writeXML( QDomElement& elem, QDomDocument & doc ) const; | ||
|
|
||
| /** sets state from Dom document | ||
| * @param itemElem is Dom node corresponding to item tag | ||
| * @param doc is the document to read | ||
| */ | ||
| bool readXML( const QDomElement& itemElem, const QDomDocument& doc ); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| class QgsComposerItemGroup: QgsComposerItem | ||
| { | ||
| %TypeHeaderCode | ||
| #include <qgscomposeritemgroup.h> | ||
| %End | ||
| public: | ||
| QgsComposerItemGroup( QgsComposition* c ); | ||
| ~QgsComposerItemGroup(); | ||
|
|
||
| /** return correct graphics item type. Added in v1.7 */ | ||
| virtual int type() const; | ||
|
|
||
| /**Adds an item to the group. All the group members are deleted | ||
| if the group is deleted*/ | ||
| void addItem( QgsComposerItem* item ); | ||
| /**Removes the items but does not delete them*/ | ||
| void removeItems(); | ||
| /**Draw outline and ev. selection handles*/ | ||
| void paint( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 ); | ||
| /**Sets this items bound in scene coordinates such that 1 item size units | ||
| corresponds to 1 scene size unit*/ | ||
| void setSceneRect( const QRectF& rectangle ); | ||
|
|
||
| /** stores state in Dom node | ||
| * @param elem is Dom element corresponding to 'Composer' tag | ||
| * @param doc is the Dom document | ||
| */ | ||
| bool writeXML( QDomElement& elem, QDomDocument & doc ) const; | ||
|
|
||
| /** sets state from Dom document | ||
| * @param itemElem is Dom node corresponding to item tag | ||
| * @param doc is the Dom document | ||
| */ | ||
| bool readXML( const QDomElement& itemElem, const QDomDocument& doc ); | ||
|
|
||
| QSet<QgsComposerItem*> items(); | ||
|
|
||
| signals: | ||
| void childItemDeleted( QgsComposerItem* item ); | ||
|
|
||
| protected: | ||
| void drawFrame( QPainter* p ); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,147 @@ | ||
| class QgsComposerLegendItem : QStandardItem | ||
| { | ||
| %TypeHeaderCode | ||
| #include <qgscomposerlegenditem.h> | ||
| %End | ||
|
|
||
| public: | ||
| QgsComposerLegendItem(); | ||
| QgsComposerLegendItem( const QString& text ); | ||
| QgsComposerLegendItem( const QIcon& icon, const QString& text ); | ||
| virtual ~QgsComposerLegendItem(); | ||
|
|
||
| enum ItemType | ||
| { | ||
| GroupItem = QStandardItem::UserType, | ||
| LayerItem, | ||
| SymbologyItem, | ||
| SymbologyV2Item, | ||
| RasterSymbolItem | ||
| }; | ||
|
|
||
| virtual void writeXML( QDomElement& elem, QDomDocument& doc ) const = 0; | ||
| /**Read item content from xml | ||
| @param itemElem item to read from | ||
| @param xServerAvailable Read item icons if true (QIcon needs x-server)*/ | ||
| virtual void readXML( const QDomElement& itemElem, bool xServerAvailable = true ) = 0; | ||
|
|
||
| virtual ItemType itemType() const = 0; | ||
| virtual QStandardItem* clone() const = 0; | ||
|
|
||
| protected: | ||
| void writeXMLChildren( QDomElement& elem, QDomDocument& doc ) const; | ||
| }; | ||
|
|
||
| class QgsComposerSymbolItem : QgsComposerLegendItem | ||
| { | ||
| %TypeHeaderCode | ||
| #include <qgscomposerlegenditem.h> | ||
| %End | ||
| public: | ||
|
|
||
| QgsComposerSymbolItem(); | ||
| QgsComposerSymbolItem( const QString& text ); | ||
| QgsComposerSymbolItem( const QIcon& icon, const QString& text ); | ||
| virtual ~QgsComposerSymbolItem(); | ||
|
|
||
| virtual QStandardItem* clone() const /Factory/; | ||
|
|
||
| virtual void writeXML( QDomElement& elem, QDomDocument& doc ) const; | ||
| virtual void readXML( const QDomElement& itemElem, bool xServerAvailable = true ); | ||
|
|
||
| /**Set symbol (takes ownership)*/ | ||
| void setSymbol( QgsSymbol* s ); | ||
| QgsSymbol* symbol(); | ||
|
|
||
| void setLayerID( const QString& id ); | ||
| QString layerID() const; | ||
|
|
||
| ItemType itemType() const; | ||
| }; | ||
|
|
||
| class QgsComposerSymbolV2Item: QgsComposerLegendItem | ||
| { | ||
| %TypeHeaderCode | ||
| #include <qgscomposerlegenditem.h> | ||
| %End | ||
|
|
||
| public: | ||
| QgsComposerSymbolV2Item(); | ||
| QgsComposerSymbolV2Item( const QString& text ); | ||
| QgsComposerSymbolV2Item( const QIcon& icon, const QString& text ); | ||
| virtual ~QgsComposerSymbolV2Item(); | ||
|
|
||
| virtual QStandardItem* clone() const /Factory/; | ||
|
|
||
| virtual void writeXML( QDomElement& elem, QDomDocument& doc ) const; | ||
| virtual void readXML( const QDomElement& itemElem, bool xServerAvailable = true ); | ||
|
|
||
| /**Set symbol (takes ownership)*/ | ||
| void setSymbolV2( QgsSymbolV2* s ); | ||
| QgsSymbolV2* symbolV2(); | ||
|
|
||
| ItemType itemType() const; | ||
| }; | ||
|
|
||
| class QgsComposerRasterSymbolItem : QgsComposerLegendItem | ||
| { | ||
| %TypeHeaderCode | ||
| #include <qgscomposerlegenditem.h> | ||
| %End | ||
| public: | ||
| QgsComposerRasterSymbolItem(); | ||
| QgsComposerRasterSymbolItem( const QString& text ); | ||
| QgsComposerRasterSymbolItem( const QIcon& icon, const QString& text ); | ||
| virtual ~QgsComposerRasterSymbolItem(); | ||
|
|
||
| virtual QStandardItem* clone() const /Factory/; | ||
|
|
||
| virtual void writeXML( QDomElement& elem, QDomDocument& doc ) const; | ||
| virtual void readXML( const QDomElement& itemElem, bool xServerAvailable = true ); | ||
|
|
||
| void setLayerID( const QString& id ); | ||
| QString layerID() const; | ||
| ItemType itemType() const; | ||
|
|
||
| void setColor( const QColor& c ); | ||
| QColor color() const; | ||
| }; | ||
|
|
||
| class QgsComposerLayerItem : QgsComposerLegendItem | ||
| { | ||
| %TypeHeaderCode | ||
| #include <qgscomposerlegenditem.h> | ||
| %End | ||
|
|
||
| public: | ||
| QgsComposerLayerItem(); | ||
| QgsComposerLayerItem( const QString& text ); | ||
| virtual ~QgsComposerLayerItem(); | ||
| virtual QStandardItem* clone() const /Factory/; | ||
|
|
||
| virtual void writeXML( QDomElement& elem, QDomDocument& doc ) const; | ||
| virtual void readXML( const QDomElement& itemElem, bool xServerAvailable = true ); | ||
|
|
||
| ItemType itemType() const; | ||
|
|
||
| void setLayerID( const QString& id ); | ||
| QString layerID() const; | ||
| }; | ||
|
|
||
| class QgsComposerGroupItem : QgsComposerLegendItem | ||
| { | ||
| %TypeHeaderCode | ||
| #include <qgscomposerlegenditem.h> | ||
| %End | ||
|
|
||
| public: | ||
| QgsComposerGroupItem(); | ||
| QgsComposerGroupItem( const QString& text ); | ||
| virtual ~QgsComposerGroupItem(); | ||
| virtual QStandardItem* clone() const /Factory/; | ||
|
|
||
| virtual void writeXML( QDomElement& elem, QDomDocument& doc ) const; | ||
| virtual void readXML( const QDomElement& itemElem, bool xServerAvailable = true ); | ||
|
|
||
| ItemType itemType() const; | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| class QgsComposerMultiFrameCommand : QUndoCommand | ||
| { | ||
| %TypeHeaderCode | ||
| #include <qgscomposermultiframecommand.h> | ||
| %End | ||
| public: | ||
| QgsComposerMultiFrameCommand( QgsComposerMultiFrame* multiFrame, const QString& text, QUndoCommand* parent = 0 ); | ||
| ~QgsComposerMultiFrameCommand(); | ||
|
|
||
| void undo(); | ||
| void redo(); | ||
|
|
||
| void savePreviousState(); | ||
| void saveAfterState(); | ||
|
|
||
| /**Returns true if previous state and after state are valid and different*/ | ||
| bool containsChange() const; | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| class QgsComposerTextTable: QgsComposerTable | ||
| { | ||
| %TypeHeaderCode | ||
| #include <qgscomposertexttable.h> | ||
| %End | ||
| public: | ||
| QgsComposerTextTable( QgsComposition* c ); | ||
| ~QgsComposerTextTable(); | ||
|
|
||
| /** return correct graphics item type. Added in v1.7 */ | ||
| virtual int type() const; | ||
|
|
||
| void setHeaderLabels( const QStringList& l ); | ||
| void addRow( const QStringList& row ); | ||
|
|
||
| bool writeXML( QDomElement& elem, QDomDocument & doc ) const; | ||
| bool readXML( const QDomElement& itemElem, const QDomDocument& doc ); | ||
|
|
||
| protected: | ||
| // bool getFeatureAttributes( QList< QMap<int, QVariant> >& attributes ); | ||
| QMap<int, QString> getHeaderLabels() const; | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| class QgsDoubleBoxScaleBarStyle: QgsScaleBarStyle | ||
| { | ||
| %TypeHeaderCode | ||
| #include <qgsdoubleboxscalebarstyle.h> | ||
| %End | ||
| public: | ||
| QgsDoubleBoxScaleBarStyle( const QgsComposerScaleBar* bar ); | ||
| ~QgsDoubleBoxScaleBarStyle(); | ||
|
|
||
| QString name() const; | ||
|
|
||
| void draw( QPainter* p, double xOffset = 0 ) const; | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| /** \ingroup MapComposer | ||
| * A model that provides layers as root items. The classification items are | ||
| * children of the layer items. | ||
| */ | ||
|
|
||
| class QgsLegendModel: QStandardItemModel | ||
| { | ||
| %TypeHeaderCode | ||
| #include <qgslegendmodel.h> | ||
| %End | ||
|
|
||
| public: | ||
|
|
||
| enum ItemType | ||
| { | ||
| GroupItem = 0, | ||
| LayerItem, | ||
| ClassificationItem | ||
| }; | ||
|
|
||
| QgsLegendModel(); | ||
| ~QgsLegendModel(); | ||
|
|
||
| /**Sets layer set and groups*/ | ||
| void setLayerSetAndGroups( const QStringList& layerIds, const QList< QPair< QString, QList<QString> > >& groupInfo ); | ||
| void setLayerSet( const QStringList& layerIds ); | ||
| /**Adds a group | ||
| @param text name of group (defaults to translation of "Group") | ||
| @param position insertion position (toplevel position (or -1 if it should be placed at the end of the legend). | ||
| @returns a pointer to the added group | ||
| */ | ||
| QStandardItem *addGroup( QString text = QString::null, int position = -1 ); | ||
|
|
||
| /**Tries to automatically update a model entry (e.g. a whole layer or only a single item)*/ | ||
| void updateItem( QStandardItem* item ); | ||
| /**Updates the whole symbology of a layer*/ | ||
| void updateLayer( QStandardItem* layerItem ); | ||
| /**Tries to update a single classification item*/ | ||
| void updateVectorClassificationItem( QStandardItem* classificationItem, QgsSymbol* symbol, QString itemText ); | ||
| void updateVectorV2ClassificationItem( QStandardItem* classificationItem, QgsSymbolV2* symbol, QString itemText ); | ||
| void updateRasterClassificationItem( QStandardItem* classificationItem ); | ||
|
|
||
| bool writeXML( QDomElement& composerLegendElem, QDomDocument& doc ) const; | ||
| bool readXML( const QDomElement& legendModelElem, const QDomDocument& doc ); | ||
|
|
||
| Qt::DropActions supportedDropActions() const; | ||
| Qt::ItemFlags flags( const QModelIndex &index ) const; | ||
|
|
||
| /**Implemented to support drag operations*/ | ||
| virtual bool removeRows( int row, int count, const QModelIndex & parent = QModelIndex() ); | ||
|
|
||
| /**For the drag operation*/ | ||
| QMimeData* mimeData( const QModelIndexList &indexes ) const; | ||
| QStringList mimeTypes() const; | ||
|
|
||
| /**Implements the drop operation*/ | ||
| bool dropMimeData( const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent ); | ||
|
|
||
| void setAutoUpdate( bool autoUpdate ); | ||
| bool autoUpdate(); | ||
|
|
||
| public slots: | ||
| void removeLayer( const QString& layerId ); | ||
| void addLayer( QgsMapLayer* theMapLayer ); | ||
|
|
||
| signals: | ||
| void layersChanged(); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| class QgsNumericScaleBarStyle : QgsScaleBarStyle | ||
| { | ||
| %TypeHeaderCode | ||
| #include <qgsnumericscalebarstyle.h> | ||
| %End | ||
| public: | ||
| QgsNumericScaleBarStyle( QgsComposerScaleBar* bar ); | ||
| ~QgsNumericScaleBarStyle(); | ||
|
|
||
| QString name() const; | ||
|
|
||
| void draw( QPainter* p, double xOffset = 0 ) const; | ||
|
|
||
| //calculation of box size is different compared to segment based scale bars | ||
| QRectF calculateBoxSize() const; | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| class QgsSingleBoxScaleBarStyle : QgsScaleBarStyle | ||
| { | ||
| %TypeHeaderCode | ||
| #include <qgssingleboxscalebarstyle.h> | ||
| %End | ||
| public: | ||
| QgsSingleBoxScaleBarStyle( const QgsComposerScaleBar* bar ); | ||
| ~QgsSingleBoxScaleBarStyle(); | ||
|
|
||
| QString name() const; | ||
|
|
||
| /*! draw method | ||
| @param p painter object | ||
| @param xOffset x offset | ||
| */ | ||
| void draw( QPainter* p, double xOffset = 0 ) const; | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| class QgsTicksScaleBarStyle: QgsScaleBarStyle | ||
| { | ||
| %TypeHeaderCode | ||
| #include <qgsticksscalebarstyle.h> | ||
| %End | ||
| public: | ||
| enum TickPosition | ||
| { | ||
| TicksUp, | ||
| TicksDown, | ||
| TicksMiddle | ||
| }; | ||
|
|
||
| QgsTicksScaleBarStyle( const QgsComposerScaleBar* bar ); | ||
| ~QgsTicksScaleBarStyle(); | ||
|
|
||
| QString name() const; | ||
|
|
||
| /*! draw method | ||
| @param p painter object | ||
| @param xOffset offset | ||
| */ | ||
| void draw( QPainter* p, double xOffset = 0 ) const; | ||
|
|
||
| void setTickPosition( TickPosition p ); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| class QgsDiagram | ||
| { | ||
| %TypeHeaderCode | ||
| #include <qgsdiagram.h> | ||
| %End | ||
| public: | ||
| virtual ~QgsDiagram(); | ||
| /**Draws the diagram at the given position (in pixel coordinates)*/ | ||
| virtual void renderDiagram( const QgsAttributeMap& att, QgsRenderContext& c, const QgsDiagramSettings& s, const QPointF& position ) = 0; | ||
| virtual QString diagramName() const = 0; | ||
| /**Returns the size in map units the diagram will use to render.*/ | ||
| virtual QSizeF diagramSize( const QgsAttributeMap& attributes, const QgsRenderContext& c, const QgsDiagramSettings& s ) = 0; | ||
| /**Returns the size in map units the diagram will use to render. Interpolate size*/ | ||
| virtual QSizeF diagramSize( const QgsAttributeMap& attributes, const QgsRenderContext& c, const QgsDiagramSettings& s, const QgsDiagramInterpolationSettings& is ) = 0; | ||
|
|
||
| protected: | ||
| /** Changes the pen width to match the current settings and rendering context | ||
| * @param pen The pen to modify | ||
| * @param s The settings that specify the pen width | ||
| * @param c The rendering specifying the proper scale units for pixel conversion | ||
| */ | ||
| void setPenWidth( QPen& pen, const QgsDiagramSettings& s, const QgsRenderContext& c ); | ||
|
|
||
| /** Calculates a size to match the current settings and rendering context | ||
| * @param size The size to convert | ||
| * @param s The settings that specify the size type | ||
| * @param c The rendering specifying the proper scale units for pixel conversion | ||
| * | ||
| * @return The converted size for rendering | ||
| */ | ||
| QSizeF sizePainterUnits( const QSizeF& size, const QgsDiagramSettings& s, const QgsRenderContext& c ); | ||
|
|
||
| /** Calculates a length to match the current settings and rendering context | ||
| * @param l The length to convert | ||
| * @param s Unused | ||
| * @param c The rendering specifying the proper scale units for pixel conversion | ||
| * | ||
| * @return The converted length for rendering | ||
| */ | ||
| float sizePainterUnits( float l, const QgsDiagramSettings& s, const QgsRenderContext& c ); | ||
|
|
||
| /** Calculates a size to match the current settings and rendering context | ||
| * @param s The settings that contain the font size and size type | ||
| * @param c The rendering specifying the proper scale units for pixel conversion | ||
| * | ||
| * @return The properly scaled font for rendering | ||
| */ | ||
| QFont scaledFont( const QgsDiagramSettings& s, const QgsRenderContext& c ); | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| class QgsHistogramDiagram: QgsDiagram | ||
| { | ||
| %TypeHeaderCode | ||
| #include <qgshistogramdiagram.h> | ||
| %End | ||
| public: | ||
| QgsHistogramDiagram(); | ||
| ~QgsHistogramDiagram(); | ||
|
|
||
| void renderDiagram( const QgsAttributeMap& att, QgsRenderContext& c, const QgsDiagramSettings& s, const QPointF& position ); | ||
| QSizeF diagramSize( const QgsAttributeMap& attributes, const QgsRenderContext& c, const QgsDiagramSettings& s ); | ||
| QSizeF diagramSize( const QgsAttributeMap& attributes, const QgsRenderContext& c, const QgsDiagramSettings& s, const QgsDiagramInterpolationSettings& is ); | ||
| QString diagramName() const; | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| class QgsPieDiagram: QgsDiagram | ||
| { | ||
| %TypeHeaderCode | ||
| #include <qgspiediagram.h> | ||
| %End | ||
| public: | ||
| QgsPieDiagram(); | ||
| ~QgsPieDiagram(); | ||
|
|
||
| void renderDiagram( const QgsAttributeMap& att, QgsRenderContext& c, const QgsDiagramSettings& s, const QPointF& position ); | ||
| QSizeF diagramSize( const QgsAttributeMap& attributes, const QgsRenderContext& c, const QgsDiagramSettings& s ); | ||
| QSizeF diagramSize( const QgsAttributeMap& attributes, const QgsRenderContext& c, const QgsDiagramSettings& s, const QgsDiagramInterpolationSettings& is ); | ||
| QString diagramName() const; | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| class QgsTextDiagram: QgsDiagram | ||
| { | ||
| %TypeHeaderCode | ||
| #include <qgstextdiagram.h> | ||
| %End | ||
|
|
||
| public: | ||
| enum Shape | ||
| { | ||
| Circle = 0, | ||
| Rectangle, | ||
| Triangle | ||
| }; | ||
|
|
||
| enum Orientation | ||
| { | ||
| Horizontal = 0, | ||
| Vertical | ||
| }; | ||
|
|
||
| QgsTextDiagram(); | ||
| ~QgsTextDiagram(); | ||
| void renderDiagram( const QgsAttributeMap& att, QgsRenderContext& c, const QgsDiagramSettings& s, const QPointF& position ); | ||
| QSizeF diagramSize( const QgsAttributeMap& attributes, const QgsRenderContext& c, const QgsDiagramSettings& s ); | ||
| QSizeF diagramSize( const QgsAttributeMap& attributes, const QgsRenderContext& c, const QgsDiagramSettings& s, const QgsDiagramInterpolationSettings& is ); | ||
|
|
||
| QString diagramName() const; | ||
| }; |