DualEdgeTriangulation.h | DualEdgeTriangulation.h | |||
---|---|---|---|---|
skipping to change at line 152 | skipping to change at line 152 | |||
int insertForcedSegment( int p1, int p2, bool breakline ); | int insertForcedSegment( int p1, int p2, bool breakline ); | |||
/**Threshold for the leftOfTest to handle numerical instabilities*/ | /**Threshold for the leftOfTest to handle numerical instabilities*/ | |||
//const static double leftOfTresh=0.00001; | //const static double leftOfTresh=0.00001; | |||
/**Security to prevent endless loops in 'baseEdgeOfTriangle'. It there are more iteration then this number, the point will not be inserted*/ | /**Security to prevent endless loops in 'baseEdgeOfTriangle'. It there are more iteration then this number, the point will not be inserted*/ | |||
const static int nBaseOfRuns = 300000; | const static int nBaseOfRuns = 300000; | |||
/**Returns the number of an edge which points to the point with number 'point' or -1 if there is an error*/ | /**Returns the number of an edge which points to the point with number 'point' or -1 if there is an error*/ | |||
int baseEdgeOfPoint( int point ); | int baseEdgeOfPoint( int point ); | |||
/**returns the number of a HalfEdge from a triangle in which 'point' is in. If the number -10 is returned, this means, that 'point' is outside the convex hull. If -5 is returned, then numerical problems with the leftOfTes t occured (and the value of the possible edge is stored in the variable 'mU nstableEdge'. -20 means, that the inserted point is exactly on an edge (the number is stored in the variable 'mEdgeWithPoint'). -25 means, that the po int is already in the triangulation (the number of the point is stored in t he member 'mTwiceInsPoint'. If -100 is returned, this means that something else went wrong*/ | /**returns the number of a HalfEdge from a triangle in which 'point' is in. If the number -10 is returned, this means, that 'point' is outside the convex hull. If -5 is returned, then numerical problems with the leftOfTes t occured (and the value of the possible edge is stored in the variable 'mU nstableEdge'. -20 means, that the inserted point is exactly on an edge (the number is stored in the variable 'mEdgeWithPoint'). -25 means, that the po int is already in the triangulation (the number of the point is stored in t he member 'mTwiceInsPoint'. If -100 is returned, this means that something else went wrong*/ | |||
int baseEdgeOfTriangle( Point3D* point ); | int baseEdgeOfTriangle( Point3D* point ); | |||
/**Checks, if 'edge' has to be swapped because of the empty circle crit erion. If so, doSwap(...) is called.*/ | /**Checks, if 'edge' has to be swapped because of the empty circle crit erion. If so, doSwap(...) is called.*/ | |||
bool checkSwap( unsigned int edge ); | bool checkSwap( unsigned int edge, unsigned int recursivDeep ); | |||
/**Swaps 'edge' and test recursively for other swaps (delaunay criterio n)*/ | /**Swaps 'edge' and test recursively for other swaps (delaunay criterio n)*/ | |||
void doSwap( unsigned int edge ); | void doSwap( unsigned int edge, unsigned int recursivDeep ); | |||
/**Swaps 'edge' and does no recursiv testing*/ | /**Swaps 'edge' and does no recursiv testing*/ | |||
void doOnlySwap( unsigned int edge ); | void doOnlySwap( unsigned int edge ); | |||
/**Number of an edge which does not point to the virtual point. It cont inuously updated for a fast search*/ | /**Number of an edge which does not point to the virtual point. It cont inuously updated for a fast search*/ | |||
unsigned int mEdgeInside; | unsigned int mEdgeInside; | |||
/**Number of an edge on the outside of the convex hull. It is updated i n method 'baseEdgeOfTriangle' to enable insertion of points outside the con vex hull*/ | /**Number of an edge on the outside of the convex hull. It is updated i n method 'baseEdgeOfTriangle' to enable insertion of points outside the con vex hull*/ | |||
unsigned int mEdgeOutside; | unsigned int mEdgeOutside; | |||
/**If an inserted point is exactly on an existing edge, 'baseEdgeOfTria ngle' returns -20 and sets the variable 'mEdgeWithPoint'*/ | /**If an inserted point is exactly on an existing edge, 'baseEdgeOfTria ngle' returns -20 and sets the variable 'mEdgeWithPoint'*/ | |||
unsigned int mEdgeWithPoint; | unsigned int mEdgeWithPoint; | |||
/**If an instability occurs in 'baseEdgeOfTriangle', mUnstableEdge is s et to the value of the current edge*/ | /**If an instability occurs in 'baseEdgeOfTriangle', mUnstableEdge is s et to the value of the current edge*/ | |||
unsigned int mUnstableEdge; | unsigned int mUnstableEdge; | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
NormVecDecorator.h | NormVecDecorator.h | |||
---|---|---|---|---|
skipping to change at line 54 | skipping to change at line 54 | |||
virtual void eliminateHorizontalTriangles(); | virtual void eliminateHorizontalTriangles(); | |||
/**Estimates the first derivative a point. Return true in case of succe s and false otherwise*/ | /**Estimates the first derivative a point. Return true in case of succe s and false otherwise*/ | |||
bool estimateFirstDerivative( int pointno ); | 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*/ | /**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 ); | bool estimateFirstDerivatives( QProgressDialog* d = 0 ); | |||
/**Returns a pointer to the normal vector for the point with the number n*/ | /**Returns a pointer to the normal vector for the point with the number n*/ | |||
Vector3D* getNormal( int n ) const; | 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*/ | /**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, Point3 D* p2, Vector3D* v2, Point3D* p3, Vector3D* v3 ); | bool getTriangle( double x, double y, Point3D* p1, Vector3D* v1, Point3 D* p2, Vector3D* v2, Point3D* p3, Vector3D* v3 ); | |||
/**This function behaves similar to the one above. Additionally, the nu mbers of the points are returned (ptn1, ptn2, ptn3) as well as the pointSta tes of the triangle points (state1, state2, state3)*/ | /**This function behaves similar to the one above. Additionally, the nu mbers of the points are returned (ptn1, ptn2, ptn3) as well as the pointSta tes 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 ); | 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'*/ | /**Returns the state of the point with the number 'pointno'*/ | |||
pointState getState( int pointno ) const; | pointState getState( int pointno ) const; | |||
/**Sets an interpolator*/ | /**Sets an interpolator*/ | |||
void setTriangleInterpolator( TriangleInterpolator* inter ); | void setTriangleInterpolator( TriangleInterpolator* inter ); | |||
/**Swaps the edge which is closest to the point with x and y coordinate s (if this is possible) and forces recalculation of the concerned normals ( if alreadyestimated is true)*/ | /**Swaps the edge which is closest to the point with x and y coordinate s (if this is possible) and forces recalculation of the concerned normals ( if alreadyestimated is true)*/ | |||
virtual bool swapEdge( double x, double y ); | virtual bool swapEdge( double x, double y ); | |||
/**Saves the triangulation as a (line) shapefile | /**Saves the triangulation as a (line) shapefile | |||
@return true in case of success*/ | @return true in case of success*/ | |||
virtual bool saveAsShapefile( const QString& fileName ) const; | virtual bool saveAsShapefile( const QString& fileName ) const; | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 1 lines changed or added | |||
ParametricLine.h | ParametricLine.h | |||
---|---|---|---|---|
skipping to change at line 37 | skipping to change at line 37 | |||
protected: | protected: | |||
/**Degree of the parametric Line*/ | /**Degree of the parametric Line*/ | |||
int mDegree; | int mDegree; | |||
/**Pointer to the parent object. If there isn't one, mParent is 0*/ | /**Pointer to the parent object. If there isn't one, mParent is 0*/ | |||
ParametricLine* mParent; | ParametricLine* mParent; | |||
/**mControlPoly stores the points of the control polygon*/ | /**mControlPoly stores the points of the control polygon*/ | |||
QVector<Point3D*>* mControlPoly; | QVector<Point3D*>* mControlPoly; | |||
public: | public: | |||
/**Default constructor*/ | /**Default constructor*/ | |||
ParametricLine(); | ParametricLine(); | |||
/**Constructor, par is a pointer to the parent object, controlpoly the | /**Constructor, par is a pointer to the parent object, controlpoly the | |||
controlpolygon*/ | controlpolygon | |||
@note not available in python binding */ | ||||
ParametricLine( ParametricLine* par, QVector<Point3D*>* controlpoly ); | ParametricLine( ParametricLine* par, QVector<Point3D*>* controlpoly ); | |||
/**Destructor*/ | /**Destructor*/ | |||
virtual ~ParametricLine(); | virtual ~ParametricLine(); | |||
virtual void add( ParametricLine* pl ) = 0; | virtual void add( ParametricLine* pl ) = 0; | |||
virtual void calcFirstDer( float t, Vector3D* v ) = 0; | virtual void calcFirstDer( float t, Vector3D* v ) = 0; | |||
virtual void calcSecDer( float t, Vector3D* v ) = 0; | virtual void calcSecDer( float t, Vector3D* v ) = 0; | |||
//virtual Point3D calcPoint(float t); | //virtual Point3D calcPoint(float t); | |||
virtual void calcPoint( float t, Point3D* ) = 0; | virtual void calcPoint( float t, Point3D* ) = 0; | |||
virtual void changeDirection() = 0; | virtual void changeDirection() = 0; | |||
//virtual void draw(QPainter* p); | //virtual void draw(QPainter* p); | |||
End of changes. 1 change blocks. | ||||
2 lines changed or deleted | 3 lines changed or added | |||
qgis.h | qgis.h | |||
---|---|---|---|---|
skipping to change at line 85 | skipping to change at line 85 | |||
case WKBMultiPoint: return WKBPoint; | case WKBMultiPoint: return WKBPoint; | |||
case WKBMultiLineString: return WKBLineString; | case WKBMultiLineString: return WKBLineString; | |||
case WKBMultiPolygon: return WKBPolygon; | case WKBMultiPolygon: return WKBPolygon; | |||
case WKBMultiPoint25D: return WKBPoint25D; | case WKBMultiPoint25D: return WKBPoint25D; | |||
case WKBMultiLineString25D: return WKBLineString25D; | case WKBMultiLineString25D: return WKBLineString25D; | |||
case WKBMultiPolygon25D: return WKBPolygon25D; | case WKBMultiPolygon25D: return WKBPolygon25D; | |||
default: return type; | default: return type; | |||
} | } | |||
} | } | |||
static WkbType multiType( WkbType type ) | ||||
{ | ||||
switch ( type ) | ||||
{ | ||||
case WKBPoint: return WKBMultiPoint; | ||||
case WKBLineString: return WKBMultiLineString; | ||||
case WKBPolygon: return WKBMultiPolygon; | ||||
case WKBPoint25D: return WKBMultiPoint25D; | ||||
case WKBLineString25D: return WKBMultiLineString25D; | ||||
case WKBPolygon25D: return WKBMultiPolygon25D; | ||||
default: return type; | ||||
} | ||||
} | ||||
static WkbType flatType( WkbType type ) | static WkbType flatType( WkbType type ) | |||
{ | { | |||
switch ( type ) | switch ( type ) | |||
{ | { | |||
case WKBPoint25D: return WKBPoint; | case WKBPoint25D: return WKBPoint; | |||
case WKBLineString25D: return WKBLineString; | case WKBLineString25D: return WKBLineString; | |||
case WKBPolygon25D: return WKBPolygon; | case WKBPolygon25D: return WKBPolygon; | |||
case WKBMultiPoint25D: return WKBMultiPoint; | case WKBMultiPoint25D: return WKBMultiPoint; | |||
case WKBMultiLineString25D: return WKBMultiLineString; | case WKBMultiLineString25D: return WKBMultiLineString; | |||
case WKBMultiPolygon25D: return WKBMultiPolygon; | case WKBMultiPolygon25D: return WKBMultiPolygon; | |||
default: return type; | default: return type; | |||
} | } | |||
} | } | |||
static bool isSingleType( WkbType type ) | ||||
{ | ||||
switch ( flatType( type ) ) | ||||
{ | ||||
case WKBPoint: | ||||
case WKBLineString: | ||||
case WKBPolygon: | ||||
return true; | ||||
default: | ||||
return false; | ||||
} | ||||
} | ||||
static bool isMultiType( WkbType type ) | ||||
{ | ||||
switch ( flatType( type ) ) | ||||
{ | ||||
case WKBMultiPoint: | ||||
case WKBMultiLineString: | ||||
case WKBMultiPolygon: | ||||
return true; | ||||
default: | ||||
return false; | ||||
} | ||||
} | ||||
static int wkbDimensions( WkbType type ) | static int wkbDimensions( WkbType type ) | |||
{ | { | |||
switch ( type ) | switch ( type ) | |||
{ | { | |||
case WKBUnknown: return 0; | case WKBUnknown: return 0; | |||
case WKBNoGeometry: return 0; | case WKBNoGeometry: return 0; | |||
case WKBPoint25D: return 3; | case WKBPoint25D: return 3; | |||
case WKBLineString25D: return 3; | case WKBLineString25D: return 3; | |||
case WKBPolygon25D: return 3; | case WKBPolygon25D: return 3; | |||
case WKBMultiPoint25D: return 3; | case WKBMultiPoint25D: return 3; | |||
skipping to change at line 147 | skipping to change at line 187 | |||
//! description strings for feature types | //! description strings for feature types | |||
static const char *featureType( WkbType type ) | static const char *featureType( WkbType type ) | |||
{ | { | |||
switch ( type ) | switch ( type ) | |||
{ | { | |||
case WKBUnknown: return "WKBUnknown"; | case WKBUnknown: return "WKBUnknown"; | |||
case WKBPoint: return "WKBPoint"; | case WKBPoint: return "WKBPoint"; | |||
case WKBLineString: return "WKBLineString"; | case WKBLineString: return "WKBLineString"; | |||
case WKBPolygon: return "WKBPolygon"; | case WKBPolygon: return "WKBPolygon"; | |||
case WKBMultiPoint: return "WKBMultiLineString"; | case WKBMultiPoint: return "WKBMultiPoint"; | |||
case WKBMultiLineString: return "WKBMultiLineString"; | ||||
case WKBMultiPolygon: return "WKBMultiPolygon"; | case WKBMultiPolygon: return "WKBMultiPolygon"; | |||
case WKBNoGeometry: return "WKBNoGeometry"; | case WKBNoGeometry: return "WKBNoGeometry"; | |||
case WKBPoint25D: return "WKBPoint25D"; | case WKBPoint25D: return "WKBPoint25D"; | |||
case WKBLineString25D: return "WKBLineString25D"; | case WKBLineString25D: return "WKBLineString25D"; | |||
case WKBPolygon25D: return "WKBPolygon25D"; | case WKBPolygon25D: return "WKBPolygon25D"; | |||
case WKBMultiPoint25D: return "WKBMultiPoint25D"; | case WKBMultiPoint25D: return "WKBMultiPoint25D"; | |||
case WKBMultiLineString25D: return "WKBMultiLineString25D"; | case WKBMultiLineString25D: return "WKBMultiLineString25D"; | |||
case WKBMultiPolygon25D: return "WKBMultiPolygon25D"; | case WKBMultiPolygon25D: return "WKBMultiPolygon25D"; | |||
default: return "invalid wkbtype"; | default: return "invalid wkbtype"; | |||
} | } | |||
skipping to change at line 198 | skipping to change at line 239 | |||
{ | { | |||
Meters = 0, | Meters = 0, | |||
Feet = 1, | Feet = 1, | |||
Degrees = 2, //for 1.0 api backwards compatibility | Degrees = 2, //for 1.0 api backwards compatibility | |||
UnknownUnit = 3, | UnknownUnit = 3, | |||
// for [1.4;1.8] api compatibility | // for [1.4;1.8] api compatibility | |||
DecimalDegrees = 2, // was 2 | DecimalDegrees = 2, // was 2 | |||
DegreesMinutesSeconds = 2, // was 4 | DegreesMinutesSeconds = 2, // was 4 | |||
DegreesDecimalMinutes = 2, // was 5 | DegreesDecimalMinutes = 2, // was 5 | |||
NauticalMiles = 7 | ||||
}; | }; | |||
//! Provides the canonical name of the type value | //! Provides the canonical name of the type value | |||
// Added in version 2.0 | // Added in version 2.0 | |||
static QString toLiteral( QGis::UnitType unit ); | static QString toLiteral( QGis::UnitType unit ); | |||
//! Converts from the canonical name to the type value | //! Converts from the canonical name to the type value | |||
// Added in version 2.0 | // Added in version 2.0 | |||
static UnitType fromLiteral( QString literal, QGis::UnitType defaultTy pe = UnknownUnit ); | static UnitType fromLiteral( QString literal, QGis::UnitType defaultTy pe = UnknownUnit ); | |||
//! Provides translated version of the type value | //! Provides translated version of the type value | |||
// Added in version 2.0 | // Added in version 2.0 | |||
static QString tr( QGis::UnitType unit ); | static QString tr( QGis::UnitType unit ); | |||
//! Returns the conversion factor between the specified units | ||||
static double fromUnitToUnitFactor( QGis::UnitType fromUnit, QGis::Unit | ||||
Type toUnit ); | ||||
//! User defined event types | //! User defined event types | |||
enum UserEvent | enum UserEvent | |||
{ | { | |||
// These first two are useful for threads to alert their parent data providers | // These first two are useful for threads to alert their parent data providers | |||
//! The extents have been calculated by a provider of a layer | //! The extents have been calculated by a provider of a layer | |||
ProviderExtentCalcEvent = ( QEvent::User + 1 ), | ProviderExtentCalcEvent = ( QEvent::User + 1 ), | |||
//! The row count has been calculated by a provider of a layer | //! The row count has been calculated by a provider of a layer | |||
ProviderCountCalcEvent | ProviderCountCalcEvent | |||
}; | }; | |||
static const double DEFAULT_IDENTIFY_RADIUS; | static const double DEFAULT_IDENTIFY_RADIUS; | |||
//! Default threshold between map coordinates and device coordinates fo | ||||
r map2pixel simplification | ||||
static const float DEFAULT_MAPTOPIXEL_THRESHOLD; | ||||
private: | private: | |||
// String representation of unit types (set in qgis.cpp) | // String representation of unit types (set in qgis.cpp) | |||
static const char *qgisUnitTypes[]; | static const char *qgisUnitTypes[]; | |||
}; | }; | |||
// hack to workaround warnings when casting void pointers | // hack to workaround warnings when casting void pointers | |||
// retrieved from QLibrary::resolve to function pointers. | // retrieved from QLibrary::resolve to function pointers. | |||
// It's assumed that this works on all systems supporting | // It's assumed that this works on all systems supporting | |||
// QLibrary | // QLibrary | |||
skipping to change at line 285 | skipping to change at line 332 | |||
double br = frexp( b, &bexp ); | double br = frexp( b, &bexp ); | |||
return aexp == bexp && | return aexp == bexp && | |||
qRound( ar * pow( 10.0, significantDigits ) ) == qRound( br * pow( 10.0, significantDigits ) ) ; | qRound( ar * pow( 10.0, significantDigits ) ) == qRound( br * pow( 10.0, significantDigits ) ) ; | |||
} | } | |||
bool qgsVariantLessThan( const QVariant& lhs, const QVariant& rhs ); | bool qgsVariantLessThan( const QVariant& lhs, const QVariant& rhs ); | |||
bool qgsVariantGreaterThan( const QVariant& lhs, const QVariant& rhs ); | bool qgsVariantGreaterThan( const QVariant& lhs, const QVariant& rhs ); | |||
QString qgsVsiPrefix( QString path ); | ||||
/** Allocates size bytes and returns a pointer to the allocated memory. | /** Allocates size bytes and returns a pointer to the allocated memory. | |||
Works like C malloc() but prints debug message by QgsLogger if allocati on fails. | Works like C malloc() but prints debug message by QgsLogger if allocati on fails. | |||
@param size size in bytes | @param size size in bytes | |||
*/ | */ | |||
void CORE_EXPORT *qgsMalloc( size_t size ); | void CORE_EXPORT *qgsMalloc( size_t size ); | |||
/** Allocates memory for an array of nmemb elements of size bytes each and returns | /** Allocates memory for an array of nmemb elements of size bytes each and returns | |||
a pointer to the allocated memory. Works like C calloc() but prints deb ug message | a pointer to the allocated memory. Works like C calloc() but prints deb ug message | |||
by QgsLogger if allocation fails. | by QgsLogger if allocation fails. | |||
@param nmemb number of elements | @param nmemb number of elements | |||
skipping to change at line 349 | skipping to change at line 398 | |||
const double MINIMUM_POINT_SIZE = 0.1; | const double MINIMUM_POINT_SIZE = 0.1; | |||
/** Magic number that determines the default point size for point symbols * / | /** Magic number that determines the default point size for point symbols * / | |||
const double DEFAULT_POINT_SIZE = 2.0; | const double DEFAULT_POINT_SIZE = 2.0; | |||
const double DEFAULT_LINE_WIDTH = 0.26; | const double DEFAULT_LINE_WIDTH = 0.26; | |||
/** default snapping tolerance for segments (@note added in 1.8) */ | /** default snapping tolerance for segments (@note added in 1.8) */ | |||
const double DEFAULT_SEGMENT_EPSILON = 1e-8; | const double DEFAULT_SEGMENT_EPSILON = 1e-8; | |||
typedef QMap<QString, QString> QgsStringMap; | typedef QMap<QString, QString> QgsStringMap; | |||
/** qgssize is used instead of size_t, because size_t is stdlib type, unkno | ||||
wn | ||||
* by SIP, and it would be hard to define size_t correctly in SIP. | ||||
* Currently used "unsigned long long" was introduced in C++11 (2011) | ||||
* but it was supported already before C++11 on common platforms. | ||||
* "unsigned long long int" gives syntax error in SIP. | ||||
* KEEP IN SYNC WITH qgssize defined in SIP! */ | ||||
typedef unsigned long long qgssize; | ||||
// FIXME: also in qgisinterface.h | // FIXME: also in qgisinterface.h | |||
#ifndef QGISEXTERN | #ifndef QGISEXTERN | |||
#ifdef WIN32 | #ifdef WIN32 | |||
# define QGISEXTERN extern "C" __declspec( dllexport ) | # define QGISEXTERN extern "C" __declspec( dllexport ) | |||
# ifdef _MSC_VER | # ifdef _MSC_VER | |||
// do not warn about C bindings returing QString | // do not warn about C bindings returing QString | |||
# pragma warning(disable:4190) | # pragma warning(disable:4190) | |||
# endif | # endif | |||
#else | #else | |||
# define QGISEXTERN extern "C" | # define QGISEXTERN extern "C" | |||
#endif | #endif | |||
#endif | #endif | |||
#endif | #endif | |||
End of changes. 9 change blocks. | ||||
2 lines changed or deleted | 61 lines changed or added | |||
qgisgui.h | qgisgui.h | |||
---|---|---|---|---|
skipping to change at line 82 | skipping to change at line 82 | |||
*/ | */ | |||
bool GUI_EXPORT openFilesRememberingFilter( QString const &filterName, | bool GUI_EXPORT openFilesRememberingFilter( QString const &filterName, | |||
QString const &filters, QStringList & selectedFiles, QString& enc, QS tring &title, | QString const &filters, QStringList & selectedFiles, QString& enc, QS tring &title, | |||
bool cancelAll = false ); | bool cancelAll = false ); | |||
/** A helper function to get an image name from the user. It will nicely | /** A helper function to get an image name from the user. It will nicely | |||
* provide filters with all available writable image formats. | * provide filters with all available writable image formats. | |||
* @param theParent widget that should act as the parent for the file dia log | * @param theParent widget that should act as the parent for the file dia log | |||
* @param theMessage the message to display to the user | * @param theMessage the message to display to the user | |||
* @param defaultFilename default file name (empty by default) | ||||
* @return QPair<QString, QString> where first is the file name and secon d is | * @return QPair<QString, QString> where first is the file name and secon d is | |||
* the file type | * the file type | |||
* @note added in 1.6 | * @note added in 1.6 | |||
*/ | */ | |||
QPair<QString, QString> GUI_EXPORT getSaveAsImageName( QWidget * theParen t, QString theMessage ); | QPair<QString, QString> GUI_EXPORT getSaveAsImageName( QWidget * theParen t, QString theMessage, QString defaultFilename = QString::null ); | |||
/** | /** | |||
Convenience function for readily creating file filters. | Convenience function for readily creating file filters. | |||
Given a long name for a file filter and a regular expression, return | Given a long name for a file filter and a regular expression, return | |||
a file filter string suitable for use in a QFileDialog::OpenFiles() | a file filter string suitable for use in a QFileDialog::OpenFiles() | |||
call. The regular express, glob, will have both all lower and upper | call. The regular express, glob, will have both all lower and upper | |||
case versions added. | case versions added. | |||
* @note added in 1.6 | * @note added in 1.6 | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 2 lines changed or added | |||
qgisinterface.h | qgisinterface.h | |||
---|---|---|---|---|
skipping to change at line 37 | skipping to change at line 37 | |||
class QgsComposerView; | class QgsComposerView; | |||
class QgsMapLayer; | class QgsMapLayer; | |||
class QgsMapCanvas; | class QgsMapCanvas; | |||
class QgsRasterLayer; | class QgsRasterLayer; | |||
class QgsVectorLayer; | class QgsVectorLayer; | |||
class QgsLegendInterface; | class QgsLegendInterface; | |||
class QgsPluginManagerInterface; | class QgsPluginManagerInterface; | |||
class QgsFeature; | class QgsFeature; | |||
class QgsMessageBar; | class QgsMessageBar; | |||
class QgsVectorLayerTools; | ||||
#include <QObject> | #include <QObject> | |||
#include <QFont> | #include <QFont> | |||
#include <QPair> | #include <QPair> | |||
#include <map> | #include <map> | |||
#include <qgis.h> | #include <qgis.h> | |||
#ifdef _MSC_VER | #ifdef _MSC_VER | |||
# pragma warning( push ) | # pragma warning( push ) | |||
skipping to change at line 220 | skipping to change at line 221 | |||
/** Return a pointer to the map canvas */ | /** Return a pointer to the map canvas */ | |||
virtual QgsMapCanvas * mapCanvas() = 0; | virtual QgsMapCanvas * mapCanvas() = 0; | |||
/** Return a pointer to the main window (instance of QgisApp in case of QGIS) */ | /** Return a pointer to the main window (instance of QgisApp in case of QGIS) */ | |||
virtual QWidget * mainWindow() = 0; | virtual QWidget * mainWindow() = 0; | |||
/** Return the message bar of the main app */ | /** Return the message bar of the main app */ | |||
virtual QgsMessageBar * messageBar() = 0; | virtual QgsMessageBar * messageBar() = 0; | |||
/**Return mainwindows / composer views of running composer instances (c urrently only one)*/ | /** Return mainwindows / composer views of running composer instances ( currently only one) */ | |||
virtual QList<QgsComposerView*> activeComposers() = 0; | virtual QList<QgsComposerView*> activeComposers() = 0; | |||
/** Create a new composer | /** Create a new composer | |||
* @param title window title for new composer (one will be generated if empty) | * @param title window title for new composer (one will be generated if empty) | |||
* @return pointer to composer's view | * @return pointer to composer's view | |||
* @note new composer window will be shown and activated (added in 1.9) | * @note new composer window will be shown and activated (added in 1.9) | |||
*/ | */ | |||
virtual QgsComposerView* createNewComposer( QString title = QString( "" ) ) = 0; | virtual QgsComposerView* createNewComposer( QString title = QString( "" ) ) = 0; | |||
/** Duplicate an existing parent composer from composer view | /** Duplicate an existing parent composer from composer view | |||
skipping to change at line 374 | skipping to change at line 375 | |||
*/ | */ | |||
#ifndef Q_MOC_RUN | #ifndef Q_MOC_RUN | |||
Q_DECL_DEPRECATED | Q_DECL_DEPRECATED | |||
#endif | #endif | |||
virtual void openURL( QString url, bool useQgisDocDirectory = true ) = 0; | virtual void openURL( QString url, bool useQgisDocDirectory = true ) = 0; | |||
/** Accessors for inserting items into menus and toolbars. | /** Accessors for inserting items into menus and toolbars. | |||
* An item can be inserted before any existing action. | * An item can be inserted before any existing action. | |||
*/ | */ | |||
//! Menus | // Menus | |||
#ifndef Q_MOC_RUN | #ifndef Q_MOC_RUN | |||
Q_DECL_DEPRECATED | Q_DECL_DEPRECATED | |||
#endif | #endif | |||
virtual QMenu *fileMenu() = 0; | virtual QMenu *fileMenu() = 0; | |||
virtual QMenu *projectMenu() = 0; | virtual QMenu *projectMenu() = 0; | |||
virtual QMenu *editMenu() = 0; | virtual QMenu *editMenu() = 0; | |||
virtual QMenu *viewMenu() = 0; | virtual QMenu *viewMenu() = 0; | |||
virtual QMenu *layerMenu() = 0; | virtual QMenu *layerMenu() = 0; | |||
/** \note added in 2.0 | /** \note added in 2.0 | |||
*/ | */ | |||
skipping to change at line 402 | skipping to change at line 403 | |||
/** \note added in 2.0 | /** \note added in 2.0 | |||
*/ | */ | |||
virtual QMenu *vectorMenu() = 0; | virtual QMenu *vectorMenu() = 0; | |||
/** \note added in 2.0 | /** \note added in 2.0 | |||
*/ | */ | |||
virtual QMenu *webMenu() = 0; | virtual QMenu *webMenu() = 0; | |||
virtual QMenu *firstRightStandardMenu() = 0; | virtual QMenu *firstRightStandardMenu() = 0; | |||
virtual QMenu *windowMenu() = 0; | virtual QMenu *windowMenu() = 0; | |||
virtual QMenu *helpMenu() = 0; | virtual QMenu *helpMenu() = 0; | |||
//! ToolBars | // ToolBars | |||
virtual QToolBar *fileToolBar() = 0; | virtual QToolBar *fileToolBar() = 0; | |||
virtual QToolBar *layerToolBar() = 0; | virtual QToolBar *layerToolBar() = 0; | |||
virtual QToolBar *mapNavToolToolBar() = 0; | virtual QToolBar *mapNavToolToolBar() = 0; | |||
virtual QToolBar *digitizeToolBar() = 0; | virtual QToolBar *digitizeToolBar() = 0; | |||
virtual QToolBar *advancedDigitizeToolBar() = 0; // added in v1.5 | virtual QToolBar *advancedDigitizeToolBar() = 0; // added in v1.5 | |||
virtual QToolBar *attributesToolBar() = 0; | virtual QToolBar *attributesToolBar() = 0; | |||
virtual QToolBar *pluginToolBar() = 0; | virtual QToolBar *pluginToolBar() = 0; | |||
virtual QToolBar *helpToolBar() = 0; | virtual QToolBar *helpToolBar() = 0; | |||
/** \note added in 1.7 | /** \note added in 1.7 | |||
*/ | */ | |||
skipping to change at line 424 | skipping to change at line 425 | |||
/** \note added in 2.0 | /** \note added in 2.0 | |||
*/ | */ | |||
virtual QToolBar *vectorToolBar() = 0; | virtual QToolBar *vectorToolBar() = 0; | |||
/** \note added in 2.0 | /** \note added in 2.0 | |||
*/ | */ | |||
virtual QToolBar *databaseToolBar() = 0; | virtual QToolBar *databaseToolBar() = 0; | |||
/** \note added in 2.0 | /** \note added in 2.0 | |||
*/ | */ | |||
virtual QToolBar *webToolBar() = 0; | virtual QToolBar *webToolBar() = 0; | |||
//! Project menu actions | // Project menu actions | |||
virtual QAction *actionNewProject() = 0; | virtual QAction *actionNewProject() = 0; | |||
virtual QAction *actionOpenProject() = 0; | virtual QAction *actionOpenProject() = 0; | |||
virtual QAction *actionSaveProject() = 0; | virtual QAction *actionSaveProject() = 0; | |||
virtual QAction *actionSaveProjectAs() = 0; | virtual QAction *actionSaveProjectAs() = 0; | |||
virtual QAction *actionSaveMapAsImage() = 0; | virtual QAction *actionSaveMapAsImage() = 0; | |||
virtual QAction *actionProjectProperties() = 0; | virtual QAction *actionProjectProperties() = 0; | |||
virtual QAction *actionPrintComposer() = 0; | virtual QAction *actionPrintComposer() = 0; | |||
virtual QAction *actionShowComposerManager() = 0; | virtual QAction *actionShowComposerManager() = 0; | |||
virtual QAction *actionExit() = 0; | virtual QAction *actionExit() = 0; | |||
//! Edit menu actions | // Edit menu actions | |||
virtual QAction *actionCutFeatures() = 0; | virtual QAction *actionCutFeatures() = 0; | |||
virtual QAction *actionCopyFeatures() = 0; | virtual QAction *actionCopyFeatures() = 0; | |||
virtual QAction *actionPasteFeatures() = 0; | virtual QAction *actionPasteFeatures() = 0; | |||
virtual QAction *actionAddFeature() = 0; | virtual QAction *actionAddFeature() = 0; | |||
virtual QAction *actionDeleteSelected() = 0; | virtual QAction *actionDeleteSelected() = 0; | |||
virtual QAction *actionMoveFeature() = 0; | virtual QAction *actionMoveFeature() = 0; | |||
virtual QAction *actionSplitFeatures() = 0; | virtual QAction *actionSplitFeatures() = 0; | |||
virtual QAction *actionSplitParts() = 0; | ||||
virtual QAction *actionAddRing() = 0; | virtual QAction *actionAddRing() = 0; | |||
virtual QAction *actionAddPart() = 0; | virtual QAction *actionAddPart() = 0; | |||
virtual QAction *actionSimplifyFeature() = 0; | virtual QAction *actionSimplifyFeature() = 0; | |||
virtual QAction *actionDeleteRing() = 0; | virtual QAction *actionDeleteRing() = 0; | |||
virtual QAction *actionDeletePart() = 0; | virtual QAction *actionDeletePart() = 0; | |||
virtual QAction *actionNodeTool() = 0; | virtual QAction *actionNodeTool() = 0; | |||
//! View menu actions | // View menu actions | |||
//! Get access to the native pan action. Call trigger() on it to set th | ||||
e default pan map tool. | ||||
virtual QAction *actionPan() = 0; | virtual QAction *actionPan() = 0; | |||
//! Get access to the native touch action. | ||||
virtual QAction *actionTouch() = 0; | virtual QAction *actionTouch() = 0; | |||
//! Get access to the native pan to selected action. Call trigger() on it to pan the map canvas to the selection. | ||||
virtual QAction *actionPanToSelected() = 0; | virtual QAction *actionPanToSelected() = 0; | |||
//! Get access to the native zoom in action. Call trigger() on it to se t the default zoom in map tool. | ||||
virtual QAction *actionZoomIn() = 0; | virtual QAction *actionZoomIn() = 0; | |||
//! Get access to the native zoom out action. Call trigger() on it to s et the default zoom out map tool. | ||||
virtual QAction *actionZoomOut() = 0; | virtual QAction *actionZoomOut() = 0; | |||
//! Get access to the native select action. Call trigger() on it to set the default select map tool. | ||||
virtual QAction *actionSelect() = 0; | virtual QAction *actionSelect() = 0; | |||
//! Get access to the native select rectangle action. Call trigger() on it to set the default select rectangle map tool. | ||||
virtual QAction *actionSelectRectangle() = 0; | virtual QAction *actionSelectRectangle() = 0; | |||
//! Get access to the native select polygon action. Call trigger() on i t to set the default select polygon map tool. | ||||
virtual QAction *actionSelectPolygon() = 0; | virtual QAction *actionSelectPolygon() = 0; | |||
//! Get access to the native select freehand action. Call trigger() on it to set the default select freehand map tool. | ||||
virtual QAction *actionSelectFreehand() = 0; | virtual QAction *actionSelectFreehand() = 0; | |||
//! Get access to the native select radius action. Call trigger() on it to set the default select radius map tool. | ||||
virtual QAction *actionSelectRadius() = 0; | virtual QAction *actionSelectRadius() = 0; | |||
//! Get access to the native identify action. Call trigger() on it to s et the default identify map tool. | ||||
virtual QAction *actionIdentify() = 0; | virtual QAction *actionIdentify() = 0; | |||
//! Get access to the native run action feature action. Call trigger() | ||||
on it to set the default run feature action map tool. | ||||
virtual QAction *actionFeatureAction() = 0; | ||||
//! Get access to the native measure action. Call trigger() on it to se | ||||
t the default measure map tool. | ||||
virtual QAction *actionMeasure() = 0; | virtual QAction *actionMeasure() = 0; | |||
//! Get access to the native measure area action. Call trigger() on it to set the default measure area map tool. | ||||
virtual QAction *actionMeasureArea() = 0; | virtual QAction *actionMeasureArea() = 0; | |||
//! Get access to the native zoom full extent action. Call trigger() on it to zoom to the full extent. | ||||
virtual QAction *actionZoomFullExtent() = 0; | virtual QAction *actionZoomFullExtent() = 0; | |||
//! Get access to the native zoom to layer action. Call trigger() on it to zoom to the active layer. | ||||
virtual QAction *actionZoomToLayer() = 0; | virtual QAction *actionZoomToLayer() = 0; | |||
//! Get access to the native zoom to selected action. Call trigger() on it to zoom to the current selection. | ||||
virtual QAction *actionZoomToSelected() = 0; | virtual QAction *actionZoomToSelected() = 0; | |||
//! Get access to the native zoom last action. Call trigger() on it to zoom to last. | ||||
virtual QAction *actionZoomLast() = 0; | virtual QAction *actionZoomLast() = 0; | |||
//! Get access to the native zoom next action. Call trigger() on it to | ||||
zoom to next. | ||||
virtual QAction *actionZoomNext() = 0; | ||||
//! Get access to the native zoom actual size action. Call trigger() on | ||||
it to zoom to actual size. | ||||
virtual QAction *actionZoomActualSize() = 0; | virtual QAction *actionZoomActualSize() = 0; | |||
//! Get access to the native map tips action. Call trigger() on it to t oggle map tips. | ||||
virtual QAction *actionMapTips() = 0; | virtual QAction *actionMapTips() = 0; | |||
//! Get access to the native new bookmark action. Call trigger() on it to open the new bookmark dialog. | ||||
virtual QAction *actionNewBookmark() = 0; | virtual QAction *actionNewBookmark() = 0; | |||
//! Get access to the native show bookmarks action. Call trigger() on i t to open the bookmarks dialog. | ||||
virtual QAction *actionShowBookmarks() = 0; | virtual QAction *actionShowBookmarks() = 0; | |||
//! Get access to the native draw action. | ||||
virtual QAction *actionDraw() = 0; | virtual QAction *actionDraw() = 0; | |||
//! Layer menu actions | // Layer menu actions | |||
virtual QAction *actionNewVectorLayer() = 0; | virtual QAction *actionNewVectorLayer() = 0; | |||
virtual QAction *actionAddOgrLayer() = 0; | virtual QAction *actionAddOgrLayer() = 0; | |||
virtual QAction *actionAddRasterLayer() = 0; | virtual QAction *actionAddRasterLayer() = 0; | |||
virtual QAction *actionAddPgLayer() = 0; | virtual QAction *actionAddPgLayer() = 0; | |||
virtual QAction *actionAddWmsLayer() = 0; | virtual QAction *actionAddWmsLayer() = 0; | |||
/** @note added in 1.9 */ | /** @note added in 1.9 */ | |||
virtual QAction *actionCopyLayerStyle() = 0; | virtual QAction *actionCopyLayerStyle() = 0; | |||
/** @note added in 1.9 */ | /** @note added in 1.9 */ | |||
virtual QAction *actionPasteLayerStyle() = 0; | virtual QAction *actionPasteLayerStyle() = 0; | |||
virtual QAction *actionOpenTable() = 0; | virtual QAction *actionOpenTable() = 0; | |||
skipping to change at line 515 | skipping to change at line 543 | |||
virtual QAction *actionRemoveLayer() = 0; | virtual QAction *actionRemoveLayer() = 0; | |||
/** @note added in 1.9 */ | /** @note added in 1.9 */ | |||
virtual QAction *actionDuplicateLayer() = 0; | virtual QAction *actionDuplicateLayer() = 0; | |||
virtual QAction *actionLayerProperties() = 0; | virtual QAction *actionLayerProperties() = 0; | |||
virtual QAction *actionAddToOverview() = 0; | virtual QAction *actionAddToOverview() = 0; | |||
virtual QAction *actionAddAllToOverview() = 0; | virtual QAction *actionAddAllToOverview() = 0; | |||
virtual QAction *actionRemoveAllFromOverview() = 0; | virtual QAction *actionRemoveAllFromOverview() = 0; | |||
virtual QAction *actionHideAllLayers() = 0; | virtual QAction *actionHideAllLayers() = 0; | |||
virtual QAction *actionShowAllLayers() = 0; | virtual QAction *actionShowAllLayers() = 0; | |||
//! Plugin menu actions | // Plugin menu actions | |||
virtual QAction *actionManagePlugins() = 0; | virtual QAction *actionManagePlugins() = 0; | |||
virtual QAction *actionPluginListSeparator() = 0; | virtual QAction *actionPluginListSeparator() = 0; | |||
virtual QAction *actionShowPythonDialog() = 0; | virtual QAction *actionShowPythonDialog() = 0; | |||
//! Settings menu actions | // Settings menu actions | |||
virtual QAction *actionToggleFullScreen() = 0; | virtual QAction *actionToggleFullScreen() = 0; | |||
virtual QAction *actionOptions() = 0; | virtual QAction *actionOptions() = 0; | |||
virtual QAction *actionCustomProjection() = 0; | virtual QAction *actionCustomProjection() = 0; | |||
//! Help menu actions | // Help menu actions | |||
virtual QAction *actionHelpContents() = 0; | virtual QAction *actionHelpContents() = 0; | |||
virtual QAction *actionQgisHomePage() = 0; | virtual QAction *actionQgisHomePage() = 0; | |||
virtual QAction *actionCheckQgisVersion() = 0; | virtual QAction *actionCheckQgisVersion() = 0; | |||
virtual QAction *actionAbout() = 0; | virtual QAction *actionAbout() = 0; | |||
//! Open feature form | /** | |||
// returns true when dialog was accepted | * Open feature form | |||
// @added in 1.6 | * @return true when dialog was accepted | |||
* @note added in 1.6 | ||||
*/ | ||||
virtual bool openFeatureForm( QgsVectorLayer *l, QgsFeature &f, bool up dateFeatureOnly = false ) = 0; | virtual bool openFeatureForm( QgsVectorLayer *l, QgsFeature &f, bool up dateFeatureOnly = false ) = 0; | |||
virtual QDialog* getFeatureForm( QgsVectorLayer *l, QgsFeature &f ) = 0 ; | virtual QDialog* getFeatureForm( QgsVectorLayer *l, QgsFeature &f ) = 0 ; | |||
virtual QgsVectorLayerTools* vectorLayerTools() = 0; | ||||
virtual void preloadForm( QString uifile ) = 0; | virtual void preloadForm( QString uifile ) = 0; | |||
/** Return vector layers in edit mode | /** Return vector layers in edit mode | |||
* @param modified whether to return only layers that have been modifie d | * @param modified whether to return only layers that have been modifie d | |||
* @returns list of layers in legend order, or empty list | * @returns list of layers in legend order, or empty list | |||
* @note added in 1.9 */ | * @note added in 1.9 */ | |||
virtual QList<QgsMapLayer *> editableLayers( bool modified = false ) co nst = 0; | virtual QList<QgsMapLayer *> editableLayers( bool modified = false ) co nst = 0; | |||
/** Get timeout for timed messages: default of 5 seconds | /** Get timeout for timed messages: default of 5 seconds | |||
* @note added in 1.9 */ | * @note added in 1.9 */ | |||
virtual int messageTimeout() = 0; | virtual int messageTimeout() = 0; | |||
signals: | signals: | |||
/** Emitted whenever current (selected) layer changes. | /** Emitted whenever current (selected) layer changes. | |||
* The pointer to layer can be null if no layer is selected | * The pointer to layer can be null if no layer is selected | |||
*/ | */ | |||
void currentLayerChanged( QgsMapLayer * layer ); | void currentLayerChanged( QgsMapLayer * layer ); | |||
/**This signal is emitted when a new composer instance has been created | /** | |||
* This signal is emitted when a new composer instance has been created | ||||
* @note added in 1.4 | * @note added in 1.4 | |||
*/ | */ | |||
void composerAdded( QgsComposerView* v ); | void composerAdded( QgsComposerView* v ); | |||
/**This signal is emitted before a new composer instance is going to be | /** | |||
removed | * This signal is emitted before a new composer instance is going to be | |||
removed | ||||
* @note added in 1.4 | * @note added in 1.4 | |||
*/ | */ | |||
void composerWillBeRemoved( QgsComposerView* v ); | void composerWillBeRemoved( QgsComposerView* v ); | |||
/**This signal is emitted when the initialization is complete | /** | |||
* @note added in version 1.6 | * This signal is emitted when the initialization is complete | |||
*/ | * @note added in 1.6 | |||
*/ | ||||
void initializationCompleted(); | void initializationCompleted(); | |||
/** emitted when a project file is successfully read | /** emitted when a project file is successfully read | |||
@note | @note | |||
This is useful for plug-ins that store properties with project file s. A | This is useful for plug-ins that store properties with project file s. A | |||
plug-in can connect to this signal. When it is emitted, the plug-i n | plug-in can connect to this signal. When it is emitted, the plug-i n | |||
knows to then check the project properties for any relevant state. | knows to then check the project properties for any relevant state. | |||
Added in v1.6 | Added in 1.6 | |||
*/ | */ | |||
void projectRead(); | void projectRead(); | |||
/** emitted when starting an entirely new project | /** emitted when starting an entirely new project | |||
@note | @note | |||
This is similar to projectRead(); plug-ins might want to be notifie d | This is similar to projectRead(); plug-ins might want to be notifie d | |||
that they're in a new project. Yes, projectRead() could have been | that they're in a new project. Yes, projectRead() could have been | |||
overloaded to be used in the case of new projects instead. However , | overloaded to be used in the case of new projects instead. However , | |||
it's probably more semantically correct to have an entirely separat e | it's probably more semantically correct to have an entirely separat e | |||
signal for when this happens. | signal for when this happens. | |||
Added in v1.6 | Added in 1.6 | |||
*/ | */ | |||
void newProjectCreated(); | void newProjectCreated(); | |||
}; | }; | |||
#ifdef _MSC_VER | #ifdef _MSC_VER | |||
# pragma warning( pop ) | # pragma warning( pop ) | |||
# pragma warning( disable: 4190 ) | # pragma warning( disable: 4190 ) | |||
#endif | #endif | |||
// FIXME: also in core/qgis.h | // FIXME: also in core/qgis.h | |||
End of changes. 40 change blocks. | ||||
21 lines changed or deleted | 61 lines changed or added | |||
qgsapplication.h | qgsapplication.h | |||
---|---|---|---|---|
skipping to change at line 29 | skipping to change at line 29 | |||
#include <QEvent> | #include <QEvent> | |||
#include <QStringList> | #include <QStringList> | |||
#include <qgis.h> | #include <qgis.h> | |||
#include <qgsconfig.h> | #include <qgsconfig.h> | |||
/** \ingroup core | /** \ingroup core | |||
* Extends QApplication to provide access to QGIS specific resources such | * Extends QApplication to provide access to QGIS specific resources such | |||
* as theme paths, database paths etc. | * as theme paths, database paths etc. | |||
*/ | */ | |||
class CORE_EXPORT QgsApplication: public QApplication | ||||
#ifdef ANDROID | ||||
typedef void XEvent; | ||||
#endif | ||||
class CORE_EXPORT QgsApplication : public QApplication | ||||
{ | { | |||
Q_OBJECT | Q_OBJECT | |||
public: | public: | |||
//! @note customConfigDir parameter added in v1.6 | //! @note customConfigDir parameter added in v1.6 | |||
QgsApplication( int & argc, char ** argv, bool GUIenabled, QString cust omConfigPath = QString() ); | QgsApplication( int & argc, char ** argv, bool GUIenabled, QString cust omConfigPath = QString() ); | |||
virtual ~QgsApplication(); | virtual ~QgsApplication(); | |||
/** This method initialises paths etc for QGIS. Called by the ctor or c all it manually | /** This method initialises paths etc for QGIS. Called by the ctor or c all it manually | |||
when your app does not extend the QApplication class. | when your app does not extend the QApplication class. | |||
@note you will probably want to call initQgis too to load the provi ders in | @note you will probably want to call initQgis too to load the provi ders in | |||
skipping to change at line 62 | skipping to change at line 67 | |||
/** Set the active theme to the specified theme. | /** Set the active theme to the specified theme. | |||
* The theme name should be a single word e.g. 'default','classic'. | * The theme name should be a single word e.g. 'default','classic'. | |||
* The theme search path usually will be pkgDataPath + "/themes/" + the mName + "/" | * The theme search path usually will be pkgDataPath + "/themes/" + the mName + "/" | |||
* but plugin writers etc can use themeName() as a basis for searching | * but plugin writers etc can use themeName() as a basis for searching | |||
* for resources in their own datastores e.g. a Qt4 resource bundle. | * for resources in their own datastores e.g. a Qt4 resource bundle. | |||
* @note A basic test will be carried out to ensure the theme search pa th | * @note A basic test will be carried out to ensure the theme search pa th | |||
* based on the supplied theme name exists. If it does not the theme na me will | * based on the supplied theme name exists. If it does not the theme na me will | |||
* be reverted to 'default'. | * be reverted to 'default'. | |||
*/ | */ | |||
static void setThemeName( const QString theThemeName ); | static void setThemeName( const QString &theThemeName ); | |||
/** Set the active theme to the specified theme. | /** Set the active theme to the specified theme. | |||
* The theme name should be a single word e.g. 'default','classic'. | * The theme name should be a single word e.g. 'default','classic'. | |||
* The theme search path usually will be pkgDataPath + "/themes/" + the mName + "/" | * The theme search path usually will be pkgDataPath + "/themes/" + the mName + "/" | |||
* but plugin writers etc can use this method as a basis for searching | * but plugin writers etc can use this method as a basis for searching | |||
* for resources in their own datastores e.g. a Qt4 resource bundle. | * for resources in their own datastores e.g. a Qt4 resource bundle. | |||
*/ | */ | |||
static const QString themeName(); | static const QString themeName(); | |||
//! Returns the path to the authors file. | //! Returns the path to the authors file. | |||
skipping to change at line 155 | skipping to change at line 160 | |||
static const QString defaultThemePath(); | static const QString defaultThemePath(); | |||
//! Returns path to the desired icon file. | //! Returns path to the desired icon file. | |||
//! First it tries to use the active theme path, then default theme pat h | //! First it tries to use the active theme path, then default theme pat h | |||
//! @note Added in 1.5 | //! @note Added in 1.5 | |||
static QString iconPath( QString iconFile ); | static QString iconPath( QString iconFile ); | |||
//! Helper to get a theme icon. It will fall back to the | //! Helper to get a theme icon. It will fall back to the | |||
//! default theme if the active theme does not have the required icon. | //! default theme if the active theme does not have the required icon. | |||
//! @note Added in 2.0 | //! @note Added in 2.0 | |||
static QIcon getThemeIcon( const QString theName ); | static QIcon getThemeIcon( const QString &theName ); | |||
//! Helper to get a theme icon as a pixmap. It will fall back to the | //! Helper to get a theme icon as a pixmap. It will fall back to the | |||
//! default theme if the active theme does not have the required icon. | //! default theme if the active theme does not have the required icon. | |||
//! @note Added in 2.0 | //! @note Added in 2.0 | |||
static QPixmap getThemePixmap( const QString theName ); | static QPixmap getThemePixmap( const QString &theName ); | |||
//! Returns the path to user's style. Added in QGIS 1.4 | //! Returns the path to user's style. Added in QGIS 1.4 | |||
static const QString userStyleV2Path(); | static const QString userStyleV2Path(); | |||
//! Returns the path to default style (works as a starting point). Adde d in QGIS 1.4 | //! Returns the path to default style (works as a starting point). Adde d in QGIS 1.4 | |||
static const QString defaultStyleV2Path(); | static const QString defaultStyleV2Path(); | |||
//! Returns the path containing qgis_core, qgis_gui, qgispython (and ot her) libraries | //! Returns the path containing qgis_core, qgis_gui, qgispython (and ot her) libraries | |||
//! @note Added in 2.0 | //! @note Added in 2.0 | |||
static const QString libraryPath(); | static const QString libraryPath(); | |||
//! Returns the path with utility executables (help viewer, crssync, .. .) | //! Returns the path with utility executables (help viewer, crssync, .. .) | |||
//! @note Added in 2.0 | //! @note Added in 2.0 | |||
static const QString libexecPath(); | static const QString libexecPath(); | |||
//! Alters prefix path - used by 3rd party apps | //! Alters prefix path - used by 3rd party apps | |||
static void setPrefixPath( const QString thePrefixPath, bool useDefault Paths = false ); | static void setPrefixPath( const QString &thePrefixPath, bool useDefaul tPaths = false ); | |||
//! Alters plugin path - used by 3rd party apps | //! Alters plugin path - used by 3rd party apps | |||
static void setPluginPath( const QString thePluginPath ); | static void setPluginPath( const QString &thePluginPath ); | |||
//! Alters pkg data path - used by 3rd party apps | //! Alters pkg data path - used by 3rd party apps | |||
static void setPkgDataPath( const QString thePkgDataPath ); | static void setPkgDataPath( const QString &thePkgDataPath ); | |||
//! Alters default svg paths - used by 3rd party apps. Added in QGIS 1. 5 | //! Alters default svg paths - used by 3rd party apps. Added in QGIS 1. 5 | |||
static void setDefaultSvgPaths( const QStringList& pathList ); | static void setDefaultSvgPaths( const QStringList& pathList ); | |||
//! loads providers | //! loads providers | |||
static void initQgis(); | static void initQgis(); | |||
//! initialise qgis.db | //! initialise qgis.db | |||
static bool createDB( QString* errorMessage = 0 ); | static bool createDB( QString* errorMessage = 0 ); | |||
skipping to change at line 277 | skipping to change at line 282 | |||
*/ | */ | |||
static QStringList skippedGdalDrivers( ) { return ABISYM( mGdalSkipList ); } | static QStringList skippedGdalDrivers( ) { return ABISYM( mGdalSkipList ); } | |||
/** Apply the skipped drivers list to gdal | /** Apply the skipped drivers list to gdal | |||
* @see skipGdalDriver | * @see skipGdalDriver | |||
* @see restoreGdalDriver | * @see restoreGdalDriver | |||
* @see skippedGdalDrivers | * @see skippedGdalDrivers | |||
* @note added in 2.0 */ | * @note added in 2.0 */ | |||
static void applyGdalSkippedDrivers(); | static void applyGdalSkippedDrivers(); | |||
#ifdef ANDROID | ||||
//dummy method to workaround sip generation issue issue | ||||
bool x11EventFilter( XEvent * event ) | ||||
{ | ||||
return 0; | ||||
} | ||||
#endif | ||||
signals: | signals: | |||
//! @note not available in python bindings | //! @note not available in python bindings | |||
void preNotify( QObject * receiver, QEvent * event, bool * done ); | void preNotify( QObject * receiver, QEvent * event, bool * done ); | |||
private: | private: | |||
static QObject* ABISYM( mFileOpenEventReceiver ); | static QObject* ABISYM( mFileOpenEventReceiver ); | |||
static QStringList ABISYM( mFileOpenEventList ); | static QStringList ABISYM( mFileOpenEventList ); | |||
static QString ABISYM( mPrefixPath ); | static QString ABISYM( mPrefixPath ); | |||
static QString ABISYM( mPluginPath ); | static QString ABISYM( mPluginPath ); | |||
End of changes. 8 change blocks. | ||||
7 lines changed or deleted | 20 lines changed or added | |||
qgsarcproperter.h | qgsarcproperter.h | |||
---|---|---|---|---|
skipping to change at line 38 | skipping to change at line 38 | |||
* \class QgsEdgeProperter | * \class QgsEdgeProperter | |||
* \brief QgsEdgeProperter is a strategy pattern. | * \brief QgsEdgeProperter is a strategy pattern. | |||
* You can use it for customize arc property. For example look at QgsDistan ceArcProperter or src/plugins/roadgraph/speedproperter.h | * You can use it for customize arc property. For example look at QgsDistan ceArcProperter or src/plugins/roadgraph/speedproperter.h | |||
*/ | */ | |||
class ANALYSIS_EXPORT QgsArcProperter | class ANALYSIS_EXPORT QgsArcProperter | |||
{ | { | |||
public: | public: | |||
/** | /** | |||
* default constructor | * default constructor | |||
*/ | */ | |||
QgsArcProperter() | QgsArcProperter() {} | |||
{ } | ||||
/** | /** | |||
* QgsGraphDirector call this method for fetching attribute from source layer | * QgsGraphDirector call this method for fetching attribute from source layer | |||
* \return required attributes list | * \return required attributes list | |||
*/ | */ | |||
virtual QgsAttributeList requiredAttributes() const | virtual QgsAttributeList requiredAttributes() const { return QgsAttribu | |||
{ return QgsAttributeList(); } | teList(); } | |||
/** | /** | |||
* calculate and return adge property | * calculate and return adge property | |||
*/ | */ | |||
virtual QVariant property( double distance, const QgsFeature &f ) const | virtual QVariant property( double distance, const QgsFeature &f ) const | |||
{ | { | |||
Q_UNUSED( distance ); | Q_UNUSED( distance ); | |||
Q_UNUSED( f ); | Q_UNUSED( f ); | |||
return QVariant(); | return QVariant(); | |||
} | } | |||
End of changes. 2 change blocks. | ||||
4 lines changed or deleted | 3 lines changed or added | |||
qgsatlascomposition.h | qgsatlascomposition.h | |||
---|---|---|---|---|
skipping to change at line 46 | skipping to change at line 46 | |||
* */ | * */ | |||
class CORE_EXPORT QgsAtlasComposition : public QObject | class CORE_EXPORT QgsAtlasComposition : public QObject | |||
{ | { | |||
Q_OBJECT | Q_OBJECT | |||
public: | public: | |||
QgsAtlasComposition( QgsComposition* composition ); | QgsAtlasComposition( QgsComposition* composition ); | |||
~QgsAtlasComposition(); | ~QgsAtlasComposition(); | |||
/** Is the atlas generation enabled ? */ | /** Is the atlas generation enabled ? */ | |||
bool enabled() const { return mEnabled; } | bool enabled() const { return mEnabled; } | |||
void setEnabled( bool e ) { mEnabled = e; } | void setEnabled( bool e ); | |||
QgsComposerMap* composerMap() const { return mComposerMap; } | /**Returns the map used by the atlas | |||
void setComposerMap( QgsComposerMap* map ) { mComposerMap = map; } | * @deprecated Use QgsComposerMap::atlasDriven() instead | |||
*/ | ||||
QgsComposerMap* composerMap() const; | ||||
/**Sets the map used by the atlas | ||||
* @deprecated Use QgsComposerMap::setAtlasDriven( true ) instead | ||||
*/ | ||||
void setComposerMap( QgsComposerMap* map ); | ||||
bool hideCoverage() const { return mHideCoverage; } | bool hideCoverage() const { return mHideCoverage; } | |||
void setHideCoverage( bool hide ) { mHideCoverage = hide; } | void setHideCoverage( bool hide ); | |||
bool fixedScale() const { return mFixedScale; } | /**Returns whether the atlas map uses a fixed scale | |||
void setFixedScale( bool fixed ) { mFixedScale = fixed; } | * @deprecated Use QgsComposerMap::atlasFixedScale() instead | |||
*/ | ||||
float margin() const { return mMargin; } | bool fixedScale() const; | |||
void setMargin( float margin ) { mMargin = margin; } | /**Sets whether the atlas map should use a fixed scale | |||
* @deprecated Use QgsComposerMap::setAtlasFixedScale( bool ) instead | ||||
*/ | ||||
void setFixedScale( bool fixed ); | ||||
/**Returns the margin for the atlas map | ||||
* @deprecated Use QgsComposerMap::atlasMargin() instead | ||||
*/ | ||||
float margin() const; | ||||
/**Sets the margin for the atlas map | ||||
* @deprecated Use QgsComposerMap::setAtlasMargin( double ) instead | ||||
*/ | ||||
void setMargin( float margin ); | ||||
QString filenamePattern() const { return mFilenamePattern; } | QString filenamePattern() const { return mFilenamePattern; } | |||
void setFilenamePattern( const QString& pattern ) { mFilenamePattern = pattern; } | void setFilenamePattern( const QString& pattern ); | |||
QgsVectorLayer* coverageLayer() const { return mCoverageLayer; } | QgsVectorLayer* coverageLayer() const { return mCoverageLayer; } | |||
void setCoverageLayer( QgsVectorLayer* lmap ); | void setCoverageLayer( QgsVectorLayer* lmap ); | |||
bool singleFile() const { return mSingleFile; } | bool singleFile() const { return mSingleFile; } | |||
void setSingleFile( bool single ) { mSingleFile = single; } | void setSingleFile( bool single ) { mSingleFile = single; } | |||
bool sortFeatures() const { return mSortFeatures; } | bool sortFeatures() const { return mSortFeatures; } | |||
void setSortFeatures( bool doSort ) { mSortFeatures = doSort; } | void setSortFeatures( bool doSort ) { mSortFeatures = doSort; } | |||
bool sortAscending() const { return mSortAscending; } | bool sortAscending() const { return mSortAscending; } | |||
void setSortAscending( bool ascending ) { mSortAscending = ascending; } | void setSortAscending( bool ascending ) { mSortAscending = ascending; } | |||
bool filterFeatures() const { return mFilterFeatures; } | bool filterFeatures() const { return mFilterFeatures; } | |||
void setFilterFeatures( bool doFilter ) { mFilterFeatures = doFilter; } | void setFilterFeatures( bool doFilter ) { mFilterFeatures = doFilter; } | |||
QString featureFilter() const { return mFeatureFilter; } | QString featureFilter() const { return mFeatureFilter; } | |||
void setFeatureFilter( const QString& expression ) { mFeatureFilter = e xpression; } | void setFeatureFilter( const QString& expression ) { mFeatureFilter = e xpression; } | |||
size_t sortKeyAttributeIndex() const { return mSortKeyAttributeIdx; } | int sortKeyAttributeIndex() const { return mSortKeyAttributeIdx; } | |||
void setSortKeyAttributeIndex( size_t idx ) { mSortKeyAttributeIdx = id | void setSortKeyAttributeIndex( int idx ) { mSortKeyAttributeIdx = idx; | |||
x; } | } | |||
/** Begins the rendering. */ | /** Begins the rendering. Returns true if successful, false if no match | |||
void beginRender(); | ing atlas | |||
features found.*/ | ||||
bool beginRender(); | ||||
/** Ends the rendering. Restores original extent */ | /** Ends the rendering. Restores original extent */ | |||
void endRender(); | void endRender(); | |||
/** Returns the number of features in the coverage layer */ | /** Returns the number of features in the coverage layer */ | |||
size_t numFeatures() const; | int numFeatures() const; | |||
/** Prepare the atlas map for the given feature. Sets the extent and co | ||||
ntext variables */ | ||||
void prepareForFeature( int i ); | ||||
/** Prepare the atlas map for the given feature. Sets the extent and co ntext variables */ | /** Prepare the atlas map for the given feature. Sets the extent and co ntext variables */ | |||
void prepareForFeature( size_t i ); | void prepareForFeature( QgsFeature * feat ); | |||
/** Returns the current filename. Must be called after prepareForFeatur e( i ) */ | /** Returns the current filename. Must be called after prepareForFeatur e( i ) */ | |||
const QString& currentFilename() const; | const QString& currentFilename() const; | |||
void writeXML( QDomElement& elem, QDomDocument& doc ) const; | void writeXML( QDomElement& elem, QDomDocument& doc ) const; | |||
void readXML( const QDomElement& elem, const QDomDocument& doc ); | void readXML( const QDomElement& elem, const QDomDocument& doc ); | |||
QgsComposition* composition() { return mComposition; } | QgsComposition* composition() { return mComposition; } | |||
/** Requeries the current atlas coverage layer and applies filtering an | ||||
d sorting. Returns | ||||
number of matching features. Must be called after prepareForFeature( | ||||
i ) */ | ||||
int updateFeatures(); | ||||
void nextFeature(); | ||||
void prevFeature(); | ||||
void lastFeature(); | ||||
void firstFeature(); | ||||
/** Returns the current atlas feature. Must be called after prepareForF | ||||
eature( i ). */ | ||||
QgsFeature* currentFeature() { return &mCurrentFeature; } | ||||
/** Recalculates the bounds of an atlas driven map */ | ||||
void prepareMap( QgsComposerMap* map ); | ||||
signals: | signals: | |||
/** emitted when one of the parameters changes */ | /** emitted when one of the parameters changes */ | |||
void parameterChanged(); | void parameterChanged(); | |||
/** emitted when atlas is enabled or disabled */ | ||||
void toggled( bool ); | ||||
/**Is emitted when the atlas has an updated status bar message for the | ||||
composer window*/ | ||||
void statusMsgChanged( QString message ); | ||||
/**Is emitted when the coverage layer for an atlas changes*/ | ||||
void coverageLayerChanged( QgsVectorLayer* layer ); | ||||
private: | private: | |||
/**Updates the filename expression*/ | ||||
void updateFilenameExpression(); | ||||
/**Evaluates filename for current feature*/ | ||||
void evalFeatureFilename(); | ||||
QgsComposition* mComposition; | QgsComposition* mComposition; | |||
bool mEnabled; | bool mEnabled; | |||
QgsComposerMap* mComposerMap; | ||||
bool mHideCoverage; | bool mHideCoverage; | |||
bool mFixedScale; | ||||
double mMargin; | ||||
QString mFilenamePattern; | QString mFilenamePattern; | |||
QgsVectorLayer* mCoverageLayer; | QgsVectorLayer* mCoverageLayer; | |||
bool mSingleFile; | bool mSingleFile; | |||
QgsCoordinateTransform mTransform; | QgsCoordinateTransform mTransform; | |||
QString mCurrentFilename; | QString mCurrentFilename; | |||
// feature ordering | // feature ordering | |||
bool mSortFeatures; | bool mSortFeatures; | |||
// sort direction | // sort direction | |||
bool mSortAscending; | bool mSortAscending; | |||
// current atlas feature number | ||||
int mCurrentFeatureNo; | ||||
public: | public: | |||
typedef std::map< QgsFeatureId, QVariant > SorterKeys; | typedef QMap< QgsFeatureId, QVariant > SorterKeys; | |||
private: | private: | |||
// value of field that is used for ordering of features | // value of field that is used for ordering of features | |||
SorterKeys mFeatureKeys; | SorterKeys mFeatureKeys; | |||
// key (attribute index) used for ordering | // key (attribute index) used for ordering | |||
size_t mSortKeyAttributeIdx; | int mSortKeyAttributeIdx; | |||
// feature filtering | // feature filtering | |||
bool mFilterFeatures; | bool mFilterFeatures; | |||
// feature expression filter | // feature expression filter | |||
QString mFeatureFilter; | QString mFeatureFilter; | |||
// id of each iterated feature (after filtering and sorting) | // id of each iterated feature (after filtering and sorting) | |||
std::vector<QgsFeatureId> mFeatureIds; | QVector<QgsFeatureId> mFeatureIds; | |||
QgsFeature mCurrentFeature; | QgsFeature mCurrentFeature; | |||
QgsRectangle mOrigExtent; | ||||
bool mRestoreLayer; | ||||
std::auto_ptr<QgsExpression> mFilenameExpr; | std::auto_ptr<QgsExpression> mFilenameExpr; | |||
// bounding box of the current feature transformed into map crs | ||||
QgsRectangle mTransformedFeatureBounds; | ||||
//forces all atlas enabled maps to redraw | ||||
void updateAtlasMaps(); | ||||
//computes the extent of the current feature, in the crs of the specifi | ||||
ed map | ||||
void computeExtent( QgsComposerMap *map ); | ||||
}; | }; | |||
#endif | #endif | |||
End of changes. 20 change blocks. | ||||
25 lines changed or deleted | 94 lines changed or added | |||
qgsattributeaction.h | qgsattributeaction.h | |||
---|---|---|---|---|
skipping to change at line 100 | skipping to change at line 100 | |||
/*! \class QgsAttributeAction | /*! \class QgsAttributeAction | |||
* \brief Storage and management of actions associated with Qgis layer | * \brief Storage and management of actions associated with Qgis layer | |||
* attributes. | * attributes. | |||
*/ | */ | |||
class CORE_EXPORT QgsAttributeAction | class CORE_EXPORT QgsAttributeAction | |||
{ | { | |||
public: | public: | |||
//! Constructor | //! Constructor | |||
QgsAttributeAction( QgsVectorLayer *layer ) : mLayer( layer ) {} | QgsAttributeAction( QgsVectorLayer *layer ) : mLayer( layer ), mDefault Action( -1 ) {} | |||
//! Destructor | //! Destructor | |||
virtual ~QgsAttributeAction() {} | virtual ~QgsAttributeAction() {} | |||
//! Add an action with the given name and action details. | //! Add an action with the given name and action details. | |||
// Will happily have duplicate names and actions. If | // Will happily have duplicate names and actions. If | |||
// capture is true, when running the action using doAction(), | // capture is true, when running the action using doAction(), | |||
// any stdout from the process will be captured and displayed in a | // any stdout from the process will be captured and displayed in a | |||
// dialog box. | // dialog box. | |||
void addAction( QgsAction::ActionType type, QString name, QString actio n, bool capture = false ); | void addAction( QgsAction::ActionType type, QString name, QString actio n, bool capture = false ); | |||
skipping to change at line 138 | skipping to change at line 138 | |||
* @note added in 1.9 | * @note added in 1.9 | |||
* @note available in python bindings as doActionFeatureWithSubstituti on | * @note available in python bindings as doActionFeatureWithSubstituti on | |||
*/ | */ | |||
void doAction( int index, | void doAction( int index, | |||
QgsFeature &feat, | QgsFeature &feat, | |||
const QMap<QString, QVariant> *substitutionMap = 0 ); | const QMap<QString, QVariant> *substitutionMap = 0 ); | |||
//! Removes all actions | //! Removes all actions | |||
void clearActions() { mActions.clear(); } | void clearActions() { mActions.clear(); } | |||
//! List all actions | ||||
const QList<QgsAction>& listActions() { return mActions; } | ||||
//! Return the layer | //! Return the layer | |||
QgsVectorLayer *layer() { return mLayer; } | QgsVectorLayer *layer() { return mLayer; } | |||
/*! Expands the given action, replacing all %'s with the value as | /*! Expands the given action, replacing all %'s with the value as | |||
* given. | * given. | |||
*/ | */ | |||
QString expandAction( QString action, const QgsAttributeMap &attributes , uint defaultValueIndex ); | QString expandAction( QString action, const QgsAttributeMap &attributes , uint defaultValueIndex ); | |||
/*! Expands the given action using the expression builder | /*! Expands the given action using the expression builder | |||
* This function currently replaces each expression between [% and %] | * This function currently replaces each expression between [% and %] | |||
skipping to change at line 174 | skipping to change at line 177 | |||
bool readXML( const QDomNode& layer_node ); | bool readXML( const QDomNode& layer_node ); | |||
int size() const { return mActions.size(); } | int size() const { return mActions.size(); } | |||
QgsAction &at( int idx ) { return mActions[idx]; } | QgsAction &at( int idx ) { return mActions[idx]; } | |||
QgsAction &operator[]( int idx ) { return mActions[idx]; } | QgsAction &operator[]( int idx ) { return mActions[idx]; } | |||
//! @deprecated Initialize QgsPythonRunner instead | //! @deprecated Initialize QgsPythonRunner instead | |||
static void setPythonExecute( void ( * )( const QString & ) ); | static void setPythonExecute( void ( * )( const QString & ) ); | |||
//! Whether the action is the default action | //! Whether the action is the default action | |||
int defaultAction() const { return mDefaultAction < 0 || mDefaultAction >= size() ? 0 : mDefaultAction; } | int defaultAction() const { return mDefaultAction < 0 || mDefaultAction >= size() ? -1 : mDefaultAction; } | |||
void setDefaultAction( int actionNumber ) { mDefaultAction = actionNumb er ; } | void setDefaultAction( int actionNumber ) { mDefaultAction = actionNumb er ; } | |||
private: | private: | |||
QList<QgsAction> mActions; | QList<QgsAction> mActions; | |||
QgsVectorLayer *mLayer; | QgsVectorLayer *mLayer; | |||
static void ( *smPythonExecute )( const QString & ); | static void ( *smPythonExecute )( const QString & ); | |||
void runAction( const QgsAction &action, | void runAction( const QgsAction &action, | |||
void ( *executePython )( const QString & ) = 0 ); | void ( *executePython )( const QString & ) = 0 ); | |||
End of changes. 3 change blocks. | ||||
2 lines changed or deleted | 5 lines changed or added | |||
qgsattributedialog.h | qgsattributedialog.h | |||
---|---|---|---|---|
skipping to change at line 21 | skipping to change at line 21 | |||
* This program is free software; you can redistribute it and/or modify * | * This program is free software; you can redistribute it and/or modify * | |||
* it under the terms of the GNU General Public License as published by * | * it under the terms of the GNU General Public License as published by * | |||
* the Free Software Foundation; either version 2 of the License, or * | * the Free Software Foundation; either version 2 of the License, or * | |||
* (at your option) any later version. * | * (at your option) any later version. * | |||
* * | * * | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef QGSATTRIBUTEDIALOG_H | #ifndef QGSATTRIBUTEDIALOG_H | |||
#define QGSATTRIBUTEDIALOG_H | #define QGSATTRIBUTEDIALOG_H | |||
#include "qgsfeature.h" | #include "qgsfeature.h" | |||
#include "qgsattributeeditorcontext.h" | ||||
class QDialog; | class QDialog; | |||
class QgsFeature; | ||||
class QLayout; | class QLayout; | |||
class QgsDistanceArea; | ||||
class QgsFeature; | ||||
class QgsField; | class QgsField; | |||
class QgsVectorLayer; | ||||
class QgsHighlight; | class QgsHighlight; | |||
class QgsDistanceArea; | class QgsVectorLayer; | |||
class QgsVectorLayerTools; | ||||
class GUI_EXPORT QgsAttributeDialog : public QObject | class GUI_EXPORT QgsAttributeDialog : public QObject | |||
{ | { | |||
Q_OBJECT | Q_OBJECT | |||
public: | public: | |||
/** | ||||
* Create an attribute dialog for a given layer and feature | ||||
* | ||||
* @param vl The layer for which the dialog will be gene | ||||
rated | ||||
* @param thepFeature A feature for which the dialog will be gene | ||||
rated | ||||
* @param featureOwner Set to true, if the dialog should take owne | ||||
rship of the feature | ||||
* @param myDa A QgsDistanceArea which will be used for ex | ||||
pressions | ||||
* @param parent A parent widget for the dialog | ||||
* @param showDialogButtons True: Show the dialog buttons accept/cancel | ||||
* | ||||
* @deprecated | ||||
*/ | ||||
QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeature, bool f eatureOwner, QgsDistanceArea myDa, QWidget* parent = 0, bool showDialogButt ons = true ); | QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeature, bool f eatureOwner, QgsDistanceArea myDa, QWidget* parent = 0, bool showDialogButt ons = true ); | |||
/** | ||||
* Create an attribute dialog for a given layer and feature | ||||
* | ||||
* @param vl The layer for which the dialog will be gene | ||||
rated | ||||
* @param thepFeature A feature for which the dialog will be gene | ||||
rated | ||||
* @param featureOwner Set to true, if the dialog should take owne | ||||
rship of the feature | ||||
* @param parent A parent widget for the dialog | ||||
* @param showDialogButtons True: Show the dialog buttons accept/cancel | ||||
* @param context The context in which this dialog is created | ||||
* | ||||
*/ | ||||
QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeature, bool f | ||||
eatureOwner, QWidget* parent = 0, bool showDialogButtons = true, QgsAttribu | ||||
teEditorContext context = QgsAttributeEditorContext() ); | ||||
~QgsAttributeDialog(); | ~QgsAttributeDialog(); | |||
/** Saves the size and position for the next time | /** Saves the size and position for the next time | |||
* this dialog box was used. | * this dialog box will be used. | |||
*/ | */ | |||
void saveGeometry(); | void saveGeometry(); | |||
/** Restores the size and position from the last time | /** Restores the size and position from the last time | |||
* this dialog box was used. | * this dialog box was used. | |||
*/ | */ | |||
void restoreGeometry(); | void restoreGeometry(); | |||
void setHighlight( QgsHighlight *h ); | void setHighlight( QgsHighlight *h ); | |||
QDialog *dialog() { return mDialog; } | QDialog *dialog() { return mDialog; } | |||
QgsFeature* feature() { return mFeature; } | QgsFeature* feature() { return mFeature; } | |||
/** | ||||
* Is this dialog editable? | ||||
* | ||||
* @return returns true, if this dialog was created in an editable mann | ||||
er. | ||||
*/ | ||||
bool editable() { return mEditable; } | ||||
public slots: | public slots: | |||
void accept(); | void accept(); | |||
int exec(); | int exec(); | |||
void show(); | void show(); | |||
void dialogDestroyed(); | void dialogDestroyed(); | |||
private: | protected: | |||
bool eventFilter( QObject *obj, QEvent *event ); | bool eventFilter( QObject *obj, QEvent *event ); | |||
private: | ||||
void init(); | ||||
QDialog *mDialog; | QDialog *mDialog; | |||
QString mSettingsPath; | QString mSettingsPath; | |||
// Used to sync multiple widgets for the same field | // Used to sync multiple widgets for the same field | |||
QMap<int, QWidget*> mProxyWidgets; | QgsAttributeEditorContext mContext; | |||
QgsVectorLayer *mLayer; | QgsVectorLayer *mLayer; | |||
QgsFeature *mFeature; | QgsFeature* mFeature; | |||
bool mFeatureOwner; | bool mFeatureOwner; | |||
QgsHighlight *mHighlight; | QgsHighlight *mHighlight; | |||
int mFormNr; | int mFormNr; | |||
static int smFormCounter; | ||||
bool mShowDialogButtons; | bool mShowDialogButtons; | |||
QString mReturnvarname; | QString mReturnvarname; | |||
// true if this dialog is editable | ||||
bool mEditable; | ||||
static int sFormCounter; | ||||
static QString sSettingsPath; | ||||
}; | }; | |||
#endif | #endif | |||
End of changes. 15 change blocks. | ||||
8 lines changed or deleted | 62 lines changed or added | |||
qgsattributeeditor.h | qgsattributeeditor.h | |||
---|---|---|---|---|
skipping to change at line 22 | skipping to change at line 22 | |||
* it under the terms of the GNU General Public License as published by * | * it under the terms of the GNU General Public License as published by * | |||
* the Free Software Foundation; either version 2 of the License, or * | * the Free Software Foundation; either version 2 of the License, or * | |||
* (at your option) any later version. * | * (at your option) any later version. * | |||
* * | * * | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef QGSATTRIBUTEEDITOR_H | #ifndef QGSATTRIBUTEEDITOR_H | |||
#define QGSATTRIBUTEEDITOR_H | #define QGSATTRIBUTEEDITOR_H | |||
#include <QVariant> | #include <QVariant> | |||
#include <QMetaType> | #include <QMetaType> | |||
#include <QGridLayout> | ||||
#include "qgsfeature.h" | #include "qgsfeature.h" | |||
#include "qgsrelationmanager.h" | ||||
class QObject; | class QObject; | |||
class QWidget; | class QWidget; | |||
class QgsVectorLayer; | ||||
class QComboBox; | class QComboBox; | |||
class QListWidget; | class QListWidget; | |||
class QgsAttributeEditorContext; | ||||
class QgsAttributeEditorElement; | class QgsAttributeEditorElement; | |||
class QgsDualView; | ||||
class QgsRelationManager; | ||||
class QgsVectorLayer; | ||||
/* \brief create attribute widget for editing */ | /* \brief create attribute widget for editing */ | |||
class GUI_EXPORT QgsAttributeEditor : public QObject | class GUI_EXPORT QgsAttributeEditor : public QObject | |||
{ | { | |||
Q_OBJECT | Q_OBJECT | |||
public: | public: | |||
QgsAttributeEditor( QObject *parent, QgsVectorLayer *vl = 0, int idx = -1 ) | QgsAttributeEditor( QObject* parent, QgsVectorLayer* vl = 0, int idx = -1 ) | |||
: QObject( parent ) | : QObject( parent ) | |||
, mLayer( vl ) | , mLayer( vl ) | |||
, mIdx( idx ) | , mIdx( idx ) | |||
{}; | {} | |||
/** | /** | |||
* Creates or prepares a attributre editor widget | * Creates or prepares a attribute editor widget | |||
* @param parent The parent object | * @param parent The parent object | |||
* @param editor The widget to prepare. Set to null if it should be gen erated | * @param editor The widget to prepare. Set to null if it should be gen erated | |||
* @param vl The vector layer to use as data source | * @param vl The vector layer to use as data source | |||
* @param idx The field index this widget refers to | * @param idx The field index this widget refers to | |||
* @param value the value to initiate this widget with | * @param value the value to initiate this widget with | |||
* @param proxyWidgets an array of widgets, which will act as a value p roxy if the same field is inserted multiple times | * @param proxyWidgets an array of widgets, which will act as a value p roxy if the same field is inserted multiple times | |||
* | * | |||
* @deprecated | ||||
*/ | */ | |||
static QWidget *createAttributeEditor( QWidget *parent, QWidget *editor | static QWidget* createAttributeEditor( QWidget* parent, QWidget* editor | |||
, QgsVectorLayer *vl, int idx, const QVariant &value, QMap<int, QWidget*> & | , QgsVectorLayer* vl, int idx, const QVariant &value, QMap<int, QWidget*>& | |||
proxyWidgets ); | proxyWidgets ); | |||
/** | /** | |||
* Creates or prepares a attributre editor widget | * Creates or prepares a attribute editor widget | |||
* @param parent The parent object | * @param parent The parent object | |||
* @param editor The widget to prepare. Set to null if it should be gen erated | * @param editor The widget to prepare. Set to null if it should be gen erated | |||
* @param vl The vector layer to use as data source | * @param vl The vector layer to use as data source | |||
* @param idx The field index this widget refers to | * @param idx The field index this widget refers to | |||
* @param value the value to initiate this widget with | * @param value the value to initiate this widget with | |||
* | * | |||
*/ | */ | |||
static QWidget *createAttributeEditor( QWidget *parent, QWidget *editor | static QWidget* createAttributeEditor( QWidget* parent, QWidget* editor | |||
, QgsVectorLayer *vl, int idx, const QVariant &value ); | , QgsVectorLayer* vl, int idx, const QVariant& value ); | |||
/** | ||||
* Creates or prepares a attribute editor widget | ||||
* @param parent The parent object | ||||
* @param editor The widget to prepare. Set to null if it should be gen | ||||
erated | ||||
* @param vl The vector layer to use as data source | ||||
* @param idx The field index this widget refers to | ||||
* @param value the value to initiate this widget with | ||||
* @param context the context used for the created attribute editor | ||||
* | ||||
*/ | ||||
static QWidget* createAttributeEditor( QWidget* parent, QWidget* editor | ||||
, QgsVectorLayer* vl, int idx, const QVariant& value, QgsAttributeEditorCon | ||||
text& context ); | ||||
/** | /** | |||
* Creates a widget form a QgsAttributeEditorElement definition. Will r ecursively generate containers and widgets. | * Creates a widget form a QgsAttributeEditorElement definition. Will r ecursively generate containers and widgets. | |||
* @param widgetDef The definition for the widget | * @param widgetDef The definition for the widget | |||
* @param parent The parent object | * @param parent The parent object | |||
* @param vl The vector layer to use as data source | * @param vl The vector layer to use as data source | |||
* @param attrs Attributes for the current feature. | * @param feat The feature to create the widget for | |||
* @param proxyWidgets An array of widgets, which will act as a value p | * @param context the context used for the created attribute editor | |||
roxy if the same field is inserted multiple times | * @param [out] labelText An optional label text will be written into t | |||
* @param createGroupBox If the element is a container, should a GroupB | he referenced QString. It will be set to | |||
ox be created to hold the children? | * a QString::null value if no label should be shown | |||
* @param [out] labelOnTop Will be set to true if the label should be p | ||||
laced on top of the field. | ||||
* If set to false, the label should be shown left or right of t | ||||
he field | ||||
* | * | |||
*/ | */ | |||
static QWidget *createWidgetFromDef( const QgsAttributeEditorElement* w | static QWidget *createWidgetFromDef( const QgsAttributeEditorElement* w | |||
idgetDef, QWidget* parent, QgsVectorLayer* vl, QgsAttributes &attrs, QMap<i | idgetDef, QWidget* parent, QgsVectorLayer* vl, const QgsFeature &feat, QgsA | |||
nt, QWidget*> &proxyWidgets, bool createGroupBox ); | ttributeEditorContext& context, QString& labelText, bool& labelOnTop ); | |||
static bool retrieveValue( QWidget *widget, QgsVectorLayer *vl, int idx , QVariant &value ); | static bool retrieveValue( QWidget *widget, QgsVectorLayer *vl, int idx , QVariant &value ); | |||
static bool setValue( QWidget *widget, QgsVectorLayer *vl, int idx, con st QVariant &value ); | static bool setValue( QWidget *widget, QgsVectorLayer *vl, int idx, con st QVariant &value ); | |||
private: | private: | |||
static QComboBox *comboBox( QWidget *editor, QWidget *parent ); | static QComboBox *comboBox( QWidget *editor, QWidget *parent ); | |||
static QListWidget *listWidget( QWidget *editor, QWidget *parent ); | static QListWidget *listWidget( QWidget *editor, QWidget *parent ); | |||
static QgsDualView* dualView( QWidget* editor, QWidget* parent ); | ||||
public slots: | public slots: | |||
void selectFileName(); | void selectFileName(); | |||
void selectDate(); | void selectDate(); | |||
void loadUrl( const QString & ); | void loadUrl( const QString & ); | |||
void loadPixmap( const QString & ); | void loadPixmap( const QString & ); | |||
void updateUrl(); | void updateUrl(); | |||
void openUrl(); | void openUrl(); | |||
void updateColor(); | void updateColor(); | |||
skipping to change at line 118 | skipping to change at line 143 | |||
void changeText(); | void changeText(); | |||
void changeText( QString str ); | void changeText( QString str ); | |||
signals: | signals: | |||
void textChanged( QString ); | void textChanged( QString ); | |||
private: | private: | |||
QList<QWidget*> mProxyList; | QList<QWidget*> mProxyList; | |||
}; | }; | |||
Q_DECLARE_METATYPE( QgsStringRelay* ) | ||||
#endif | #endif | |||
End of changes. 16 change blocks. | ||||
18 lines changed or deleted | 49 lines changed or added | |||
qgsattributetablefiltermodel.h | qgsattributetablefiltermodel.h | |||
---|---|---|---|---|
skipping to change at line 170 | skipping to change at line 170 | |||
void extentsChanged(); | void extentsChanged(); | |||
private slots: | private slots: | |||
void selectionChanged(); | void selectionChanged(); | |||
private: | private: | |||
QgsFeatureIds mFilteredFeatures; | QgsFeatureIds mFilteredFeatures; | |||
QgsMapCanvas* mCanvas; | QgsMapCanvas* mCanvas; | |||
FilterMode mFilterMode; | FilterMode mFilterMode; | |||
bool mSelectedOnTop; | bool mSelectedOnTop; | |||
QItemSelectionModel* mMasterSelection; | ||||
QgsAttributeTableModel* mTableModel; | QgsAttributeTableModel* mTableModel; | |||
}; | }; | |||
#endif | #endif | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 0 lines changed or added | |||
qgsattributetablemodel.h | qgsattributetablemodel.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
#include <QModelIndex> | #include <QModelIndex> | |||
#include <QObject> | #include <QObject> | |||
#include <QHash> | #include <QHash> | |||
#include <QQueue> | #include <QQueue> | |||
#include <QMap> | #include <QMap> | |||
#include "qgsvectorlayer.h" // QgsAttributeList | #include "qgsvectorlayer.h" // QgsAttributeList | |||
#include "qgsvectorlayercache.h" | #include "qgsvectorlayercache.h" | |||
class QgsMapCanvas; | class QgsMapCanvas; | |||
class QgsMapLayerAction; | ||||
/** | /** | |||
* A model backed by a {@link QgsVectorLayerCache} which is able to provide | * A model backed by a {@link QgsVectorLayerCache} which is able to provide | |||
* feature/attribute information to a QAbstractItemView. | * feature/attribute information to a QAbstractItemView. | |||
* | * | |||
* @brief | * @brief | |||
* Is able to generate editor widgets for its QModelIndexes as well. | * Is able to generate editor widgets for its QModelIndexes as well. | |||
* Is mostly referred to as "master model" within this doc and the source. | * Is mostly referred to as "master model" within this doc and the source. | |||
* | * | |||
* @see <a href="http://doc.qt.digia.com/qt/model-view-programming.html">Qt Model View Programming</a> | * @see <a href="http://doc.qt.digia.com/qt/model-view-programming.html">Qt Model View Programming</a> | |||
skipping to change at line 177 | skipping to change at line 178 | |||
* Returns the layer cache this model uses as backend. | * Returns the layer cache this model uses as backend. | |||
*/ | */ | |||
inline QgsVectorLayerCache* layerCache() const { return mLayerCache; } | inline QgsVectorLayerCache* layerCache() const { return mLayerCache; } | |||
/** | /** | |||
* Execute an action | * Execute an action | |||
*/ | */ | |||
void executeAction( int action, const QModelIndex &idx ) const; | void executeAction( int action, const QModelIndex &idx ) const; | |||
/** | /** | |||
* Execute a QgsMapLayerAction | ||||
*/ | ||||
void executeMapLayerAction( QgsMapLayerAction* action, const QModelInde | ||||
x &idx ) const; | ||||
/** | ||||
* Return the feature attributes at given model index | * Return the feature attributes at given model index | |||
* @return feature attributes at given model index | * @return feature attributes at given model index | |||
*/ | */ | |||
QgsFeature feature( const QModelIndex &idx ) const; | QgsFeature feature( const QModelIndex &idx ) const; | |||
/** | /** | |||
* Caches the entire data for one column. This should be called prior t o sorting, | * Caches the entire data for one column. This should be called prior t o sorting, | |||
* so the data does not have to be fetched for every single comparison. | * so the data does not have to be fetched for every single comparison. | |||
* Specify -1 as column to invalidate the cache | * Specify -1 as column to invalidate the cache | |||
* | * | |||
* @param column The column index of the field to catch | * @param column The column index of the field to catch | |||
*/ | */ | |||
void prefetchColumnData( int column ); | void prefetchColumnData( int column ); | |||
void setRequest( const QgsFeatureRequest& request ); | ||||
signals: | signals: | |||
/** | /** | |||
* Model has been changed | * Model has been changed | |||
*/ | */ | |||
void modelChanged(); | void modelChanged(); | |||
//! @note not available in python bindings | //! @note not available in python bindings | |||
void progress( int i, bool &cancel ); | void progress( int i, bool &cancel ); | |||
void finished(); | void finished(); | |||
private slots: | private slots: | |||
/** | /** | |||
* Launched whenever the number of fields has changed | * Launched whenever the number of fields has changed | |||
*/ | */ | |||
virtual void updatedFields(); | virtual void updatedFields(); | |||
/** | /** | |||
* Gets called when an edit command ends | ||||
* This will synchronize all fields which have been changed since the l | ||||
ast | ||||
* edit command in one single go | ||||
*/ | ||||
virtual void editCommandEnded(); | ||||
/** | ||||
* Called whenever a column is removed; | * Called whenever a column is removed; | |||
*/ | */ | |||
virtual void attributeDeleted( int idx ); | virtual void attributeDeleted( int idx ); | |||
protected slots: | protected slots: | |||
/** | /** | |||
* Launched when attribute value has been changed | * Launched when attribute value has been changed | |||
* @param fid feature id | * @param fid feature id | |||
* @param idx attribute index | * @param idx attribute index | |||
* @param value new value | * @param value new value | |||
*/ | */ | |||
virtual void attributeValueChanged( QgsFeatureId fid, int idx, const QV ariant &value ); | virtual void attributeValueChanged( QgsFeatureId fid, int idx, const QV ariant &value ); | |||
/** | /** | |||
* Launched when a feature has been deleted | * Launched when a feature has been deleted | |||
* @param fid feature id | * @param fid feature id | |||
*/ | */ | |||
virtual void featureDeleted( QgsFeatureId fid ); | virtual void featureDeleted( QgsFeatureId fid ); | |||
/** | /** | |||
* Launched when a feature has been added | * Launched when a feature has been added | |||
* @param fid feature id | * @param fid feature id | |||
* @param inOperation guard insertion with beginInsertRows() / endInser tRows() | ||||
*/ | */ | |||
virtual void featureAdded( QgsFeatureId fid, bool inOperation = true ); | virtual void featureAdded( QgsFeatureId fid ); | |||
/** | /** | |||
* Launched when layer has been deleted | * Launched when layer has been deleted | |||
*/ | */ | |||
virtual void layerDeleted(); | virtual void layerDeleted(); | |||
protected: | protected: | |||
QgsVectorLayerCache *mLayerCache; | QgsVectorLayerCache *mLayerCache; | |||
int mFieldCount; | int mFieldCount; | |||
skipping to change at line 270 | skipping to change at line 284 | |||
* @return feature exists | * @return feature exists | |||
*/ | */ | |||
virtual bool loadFeatureAtId( QgsFeatureId fid ) const; | virtual bool loadFeatureAtId( QgsFeatureId fid ) const; | |||
QgsFeatureRequest mFeatureRequest; | QgsFeatureRequest mFeatureRequest; | |||
/** The currently cached column */ | /** The currently cached column */ | |||
int mCachedField; | int mCachedField; | |||
/** Allows to cache one specific column (used for sorting) */ | /** Allows to cache one specific column (used for sorting) */ | |||
QHash<QgsFeatureId, QVariant> mFieldCache; | QHash<QgsFeatureId, QVariant> mFieldCache; | |||
/** | ||||
* Holds the bounds of changed cells while an update operation is runni | ||||
ng | ||||
* top = min row | ||||
* left = min column | ||||
* bottom = max row | ||||
* right = max column | ||||
*/ | ||||
QRect mChangedCellBounds; | ||||
}; | }; | |||
#endif | #endif | |||
End of changes. 7 change blocks. | ||||
2 lines changed or deleted | 28 lines changed or added | |||
qgsattributetableview.h | qgsattributetableview.h | |||
---|---|---|---|---|
skipping to change at line 24 | skipping to change at line 24 | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef QGSATTRIBUTETABLEVIEW_H | #ifndef QGSATTRIBUTETABLEVIEW_H | |||
#define QGSATTRIBUTETABLEVIEW_H | #define QGSATTRIBUTETABLEVIEW_H | |||
#include <QTableView> | #include <QTableView> | |||
#include <QAction> | #include <QAction> | |||
#include "qgsfeature.h" // For QgsFeatureIds | #include "qgsfeature.h" // For QgsFeatureIds | |||
class QgsAttributeTableModel; | class QgsAttributeTableDelegate; | |||
class QgsAttributeTableFilterModel; | class QgsAttributeTableFilterModel; | |||
class QgsVectorLayerCache; | class QgsAttributeTableModel; | |||
class QgsFeatureSelectionModel; | class QgsFeatureSelectionModel; | |||
class QgsAttributeTableDelegate; | class QgsIFeatureSelectionManager; | |||
class QgsMapCanvas; | class QgsMapCanvas; | |||
class QgsVectorLayer; | class QgsVectorLayer; | |||
class QgsVectorLayerCache; | ||||
class QMenu; | class QMenu; | |||
class QProgressDialog; | class QProgressDialog; | |||
/** | /** | |||
* @brief | * @brief | |||
* Provides a table view of features of a @link QgsVectorLayer @endlink. | * Provides a table view of features of a @link QgsVectorLayer @endlink. | |||
* | * | |||
* This can either be used as a standalone widget. QgsBrowser features a re ference implementation. | * This can either be used as a standalone widget. QgsBrowser features a re ference implementation. | |||
* Or this can be used within the @link QgsDualView @endlink stacked widget . | * Or this can be used within the @link QgsDualView @endlink stacked widget . | |||
*/ | */ | |||
skipping to change at line 53 | skipping to change at line 54 | |||
{ | { | |||
Q_OBJECT | Q_OBJECT | |||
public: | public: | |||
QgsAttributeTableView( QWidget* parent = 0 ); | QgsAttributeTableView( QWidget* parent = 0 ); | |||
virtual ~QgsAttributeTableView(); | virtual ~QgsAttributeTableView(); | |||
virtual void setModel( QgsAttributeTableFilterModel* filterModel ); | virtual void setModel( QgsAttributeTableFilterModel* filterModel ); | |||
/** | /** | |||
* Autocreates the models | * @brief setFeatureSelectionManager | |||
* @param layerCache The @link QgsVectorLayerCache @endlink to use ( as | * @param featureSelectionManager We will take ownership | |||
backend ) | ||||
* @param canvas The @link QgsMapCanvas @endlink to use ( for the c | ||||
urrently visible features filter ) | ||||
* | ||||
* @deprecated | ||||
*/ | */ | |||
void setCanvasAndLayerCache( QgsMapCanvas *canvas, QgsVectorLayerCache *layerCache ); | void setFeatureSelectionManager( QgsIFeatureSelectionManager* featureSe lectionManager ); | |||
/** | /** | |||
* This event filter is installed on the verticalHeader to intercept mo use press and release | * This event filter is installed on the verticalHeader to intercept mo use press and release | |||
* events. These are used to disable / enable live synchronisation with the map canvas selection | * events. These are used to disable / enable live synchronisation with the map canvas selection | |||
* which can be slow due to recurring canvas repaints. Updating the | * which can be slow due to recurring canvas repaints. Updating the | |||
* | * | |||
* @param object The object which is the target of the event. | * @param object The object which is the target of the event. | |||
* @param event The intercepted event | * @param event The intercepted event | |||
* | * | |||
* @return Returns always false, so the event gets processed | * @return Returns always false, so the event gets processed | |||
skipping to change at line 146 | skipping to change at line 144 | |||
void repaintRequested(); | void repaintRequested(); | |||
virtual void selectAll(); | virtual void selectAll(); | |||
virtual void selectRow( int row ); | virtual void selectRow( int row ); | |||
virtual void _q_selectRow( int row ); | virtual void _q_selectRow( int row ); | |||
private: | private: | |||
void selectRow( int row, bool anchor ); | void selectRow( int row, bool anchor ); | |||
QgsAttributeTableModel* mMasterModel; | QgsAttributeTableModel* mMasterModel; | |||
QgsAttributeTableFilterModel* mFilterModel; | QgsAttributeTableFilterModel* mFilterModel; | |||
QgsFeatureSelectionModel* mFeatureSelectionModel; | QgsFeatureSelectionModel* mFeatureSelectionModel; | |||
QgsIFeatureSelectionManager* mFeatureSelectionManager; | ||||
QgsAttributeTableDelegate* mTableDelegate; | QgsAttributeTableDelegate* mTableDelegate; | |||
QAbstractItemModel* mModel; // Most likely the filter model | QAbstractItemModel* mModel; // Most likely the filter model | |||
QMenu *mActionPopup; | QMenu *mActionPopup; | |||
QgsVectorLayerCache* mLayerCache; | QgsVectorLayerCache* mLayerCache; | |||
int mRowSectionAnchor; | int mRowSectionAnchor; | |||
QItemSelectionModel::SelectionFlag mCtrlDragSelectionFlag; | QItemSelectionModel::SelectionFlag mCtrlDragSelectionFlag; | |||
}; | }; | |||
#endif | #endif | |||
End of changes. 7 change blocks. | ||||
11 lines changed or deleted | 8 lines changed or added | |||
qgscachedfeatureiterator.h | qgscachedfeatureiterator.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
/** | /** | |||
* @brief | * @brief | |||
* Delivers features from the cache | * Delivers features from the cache | |||
* | * | |||
*/ | */ | |||
class CORE_EXPORT QgsCachedFeatureIterator : public QgsAbstractFeatureItera tor | class CORE_EXPORT QgsCachedFeatureIterator : public QgsAbstractFeatureItera tor | |||
{ | { | |||
public: | public: | |||
/** | /** | |||
* @brief | ||||
* This constructor creates a feature iterator, that delivers only cach ed information, based on the | * This constructor creates a feature iterator, that delivers only cach ed information, based on the | |||
* @link QgsFeatureIds @endlink. No request is made to the backend. | * @link QgsFeatureIds @endlink. No request is made to the backend. | |||
* | * | |||
* @param vlCache The vector layer cache to use | * @param vlCache The vector layer cache to use | |||
* @param featureRequest The feature request to answer | * @param featureRequest The feature request to answer | |||
* @param featureIds The feature ids to return | * @param featureIds The feature ids to return | |||
* | ||||
* @deprecated Use QgsCachedFeatureIterator( QgsVectorLayerCache* vlCac | ||||
he, QgsFeatureRequest featureRequest ) | ||||
* instead | ||||
*/ | */ | |||
QgsCachedFeatureIterator( QgsVectorLayerCache* vlCache, QgsFeatureReque st featureRequest, QgsFeatureIds featureIds ); | QgsCachedFeatureIterator( QgsVectorLayerCache* vlCache, QgsFeatureReque st featureRequest, QgsFeatureIds featureIds ); | |||
/** | /** | |||
* @brief | * This constructor creates a feature iterator, that delivers all cache d features. No request is made to the backend. | |||
* | * | |||
* @param f | * @param vlCache The vector layer cache to use | |||
* @return bool | * @param featureRequest The feature request to answer | |||
*/ | */ | |||
virtual bool nextFeature( QgsFeature& f ); | QgsCachedFeatureIterator( QgsVectorLayerCache* vlCache, QgsFeatureReque st featureRequest ); | |||
/** | /** | |||
* @brief | * Rewind to the beginning of the iterator | |||
* | * | |||
* @return bool | * @return bool true if the operation was ok | |||
*/ | */ | |||
virtual bool rewind(); | virtual bool rewind(); | |||
/** | /** | |||
* @brief | * Close this iterator. No further features will be available. | |||
* | * | |||
* @return bool | * @return true if successful | |||
*/ | */ | |||
virtual bool close(); | virtual bool close(); | |||
// QgsAbstractFeatureIterator interface | ||||
protected: | ||||
/** | ||||
* Implementation for fetching a feature. | ||||
* | ||||
* @param f Will write to this feature | ||||
* @return bool true if the operation was ok | ||||
* | ||||
* @see bool getFeature( QgsFeature& f ) | ||||
*/ | ||||
virtual bool fetchFeature( QgsFeature& f ); | ||||
/** | ||||
* We have a local special iterator for FilterFids, no need to run the | ||||
generic. | ||||
* | ||||
* @param f Will write to this feature | ||||
* @return bool true if the operation was ok | ||||
*/ | ||||
virtual bool nextFeatureFilterFids( QgsFeature& f ) { return fetchFeatu | ||||
re( f ); } | ||||
private: | private: | |||
QgsFeatureIds mFeatureIds; | QgsFeatureIds mFeatureIds; | |||
QgsVectorLayerCache* mVectorLayerCache; | QgsVectorLayerCache* mVectorLayerCache; | |||
QgsFeatureIds::Iterator mFeatureIdIterator; | QgsFeatureIds::ConstIterator mFeatureIdIterator; | |||
}; | }; | |||
/** | /** | |||
* @brief | * @brief | |||
* Uses another iterator as backend and writes features to the cache | * Uses another iterator as backend and writes features to the cache | |||
* | * | |||
*/ | */ | |||
class CORE_EXPORT QgsCachedFeatureWriterIterator : public QgsAbstractFeatur eIterator | class CORE_EXPORT QgsCachedFeatureWriterIterator : public QgsAbstractFeatur eIterator | |||
{ | { | |||
public: | public: | |||
/** | /** | |||
* @brief | ||||
* This constructor creates a feature iterator, which queries the backe nd and caches retrieved features. | * This constructor creates a feature iterator, which queries the backe nd and caches retrieved features. | |||
* | * | |||
* @param vlCache The vector layer cache to use | * @param vlCache The vector layer cache to use | |||
* @param featureRequest The feature request to answer | * @param featureRequest The feature request to answer | |||
*/ | */ | |||
QgsCachedFeatureWriterIterator( QgsVectorLayerCache* vlCache, QgsFeatur eRequest featureRequest ); | QgsCachedFeatureWriterIterator( QgsVectorLayerCache* vlCache, QgsFeatur eRequest featureRequest ); | |||
/** | /** | |||
* @brief | * Rewind to the beginning of the iterator | |||
* | * | |||
* @param f | * @return bool true if the operation was ok | |||
* @return bool | ||||
*/ | */ | |||
virtual bool nextFeature( QgsFeature& f ); | virtual bool rewind(); | |||
/** | /** | |||
* @brief | * Close this iterator. No further features will be available. | |||
* | * | |||
* @return bool | * @return true if successful | |||
*/ | */ | |||
virtual bool rewind(); | virtual bool close(); | |||
protected: | ||||
/** | /** | |||
* @brief | * Implementation for fetching a feature. | |||
* | * | |||
* @return bool | * @param f Will write to this feature | |||
* @return bool true if the operation was ok | ||||
* | ||||
* @see bool getFeature( QgsFeature& f ) | ||||
*/ | */ | |||
virtual bool close(); | virtual bool fetchFeature( QgsFeature& f ); | |||
private: | private: | |||
QgsFeatureIterator mFeatIt; | QgsFeatureIterator mFeatIt; | |||
QgsVectorLayerCache* mVectorLayerCache; | QgsVectorLayerCache* mVectorLayerCache; | |||
QgsFeatureIds mFids; | QgsFeatureIds mFids; | |||
}; | }; | |||
#endif // QGSCACHEDFEATUREITERATOR_H | #endif // QGSCACHEDFEATUREITERATOR_H | |||
End of changes. 21 change blocks. | ||||
21 lines changed or deleted | 49 lines changed or added | |||
qgscategorizedsymbolrendererv2.h | qgscategorizedsymbolrendererv2.h | |||
---|---|---|---|---|
skipping to change at line 20 | skipping to change at line 20 | |||
* it under the terms of the GNU General Public License as published by * | * it under the terms of the GNU General Public License as published by * | |||
* the Free Software Foundation; either version 2 of the License, or * | * the Free Software Foundation; either version 2 of the License, or * | |||
* (at your option) any later version. * | * (at your option) any later version. * | |||
* * | * * | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef QGSCATEGORIZEDSYMBOLRENDERERV2_H | #ifndef QGSCATEGORIZEDSYMBOLRENDERERV2_H | |||
#define QGSCATEGORIZEDSYMBOLRENDERERV2_H | #define QGSCATEGORIZEDSYMBOLRENDERERV2_H | |||
#include "qgssymbolv2.h" | #include "qgssymbolv2.h" | |||
#include "qgsrendererv2.h" | #include "qgsrendererv2.h" | |||
#include "qgsexpression.h" | ||||
#include <QHash> | #include <QHash> | |||
#include <QScopedPointer> | ||||
class QgsVectorColorRampV2; | class QgsVectorColorRampV2; | |||
class QgsVectorLayer; | class QgsVectorLayer; | |||
/* \brief categorized renderer */ | /* \brief categorized renderer */ | |||
class CORE_EXPORT QgsRendererCategoryV2 | class CORE_EXPORT QgsRendererCategoryV2 | |||
{ | { | |||
public: | public: | |||
QgsRendererCategoryV2( ); | QgsRendererCategoryV2( ); | |||
//! takes ownership of symbol | //! takes ownership of symbol | |||
QgsRendererCategoryV2( QVariant value, QgsSymbolV2* symbol, QString lab el ); | QgsRendererCategoryV2( QVariant value, QgsSymbolV2* symbol, QString lab el ); | |||
//! copy constructor | //! copy constructor | |||
QgsRendererCategoryV2( const QgsRendererCategoryV2& cat ); | QgsRendererCategoryV2( const QgsRendererCategoryV2& cat ); | |||
~QgsRendererCategoryV2(); | QgsRendererCategoryV2& operator=( QgsRendererCategoryV2 cat ); | |||
QgsRendererCategoryV2& operator=( const QgsRendererCategoryV2& cat ); | ||||
QVariant value() const; | QVariant value() const; | |||
QgsSymbolV2* symbol() const; | QgsSymbolV2* symbol() const; | |||
QString label() const; | QString label() const; | |||
void setValue( const QVariant &value ); | void setValue( const QVariant &value ); | |||
void setSymbol( QgsSymbolV2* s ); | void setSymbol( QgsSymbolV2* s ); | |||
void setLabel( const QString &label ); | void setLabel( const QString &label ); | |||
// debugging | // debugging | |||
QString dump() const; | QString dump() const; | |||
void toSld( QDomDocument& doc, QDomElement &element, QgsStringMap props ) const; | void toSld( QDomDocument& doc, QDomElement &element, QgsStringMap props ) const; | |||
protected: | protected: | |||
QVariant mValue; | QVariant mValue; | |||
QgsSymbolV2* mSymbol; | QScopedPointer<QgsSymbolV2> mSymbol; | |||
QString mLabel; | QString mLabel; | |||
void swap( QgsRendererCategoryV2 & other ); | ||||
}; | }; | |||
typedef QList<QgsRendererCategoryV2> QgsCategoryList; | typedef QList<QgsRendererCategoryV2> QgsCategoryList; | |||
class CORE_EXPORT QgsCategorizedSymbolRendererV2 : public QgsFeatureRendere rV2 | class CORE_EXPORT QgsCategorizedSymbolRendererV2 : public QgsFeatureRendere rV2 | |||
{ | { | |||
public: | public: | |||
QgsCategorizedSymbolRendererV2( QString attrName = QString(), QgsCatego ryList categories = QgsCategoryList() ); | QgsCategorizedSymbolRendererV2( QString attrName = QString(), QgsCatego ryList categories = QgsCategoryList() ); | |||
skipping to change at line 125 | skipping to change at line 127 | |||
//! create renderer from XML element | //! create renderer from XML element | |||
static QgsFeatureRendererV2* create( QDomElement& element ); | static QgsFeatureRendererV2* create( QDomElement& element ); | |||
//! store renderer info to XML element | //! store renderer info to XML element | |||
virtual QDomElement save( QDomDocument& doc ); | virtual QDomElement save( QDomDocument& doc ); | |||
//! return a list of symbology items for the legend | //! return a list of symbology items for the legend | |||
virtual QgsLegendSymbologyList legendSymbologyItems( QSize iconSize ); | virtual QgsLegendSymbologyList legendSymbologyItems( QSize iconSize ); | |||
//! return a list of item text / symbol | //! return a list of item text / symbol | |||
//! @note: this method was added in version 1.5 | //! @note this method was added in version 1.5 | |||
//! @note not available in python bindings | //! @note not available in python bindings | |||
virtual QgsLegendSymbolList legendSymbolItems(); | virtual QgsLegendSymbolList legendSymbolItems( double scaleDenominator = -1, QString rule = QString() ); | |||
QgsSymbolV2* sourceSymbol(); | QgsSymbolV2* sourceSymbol(); | |||
void setSourceSymbol( QgsSymbolV2* sym ); | void setSourceSymbol( QgsSymbolV2* sym ); | |||
QgsVectorColorRampV2* sourceColorRamp(); | QgsVectorColorRampV2* sourceColorRamp(); | |||
void setSourceColorRamp( QgsVectorColorRampV2* ramp ); | void setSourceColorRamp( QgsVectorColorRampV2* ramp ); | |||
//! @note added in 2.1 | ||||
bool invertedColorRamp() { return mInvertedColorRamp; } | ||||
void setInvertedColorRamp( bool inverted ) { mInvertedColorRamp = inver | ||||
ted; } | ||||
//! @note added in 1.6 | //! @note added in 1.6 | |||
void setRotationField( QString fieldName ) { mRotationField = fieldName ; } | void setRotationField( QString fieldOrExpression ); | |||
//! @note added in 1.6 | //! @note added in 1.6 | |||
QString rotationField() const { return mRotationField; } | QString rotationField() const; | |||
//! @note added in 1.6 | //! @note added in 1.6 | |||
void setSizeScaleField( QString fieldName ) { mSizeScaleField = fieldNa me; } | void setSizeScaleField( QString fieldOrExpression ); | |||
//! @note added in 1.6 | //! @note added in 1.6 | |||
QString sizeScaleField() const { return mSizeScaleField; } | QString sizeScaleField() const; | |||
//! @note added in 2.0 | //! @note added in 2.0 | |||
void setScaleMethod( QgsSymbolV2::ScaleMethod scaleMethod ); | void setScaleMethod( QgsSymbolV2::ScaleMethod scaleMethod ); | |||
//! @note added in 2.0 | //! @note added in 2.0 | |||
QgsSymbolV2::ScaleMethod scaleMethod() const { return mScaleMethod; } | QgsSymbolV2::ScaleMethod scaleMethod() const { return mScaleMethod; } | |||
protected: | protected: | |||
QString mAttrName; | QString mAttrName; | |||
QgsCategoryList mCategories; | QgsCategoryList mCategories; | |||
QgsSymbolV2* mSourceSymbol; | QScopedPointer<QgsSymbolV2> mSourceSymbol; | |||
QgsVectorColorRampV2* mSourceColorRamp; | QScopedPointer<QgsVectorColorRampV2> mSourceColorRamp; | |||
QString mRotationField; | bool mInvertedColorRamp; | |||
QString mSizeScaleField; | QScopedPointer<QgsExpression> mRotation; | |||
QScopedPointer<QgsExpression> mSizeScale; | ||||
QgsSymbolV2::ScaleMethod mScaleMethod; | QgsSymbolV2::ScaleMethod mScaleMethod; | |||
QScopedPointer<QgsExpression> mExpression; | ||||
//! attribute index (derived from attribute name in startRender) | //! attribute index (derived from attribute name in startRender) | |||
int mAttrNum; | int mAttrNum; | |||
int mRotationFieldIdx, mSizeScaleFieldIdx; | ||||
//! hashtable for faster access to symbols | //! hashtable for faster access to symbols | |||
QHash<QString, QgsSymbolV2*> mSymbolHash; | QHash<QString, QgsSymbolV2*> mSymbolHash; | |||
//! temporary symbols, used for data-defined rotation and scaling | //! temporary symbols, used for data-defined rotation and scaling | |||
QHash<QString, QgsSymbolV2*> mTempSymbols; | QHash<QString, QgsSymbolV2*> mTempSymbols; | |||
void rebuildHash(); | void rebuildHash(); | |||
QgsSymbolV2* symbolForValue( QVariant value ); | QgsSymbolV2* symbolForValue( QVariant value ); | |||
End of changes. 15 change blocks. | ||||
15 lines changed or deleted | 23 lines changed or added | |||
qgscategorizedsymbolrendererv2widget.h | qgscategorizedsymbolrendererv2widget.h | |||
---|---|---|---|---|
skipping to change at line 49 | skipping to change at line 49 | |||
int columnCount( const QModelIndex & = QModelIndex() ) const; | int columnCount( const QModelIndex & = QModelIndex() ) const; | |||
QModelIndex index( int row, int column, const QModelIndex &parent = QMo delIndex() ) const; | QModelIndex index( int row, int column, const QModelIndex &parent = QMo delIndex() ) const; | |||
QModelIndex parent( const QModelIndex &index ) const; | QModelIndex parent( const QModelIndex &index ) const; | |||
QStringList mimeTypes() const; | QStringList mimeTypes() const; | |||
QMimeData *mimeData( const QModelIndexList &indexes ) const; | QMimeData *mimeData( const QModelIndexList &indexes ) const; | |||
bool dropMimeData( const QMimeData *data, Qt::DropAction action, int ro w, int column, const QModelIndex &parent ); | bool dropMimeData( const QMimeData *data, Qt::DropAction action, int ro w, int column, const QModelIndex &parent ); | |||
void setRenderer( QgsCategorizedSymbolRendererV2* renderer ); | void setRenderer( QgsCategorizedSymbolRendererV2* renderer ); | |||
void addCategory( const QgsRendererCategoryV2 &cat ); | void addCategory( const QgsRendererCategoryV2 &cat ); | |||
QgsRendererCategoryV2 category( const QModelIndex &index ); | ||||
void deleteRows( QList<int> rows ); | void deleteRows( QList<int> rows ); | |||
void removeAllRows( ); | void removeAllRows( ); | |||
void sort( int column, Qt::SortOrder order = Qt::AscendingOrder ); | void sort( int column, Qt::SortOrder order = Qt::AscendingOrder ); | |||
signals: | signals: | |||
void rowsMoved(); | void rowsMoved(); | |||
private: | private: | |||
QgsCategorizedSymbolRendererV2* mRenderer; | QgsCategorizedSymbolRendererV2* mRenderer; | |||
QString mMimeFormat; | QString mMimeFormat; | |||
skipping to change at line 89 | skipping to change at line 90 | |||
virtual QgsFeatureRendererV2* renderer(); | virtual QgsFeatureRendererV2* renderer(); | |||
public slots: | public slots: | |||
void changeCategorizedSymbol(); | void changeCategorizedSymbol(); | |||
void categoryColumnChanged(); | void categoryColumnChanged(); | |||
void categoriesDoubleClicked( const QModelIndex & idx ); | void categoriesDoubleClicked( const QModelIndex & idx ); | |||
void addCategory(); | void addCategory(); | |||
void addCategories(); | void addCategories(); | |||
void deleteCategories(); | void deleteCategories(); | |||
void deleteAllCategories(); | void deleteAllCategories(); | |||
void setExpression(); | ||||
void rotationFieldChanged( QString fldName ); | void rotationFieldChanged( QString fldName ); | |||
void sizeScaleFieldChanged( QString fldName ); | void sizeScaleFieldChanged( QString fldName ); | |||
void scaleMethodChanged( QgsSymbolV2::ScaleMethod scaleMethod ); | void scaleMethodChanged( QgsSymbolV2::ScaleMethod scaleMethod ); | |||
void showSymbolLevels(); | void showSymbolLevels(); | |||
void rowsMoved(); | void rowsMoved(); | |||
protected: | protected: | |||
skipping to change at line 122 | skipping to change at line 124 | |||
//! return a list of indexes for the categories unders selection | //! return a list of indexes for the categories unders selection | |||
QList<int> selectedCategories(); | QList<int> selectedCategories(); | |||
//! change the selected symbols alone for the change button, if there i s a selection | //! change the selected symbols alone for the change button, if there i s a selection | |||
void changeSelectedSymbols(); | void changeSelectedSymbols(); | |||
void changeCategorySymbol(); | void changeCategorySymbol(); | |||
QList<QgsSymbolV2*> selectedSymbols(); | QList<QgsSymbolV2*> selectedSymbols(); | |||
QgsCategoryList selectedCategoryList(); | ||||
void refreshSymbolView() { populateCategories(); } | void refreshSymbolView() { populateCategories(); } | |||
void keyPressEvent( QKeyEvent* event ); | ||||
protected: | protected: | |||
QgsCategorizedSymbolRendererV2* mRenderer; | QgsCategorizedSymbolRendererV2* mRenderer; | |||
QgsSymbolV2* mCategorizedSymbol; | QgsSymbolV2* mCategorizedSymbol; | |||
QgsRendererV2DataDefinedMenus* mDataDefinedMenus; | QgsRendererV2DataDefinedMenus* mDataDefinedMenus; | |||
QgsCategorizedSymbolRendererV2Model* mModel; | QgsCategorizedSymbolRendererV2Model* mModel; | |||
private: | private: | |||
QString mOldClassificationAttribute; | QString mOldClassificationAttribute; | |||
QgsCategoryList mCopyBuffer; | ||||
}; | }; | |||
#endif // QGSCATEGORIZEDSYMBOLRENDERERV2WIDGET_H | #endif // QGSCATEGORIZEDSYMBOLRENDERERV2WIDGET_H | |||
End of changes. 5 change blocks. | ||||
0 lines changed or deleted | 5 lines changed or added | |||
qgsclipper.h | qgsclipper.h | |||
---|---|---|---|---|
skipping to change at line 74 | skipping to change at line 74 | |||
static const double MAX_Y; | static const double MAX_Y; | |||
static const double MIN_Y; | static const double MIN_Y; | |||
// A handy way to refer to the four boundaries | // A handy way to refer to the four boundaries | |||
enum Boundary {XMax, XMin, YMax, YMin}; | enum Boundary {XMax, XMin, YMax, YMin}; | |||
// Trims the given feature to a rectangular box. Returns the trimmed | // Trims the given feature to a rectangular box. Returns the trimmed | |||
// feature in x and y. The shapeOpen parameter determines whether | // feature in x and y. The shapeOpen parameter determines whether | |||
// the function treats the points as a closed shape (polygon), or as | // the function treats the points as a closed shape (polygon), or as | |||
// an open shape (linestring). | // an open shape (linestring). | |||
// | ||||
// @note not available in python bindings on android | ||||
static void trimFeature( QVector<double>& x, | static void trimFeature( QVector<double>& x, | |||
QVector<double>& y, | QVector<double>& y, | |||
bool shapeOpen ); | bool shapeOpen ); | |||
static void trimPolygon( QPolygonF& pts, const QgsRectangle& clipRect ) ; | static void trimPolygon( QPolygonF& pts, const QgsRectangle& clipRect ) ; | |||
/**Reads a polyline from WKB and clips it to clipExtent | /**Reads a polyline from WKB and clips it to clipExtent | |||
@param wkb pointer to the start of the line wkb | @param wkb pointer to the start of the line wkb | |||
@param clipExtent clipping bounds | @param clipExtent clipping bounds | |||
@param line out: clipped line coordinates*/ | @param line out: clipped line coordinates*/ | |||
skipping to change at line 181 | skipping to change at line 183 | |||
y.clear(); | y.clear(); | |||
trimFeatureToBoundary( tmpX, tmpY, x, y, YMin, shapeOpen ); | trimFeatureToBoundary( tmpX, tmpY, x, y, YMin, shapeOpen ); | |||
} | } | |||
inline void QgsClipper::trimPolygon( QPolygonF& pts, const QgsRectangle& cl ipRect ) | inline void QgsClipper::trimPolygon( QPolygonF& pts, const QgsRectangle& cl ipRect ) | |||
{ | { | |||
QPolygonF tmpPts; | QPolygonF tmpPts; | |||
tmpPts.reserve( pts.size() ); | tmpPts.reserve( pts.size() ); | |||
trimPolygonToBoundary( pts, tmpPts, clipRect, XMax, clipRect.xMaximum() ) ; | trimPolygonToBoundary( pts, tmpPts, clipRect, XMax, clipRect.xMaximum() ) ; | |||
pts.clear(); | pts.resize( 0 ); | |||
trimPolygonToBoundary( tmpPts, pts, clipRect, YMax, clipRect.yMaximum() ) ; | trimPolygonToBoundary( tmpPts, pts, clipRect, YMax, clipRect.yMaximum() ) ; | |||
tmpPts.clear(); | tmpPts.resize( 0 ); | |||
trimPolygonToBoundary( pts, tmpPts, clipRect, XMin, clipRect.xMinimum() ) ; | trimPolygonToBoundary( pts, tmpPts, clipRect, XMin, clipRect.xMinimum() ) ; | |||
pts.clear(); | pts.resize( 0 ); | |||
trimPolygonToBoundary( tmpPts, pts, clipRect, YMin, clipRect.yMinimum() ) ; | trimPolygonToBoundary( tmpPts, pts, clipRect, YMin, clipRect.yMinimum() ) ; | |||
} | } | |||
// An auxilary function that is part of the polygon trimming | // An auxilary function that is part of the polygon trimming | |||
// code. Will trim the given polygon to the given boundary and return | // code. Will trim the given polygon to the given boundary and return | |||
// the trimmed polygon in the out pointer. Uses Sutherland and | // the trimmed polygon in the out pointer. Uses Sutherland and | |||
// Hodgman's polygon-clipping algorithm. | // Hodgman's polygon-clipping algorithm. | |||
inline void QgsClipper::trimFeatureToBoundary( | inline void QgsClipper::trimFeatureToBoundary( | |||
const QVector<double>& inX, | const QVector<double>& inX, | |||
End of changes. 4 change blocks. | ||||
3 lines changed or deleted | 5 lines changed or added | |||
qgscolorbutton.h | qgscolorbutton.h | |||
---|---|---|---|---|
skipping to change at line 142 | skipping to change at line 142 | |||
#endif | #endif | |||
void showEvent( QShowEvent* e ); | void showEvent( QShowEvent* e ); | |||
static const QPixmap& transpBkgrd(); | static const QPixmap& transpBkgrd(); | |||
private: | private: | |||
QString mColorDialogTitle; | QString mColorDialogTitle; | |||
QColor mColor; | QColor mColor; | |||
QColorDialog::ColorDialogOptions mColorDialogOptions; | QColorDialog::ColorDialogOptions mColorDialogOptions; | |||
bool mAcceptLiveUpdates; | bool mAcceptLiveUpdates; | |||
QTemporaryFile mTempPNG; | QTemporaryFile mTempPNG; | |||
bool mColorSet; // added in QGIS 2.1 | ||||
private slots: | private slots: | |||
void onButtonClicked(); | void onButtonClicked(); | |||
/** | /** | |||
* Sets color for button, if valid. | * Sets color for button, if valid. | |||
* | * | |||
* @note added in 1.9 | * @note added in 1.9 | |||
*/ | */ | |||
void setValidColor( const QColor& newColor ); | void setValidColor( const QColor& newColor ); | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 1 lines changed or added | |||
qgscolorrampcombobox.h | qgscolorrampcombobox.h | |||
---|---|---|---|---|
skipping to change at line 40 | skipping to change at line 40 | |||
//! initialize the combo box with color ramps from the style | //! initialize the combo box with color ramps from the style | |||
void populate( QgsStyleV2* style ); | void populate( QgsStyleV2* style ); | |||
//! add/select color ramp which was used previously by the renderer | //! add/select color ramp which was used previously by the renderer | |||
void setSourceColorRamp( QgsVectorColorRampV2* sourceRamp ); | void setSourceColorRamp( QgsVectorColorRampV2* sourceRamp ); | |||
//! return new instance of the current color ramp or NULL if there is n o active color ramp | //! return new instance of the current color ramp or NULL if there is n o active color ramp | |||
QgsVectorColorRampV2* currentColorRamp(); | QgsVectorColorRampV2* currentColorRamp(); | |||
//! @note not available in python bindings | ||||
static QSize rampIconSize; | static QSize rampIconSize; | |||
//! @note added in 2.2 | ||||
void setShowGradientOnly( bool gradientOnly ) { mShowGradientOnly = gra | ||||
dientOnly; } | ||||
//! @note added in 2.2 | ||||
bool showGradientOnly() const { return mShowGradientOnly; } | ||||
public slots: | public slots: | |||
void colorRampChanged( int index ); | void colorRampChanged( int index ); | |||
protected: | protected: | |||
QgsStyleV2* mStyle; | QgsStyleV2* mStyle; | |||
QgsVectorColorRampV2* mSourceColorRamp; // owns the copy | QgsVectorColorRampV2* mSourceColorRamp; // owns the copy | |||
private: | ||||
bool mShowGradientOnly; | ||||
}; | }; | |||
#endif // QGSCOLORRAMPCOMBOBOX_H | #endif // QGSCOLORRAMPCOMBOBOX_H | |||
End of changes. 3 change blocks. | ||||
0 lines changed or deleted | 11 lines changed or added | |||
qgscomposereffect.h | qgscomposereffect.h | |||
---|---|---|---|---|
skipping to change at line 32 | skipping to change at line 32 | |||
#include <QGraphicsEffect> | #include <QGraphicsEffect> | |||
class CORE_EXPORT QgsComposerEffect : public QGraphicsEffect | class CORE_EXPORT QgsComposerEffect : public QGraphicsEffect | |||
{ | { | |||
Q_OBJECT | Q_OBJECT | |||
public: | public: | |||
QgsComposerEffect(); | QgsComposerEffect(); | |||
~QgsComposerEffect(); | ~QgsComposerEffect(); | |||
void setCompositionMode( const QPainter::CompositionMode compositionMod e ); | void setCompositionMode( const QPainter::CompositionMode &compositionMo de ); | |||
protected: | protected: | |||
/** Called whenever source needs to be drawn */ | /** Called whenever source needs to be drawn */ | |||
virtual void draw( QPainter *painter ); | virtual void draw( QPainter *painter ); | |||
private: | private: | |||
QPainter::CompositionMode mCompositionMode; | QPainter::CompositionMode mCompositionMode; | |||
}; | }; | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
qgscomposeritem.h | qgscomposeritem.h | |||
---|---|---|---|---|
skipping to change at line 111 | skipping to change at line 111 | |||
QgsComposerItem( qreal x, qreal y, qreal width, qreal height, QgsCompos ition* composition, bool manageZValue = true ); | QgsComposerItem( qreal x, qreal y, qreal width, qreal height, QgsCompos ition* composition, bool manageZValue = true ); | |||
virtual ~QgsComposerItem(); | virtual ~QgsComposerItem(); | |||
/** return correct graphics item type. Added in v1.7 */ | /** return correct graphics item type. Added in v1.7 */ | |||
virtual int type() const { return ComposerItem; } | virtual int type() const { return ComposerItem; } | |||
/** \brief Set selected, selected item should be highlighted */ | /** \brief Set selected, selected item should be highlighted */ | |||
virtual void setSelected( bool s ); | virtual void setSelected( bool s ); | |||
/** \brief Is selected */ | /** \brief Is selected */ | |||
virtual bool selected() {return QGraphicsRectItem::isSelected();} | virtual bool selected() const {return QGraphicsRectItem::isSelected();} ; | |||
/** stores state in project */ | /** stores state in project */ | |||
virtual bool writeSettings(); | virtual bool writeSettings(); | |||
/** read state from project */ | /** read state from project */ | |||
virtual bool readSettings(); | virtual bool readSettings(); | |||
/** delete settings from project file */ | /** delete settings from project file */ | |||
virtual bool removeSettings(); | virtual bool removeSettings(); | |||
/**Moves item in canvas coordinates*/ | /**Moves item in canvas coordinates*/ | |||
void move( double dx, double dy ); | void move( double dx, double dy ); | |||
/**Move Content of item. Does nothing per default (but implemented in c omposer map) | /**Move Content of item. Does nothing per default (but implemented in c omposer map) | |||
@param dx move in x-direction (canvas coordinates) | @param dx move in x-direction (canvas coordinates) | |||
@param dy move in y-direction(canvas coordinates)*/ | @param dy move in y-direction(canvas coordinates)*/ | |||
virtual void moveContent( double dx, double dy ) { Q_UNUSED( dx ); Q_UN USED( dy ); } | virtual void moveContent( double dx, double dy ) { Q_UNUSED( dx ); Q_UN USED( dy ); } | |||
/**Zoom content of item. Does nothing per default (but implemented in c omposer map) | /**Zoom content of item. Does nothing per default (but implemented in c omposer map) | |||
@param delta value from wheel event that describes magnitude and direc | @param delta value from wheel event that describes magnitude and dire | |||
tion (positive /negative number) | ction (positive /negative number) | |||
@param x x-position of mouse cursor (in item coordinates) | @param x x-position of mouse cursor (in item coordinates) | |||
@param y y-position of mouse cursor (in item coordinates)*/ | @param y y-position of mouse cursor (in item coordinates)*/ | |||
virtual void zoomContent( int delta, double x, double y ) { Q_UNUSED( d elta ); Q_UNUSED( x ); Q_UNUSED( y ); } | virtual void zoomContent( int delta, double x, double y ) { Q_UNUSED( d elta ); Q_UNUSED( x ); Q_UNUSED( y ); } | |||
/**Moves the item to a new position (in canvas coordinates)*/ | /**Moves the item to a new position (in canvas coordinates)*/ | |||
void setItemPosition( double x, double y, ItemPositionMode itemPoint = UpperLeft ); | void setItemPosition( double x, double y, ItemPositionMode itemPoint = UpperLeft ); | |||
/**Sets item position and width / height in one go | /**Sets item position and width / height in one go | |||
@param x item position x | ||||
@param y item position y | ||||
@param width item width | ||||
@param height item height | ||||
@param itemPoint item position mode | ||||
@param posIncludesFrame set to true if the position and size argument | ||||
s include the item's frame border | ||||
@note: this method was added in version 1.6*/ | @note: this method was added in version 1.6*/ | |||
void setItemPosition( double x, double y, double width, double height, ItemPositionMode itemPoint = UpperLeft ); | void setItemPosition( double x, double y, double width, double height, ItemPositionMode itemPoint = UpperLeft, bool posIncludesFrame = false ); | |||
/**Returns item's last used position mode. | /**Returns item's last used position mode. | |||
@note: This property has no effect on actual's item position, which i s always the top-left corner. | @note: This property has no effect on actual's item position, which i s always the top-left corner. | |||
@note: this method was added in version 2.0*/ | @note: this method was added in version 2.0*/ | |||
ItemPositionMode lastUsedPositionMode() { return mLastUsedPositionMode; } | ItemPositionMode lastUsedPositionMode() { return mLastUsedPositionMode; } | |||
/**Sets this items bound in scene coordinates such that 1 item size uni ts | /**Sets this items bound in scene coordinates such that 1 item size uni ts | |||
corresponds to 1 scene size unit*/ | corresponds to 1 scene size unit*/ | |||
virtual void setSceneRect( const QRectF& rectangle ); | virtual void setSceneRect( const QRectF& rectangle ); | |||
skipping to change at line 183 | skipping to change at line 190 | |||
* @see hasFrame | * @see hasFrame | |||
*/ | */ | |||
bool hasFrame() const {return mFrame;} | bool hasFrame() const {return mFrame;} | |||
/** Set whether this item has a frame drawn around it or not. | /** Set whether this item has a frame drawn around it or not. | |||
* @param drawFrame draw frame | * @param drawFrame draw frame | |||
* @returns nothing | * @returns nothing | |||
* @note introduced in 1.8 | * @note introduced in 1.8 | |||
* @see hasFrame | * @see hasFrame | |||
*/ | */ | |||
void setFrameEnabled( bool drawFrame ) {mFrame = drawFrame;} | void setFrameEnabled( bool drawFrame ); | |||
/** Sets frame outline width | ||||
* @param outlineWidth new width for outline frame | ||||
* @returns nothing | ||||
* @note introduced in 2.2 | ||||
* @see setFrameEnabled | ||||
*/ | ||||
virtual void setFrameOutlineWidth( double outlineWidth ); | ||||
/** Returns the estimated amount the item's frame bleeds outside the it | ||||
em's | ||||
* actual rectangle. For instance, if the item has a 2mm frame outline | ||||
, then | ||||
* 1mm of this frame is drawn outside the item's rect. In this case th | ||||
e | ||||
* return value will be 1.0 | ||||
* @note introduced in 2.2 | ||||
*/ | ||||
virtual double estimatedFrameBleed() const; | ||||
/** Returns the item's rectangular bounds, including any bleed caused b | ||||
y the item's frame. | ||||
* The bounds are returned in the item's coordinate system (see Qt's Q | ||||
GraphicsItem docs for | ||||
* more details about QGraphicsItem coordinate systems). The results d | ||||
iffer from Qt's rect() | ||||
* function, as rect() makes no allowances for the portion of outlines | ||||
which are drawn | ||||
* outside of the item. | ||||
* @note introduced in 2.2 | ||||
* @see estimatedFrameBleed | ||||
*/ | ||||
virtual QRectF rectWithFrame() const; | ||||
/** Whether this item has a Background or not. | /** Whether this item has a Background or not. | |||
* @returns true if there is a Background around this item, otherwise f alse. | * @returns true if there is a Background around this item, otherwise f alse. | |||
* @note introduced since 2.0 | * @note introduced since 2.0 | |||
* @see hasBackground | * @see hasBackground | |||
*/ | */ | |||
bool hasBackground() const {return mBackground;} | bool hasBackground() const {return mBackground;} | |||
/** Set whether this item has a Background drawn around it or not. | /** Set whether this item has a Background drawn around it or not. | |||
* @param drawBackground draw Background | * @param drawBackground draw Background | |||
skipping to change at line 283 | skipping to change at line 316 | |||
double fontDescentMillimeters( const QFont& font ) const; | double fontDescentMillimeters( const QFont& font ) const; | |||
/**Calculates font to from point size to pixel size*/ | /**Calculates font to from point size to pixel size*/ | |||
double pixelFontSize( double pointSize ) const; | double pixelFontSize( double pointSize ) const; | |||
/**Returns a font where size is in pixel and font size is upscaled with FONT_WORKAROUND_SCALE*/ | /**Returns a font where size is in pixel and font size is upscaled with FONT_WORKAROUND_SCALE*/ | |||
QFont scaledFontPixelSize( const QFont& font ) const; | QFont scaledFontPixelSize( const QFont& font ) const; | |||
/**Locks / unlocks the item position for mouse drags | /**Locks / unlocks the item position for mouse drags | |||
@note this method was added in version 1.2*/ | @note this method was added in version 1.2*/ | |||
void setPositionLock( bool lock ) {mItemPositionLocked = lock;} | void setPositionLock( bool lock ); | |||
/**Returns position lock for mouse drags (true means locked) | /**Returns position lock for mouse drags (true means locked) | |||
@note this method was added in version 1.2*/ | @note this method was added in version 1.2*/ | |||
bool positionLock() const {return mItemPositionLocked;} | bool positionLock() const {return mItemPositionLocked;} | |||
/**Update mouse cursor at (item) position | /**Returns the rotation for the composer item | |||
@note this method was added in version 1.2*/ | @note this method was added in version 2.1*/ | |||
void updateCursor( const QPointF& itemPos ); | double itemRotation() const {return mItemRotation;} | |||
double rotation() const {return mRotation;} | /**Returns the rotation for the composer item | |||
* @deprecated Use itemRotation() | ||||
* instead | ||||
*/ | ||||
double rotation() const {return mItemRotation;} | ||||
/**Updates item, with the possibility to do custom update for subclasse s*/ | /**Updates item, with the possibility to do custom update for subclasse s*/ | |||
virtual void updateItem() { QGraphicsRectItem::update(); } | virtual void updateItem() { QGraphicsRectItem::update(); } | |||
/**Get item's id (which is not necessarly unique) | /**Get item's id (which is not necessarly unique) | |||
@note this method was added in version 1.7*/ | @note this method was added in version 1.7*/ | |||
QString id() const { return mId; } | QString id() const { return mId; } | |||
/**Set item's id (which is not necessarly unique) | /**Set item's id (which is not necessarly unique) | |||
@note this method was added in version 1.7*/ | @note this method was added in version 1.7*/ | |||
virtual void setId( const QString& id ); | virtual void setId( const QString& id ); | |||
/**Get item identification name | /**Get item identification name | |||
@note this method was added in version 2.0 | @note this method was added in version 2.0 | |||
@note there is not setter since one can't manually set the id*/ | @note there is not setter since one can't manually set the id*/ | |||
QString uuid() const { return mUuid; } | QString uuid() const { return mUuid; } | |||
public slots: | public slots: | |||
/**Sets the item rotation | ||||
* @deprecated Use setItemRotation( double rotation ) instead | ||||
*/ | ||||
virtual void setRotation( double r ); | virtual void setRotation( double r ); | |||
/**Sets the item rotation | ||||
@param r item rotation in degrees | ||||
@param adjustPosition set to true if item should be shifted so that r | ||||
otation occurs | ||||
around item center. If false, rotation occurs around item origin | ||||
@note this method was added in version 2.1 | ||||
*/ | ||||
virtual void setItemRotation( double r, bool adjustPosition = false ); | ||||
void repaint(); | void repaint(); | |||
protected: | protected: | |||
QgsComposition* mComposition; | QgsComposition* mComposition; | |||
QgsComposerItem::MouseMoveAction mCurrentMouseMoveAction; | QgsComposerItem::MouseMoveAction mCurrentMouseMoveAction; | |||
/**Start point of the last mouse move action (in scene coordinates)*/ | /**Start point of the last mouse move action (in scene coordinates)*/ | |||
QPointF mMouseMoveStartPos; | QPointF mMouseMoveStartPos; | |||
/**Position of the last mouse move event (in scene coordinates)*/ | /**Position of the last mouse move event (in scene coordinates)*/ | |||
skipping to change at line 345 | skipping to change at line 394 | |||
QColor mBackgroundColor; | QColor mBackgroundColor; | |||
/**True if item position and size cannot be changed with mouse move | /**True if item position and size cannot be changed with mouse move | |||
@note: this member was added in version 1.2*/ | @note: this member was added in version 1.2*/ | |||
bool mItemPositionLocked; | bool mItemPositionLocked; | |||
/**Backup to restore item appearance if no view scale factor is availab le*/ | /**Backup to restore item appearance if no view scale factor is availab le*/ | |||
mutable double mLastValidViewScaleFactor; | mutable double mLastValidViewScaleFactor; | |||
/**Item rotation in degrees, clockwise*/ | /**Item rotation in degrees, clockwise*/ | |||
double mRotation; | double mItemRotation; | |||
/**Composition blend mode for item*/ | /**Composition blend mode for item*/ | |||
QPainter::CompositionMode mBlendMode; | QPainter::CompositionMode mBlendMode; | |||
bool mEffectsEnabled; | bool mEffectsEnabled; | |||
QgsComposerEffect *mEffect; | QgsComposerEffect *mEffect; | |||
/**Item transparency*/ | /**Item transparency*/ | |||
int mTransparency; | int mTransparency; | |||
/**The item's position mode | /**The item's position mode | |||
@note: this member was added in version 2.0*/ | @note: this member was added in version 2.0*/ | |||
ItemPositionMode mLastUsedPositionMode; | ItemPositionMode mLastUsedPositionMode; | |||
//event handlers | ||||
virtual void mouseMoveEvent( QGraphicsSceneMouseEvent * event ); | ||||
virtual void mousePressEvent( QGraphicsSceneMouseEvent * event ); | ||||
virtual void mouseReleaseEvent( QGraphicsSceneMouseEvent * event ); | ||||
virtual void hoverMoveEvent( QGraphicsSceneHoverEvent * event ); | ||||
/**Finds out the appropriate cursor for the current mouse position in t | ||||
he widget (e.g. move in the middle, resize at border)*/ | ||||
Qt::CursorShape cursorForPosition( const QPointF& itemCoordPos ); | ||||
/**Finds out which mouse move action to choose depending on the cursor | ||||
position inside the widget*/ | ||||
QgsComposerItem::MouseMoveAction mouseMoveActionForPosition( const QPoi | ||||
ntF& itemCoordPos ); | ||||
/**Changes the rectangle of an item depending on current mouse action ( | ||||
resize or move) | ||||
@param currentPosition current position of mouse cursor | ||||
@param mouseMoveStartPos cursor position at the start of the current m | ||||
ouse action | ||||
@param originalItem Item position at the start of the mouse action | ||||
@param dx x-Change of mouse cursor | ||||
@param dy y-Change of mouse cursor | ||||
@param changeItem Item to change size (can be the same as originalItem | ||||
or a differen one) | ||||
*/ | ||||
void changeItemRectangle( const QPointF& currentPosition, const QPointF | ||||
& mouseMoveStartPos, const QGraphicsRectItem* originalItem, double dx, doub | ||||
le dy, QGraphicsRectItem* changeItem ); | ||||
/**Draw selection boxes around item*/ | /**Draw selection boxes around item*/ | |||
virtual void drawSelectionBoxes( QPainter* p ); | virtual void drawSelectionBoxes( QPainter* p ); | |||
/**Draw black frame around item*/ | /**Draw black frame around item*/ | |||
virtual void drawFrame( QPainter* p ); | virtual void drawFrame( QPainter* p ); | |||
/**Draw background*/ | /**Draw background*/ | |||
virtual void drawBackground( QPainter* p ); | virtual void drawBackground( QPainter* p ); | |||
/**Draws arrowhead*/ | /**Draws arrowhead*/ | |||
skipping to change at line 413 | skipping to change at line 439 | |||
double lockSymbolSize() const; | double lockSymbolSize() const; | |||
/**Returns the zoom factor of the graphics view. | /**Returns the zoom factor of the graphics view. | |||
@return the factor or -1 in case of error (e.g. graphic view does not exist) | @return the factor or -1 in case of error (e.g. graphic view does not exist) | |||
@note: this function was introduced in version 1.2*/ | @note: this function was introduced in version 1.2*/ | |||
double horizontalViewScaleFactor() const; | double horizontalViewScaleFactor() const; | |||
//some utility functions | //some utility functions | |||
/**Calculates width and hight of the picture (in mm) such that it fits into the item frame with the given rotation*/ | /**Calculates width and hight of the picture (in mm) such that it fits into the item frame with the given rotation*/ | |||
bool imageSizeConsideringRotation( double& width, double& height, doubl | ||||
e rotation ) const; | ||||
/**Calculates width and hight of the picture (in mm) such that it fits | ||||
into the item frame with the given rotation | ||||
* @deprecated Use bool imageSizeConsideringRotation( double& width, do | ||||
uble& height, double rotation ) | ||||
* instead | ||||
*/ | ||||
bool imageSizeConsideringRotation( double& width, double& height ) cons t; | bool imageSizeConsideringRotation( double& width, double& height ) cons t; | |||
/**Calculates the largest scaled version of originalRect which fits wit | ||||
hin boundsRect, when it is rotated by | ||||
* a specified amount | ||||
@param originalRect QRectF to be rotated and scaled | ||||
@param boundsRect QRectF specifying the bounds which the rotated an | ||||
d scaled rectangle must fit within | ||||
@param rotation the rotation in degrees to be applied to the rectan | ||||
gle | ||||
*/ | ||||
QRectF largestRotatedRectWithinBounds( QRectF originalRect, QRectF boun | ||||
dsRect, double rotation ) const; | ||||
/**Calculates corner point after rotation and scaling*/ | /**Calculates corner point after rotation and scaling*/ | |||
bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double wi | ||||
dth, double height, double rotation ) const; | ||||
/**Calculates corner point after rotation and scaling | ||||
* @deprecated Use bool cornerPointOnRotatedAndScaledRect( double& x, d | ||||
ouble& y, double width, double height, double rotation ) | ||||
* instead | ||||
*/ | ||||
bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double wi dth, double height ) const; | bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double wi dth, double height ) const; | |||
/**Calculates width / height of the bounding box of a rotated rectangle | /**Calculates width / height of the bounding box of a rotated rectangle | |||
(mRotation)*/ | */ | |||
void sizeChangedByRotation( double& width, double& height, double rotat | ||||
ion ); | ||||
/**Calculates width / height of the bounding box of a rotated rectangle | ||||
* @deprecated Use void sizeChangedByRotation( double& width, double& he | ||||
ight, double rotation ) | ||||
* instead | ||||
*/ | ||||
void sizeChangedByRotation( double& width, double& height ); | void sizeChangedByRotation( double& width, double& height ); | |||
/**Rotates a point / vector | /**Rotates a point / vector | |||
@param angle rotation angle in degrees, counterclockwise | @param angle rotation angle in degrees, counterclockwise | |||
@param x in/out: x coordinate before / after the rotation | @param x in/out: x coordinate before / after the rotation | |||
@param y in/out: y cooreinate before / after the rotation*/ | @param y in/out: y cooreinate before / after the rotation*/ | |||
void rotate( double angle, double& x, double& y ) const; | void rotate( double angle, double& x, double& y ) const; | |||
/**Return horizontal align snap item. Creates a new graphics line if 0* / | /**Return horizontal align snap item. Creates a new graphics line if 0* / | |||
QGraphicsLineItem* hAlignSnapItem(); | QGraphicsLineItem* hAlignSnapItem(); | |||
void deleteHAlignSnapItem(); | void deleteHAlignSnapItem(); | |||
/**Return vertical align snap item. Creates a new graphics line if 0*/ | /**Return vertical align snap item. Creates a new graphics line if 0*/ | |||
QGraphicsLineItem* vAlignSnapItem(); | QGraphicsLineItem* vAlignSnapItem(); | |||
void deleteVAlignSnapItem(); | void deleteVAlignSnapItem(); | |||
void deleteAlignItems(); | void deleteAlignItems(); | |||
signals: | signals: | |||
/**Is emitted on rotation change to notify north arrow pictures*/ | /**Is emitted on item rotation change*/ | |||
void rotationChanged( double newRotation ); | void itemRotationChanged( double newRotation ); | |||
/**Used e.g. by the item widgets to update the gui elements*/ | /**Used e.g. by the item widgets to update the gui elements*/ | |||
void itemChanged(); | void itemChanged(); | |||
/**Emitted if the rectangle changes*/ | /**Emitted if the rectangle changes*/ | |||
void sizeChanged(); | void sizeChanged(); | |||
/**Emitted if the item's frame style changes | ||||
* @note: this function was introduced in version 2.2 | ||||
*/ | ||||
void frameChanged(); | ||||
private: | private: | |||
// id (not unique) | // id (not unique) | |||
QString mId; | QString mId; | |||
// name (unique) | // name (unique) | |||
QString mUuid; | QString mUuid; | |||
// name (temporary when loaded from template) | // name (temporary when loaded from template) | |||
QString mTemplateUuid; | QString mTemplateUuid; | |||
void init( bool manageZValue ); | void init( bool manageZValue ); | |||
End of changes. 18 change blocks. | ||||
49 lines changed or deleted | 116 lines changed or added | |||
qgscomposeritemcommand.h | qgscomposeritemcommand.h | |||
---|---|---|---|---|
skipping to change at line 77 | skipping to change at line 77 | |||
newest after state. The purpose is to avoid too many micro changes in the history*/ | newest after state. The purpose is to avoid too many micro changes in the history*/ | |||
class CORE_EXPORT QgsComposerMergeCommand: public QgsComposerItemCommand | class CORE_EXPORT QgsComposerMergeCommand: public QgsComposerItemCommand | |||
{ | { | |||
public: | public: | |||
enum Context | enum Context | |||
{ | { | |||
Unknown = 0, | Unknown = 0, | |||
//composer label | //composer label | |||
ComposerLabelSetText, | ComposerLabelSetText, | |||
ComposerLabelSetId, | ComposerLabelSetId, | |||
ComposerLabelRotation, | ||||
//composer map | //composer map | |||
ComposerMapRotation, | ComposerMapRotation, | |||
ComposerMapAnnotationDistance, | ComposerMapAnnotationDistance, | |||
//composer legend | //composer legend | |||
ComposerLegendText, | ComposerLegendText, | |||
LegendColumnCount, | LegendColumnCount, | |||
LegendSplitLayer, | LegendSplitLayer, | |||
LegendEqualColumnWidth, | LegendEqualColumnWidth, | |||
LegendSymbolWidth, | LegendSymbolWidth, | |||
LegendSymbolHeight, | LegendSymbolHeight, | |||
LegendWmsLegendWidth, | ||||
LegendWmsLegendHeight, | ||||
LegendTitleSpaceBottom, | LegendTitleSpaceBottom, | |||
LegendGroupSpace, | LegendGroupSpace, | |||
LegendLayerSpace, | LegendLayerSpace, | |||
LegendSymbolSpace, | LegendSymbolSpace, | |||
LegendIconSymbolSpace, | LegendIconSymbolSpace, | |||
LegendBoxSpace, | LegendBoxSpace, | |||
LegendColumnSpace, | LegendColumnSpace, | |||
//composer picture | //composer picture | |||
ComposerPictureRotation, | ComposerPictureRotation, | |||
// composer scalebar | // composer scalebar | |||
skipping to change at line 112 | skipping to change at line 113 | |||
ScaleBarNSegments, | ScaleBarNSegments, | |||
ScaleBarUnitText, | ScaleBarUnitText, | |||
ScaleBarMapUnitsSegment, | ScaleBarMapUnitsSegment, | |||
ScaleBarLabelBarSize, | ScaleBarLabelBarSize, | |||
ScaleBarBoxContentSpace, | ScaleBarBoxContentSpace, | |||
// composer table | // composer table | |||
TableMaximumFeatures, | TableMaximumFeatures, | |||
TableMargin, | TableMargin, | |||
TableGridStrokeWidth, | TableGridStrokeWidth, | |||
//composer shape | //composer shape | |||
ShapeRotation, | ShapeCornerRadius, | |||
ShapeOutlineWidth, | ShapeOutlineWidth, | |||
//composer arrow | //composer arrow | |||
ArrowOutlineWidth, | ArrowOutlineWidth, | |||
ArrowHeadWidth, | ArrowHeadWidth, | |||
//item | //item | |||
ItemOutlineWidth, | ItemOutlineWidth, | |||
ItemMove | ItemMove, | |||
ItemRotation | ||||
}; | }; | |||
QgsComposerMergeCommand( Context c, QgsComposerItem* item, const QStrin g& text ); | QgsComposerMergeCommand( Context c, QgsComposerItem* item, const QStrin g& text ); | |||
~QgsComposerMergeCommand(); | ~QgsComposerMergeCommand(); | |||
bool mergeWith( const QUndoCommand * command ); | bool mergeWith( const QUndoCommand * command ); | |||
int id() const { return ( int )mContext; } | int id() const { return ( int )mContext; } | |||
private: | private: | |||
Context mContext; | Context mContext; | |||
End of changes. 4 change blocks. | ||||
3 lines changed or deleted | 5 lines changed or added | |||
qgscomposeritemgroup.h | qgscomposeritemgroup.h | |||
---|---|---|---|---|
skipping to change at line 70 | skipping to change at line 70 | |||
void childItemDeleted( QgsComposerItem* item ); | void childItemDeleted( QgsComposerItem* item ); | |||
public slots: | public slots: | |||
void itemDestroyed(); | void itemDestroyed(); | |||
protected: | protected: | |||
void drawFrame( QPainter* p ); | void drawFrame( QPainter* p ); | |||
private: | private: | |||
QSet<QgsComposerItem*> mItems; | QSet<QgsComposerItem*> mItems; | |||
QRectF mSceneBoundingRectangle; | QRectF mBoundingRectangle; | |||
}; | }; | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
qgscomposerlabel.h | qgscomposerlabel.h | |||
---|---|---|---|---|
skipping to change at line 90 | skipping to change at line 90 | |||
//!brief Mutator for the margin of the label | //!brief Mutator for the margin of the label | |||
void setMargin( double m ) {mMargin = m;} | void setMargin( double m ) {mMargin = m;} | |||
/**Sets text color | /**Sets text color | |||
@note: this function was added in version 1.4*/ | @note: this function was added in version 1.4*/ | |||
void setFontColor( const QColor& c ) {mFontColor = c;} | void setFontColor( const QColor& c ) {mFontColor = c;} | |||
/**Get font color | /**Get font color | |||
@note: this function was added in version 1.4*/ | @note: this function was added in version 1.4*/ | |||
QColor fontColor() const {return mFontColor;} | QColor fontColor() const {return mFontColor;} | |||
void setSceneRect( const QRectF& rectangle ); | ||||
/** stores state in Dom element | /** stores state in Dom element | |||
* @param elem is Dom element corresponding to 'Composer' tag | * @param elem is Dom element corresponding to 'Composer' tag | |||
* @param doc document | * @param doc document | |||
*/ | */ | |||
bool writeXML( QDomElement& elem, QDomDocument & doc ) const; | bool writeXML( QDomElement& elem, QDomDocument & doc ) const; | |||
/** sets state from Dom document | /** sets state from Dom document | |||
* @param itemElem is Dom element corresponding to 'ComposerLabel' ta g | * @param itemElem is Dom element corresponding to 'ComposerLabel' ta g | |||
* @param doc document | * @param doc document | |||
*/ | */ | |||
bool readXML( const QDomElement& itemElem, const QDomDocument& doc ); | bool readXML( const QDomElement& itemElem, const QDomDocument& doc ); | |||
public slots: | ||||
virtual void setRotation( double r ); | ||||
private slots: | private slots: | |||
void loadingHtmlFinished( bool ); | void loadingHtmlFinished( bool ); | |||
private: | private: | |||
// Text | // Text | |||
QString mText; | QString mText; | |||
// Html state | // Html state | |||
int mHtmlState; | int mHtmlState; | |||
double mHtmlUnitsToMM; | double mHtmlUnitsToMM; | |||
skipping to change at line 141 | skipping to change at line 136 | |||
// Horizontal Alignment | // Horizontal Alignment | |||
Qt::AlignmentFlag mHAlignment; | Qt::AlignmentFlag mHAlignment; | |||
// Vertical Alignment | // Vertical Alignment | |||
Qt::AlignmentFlag mVAlignment; | Qt::AlignmentFlag mVAlignment; | |||
/**Replaces replace '$CURRENT_DATE<(FORMAT)>' with the current date (e. g. $CURRENT_DATE(d 'June' yyyy)*/ | /**Replaces replace '$CURRENT_DATE<(FORMAT)>' with the current date (e. g. $CURRENT_DATE(d 'June' yyyy)*/ | |||
void replaceDateText( QString& text ) const; | void replaceDateText( QString& text ) const; | |||
/**Width of the text box. This is different to rectangle().width() in c | ||||
ase there is rotation*/ | ||||
double mTextBoxWidth; | ||||
/**Height of the text box. This is different to rectangle().height() in | ||||
case there is rotation*/ | ||||
double mTextBoxHeight; | ||||
QgsFeature* mExpressionFeature; | QgsFeature* mExpressionFeature; | |||
QgsVectorLayer* mExpressionLayer; | QgsVectorLayer* mExpressionLayer; | |||
QMap<QString, QVariant> mSubstitutions; | QMap<QString, QVariant> mSubstitutions; | |||
}; | }; | |||
#endif | #endif | |||
End of changes. 3 change blocks. | ||||
12 lines changed or deleted | 0 lines changed or added | |||
qgscomposerlegend.h | qgscomposerlegend.h | |||
---|---|---|---|---|
skipping to change at line 90 | skipping to change at line 90 | |||
QColor fontColor() const {return mFontColor;} | QColor fontColor() const {return mFontColor;} | |||
void setFontColor( const QColor& c ) {mFontColor = c;} | void setFontColor( const QColor& c ) {mFontColor = c;} | |||
double symbolWidth() const {return mSymbolWidth;} | double symbolWidth() const {return mSymbolWidth;} | |||
void setSymbolWidth( double w ) {mSymbolWidth = w;} | void setSymbolWidth( double w ) {mSymbolWidth = w;} | |||
double symbolHeight() const {return mSymbolHeight;} | double symbolHeight() const {return mSymbolHeight;} | |||
void setSymbolHeight( double h ) {mSymbolHeight = h;} | void setSymbolHeight( double h ) {mSymbolHeight = h;} | |||
double wmsLegendWidth() const {return mWmsLegendWidth;} | ||||
void setWmsLegendWidth( double w ) {mWmsLegendWidth = w;} | ||||
double wmsLegendHeight() const {return mWmsLegendHeight;} | ||||
void setWmsLegendHeight( double h ) {mWmsLegendHeight = h;} | ||||
void setWrapChar( const QString& t ) {mWrapChar = t;} | void setWrapChar( const QString& t ) {mWrapChar = t;} | |||
QString wrapChar() const {return mWrapChar;} | QString wrapChar() const {return mWrapChar;} | |||
int columnCount() const { return mColumnCount; } | int columnCount() const { return mColumnCount; } | |||
void setColumnCount( int c ) { mColumnCount = c;} | void setColumnCount( int c ) { mColumnCount = c;} | |||
int splitLayer() const { return mSplitLayer; } | int splitLayer() const { return mSplitLayer; } | |||
void setSplitLayer( bool s ) { mSplitLayer = s;} | void setSplitLayer( bool s ) { mSplitLayer = s;} | |||
int equalColumnWidth() const { return mEqualColumnWidth; } | int equalColumnWidth() const { return mEqualColumnWidth; } | |||
skipping to change at line 142 | skipping to change at line 148 | |||
/**Space between item box and contents*/ | /**Space between item box and contents*/ | |||
qreal mBoxSpace; | qreal mBoxSpace; | |||
/**Space between columns*/ | /**Space between columns*/ | |||
double mColumnSpace; | double mColumnSpace; | |||
/**Width of symbol icon*/ | /**Width of symbol icon*/ | |||
double mSymbolWidth; | double mSymbolWidth; | |||
/**Height of symbol icon*/ | /**Height of symbol icon*/ | |||
double mSymbolHeight; | double mSymbolHeight; | |||
/**Width of WMS legendGraphic pixmap*/ | ||||
double mWmsLegendWidth; | ||||
/**Height of WMS legendGraphic pixmap*/ | ||||
double mWmsLegendHeight; | ||||
/** Spacing between lines when wrapped */ | /** Spacing between lines when wrapped */ | |||
double mlineSpacing; | double mlineSpacing; | |||
/** Number of legend columns */ | /** Number of legend columns */ | |||
int mColumnCount; | int mColumnCount; | |||
QgsLegendModel mLegendModel; | QgsLegendModel mLegendModel; | |||
/**Reference to map (because symbols are sometimes in map units)*/ | /**Reference to map (because symbols are sometimes in map units)*/ | |||
const QgsComposerMap* mComposerMap; | const QgsComposerMap* mComposerMap; | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 11 lines changed or added | |||
qgscomposerlegenditem.h | qgscomposerlegenditem.h | |||
---|---|---|---|---|
skipping to change at line 59 | skipping to change at line 59 | |||
virtual ItemType itemType() const = 0; | virtual ItemType itemType() const = 0; | |||
virtual QStandardItem* clone() const = 0; | virtual QStandardItem* clone() const = 0; | |||
QgsComposerLegendStyle::Style style() const { return mStyle; } | QgsComposerLegendStyle::Style style() const { return mStyle; } | |||
void setStyle( QgsComposerLegendStyle::Style style ) { mStyle = style; } | void setStyle( QgsComposerLegendStyle::Style style ) { mStyle = style; } | |||
// Get text defined by user | // Get text defined by user | |||
virtual QString userText() const { return mUserText; } | virtual QString userText() const { return mUserText; } | |||
// Set text defined by user | // Set text defined by user | |||
virtual void setUserText( const QString & text ) { mUserText = text; } | virtual void setUserText( const QString & text ) { mUserText = text; } | |||
protected: | protected: | |||
void writeXMLChildren( QDomElement& elem, QDomDocument& doc ) const; | void writeXMLChildren( QDomElement& elem, QDomDocument& doc ) const; | |||
QgsComposerLegendStyle::Style mStyle; | QgsComposerLegendStyle::Style mStyle; | |||
// User defined text | // User defined text | |||
QString mUserText; | QString mUserText; | |||
}; | }; | |||
skipping to change at line 139 | skipping to change at line 139 | |||
virtual void readXML( const QDomElement& itemElem, bool xServerAvailabl e = true ); | virtual void readXML( const QDomElement& itemElem, bool xServerAvailabl e = true ); | |||
ItemType itemType() const { return LayerItem; } | ItemType itemType() const { return LayerItem; } | |||
void setLayerID( const QString& id ) { mLayerID = id; } | void setLayerID( const QString& id ) { mLayerID = id; } | |||
QString layerID() const { return mLayerID; } | QString layerID() const { return mLayerID; } | |||
void setShowFeatureCount( bool show ) { mShowFeatureCount = show; } | void setShowFeatureCount( bool show ) { mShowFeatureCount = show; } | |||
bool showFeatureCount() const { return mShowFeatureCount; } | bool showFeatureCount() const { return mShowFeatureCount; } | |||
void setDefaultStyle(); | void setDefaultStyle( double scaleDenominator = -1, QString rule = "" ) ; | |||
private: | private: | |||
QString mLayerID; | QString mLayerID; | |||
// Show vector feature counts | // Show vector feature counts | |||
bool mShowFeatureCount; | bool mShowFeatureCount; | |||
}; | }; | |||
class CORE_EXPORT QgsComposerGroupItem: public QgsComposerLegendItem | class CORE_EXPORT QgsComposerGroupItem: public QgsComposerLegendItem | |||
{ | { | |||
public: | public: | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
qgscomposermap.h | qgscomposermap.h | |||
---|---|---|---|---|
skipping to change at line 154 | skipping to change at line 154 | |||
/** \brief Scale */ | /** \brief Scale */ | |||
double scale() const; | double scale() const; | |||
/**Sets new scale and changes only mExtent*/ | /**Sets new scale and changes only mExtent*/ | |||
void setNewScale( double scaleDenominator ); | void setNewScale( double scaleDenominator ); | |||
/**Sets new Extent and changes width, height (and implicitely also scal e)*/ | /**Sets new Extent and changes width, height (and implicitely also scal e)*/ | |||
void setNewExtent( const QgsRectangle& extent ); | void setNewExtent( const QgsRectangle& extent ); | |||
/**Sets new Extent for the current atlas preview and changes width, hei | ||||
ght (and implicitely also scale). | ||||
Atlas preview extents are only temporary, and are regenerated wheneve | ||||
r the atlas feature changes | ||||
*/ | ||||
void setNewAtlasFeatureExtent( const QgsRectangle& extent ); | ||||
/**Called when atlas preview is toggled, to force map item to update it | ||||
s extent and redraw*/ | ||||
void toggleAtlasPreview(); | ||||
/**Returns a pointer to the current map extent, which is either the ori | ||||
ginal user specified | ||||
extent or the temporary atlas-driven feature extent depending on the | ||||
current atlas state of the composition. | ||||
Both a const and non-const version are included.*/ | ||||
QgsRectangle* currentMapExtent(); | ||||
const QgsRectangle* currentMapExtent() const; | ||||
PreviewMode previewMode() const {return mPreviewMode;} | PreviewMode previewMode() const {return mPreviewMode;} | |||
void setPreviewMode( PreviewMode m ); | void setPreviewMode( PreviewMode m ); | |||
/**Getter for flag that determines if the stored layer set should be us ed or the current layer set of the qgis mapcanvas | /**Getter for flag that determines if the stored layer set should be us ed or the current layer set of the qgis mapcanvas | |||
@note this function was added in version 1.2*/ | @note this function was added in version 1.2*/ | |||
bool keepLayerSet() const {return mKeepLayerSet;} | bool keepLayerSet() const {return mKeepLayerSet;} | |||
/**Setter for flag that determines if the stored layer set should be us ed or the current layer set of the qgis mapcanvas | /**Setter for flag that determines if the stored layer set should be us ed or the current layer set of the qgis mapcanvas | |||
@note this function was added in version 1.2*/ | @note this function was added in version 1.2*/ | |||
void setKeepLayerSet( bool enabled ) {mKeepLayerSet = enabled;} | void setKeepLayerSet( bool enabled ) {mKeepLayerSet = enabled;} | |||
skipping to change at line 250 | skipping to change at line 264 | |||
/**Sets the color of the grid pen | /**Sets the color of the grid pen | |||
@note this function was added in version 1.4*/ | @note this function was added in version 1.4*/ | |||
void setGridPenColor( const QColor& c ); | void setGridPenColor( const QColor& c ); | |||
/**Sets font for grid annotations | /**Sets font for grid annotations | |||
@note this function was added in version 1.4*/ | @note this function was added in version 1.4*/ | |||
void setGridAnnotationFont( const QFont& f ) { mGridAnnotationFont = f; } | void setGridAnnotationFont( const QFont& f ) { mGridAnnotationFont = f; } | |||
QFont gridAnnotationFont() const { return mGridAnnotationFont; } | QFont gridAnnotationFont() const { return mGridAnnotationFont; } | |||
/**Sets font color for grid annotations | /**Sets font color for grid annotations | |||
@note: this function was added in version 2.0*/ | @note this function was added in version 2.0*/ | |||
void setAnnotationFontColor( const QColor& c ) {mGridAnnotationFontColo r = c;} | void setAnnotationFontColor( const QColor& c ) {mGridAnnotationFontColo r = c;} | |||
/**Get font color for grid annotations | /**Get font color for grid annotations | |||
@note: this function was added in version 2.0*/ | @note: this function was added in version 2.0*/ | |||
QColor annotationFontColor() const {return mGridAnnotationFontColor;} | QColor annotationFontColor() const {return mGridAnnotationFontColor;} | |||
/**Sets coordinate precision for grid annotations | /**Sets coordinate precision for grid annotations | |||
@note this function was added in version 1.4*/ | @note this function was added in version 1.4*/ | |||
void setGridAnnotationPrecision( int p ) {mGridAnnotationPrecision = p; } | void setGridAnnotationPrecision( int p ) {mGridAnnotationPrecision = p; } | |||
int gridAnnotationPrecision() const {return mGridAnnotationPrecision;} | int gridAnnotationPrecision() const {return mGridAnnotationPrecision;} | |||
skipping to change at line 290 | skipping to change at line 304 | |||
/**Set grid frame style (NoGridFrame or Zebra) | /**Set grid frame style (NoGridFrame or Zebra) | |||
@note: this function was added in version 1.9*/ | @note: this function was added in version 1.9*/ | |||
void setGridFrameStyle( GridFrameStyle style ) { mGridFrameStyle = styl e; } | void setGridFrameStyle( GridFrameStyle style ) { mGridFrameStyle = styl e; } | |||
GridFrameStyle gridFrameStyle() const { return mGridFrameStyle; } | GridFrameStyle gridFrameStyle() const { return mGridFrameStyle; } | |||
/**Set grid frame width | /**Set grid frame width | |||
@note: this function was added in version 1.9*/ | @note: this function was added in version 1.9*/ | |||
void setGridFrameWidth( double w ) { mGridFrameWidth = w; } | void setGridFrameWidth( double w ) { mGridFrameWidth = w; } | |||
double gridFrameWidth() const { return mGridFrameWidth; } | double gridFrameWidth() const { return mGridFrameWidth; } | |||
/**Set grid frame pen thickness | ||||
@note: this function was added in version 2.1*/ | ||||
void setGridFramePenSize( double w ) { mGridFramePenThickness = w; } | ||||
double gridFramePenSize() const { return mGridFramePenThickness; } | ||||
/**Sets pen color for grid frame | ||||
@note: this function was added in version 2.1*/ | ||||
void setGridFramePenColor( const QColor& c ) { mGridFramePenColor = c;} | ||||
/**Get pen color for grid frame | ||||
@note: this function was added in version 2.1*/ | ||||
QColor gridFramePenColor() const {return mGridFramePenColor;} | ||||
/**Sets first fill color for grid zebra frame | ||||
@note: this function was added in version 2.1*/ | ||||
void setGridFrameFillColor1( const QColor& c ) { mGridFrameFillColor1 = | ||||
c;} | ||||
/**Get first fill color for grid zebra frame | ||||
@note: this function was added in version 2.1*/ | ||||
QColor gridFrameFillColor1() const {return mGridFrameFillColor1;} | ||||
/**Sets second fill color for grid zebra frame | ||||
@note: this function was added in version 2.1*/ | ||||
void setGridFrameFillColor2( const QColor& c ) { mGridFrameFillColor2 = | ||||
c;} | ||||
/**Get second fill color for grid zebra frame | ||||
@note: this function was added in version 2.1*/ | ||||
QColor gridFrameFillColor2() const {return mGridFrameFillColor2;} | ||||
/**In case of annotations, the bounding rectangle can be larger than th e map item rectangle | /**In case of annotations, the bounding rectangle can be larger than th e map item rectangle | |||
@note this function was added in version 1.4*/ | @note this function was added in version 1.4*/ | |||
QRectF boundingRect() const; | QRectF boundingRect() const; | |||
/**Updates the bounding rect of this item. Call this function before do ing any changes related to annotation out of the map rectangle | /**Updates the bounding rect of this item. Call this function before do ing any changes related to annotation out of the map rectangle | |||
@note this function was added in version 1.4*/ | @note this function was added in version 1.4*/ | |||
void updateBoundingRect(); | void updateBoundingRect(); | |||
/* reimplement setFrameOutlineWidth, so that updateBoundingRect() is ca | ||||
lled after setting the frame width */ | ||||
virtual void setFrameOutlineWidth( double outlineWidth ); | ||||
/**Sets length of the cros segments (if grid style is cross) | /**Sets length of the cros segments (if grid style is cross) | |||
@note this function was added in version 1.4*/ | @note this function was added in version 1.4*/ | |||
void setCrossLength( double l ) {mCrossLength = l;} | void setCrossLength( double l ) {mCrossLength = l;} | |||
double crossLength() {return mCrossLength;} | double crossLength() {return mCrossLength;} | |||
/**Sets rotation for the map - this does not affect the composer item s | ||||
hape, only the | ||||
way the map is drawn within the item | ||||
* @deprecated Use setMapRotation( double rotation ) instead | ||||
*/ | ||||
void setRotation( double r ); | ||||
/**Returns the rotation used for drawing the map within the composer it | ||||
em | ||||
* @deprecated Use mapRotation() instead | ||||
*/ | ||||
double rotation() const { return mMapRotation;}; | ||||
/**Sets rotation for the map - this does not affect the composer item s | ||||
hape, only the | ||||
way the map is drawn within the item | ||||
@note this function was added in version 2.1*/ | ||||
void setMapRotation( double r ); | void setMapRotation( double r ); | |||
/**Returns the rotation used for drawing the map within the composer it | ||||
em*/ | ||||
double mapRotation() const { return mMapRotation;}; | ||||
void updateItem(); | void updateItem(); | |||
/**Sets canvas pointer (necessary to query and draw map canvas items)*/ | /**Sets canvas pointer (necessary to query and draw map canvas items)*/ | |||
void setMapCanvas( QGraphicsView* canvas ) { mMapCanvas = canvas; } | void setMapCanvas( QGraphicsView* canvas ) { mMapCanvas = canvas; } | |||
void setDrawCanvasItems( bool b ) { mDrawCanvasItems = b; } | void setDrawCanvasItems( bool b ) { mDrawCanvasItems = b; } | |||
bool drawCanvasItems() const { return mDrawCanvasItems; } | bool drawCanvasItems() const { return mDrawCanvasItems; } | |||
/**Returns the conversion factor map units -> mm*/ | /**Returns the conversion factor map units -> mm*/ | |||
skipping to change at line 335 | skipping to change at line 393 | |||
/** Returns the overview's blending mode */ | /** Returns the overview's blending mode */ | |||
QPainter::CompositionMode overviewBlendMode() const {return mOverviewBl endMode;} | QPainter::CompositionMode overviewBlendMode() const {return mOverviewBl endMode;} | |||
/** Sets the overview's blending mode*/ | /** Sets the overview's blending mode*/ | |||
void setOverviewBlendMode( QPainter::CompositionMode blendMode ); | void setOverviewBlendMode( QPainter::CompositionMode blendMode ); | |||
/** Returns true if the overview frame is inverted */ | /** Returns true if the overview frame is inverted */ | |||
bool overviewInverted() const {return mOverviewInverted;} | bool overviewInverted() const {return mOverviewInverted;} | |||
/** Sets the overview's inversion mode*/ | /** Sets the overview's inversion mode*/ | |||
void setOverviewInverted( bool inverted ); | void setOverviewInverted( bool inverted ); | |||
/** Returns true if the extent is forced to center on the overview */ | ||||
bool overviewCentered() const { return mOverviewCentered; } | ||||
/** Set the overview's centering mode */ | ||||
void setOverviewCentered( bool centered ); | ||||
void setGridLineSymbol( QgsLineSymbolV2* symbol ); | void setGridLineSymbol( QgsLineSymbolV2* symbol ); | |||
QgsLineSymbolV2* gridLineSymbol() { return mGridLineSymbol; } | QgsLineSymbolV2* gridLineSymbol() { return mGridLineSymbol; } | |||
/** Returns the grid's blending mode */ | /** Returns the grid's blending mode */ | |||
QPainter::CompositionMode gridBlendMode() const {return mGridBlendMode; } | QPainter::CompositionMode gridBlendMode() const {return mGridBlendMode; } | |||
/** Sets the grid's blending mode*/ | /** Sets the grid's blending mode*/ | |||
void setGridBlendMode( QPainter::CompositionMode blendMode ); | void setGridBlendMode( QPainter::CompositionMode blendMode ); | |||
/**Sets mId to a number not yet used in the composition. mId is kept if it is not in use. | /**Sets mId to a number not yet used in the composition. mId is kept if it is not in use. | |||
Usually, this function is called before adding the composer map to the composition*/ | Usually, this function is called before adding the composer map to the composition*/ | |||
void assignFreeId(); | void assignFreeId(); | |||
/**Calculates width and hight of the picture (in mm) such that it fits | ||||
into the item frame with the given rotation | ||||
* @deprecated Use bool QgsComposerItem::imageSizeConsideringRotation( | ||||
double& width, double& height, double rotation ) | ||||
* instead | ||||
*/ | ||||
bool imageSizeConsideringRotation( double& width, double& height ) cons | ||||
t; | ||||
/**Calculates corner point after rotation and scaling | ||||
* @deprecated Use QgsComposerItem::cornerPointOnRotatedAndScaledRect( | ||||
double& x, double& y, double width, double height, double rotation ) | ||||
* instead | ||||
*/ | ||||
bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double wi | ||||
dth, double height ) const; | ||||
/**Calculates width / height of the bounding box of a rotated rectangle | ||||
* @deprecated Use QgsComposerItem::sizeChangedByRotation( double& width | ||||
, double& height, double rotation ) | ||||
* instead | ||||
*/ | ||||
void sizeChangedByRotation( double& width, double& height ); | ||||
/** Returns true if the map extent is set to follow the current atlas f | ||||
eature */ | ||||
bool atlasDriven() const { return mAtlasDriven; } | ||||
/** Set to true if the map extents should be set by the current atlas f | ||||
eature */ | ||||
void setAtlasDriven( bool enabled ) { mAtlasDriven = enabled; } | ||||
/** Returns true if the map uses a fixed scale when in atlas mode */ | ||||
bool atlasFixedScale() const { return mAtlasFixedScale; } | ||||
/** Set to true if the map should use a fixed scale when in atlas mode | ||||
*/ | ||||
void setAtlasFixedScale( bool fixed ) { mAtlasFixedScale = fixed; } | ||||
/** Returns the margin size (percentage) used when the map is in atlas | ||||
mode */ | ||||
double atlasMargin() const { return mAtlasMargin; } | ||||
/** Sets the margin size (percentage) used when the map is in atlas mod | ||||
e */ | ||||
void setAtlasMargin( double margin ) { mAtlasMargin = margin; } | ||||
signals: | signals: | |||
void extentChanged(); | void extentChanged(); | |||
/**Is emitted on rotation change to notify north arrow pictures*/ | ||||
void mapRotationChanged( double newRotation ); | ||||
public slots: | public slots: | |||
/**Called if map canvas has changed*/ | /**Called if map canvas has changed*/ | |||
void updateCachedImage( ); | void updateCachedImage( ); | |||
/**Call updateCachedImage if item is in render mode*/ | /**Call updateCachedImage if item is in render mode*/ | |||
void renderModeUpdateCachedImage(); | void renderModeUpdateCachedImage(); | |||
void overviewExtentChanged(); | ||||
private: | private: | |||
enum AnnotationCoordinate | enum AnnotationCoordinate | |||
{ | { | |||
Longitude = 0, | Longitude = 0, | |||
Latitude | Latitude | |||
}; | }; | |||
// Pointer to map renderer of the QGIS main map. Note that QgsComposerM ap uses a different map renderer, | // Pointer to map renderer of the QGIS main map. Note that QgsComposerM ap uses a different map renderer, | |||
//it just copies some properties from the main map renderer. | //it just copies some properties from the main map renderer. | |||
QgsMapRenderer *mMapRenderer; | QgsMapRenderer *mMapRenderer; | |||
/**Unique identifier*/ | /**Unique identifier*/ | |||
int mId; | int mId; | |||
// Map region in map units realy used for rendering | // Map region in map units realy used for rendering | |||
// It can be the same as mUserExtent, but it can be bigger in on dimens ion if mCalculate==Scale, | // It can be the same as mUserExtent, but it can be bigger in on dimens ion if mCalculate==Scale, | |||
// so that full rectangle in paper is used. | // so that full rectangle in paper is used. | |||
QgsRectangle mExtent; | QgsRectangle mExtent; | |||
// Current temporary map region in map units. This is overwritten when | ||||
atlas feature changes. It's also | ||||
// used when the user changes the map extent and an atlas preview is en | ||||
abled. This allows the user | ||||
// to manually tweak each atlas preview page without affecting the actu | ||||
al original map extent. | ||||
QgsRectangle mAtlasFeatureExtent; | ||||
// Cache used in composer preview | // Cache used in composer preview | |||
QImage mCacheImage; | QImage mCacheImage; | |||
// Is cache up to date | // Is cache up to date | |||
bool mCacheUpdated; | bool mCacheUpdated; | |||
/** \brief Preview style */ | /** \brief Preview style */ | |||
PreviewMode mPreviewMode; | PreviewMode mPreviewMode; | |||
/** \brief Number of layers when cache was created */ | /** \brief Number of layers when cache was created */ | |||
int mNumCachedLayers; | int mNumCachedLayers; | |||
/** \brief set to true if in state of drawing. Concurrent requests to d raw method are returned if set to true */ | /** \brief set to true if in state of drawing. Concurrent requests to d raw method are returned if set to true */ | |||
bool mDrawing; | bool mDrawing; | |||
/**Offset in x direction for showing map cache image*/ | /**Offset in x direction for showing map cache image*/ | |||
double mXOffset; | double mXOffset; | |||
/**Offset in y direction for showing map cache image*/ | /**Offset in y direction for showing map cache image*/ | |||
double mYOffset; | double mYOffset; | |||
/**Map rotation*/ | ||||
double mMapRotation; | ||||
/**Flag if layers to be displayed should be read from qgis canvas (true ) or from stored list in mLayerSet (false)*/ | /**Flag if layers to be displayed should be read from qgis canvas (true ) or from stored list in mLayerSet (false)*/ | |||
bool mKeepLayerSet; | bool mKeepLayerSet; | |||
/**Stored layer list (used if layer live-link mKeepLayerSet is disabled )*/ | /**Stored layer list (used if layer live-link mKeepLayerSet is disabled )*/ | |||
QStringList mLayerSet; | QStringList mLayerSet; | |||
/**Id of map which displays its extent rectangle into this composer map (overview map functionality). -1 if not present*/ | /**Id of map which displays its extent rectangle into this composer map (overview map functionality). -1 if not present*/ | |||
int mOverviewFrameMapId; | int mOverviewFrameMapId; | |||
/**Drawing style for overview farme*/ | /**Drawing style for overview farme*/ | |||
QgsFillSymbolV2* mOverviewFrameMapSymbol; | QgsFillSymbolV2* mOverviewFrameMapSymbol; | |||
QgsLineSymbolV2* mGridLineSymbol; | QgsLineSymbolV2* mGridLineSymbol; | |||
/**Blend mode for overview*/ | /**Blend mode for overview*/ | |||
QPainter::CompositionMode mOverviewBlendMode; | QPainter::CompositionMode mOverviewBlendMode; | |||
bool mOverviewInverted; | bool mOverviewInverted; | |||
/** Centering mode for overview */ | ||||
bool mOverviewCentered; | ||||
/**Establishes signal/slot connection for update in case of layer chang e*/ | /**Establishes signal/slot connection for update in case of layer chang e*/ | |||
void connectUpdateSlot(); | void connectUpdateSlot(); | |||
/**Removes layer ids from mLayerSet that are no longer present in the q gis main map*/ | /**Removes layer ids from mLayerSet that are no longer present in the q gis main map*/ | |||
void syncLayerSet(); | void syncLayerSet(); | |||
/**True if coordinate grid has to be displayed*/ | /**True if coordinate grid has to be displayed*/ | |||
bool mGridEnabled; | bool mGridEnabled; | |||
/**Solid or crosses*/ | /**Solid or crosses*/ | |||
skipping to change at line 466 | skipping to change at line 575 | |||
GridAnnotationDirection mRightGridAnnotationDirection; | GridAnnotationDirection mRightGridAnnotationDirection; | |||
/**Annotation direction on top side ( horizontal or vertical )*/ | /**Annotation direction on top side ( horizontal or vertical )*/ | |||
GridAnnotationDirection mTopGridAnnotationDirection; | GridAnnotationDirection mTopGridAnnotationDirection; | |||
/**Annotation direction on bottom side ( horizontal or vertical )*/ | /**Annotation direction on bottom side ( horizontal or vertical )*/ | |||
GridAnnotationDirection mBottomGridAnnotationDirection; | GridAnnotationDirection mBottomGridAnnotationDirection; | |||
GridAnnotationFormat mGridAnnotationFormat; | GridAnnotationFormat mGridAnnotationFormat; | |||
GridFrameStyle mGridFrameStyle; | GridFrameStyle mGridFrameStyle; | |||
double mGridFrameWidth; | double mGridFrameWidth; | |||
double mGridFramePenThickness; | ||||
QColor mGridFramePenColor; | ||||
QColor mGridFrameFillColor1; | ||||
QColor mGridFrameFillColor2; | ||||
/**Current bounding rectangle. This is used to check if notification to the graphics scene is necessary*/ | /**Current bounding rectangle. This is used to check if notification to the graphics scene is necessary*/ | |||
QRectF mCurrentRectangle; | QRectF mCurrentRectangle; | |||
/**The length of the cross sides for mGridStyle Cross*/ | /**The length of the cross sides for mGridStyle Cross*/ | |||
double mCrossLength; | double mCrossLength; | |||
QGraphicsView* mMapCanvas; | QGraphicsView* mMapCanvas; | |||
/**True if annotation items, rubber band, etc. from the main canvas sho uld be displayed*/ | /**True if annotation items, rubber band, etc. from the main canvas sho uld be displayed*/ | |||
bool mDrawCanvasItems; | bool mDrawCanvasItems; | |||
/**Adjusts an extent rectangle to match the provided item width and hei | ||||
ght, so that extent | ||||
* center of extent remains the same */ | ||||
void adjustExtentToItemShape( double itemWidth, double itemHeight, QgsR | ||||
ectangle& extent ) const; | ||||
/**True if map is being controlled by an atlas*/ | ||||
bool mAtlasDriven; | ||||
/**True if map uses a fixed scale when controlled by an atlas*/ | ||||
bool mAtlasFixedScale; | ||||
/**Margin size for atlas driven extents (percentage of feature size)*/ | ||||
double mAtlasMargin; | ||||
/**Returns a list of the layers to render for this map item*/ | ||||
QStringList layersToRender(); | ||||
/**Draws the map grid*/ | /**Draws the map grid*/ | |||
void drawGrid( QPainter* p ); | void drawGrid( QPainter* p ); | |||
void drawGridFrame( QPainter* p, const QList< QPair< double, QLineF > > & hLines, const QList< QPair< double, QLineF > >& vLines ); | void drawGridFrame( QPainter* p, const QList< QPair< double, QLineF > > & hLines, const QList< QPair< double, QLineF > >& vLines ); | |||
/**Draw coordinates for mGridAnnotationType Coordinate | /**Draw coordinates for mGridAnnotationType Coordinate | |||
@param p drawing painter | @param p drawing painter | |||
@param hLines horizontal coordinate lines in item coordinates | @param hLines horizontal coordinate lines in item coordinates | |||
@param vLines vertical coordinate lines in item coordinates*/ | @param vLines vertical coordinate lines in item coordinates*/ | |||
void drawCoordinateAnnotations( QPainter* p, const QList< QPair< double , QLineF > >& hLines, const QList< QPair< double, QLineF > >& vLines ); | void drawCoordinateAnnotations( QPainter* p, const QList< QPair< double , QLineF > >& hLines, const QList< QPair< double, QLineF > >& vLines ); | |||
void drawCoordinateAnnotation( QPainter* p, const QPointF& pos, QString annotationString ); | void drawCoordinateAnnotation( QPainter* p, const QPointF& pos, QString annotationString ); | |||
/**Draws a single annotation | /**Draws a single annotation | |||
skipping to change at line 506 | skipping to change at line 633 | |||
int yGridLines( QList< QPair< double, QLineF > >& lines ) const; | int yGridLines( QList< QPair< double, QLineF > >& lines ) const; | |||
/**Returns extent that considers mOffsetX / mOffsetY (during content mo ve)*/ | /**Returns extent that considers mOffsetX / mOffsetY (during content mo ve)*/ | |||
QgsRectangle transformedExtent() const; | QgsRectangle transformedExtent() const; | |||
/**Returns extent that considers rotation and shift with mOffsetX / mOf fsetY*/ | /**Returns extent that considers rotation and shift with mOffsetX / mOf fsetY*/ | |||
QPolygonF transformedMapPolygon() const; | QPolygonF transformedMapPolygon() const; | |||
double maxExtension() const; | double maxExtension() const; | |||
/**Returns the polygon of the map extent. If rotation == 0, the result is the same as mExtent | /**Returns the polygon of the map extent. If rotation == 0, the result is the same as mExtent | |||
@param poly out: the result polygon with the four corner points. The po ints are clockwise, starting at the top-left point | @param poly out: the result polygon with the four corner points. The po ints are clockwise, starting at the top-left point | |||
@return true in case of success*/ | @return true in case of success*/ | |||
void mapPolygon( QPolygonF& poly ) const; | void mapPolygon( QPolygonF& poly ) const; | |||
/** mapPolygon variant using a given extent */ | ||||
void mapPolygon( const QgsRectangle& extent, QPolygonF& poly ) const; | ||||
/**Calculates the extent to request and the yShift of the top-left poin t in case of rotation.*/ | /**Calculates the extent to request and the yShift of the top-left poin t in case of rotation.*/ | |||
void requestedExtent( QgsRectangle& extent ) const; | void requestedExtent( QgsRectangle& extent ) const; | |||
/**Scales a composer map shift (in MM) and rotates it by mRotation | /**Scales a composer map shift (in MM) and rotates it by mRotation | |||
@param xShift in: shift in x direction (in item units), out: xShift in map units | @param xShift in: shift in x direction (in item units), out: xShift in map units | |||
@param yShift in: shift in y direction (in item units), out: yShift in map units*/ | @param yShift in: shift in y direction (in item units), out: yShift in map units*/ | |||
void transformShift( double& xShift, double& yShift ) const; | void transformShift( double& xShift, double& yShift ) const; | |||
/**Transforms map coordinates to item coordinates (considering rotation and move offset)*/ | /**Transforms map coordinates to item coordinates (considering rotation and move offset)*/ | |||
QPointF mapToItemCoords( const QPointF& mapCoords ) const; | QPointF mapToItemCoords( const QPointF& mapCoords ) const; | |||
/**Returns the item border of a point (in item coordinates)*/ | /**Returns the item border of a point (in item coordinates)*/ | |||
Border borderForLineCoord( const QPointF& p ) const; | Border borderForLineCoord( const QPointF& p ) const; | |||
skipping to change at line 528 | skipping to change at line 658 | |||
void drawCanvasItem( QGraphicsItem* item, QPainter* painter, const QSty leOptionGraphicsItem* itemStyle ); | void drawCanvasItem( QGraphicsItem* item, QPainter* painter, const QSty leOptionGraphicsItem* itemStyle ); | |||
QPointF composerMapPosForItem( const QGraphicsItem* item ) const; | QPointF composerMapPosForItem( const QGraphicsItem* item ) const; | |||
void sortGridLinesOnBorders( const QList< QPair< double, QLineF > >& hL ines, const QList< QPair< double, QLineF > >& vLines, QMap< double, double >& leftFrameEntries, | void sortGridLinesOnBorders( const QList< QPair< double, QLineF > >& hL ines, const QList< QPair< double, QLineF > >& vLines, QMap< double, double >& leftFrameEntries, | |||
QMap< double, double >& rightFrameEntries, QMap< double, double >& topFrameEntries, QMap< double, double >& bottomFra meEntries ) const; | QMap< double, double >& rightFrameEntries, QMap< double, double >& topFrameEntries, QMap< double, double >& bottomFra meEntries ) const; | |||
void drawGridFrameBorder( QPainter* p, const QMap< double, double >& bo rderPos, Border border ); | void drawGridFrameBorder( QPainter* p, const QMap< double, double >& bo rderPos, Border border ); | |||
void drawGridLine( const QLineF& line, QPainter* p ); | void drawGridLine( const QLineF& line, QPainter* p ); | |||
void drawOverviewMapExtent( QPainter* p ); | void drawOverviewMapExtent( QPainter* p ); | |||
void createDefaultOverviewFrameSymbol(); | void createDefaultOverviewFrameSymbol(); | |||
void createDefaultGridLineSymbol(); | void createDefaultGridLineSymbol(); | |||
void initGridAnnotationFormatFromProject(); | void initGridAnnotationFormatFromProject(); | |||
}; | }; | |||
#endif | #endif | |||
End of changes. 17 change blocks. | ||||
1 lines changed or deleted | 160 lines changed or added | |||
qgscomposerpicture.h | qgscomposerpicture.h | |||
---|---|---|---|---|
skipping to change at line 63 | skipping to change at line 63 | |||
* @param doc is Dom document | * @param doc is Dom document | |||
*/ | */ | |||
bool writeXML( QDomElement& elem, QDomDocument & doc ) const; | bool writeXML( QDomElement& elem, QDomDocument & doc ) const; | |||
/** sets state from Dom document | /** sets state from Dom document | |||
* @param itemElem is Dom node corresponding to item tag | * @param itemElem is Dom node corresponding to item tag | |||
* @param doc is Dom document | * @param doc is Dom document | |||
*/ | */ | |||
bool readXML( const QDomElement& itemElem, const QDomDocument& doc ); | bool readXML( const QDomElement& itemElem, const QDomDocument& doc ); | |||
/**Returns the rotation used for drawing the picture within the compose | ||||
r item | ||||
* @deprecated Use pictureRotation() instead | ||||
*/ | ||||
double rotation() const { return mPictureRotation;}; | ||||
/**Returns the rotation used for drawing the picture within the item | ||||
@note this function was added in version 2.1*/ | ||||
double pictureRotation() const { return mPictureRotation;}; | ||||
/**Sets the map object for rotation (by id). A value of -1 disables the map rotation*/ | /**Sets the map object for rotation (by id). A value of -1 disables the map rotation*/ | |||
void setRotationMap( int composerMapId ); | void setRotationMap( int composerMapId ); | |||
/**Returns the id of the rotation map*/ | /**Returns the id of the rotation map*/ | |||
int rotationMap() const; | int rotationMap() const; | |||
/**True if the rotation is taken from a map item*/ | /**True if the rotation is taken from a map item*/ | |||
bool useRotationMap() const {return mRotationMap;} | bool useRotationMap() const {return mRotationMap;} | |||
/**Calculates width and hight of the picture (in mm) such that it fits | ||||
into the item frame with the given rotation | ||||
* @deprecated Use bool QgsComposerItem::imageSizeConsideringRotation( | ||||
double& width, double& height, double rotation ) | ||||
* instead | ||||
*/ | ||||
bool imageSizeConsideringRotation( double& width, double& height ) cons | ||||
t; | ||||
/**Calculates corner point after rotation and scaling | ||||
* @deprecated Use QgsComposerItem::cornerPointOnRotatedAndScaledRect( | ||||
double& x, double& y, double width, double height, double rotation ) | ||||
* instead | ||||
*/ | ||||
bool cornerPointOnRotatedAndScaledRect( double& x, double& y, double wi | ||||
dth, double height ) const; | ||||
/**Calculates width / height of the bounding box of a rotated rectangle | ||||
* @deprecated Use QgsComposerItem::sizeChangedByRotation( double& width | ||||
, double& height, double rotation ) | ||||
* instead | ||||
*/ | ||||
void sizeChangedByRotation( double& width, double& height ); | ||||
public slots: | public slots: | |||
/**Sets the rotation and adapts the item rect*/ | /**Sets the picture rotation within the item bounds. This does not affe | |||
ct the item rectangle, | ||||
only the way the picture is drawn within the item. | ||||
* @deprecated Use setPictureRotation( double rotation ) instead | ||||
*/ | ||||
virtual void setRotation( double r ); | virtual void setRotation( double r ); | |||
/**Sets the picture rotation within the item bounds. This does not affe | ||||
ct the item rectangle, | ||||
only the way the picture is drawn within the item. | ||||
@note this function was added in version 2.1*/ | ||||
virtual void setPictureRotation( double r ); | ||||
signals: | ||||
/**Is emitted on picture rotation change*/ | ||||
void pictureRotationChanged( double newRotation ); | ||||
private: | private: | |||
enum Mode //SVG or raster graphic format | enum Mode //SVG or raster graphic format | |||
{ | { | |||
SVG, | SVG, | |||
RASTER, | RASTER, | |||
Unknown | Unknown | |||
}; | }; | |||
//default constructor is forbidden | //default constructor is forbidden | |||
QgsComposerPicture(); | QgsComposerPicture(); | |||
/**Calculates bounding rect for svg file (mSourcefile) such that aspect ratio is correct*/ | /**Calculates bounding rect for svg file (mSourcefile) such that aspect ratio is correct*/ | |||
QRectF boundedSVGRect( double deviceWidth, double deviceHeight ); | QRectF boundedSVGRect( double deviceWidth, double deviceHeight ); | |||
/**Calculates bounding rect for image such that aspect ratio is correct */ | /**Calculates bounding rect for image such that aspect ratio is correct */ | |||
QRectF boundedImageRect( double deviceWidth, double deviceHeight ); | QRectF boundedImageRect( double deviceWidth, double deviceHeight ); | |||
/**Returns size of current raster or svg picture */ | ||||
QSizeF pictureSize(); | ||||
QImage mImage; | QImage mImage; | |||
QSvgRenderer mSVG; | QSvgRenderer mSVG; | |||
QFile mSourceFile; | QFile mSourceFile; | |||
Mode mMode; | Mode mMode; | |||
QSize mDefaultSvgSize; | QSize mDefaultSvgSize; | |||
/**Image rotation*/ | ||||
double mPictureRotation; | ||||
/**Map that sets the rotation (or 0 if this picture uses map independen t rotation)*/ | /**Map that sets the rotation (or 0 if this picture uses map independen t rotation)*/ | |||
const QgsComposerMap* mRotationMap; | const QgsComposerMap* mRotationMap; | |||
/**Width of the picture (in mm)*/ | /**Width of the picture (in mm)*/ | |||
double mPictureWidth; | double mPictureWidth; | |||
/**Height of the picture (in mm)*/ | /**Height of the picture (in mm)*/ | |||
double mPictureHeight; | double mPictureHeight; | |||
}; | }; | |||
#endif | #endif | |||
End of changes. 6 change blocks. | ||||
1 lines changed or deleted | 53 lines changed or added | |||
qgscomposerruler.h | qgscomposerruler.h | |||
---|---|---|---|---|
skipping to change at line 12 | skipping to change at line 12 | |||
#define QGSCOMPOSERRULER_H | #define QGSCOMPOSERRULER_H | |||
#include "qgscomposeritem.h" | #include "qgscomposeritem.h" | |||
#include <QWidget> | #include <QWidget> | |||
class QgsComposition; | class QgsComposition; | |||
class QGraphicsLineItem; | class QGraphicsLineItem; | |||
/**A class to show paper scale and the current cursor position*/ | /**A class to show paper scale and the current cursor position*/ | |||
class GUI_EXPORT QgsComposerRuler: public QWidget | class GUI_EXPORT QgsComposerRuler: public QWidget | |||
{ | { | |||
Q_OBJECT | ||||
public: | public: | |||
enum Direction | enum Direction | |||
{ | { | |||
Horizontal = 0, | Horizontal = 0, | |||
Vertical | Vertical | |||
}; | }; | |||
QgsComposerRuler( QgsComposerRuler::Direction d ); | QgsComposerRuler( QgsComposerRuler::Direction d ); | |||
~QgsComposerRuler(); | ~QgsComposerRuler(); | |||
QSize minimumSizeHint() const; | QSize minimumSizeHint() const; | |||
void setSceneTransform( const QTransform& transform ); | void setSceneTransform( const QTransform& transform ); | |||
void updateMarker( const QPointF& pos ) { mMarkerPos = pos; repaint(); } | void updateMarker( const QPointF& pos ) { mMarkerPos = pos; repaint(); } | |||
void setComposition( QgsComposition* c ) { mComposition = c; } | void setComposition( QgsComposition* c ) { mComposition = c; } | |||
QgsComposition* composition() { return mComposition; } | QgsComposition* composition() { return mComposition; } | |||
int rulerSize() { return mRulerMinSize; } | ||||
protected: | protected: | |||
void paintEvent( QPaintEvent* event ); | void paintEvent( QPaintEvent* event ); | |||
void mouseMoveEvent( QMouseEvent* event ); | void mouseMoveEvent( QMouseEvent* event ); | |||
void mouseReleaseEvent( QMouseEvent* event ); | void mouseReleaseEvent( QMouseEvent* event ); | |||
void mousePressEvent( QMouseEvent* event ); | void mousePressEvent( QMouseEvent* event ); | |||
private: | private: | |||
static const int validScaleMultiples[]; | ||||
static const int validScaleMagnitudes[]; | ||||
Direction mDirection; | Direction mDirection; | |||
QTransform mTransform; | QTransform mTransform; | |||
QPointF mMarkerPos; | QPointF mMarkerPos; | |||
QgsComposition* mComposition; //reference to composition for paper size , nPages | QgsComposition* mComposition; //reference to composition for paper size , nPages | |||
QGraphicsLineItem* mLineSnapItem; | QGraphicsLineItem* mLineSnapItem; | |||
//items snapped to the current snap line | //items snapped to the current snap line | |||
QList< QPair< QgsComposerItem*, QgsComposerItem::ItemPositionMode > > m SnappedItems; | QList< QPair< QgsComposerItem*, QgsComposerItem::ItemPositionMode > > m SnappedItems; | |||
QFont * mRulerFont; | ||||
QFontMetrics * mRulerFontMetrics; | ||||
double mScaleMinPixelsWidth; | ||||
int mRulerMinSize; | ||||
int mMinPixelsPerDivision; | ||||
int mPixelsBetweenLineAndText; | ||||
int mTextBaseline; | ||||
int mMinSpacingVerticalLabels; | ||||
void setSnapLinePosition( const QPointF& pos ); | void setSnapLinePosition( const QPointF& pos ); | |||
//calculate optimum labeled units for ruler so that labels are a good d | ||||
istance apart | ||||
int optimumScale( double minPixelDiff, int &magnitude, int &multiple ); | ||||
//calculate number of small divisions for each ruler unit, ensuring tha | ||||
t they | ||||
//are sufficiently spaced | ||||
int optimumNumberDivisions( double rulerScale, int scaleMultiple ); | ||||
//draws vertical text on a painter | ||||
void drawRotatedText( QPainter *painter, QPointF pos, const QString &te | ||||
xt ); | ||||
/* Draws small ruler divisions | ||||
* Starting at startPos in mm, for numDivisions divisions, with major d | ||||
ivision spacing of rulerScale (in mm) | ||||
* Stop drawing if position exceeds maxPos | ||||
*/ | ||||
void drawSmallDivisions( QPainter *painter, double startPos, int numDiv | ||||
isions, double rulerScale, double maxPos = 0 ); | ||||
//draw current marker pos on ruler | ||||
void drawMarkerPos( QPainter *painter ); | ||||
signals: | ||||
/**Is emitted when mouse cursor coordinates change*/ | ||||
void cursorPosChanged( QPointF ); | ||||
}; | }; | |||
#endif // QGSCOMPOSERRULER_H | #endif // QGSCOMPOSERRULER_H | |||
End of changes. 5 change blocks. | ||||
0 lines changed or deleted | 44 lines changed or added | |||
qgscomposerscalebar.h | qgscomposerscalebar.h | |||
---|---|---|---|---|
skipping to change at line 49 | skipping to change at line 49 | |||
Left = 0, | Left = 0, | |||
Middle, | Middle, | |||
Right | Right | |||
}; | }; | |||
/**Added in version 1.9*/ | /**Added in version 1.9*/ | |||
enum ScaleBarUnits | enum ScaleBarUnits | |||
{ | { | |||
MapUnits = 0, | MapUnits = 0, | |||
Meters, | Meters, | |||
Feet | Feet, | |||
NauticalMiles | ||||
}; | }; | |||
QgsComposerScaleBar( QgsComposition* composition ); | QgsComposerScaleBar( QgsComposition* composition ); | |||
~QgsComposerScaleBar(); | ~QgsComposerScaleBar(); | |||
/** return correct graphics item type. Added in v1.7 */ | /** return correct graphics item type. Added in v1.7 */ | |||
virtual int type() const { return ComposerScaleBar; } | virtual int type() const { return ComposerScaleBar; } | |||
/** \brief Reimplementation of QCanvasItem::paint*/ | /** \brief Reimplementation of QCanvasItem::paint*/ | |||
void paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyl e, QWidget* pWidget ); | void paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyl e, QWidget* pWidget ); | |||
skipping to change at line 121 | skipping to change at line 122 | |||
/**@note: this method was added in version 1.9*/ | /**@note: this method was added in version 1.9*/ | |||
ScaleBarUnits units() const { return mUnits; } | ScaleBarUnits units() const { return mUnits; } | |||
/**@note: this method was added in version 1.9*/ | /**@note: this method was added in version 1.9*/ | |||
void setUnits( ScaleBarUnits u ); | void setUnits( ScaleBarUnits u ); | |||
/**Apply default settings*/ | /**Apply default settings*/ | |||
void applyDefaultSettings(); | void applyDefaultSettings(); | |||
/**Apply default size (scale bar 1/5 of map item width) | /**Apply default size (scale bar 1/5 of map item width) | |||
@note this method was added in version 1.7*/ | @note this method was added in version 1.7*/ | |||
void applyDefaultSize(); | void applyDefaultSize( ScaleBarUnits u = Meters ); | |||
/**Sets style by name | /**Sets style by name | |||
@param styleName (untranslated) style name. Possibilities are: 'Single Box', 'Double Box', 'Line Ticks Middle', 'Line Ticks Down', 'Line Ticks Up ', 'Numeric'*/ | @param styleName (untranslated) style name. Possibilities are: 'Single Box', 'Double Box', 'Line Ticks Middle', 'Line Ticks Down', 'Line Ticks Up ', 'Numeric'*/ | |||
void setStyle( const QString& styleName ); | void setStyle( const QString& styleName ); | |||
/**Returns style name*/ | /**Returns style name*/ | |||
QString style() const; | QString style() const; | |||
/**Returns the x - positions of the segment borders (in item coordinate s) and the width | /**Returns the x - positions of the segment borders (in item coordinate s) and the width | |||
of the segment*/ | of the segment | |||
@note python bindings not available on android | ||||
*/ | ||||
void segmentPositions( QList<QPair<double, double> >& posWidthList ) co nst; | void segmentPositions( QList<QPair<double, double> >& posWidthList ) co nst; | |||
/**Sets box size suitable to content*/ | /**Sets box size suitable to content*/ | |||
void adjustBoxSize(); | void adjustBoxSize(); | |||
/**Adjusts box size and calls QgsComposerItem::update()*/ | /**Adjusts box size and calls QgsComposerItem::update()*/ | |||
void update(); | void update(); | |||
/**Returns string of first label (important for drawing, labeling, size calculation*/ | /**Returns string of first label (important for drawing, labeling, size calculation*/ | |||
QString firstLabelString() const; | QString firstLabelString() const; | |||
skipping to change at line 206 | skipping to change at line 209 | |||
/**Width of a segment (in mm)*/ | /**Width of a segment (in mm)*/ | |||
double mSegmentMillimeters; | double mSegmentMillimeters; | |||
Alignment mAlignment; | Alignment mAlignment; | |||
ScaleBarUnits mUnits; | ScaleBarUnits mUnits; | |||
/**Calculates with of a segment in mm and stores it in mSegmentMillimet ers*/ | /**Calculates with of a segment in mm and stores it in mSegmentMillimet ers*/ | |||
void refreshSegmentMillimeters(); | void refreshSegmentMillimeters(); | |||
/**Returns diagonal of composer map in selected units (map units / mete rs / feet)*/ | /**Returns diagonal of composer map in selected units (map units / mete rs / feet / nautical miles)*/ | |||
double mapWidth() const; | double mapWidth() const; | |||
}; | }; | |||
#endif //QGSCOMPOSERSCALEBAR_H | #endif //QGSCOMPOSERSCALEBAR_H | |||
End of changes. 5 change blocks. | ||||
4 lines changed or deleted | 8 lines changed or added | |||
qgscomposershape.h | qgscomposershape.h | |||
---|---|---|---|---|
skipping to change at line 25 | skipping to change at line 25 | |||
* * | * * | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef QGSCOMPOSERSHAPE_H | #ifndef QGSCOMPOSERSHAPE_H | |||
#define QGSCOMPOSERSHAPE_H | #define QGSCOMPOSERSHAPE_H | |||
#include "qgscomposeritem.h" | #include "qgscomposeritem.h" | |||
#include <QBrush> | #include <QBrush> | |||
#include <QPen> | #include <QPen> | |||
class QgsFillSymbolV2; | ||||
/**A composer items that draws common shapes (ellipse, triangle, rectangle) */ | /**A composer items that draws common shapes (ellipse, triangle, rectangle) */ | |||
class CORE_EXPORT QgsComposerShape: public QgsComposerItem | class CORE_EXPORT QgsComposerShape: public QgsComposerItem | |||
{ | { | |||
Q_OBJECT | Q_OBJECT | |||
public: | public: | |||
enum Shape | enum Shape | |||
{ | { | |||
Ellipse, | Ellipse, | |||
Rectangle, | Rectangle, | |||
skipping to change at line 64 | skipping to change at line 66 | |||
/** sets state from Dom document | /** sets state from Dom document | |||
* @param itemElem is Dom node corresponding to item tag | * @param itemElem is Dom node corresponding to item tag | |||
* @param doc is Dom document | * @param doc is Dom document | |||
*/ | */ | |||
bool readXML( const QDomElement& itemElem, const QDomDocument& doc ); | bool readXML( const QDomElement& itemElem, const QDomDocument& doc ); | |||
//setters and getters | //setters and getters | |||
QgsComposerShape::Shape shapeType() const {return mShape;} | QgsComposerShape::Shape shapeType() const {return mShape;} | |||
void setShapeType( QgsComposerShape::Shape s ) {mShape = s;} | void setShapeType( QgsComposerShape::Shape s ) {mShape = s;} | |||
/**Sets this items bound in scene coordinates such that 1 item size uni | /**Sets radius for rounded rectangle corners. Added in v2.1 */ | |||
ts | void setCornerRadius( double radius ); | |||
corresponds to 1 scene size unit. Also, the shape is scaled*/ | /**Returns the radius for rounded rectangle corners*/ | |||
void setSceneRect( const QRectF& rectangle ); | double cornerRadius() const { return mCornerRadius; }; | |||
public slots: | /**Sets the QgsFillSymbolV2 used to draw the shape. Must also call setU | |||
/**Sets item rotation and resizes item bounds such that the shape alway | seSymbolV2( true ) to | |||
s has the same size*/ | * enable drawing with a symbol. | |||
virtual void setRotation( double r ); | * Note: added in version 2.1*/ | |||
void setShapeStyleSymbol( QgsFillSymbolV2* symbol ); | ||||
/**Returns the QgsFillSymbolV2 used to draw the shape. | ||||
* Note: added in version 2.1*/ | ||||
QgsFillSymbolV2* shapeStyleSymbol() { return mShapeStyleSymbol; } | ||||
/**Controls whether the shape should be drawn using a QgsFillSymbolV2. | ||||
* Note: Added in v2.1 */ | ||||
void setUseSymbolV2( bool useSymbolV2 ); | ||||
protected: | protected: | |||
/* reimplement drawFrame, since it's not a rect, but a custom shape */ | /* reimplement drawFrame, since it's not a rect, but a custom shape */ | |||
virtual void drawFrame( QPainter* p ); | virtual void drawFrame( QPainter* p ); | |||
/* reimplement drawBackground, since it's not a rect, but a custom shap e */ | /* reimplement drawBackground, since it's not a rect, but a custom shap e */ | |||
virtual void drawBackground( QPainter* p ); | virtual void drawBackground( QPainter* p ); | |||
/**reimplement estimatedFrameBleed, since frames on shapes are drawn us | ||||
ing symbology | ||||
* rather than the item's pen */ | ||||
virtual double estimatedFrameBleed() const; | ||||
public slots: | ||||
/**Should be called after the shape's symbol is changed. Redraws the sh | ||||
ape and recalculates | ||||
* its selection bounds. | ||||
* Note: added in version 2.1*/ | ||||
void refreshSymbol(); | ||||
private: | private: | |||
/**Ellipse, rectangle or triangle*/ | /**Ellipse, rectangle or triangle*/ | |||
Shape mShape; | Shape mShape; | |||
double mCornerRadius; | ||||
bool mUseSymbolV2; | ||||
QgsFillSymbolV2* mShapeStyleSymbol; | ||||
/* draws the custom shape */ | /* draws the custom shape */ | |||
void drawShape( QPainter* p ); | void drawShape( QPainter* p ); | |||
/* draws the custom shape using symbol v2*/ | ||||
void drawShapeUsingSymbol( QPainter* p ); | ||||
/* creates the default shape symbol */ | ||||
void createDefaultShapeStyleSymbol(); | ||||
/**Returns a point on the line from startPoint to directionPoint that i s a certain distance away from the starting point*/ | /**Returns a point on the line from startPoint to directionPoint that i s a certain distance away from the starting point*/ | |||
QPointF pointOnLineWithDistance( const QPointF& startPoint, const QPoin tF& directionPoint, double distance ) const; | QPointF pointOnLineWithDistance( const QPointF& startPoint, const QPoin tF& directionPoint, double distance ) const; | |||
}; | }; | |||
#endif // QGSCOMPOSERSHAPEITEM_H | #endif // QGSCOMPOSERSHAPEITEM_H | |||
End of changes. 5 change blocks. | ||||
9 lines changed or deleted | 42 lines changed or added | |||
qgscomposerview.h | qgscomposerview.h | |||
---|---|---|---|---|
skipping to change at line 68 | skipping to change at line 68 | |||
AddHtml, | AddHtml, | |||
AddMap, // add new map | AddMap, // add new map | |||
AddLegend, // add vector legend | AddLegend, // add vector legend | |||
AddLabel, // add label | AddLabel, // add label | |||
AddScalebar, // add scalebar | AddScalebar, // add scalebar | |||
AddPicture, // add raster/vector picture | AddPicture, // add raster/vector picture | |||
AddRectangle, | AddRectangle, | |||
AddEllipse, | AddEllipse, | |||
AddTriangle, | AddTriangle, | |||
AddTable, //add attribute table | AddTable, //add attribute table | |||
MoveItemContent //move content of item (e.g. content of map) | MoveItemContent, //move content of item (e.g. content of map) | |||
Pan, | ||||
Zoom | ||||
}; | ||||
enum ClipboardMode | ||||
{ | ||||
ClipboardModeCut, | ||||
ClipboardModeCopy | ||||
}; | ||||
enum PasteMode | ||||
{ | ||||
PasteModeCursor, | ||||
PasteModeCenter, | ||||
PasteModeInPlace | ||||
}; | ||||
enum ToolStatus | ||||
{ | ||||
Inactive, | ||||
Active, | ||||
ActiveUntilMouseRelease | ||||
}; | }; | |||
QgsComposerView( QWidget* parent = 0, const char* name = 0, Qt::WFlags f = 0 ); | QgsComposerView( QWidget* parent = 0, const char* name = 0, Qt::WFlags f = 0 ); | |||
/**Add an item group containing the selected items*/ | /**Add an item group containing the selected items*/ | |||
void groupItems(); | void groupItems(); | |||
/**Ungroups the selected items*/ | /**Ungroups the selected items*/ | |||
void ungroupItems(); | void ungroupItems(); | |||
/**Cuts or copies the selected items*/ | ||||
void copyItems( ClipboardMode mode ); | ||||
/**Pastes items from clipboard*/ | ||||
void pasteItems( PasteMode mode ); | ||||
/**Deletes selected items*/ | ||||
void deleteSelectedItems(); | ||||
/**Selects all items*/ | ||||
void selectAll(); | ||||
/**Deselects all items*/ | ||||
void selectNone(); | ||||
/**Inverts current selection*/ | ||||
void selectInvert(); | ||||
QgsComposerView::Tool currentTool() const {return mCurrentTool;} | QgsComposerView::Tool currentTool() const {return mCurrentTool;} | |||
void setCurrentTool( QgsComposerView::Tool t ) {mCurrentTool = t;} | void setCurrentTool( QgsComposerView::Tool t ); | |||
/**Sets composition (derived from QGraphicsScene)*/ | /**Sets composition (derived from QGraphicsScene)*/ | |||
void setComposition( QgsComposition* c ); | void setComposition( QgsComposition* c ); | |||
/**Returns the composition or 0 in case of error*/ | /**Returns the composition or 0 in case of error*/ | |||
QgsComposition* composition(); | QgsComposition* composition(); | |||
/**Returns the composer main window*/ | /**Returns the composer main window*/ | |||
QMainWindow* composerWindow(); | QMainWindow* composerWindow(); | |||
void setPaintingEnabled( bool enabled ) { mPaintingEnabled = enabled; } | void setPaintingEnabled( bool enabled ) { mPaintingEnabled = enabled; } | |||
bool paintingEnabled() const { return mPaintingEnabled; } | bool paintingEnabled() const { return mPaintingEnabled; } | |||
/**Update rulers with current scene rect*/ | /**Update rulers with current scene rect*/ | |||
void updateRulers(); | void updateRulers(); | |||
void setHorizontalRuler( QgsComposerRuler* r ) { mHorizontalRuler = r; } | void setHorizontalRuler( QgsComposerRuler* r ) { mHorizontalRuler = r; } | |||
void setVerticalRuler( QgsComposerRuler* r ) { mVerticalRuler = r; } | void setVerticalRuler( QgsComposerRuler* r ) { mVerticalRuler = r; } | |||
/**Set zoom level, where a zoom level of 1.0 corresponds to 100%*/ | ||||
void setZoomLevel( double zoomLevel ); | ||||
protected: | protected: | |||
void mousePressEvent( QMouseEvent* ); | void mousePressEvent( QMouseEvent* ); | |||
void mouseReleaseEvent( QMouseEvent* ); | void mouseReleaseEvent( QMouseEvent* ); | |||
void mouseMoveEvent( QMouseEvent* ); | void mouseMoveEvent( QMouseEvent* ); | |||
void mouseDoubleClickEvent( QMouseEvent* e ); | void mouseDoubleClickEvent( QMouseEvent* e ); | |||
void keyPressEvent( QKeyEvent * e ); | void keyPressEvent( QKeyEvent * e ); | |||
void keyReleaseEvent( QKeyEvent * e ); | ||||
void wheelEvent( QWheelEvent* event ); | void wheelEvent( QWheelEvent* event ); | |||
void paintEvent( QPaintEvent* event ); | void paintEvent( QPaintEvent* event ); | |||
void hideEvent( QHideEvent* e ); | void hideEvent( QHideEvent* e ); | |||
void showEvent( QShowEvent* e ); | void showEvent( QShowEvent* e ); | |||
void resizeEvent( QResizeEvent* event ); | void resizeEvent( QResizeEvent* event ); | |||
void scrollContentsBy( int dx, int dy ); | void scrollContentsBy( int dx, int dy ); | |||
private: | private: | |||
/**Current composer tool*/ | /**Current composer tool*/ | |||
QgsComposerView::Tool mCurrentTool; | QgsComposerView::Tool mCurrentTool; | |||
/**Previous composer tool*/ | ||||
QgsComposerView::Tool mPreviousTool; | ||||
/**Rubber band item*/ | /**Rubber band item*/ | |||
QGraphicsRectItem* mRubberBandItem; | QGraphicsRectItem* mRubberBandItem; | |||
/**Rubber band item for arrows*/ | /**Rubber band item for arrows*/ | |||
QGraphicsLineItem* mRubberBandLineItem; | QGraphicsLineItem* mRubberBandLineItem; | |||
/**Item to move content*/ | /**Item to move content*/ | |||
QgsComposerItem* mMoveContentItem; | QgsComposerItem* mMoveContentItem; | |||
/**Start position of content move*/ | /**Start position of content move*/ | |||
QPointF mMoveContentStartPos; | QPointF mMoveContentStartPos; | |||
/**Start of rubber band creation*/ | /**Start of rubber band creation*/ | |||
QPointF mRubberBandStartPos; | QPointF mRubberBandStartPos; | |||
/**True if user is currently selecting by marquee*/ | ||||
bool mMarqueeSelect; | ||||
/**True if user is currently zooming by marquee*/ | ||||
bool mMarqueeZoom; | ||||
/**True if user is currently temporarily activating the zoom tool by ho | ||||
lding control+space*/ | ||||
QgsComposerView::ToolStatus mTemporaryZoomStatus; | ||||
bool mPaintingEnabled; | bool mPaintingEnabled; | |||
QgsComposerRuler* mHorizontalRuler; | QgsComposerRuler* mHorizontalRuler; | |||
QgsComposerRuler* mVerticalRuler; | QgsComposerRuler* mVerticalRuler; | |||
/** Draw a shape on the canvas */ | /** Draw a shape on the canvas */ | |||
void addShape( Tool currentTool ); | void addShape( Tool currentTool ); | |||
/**True if user is currently panning by clicking and dragging with the | ||||
pan tool*/ | ||||
bool mToolPanning; | ||||
/**True if user is currently panning by holding the middle mouse button | ||||
*/ | ||||
bool mMousePanning; | ||||
/**True if user is currently panning by holding the space key*/ | ||||
bool mKeyPanning; | ||||
/**True if user is currently dragging with the move item content tool*/ | ||||
bool mMovingItemContent; | ||||
QPoint mMouseLastXY; | ||||
QPoint mMouseCurrentXY; | ||||
QPoint mMousePressStartPos; | ||||
/**Returns the default mouse cursor for a tool*/ | ||||
QCursor defaultCursorForTool( Tool currentTool ); | ||||
/**Zoom composition from a mouse wheel event*/ | ||||
void wheelZoom( QWheelEvent * event ); | ||||
/**Redraws the rubber band*/ | ||||
void updateRubberBand( QPointF & pos ); | ||||
/**Removes the rubber band and cleans up*/ | ||||
void removeRubberBand(); | ||||
/**Starts a marquee selection*/ | ||||
void startMarqueeSelect( QPointF & scenePoint ); | ||||
/**Finalises a marquee selection*/ | ||||
void endMarqueeSelect( QMouseEvent* e ); | ||||
/**Starts a zoom in marquee*/ | ||||
void startMarqueeZoom( QPointF & scenePoint ); | ||||
/**Finalises a marquee zoom*/ | ||||
void endMarqueeZoom( QMouseEvent* e ); | ||||
//void connectAddRemoveCommandSignals( QgsAddRemoveItemCommand* c ); | //void connectAddRemoveCommandSignals( QgsAddRemoveItemCommand* c ); | |||
signals: | signals: | |||
/**Is emitted when selected item changed. If 0, no item is selected*/ | /**Is emitted when selected item changed. If 0, no item is selected*/ | |||
void selectedItemChanged( QgsComposerItem* selected ); | void selectedItemChanged( QgsComposerItem* selected ); | |||
/**Is emitted when a composer item has been removed from the scene*/ | /**Is emitted when a composer item has been removed from the scene*/ | |||
void itemRemoved( QgsComposerItem* ); | void itemRemoved( QgsComposerItem* ); | |||
/**Current action (e.g. adding composer map) has been finished. The pur pose of this signal is that | /**Current action (e.g. adding composer map) has been finished. The pur pose of this signal is that | |||
QgsComposer may set the selection tool again*/ | QgsComposer may set the selection tool again*/ | |||
void actionFinished(); | void actionFinished(); | |||
/**Is emitted when mouse cursor coordinates change*/ | ||||
void cursorPosChanged( QPointF ); | ||||
/**Is emitted when the view zoom changes*/ | ||||
void zoomLevelChanged(); | ||||
/**Emitted before composerview is shown*/ | /**Emitted before composerview is shown*/ | |||
void composerViewShow( QgsComposerView* ); | void composerViewShow( QgsComposerView* ); | |||
/**Emitted before composerview is hidden*/ | /**Emitted before composerview is hidden*/ | |||
void composerViewHide( QgsComposerView* ); | void composerViewHide( QgsComposerView* ); | |||
}; | }; | |||
#endif | #endif | |||
End of changes. 9 change blocks. | ||||
2 lines changed or deleted | 96 lines changed or added | |||
qgscomposition.h | qgscomposition.h | |||
---|---|---|---|---|
skipping to change at line 44 | skipping to change at line 44 | |||
#include "qgsatlascomposition.h" | #include "qgsatlascomposition.h" | |||
class QgisApp; | class QgisApp; | |||
class QgsComposerFrame; | class QgsComposerFrame; | |||
class QgsComposerMap; | class QgsComposerMap; | |||
class QgsPaperItem; | class QgsPaperItem; | |||
class QGraphicsRectItem; | class QGraphicsRectItem; | |||
class QgsMapRenderer; | class QgsMapRenderer; | |||
class QDomElement; | class QDomElement; | |||
class QgsComposerArrow; | class QgsComposerArrow; | |||
class QgsComposerMouseHandles; | ||||
class QgsComposerHtml; | class QgsComposerHtml; | |||
class QgsComposerItem; | class QgsComposerItem; | |||
class QgsComposerLabel; | class QgsComposerLabel; | |||
class QgsComposerLegend; | class QgsComposerLegend; | |||
class QgsComposerMap; | class QgsComposerMap; | |||
class QgsComposerPicture; | class QgsComposerPicture; | |||
class QgsComposerScaleBar; | class QgsComposerScaleBar; | |||
class QgsComposerShape; | class QgsComposerShape; | |||
class QgsComposerAttributeTable; | class QgsComposerAttributeTable; | |||
class QgsComposerMultiFrame; | class QgsComposerMultiFrame; | |||
class QgsComposerMultiFrameCommand; | class QgsComposerMultiFrameCommand; | |||
class QgsVectorLayer; | class QgsVectorLayer; | |||
class QgsComposer; | class QgsComposer; | |||
class QgsFillSymbolV2; | ||||
/** \ingroup MapComposer | /** \ingroup MapComposer | |||
* Graphics scene for map printing. The class manages the paper item which always | * Graphics scene for map printing. The class manages the paper item which always | |||
* is the item in the back (z-value 0). It maintains the z-Values of the it ems and stores | * is the item in the back (z-value 0). It maintains the z-Values of the it ems and stores | |||
* them in a list in ascending z-Order. This list can be changed to lower/r aise items one position | * them in a list in ascending z-Order. This list can be changed to lower/r aise items one position | |||
* or to bring them to front/back. | * or to bring them to front/back. | |||
* */ | * */ | |||
class CORE_EXPORT QgsComposition : public QGraphicsScene | class CORE_EXPORT QgsComposition : public QGraphicsScene | |||
{ | { | |||
Q_OBJECT | Q_OBJECT | |||
skipping to change at line 85 | skipping to change at line 87 | |||
}; | }; | |||
/**Style to draw the snapping grid*/ | /**Style to draw the snapping grid*/ | |||
enum GridStyle | enum GridStyle | |||
{ | { | |||
Solid, | Solid, | |||
Dots, | Dots, | |||
Crosses | Crosses | |||
}; | }; | |||
enum ZValueDirection | ||||
{ | ||||
ZValueBelow, | ||||
ZValueAbove | ||||
}; | ||||
/**Composition atlas modes*/ | ||||
enum AtlasMode | ||||
{ | ||||
AtlasOff, // Composition is not being controlled by an atlas | ||||
PreviewAtlas, // An atlas composition is being previewed in the app | ||||
ExportAtlas // The composition is being exported as an atlas | ||||
}; | ||||
QgsComposition( QgsMapRenderer* mapRenderer ); | QgsComposition( QgsMapRenderer* mapRenderer ); | |||
~QgsComposition(); | ~QgsComposition(); | |||
/**Changes size of paper item*/ | /**Changes size of paper item*/ | |||
void setPaperSize( double width, double height ); | void setPaperSize( double width, double height ); | |||
/**Returns height of paper item*/ | /**Returns height of paper item*/ | |||
double paperHeight() const; | double paperHeight() const; | |||
/**Returns width of paper item*/ | /**Returns width of paper item*/ | |||
double paperWidth() const; | double paperWidth() const; | |||
double spaceBetweenPages() const { return mSpaceBetweenPages; } | double spaceBetweenPages() const { return mSpaceBetweenPages; } | |||
/**Note: added in version 1.9*/ | /**Note: added in version 1.9*/ | |||
void setNumPages( int pages ); | void setNumPages( int pages ); | |||
/**Note: added in version 1.9*/ | /**Note: added in version 1.9*/ | |||
int numPages() const; | int numPages() const; | |||
/**Note: added in version 2.1*/ | ||||
void setPageStyleSymbol( QgsFillSymbolV2* symbol ); | ||||
/**Note: added in version 2.1*/ | ||||
QgsFillSymbolV2* pageStyleSymbol() { return mPageStyleSymbol; } | ||||
/**Returns the position within a page of a point in the composition | ||||
@note Added in QGIS 2.1 | ||||
*/ | ||||
QPointF positionOnPage( const QPointF & position ) const; | ||||
/**Returns the page number corresponding to a point in the composition | ||||
@note Added in QGIS 2.1 | ||||
*/ | ||||
int pageNumberForPoint( const QPointF & position ) const; | ||||
/**Sets the status bar message for the composer window | ||||
@note Added in QGIS 2.1 | ||||
*/ | ||||
void setStatusMessage( const QString & message ); | ||||
/**Refreshes the composition when composer related options change | ||||
*Note: added in version 2.1*/ | ||||
void updateSettings(); | ||||
void setSnapToGridEnabled( bool b ); | void setSnapToGridEnabled( bool b ); | |||
bool snapToGridEnabled() const {return mSnapToGrid;} | bool snapToGridEnabled() const {return mSnapToGrid;} | |||
void setGridVisible( bool b ); | ||||
bool gridVisible() const {return mGridVisible;} | ||||
/**Hides / shows custom snap lines*/ | ||||
void setSnapLinesVisible( bool visible ); | ||||
bool snapLinesVisible() const {return mGuidesVisible;} | ||||
void setAlignmentSnap( bool s ) { mAlignmentSnap = s; } | ||||
bool alignmentSnap() const { return mAlignmentSnap; } | ||||
void setSmartGuidesEnabled( bool b ) { mSmartGuides = b; } | ||||
bool smartGuidesEnabled() const {return mSmartGuides;} | ||||
/**Removes all snap lines*/ | ||||
void clearSnapLines(); | ||||
void setSnapGridResolution( double r ); | void setSnapGridResolution( double r ); | |||
double snapGridResolution() const {return mSnapGridResolution;} | double snapGridResolution() const {return mSnapGridResolution;} | |||
void setSnapGridTolerance( double tolerance ); | ||||
double snapGridTolerance() const {return mSnapGridTolerance;} | ||||
void setSnapGridOffsetX( double offset ); | void setSnapGridOffsetX( double offset ); | |||
double snapGridOffsetX() const {return mSnapGridOffsetX;} | double snapGridOffsetX() const {return mSnapGridOffsetX;} | |||
void setSnapGridOffsetY( double offset ); | void setSnapGridOffsetY( double offset ); | |||
double snapGridOffsetY() const {return mSnapGridOffsetY;} | double snapGridOffsetY() const {return mSnapGridOffsetY;} | |||
void setGridPen( const QPen& p ); | void setGridPen( const QPen& p ); | |||
const QPen& gridPen() const {return mGridPen;} | const QPen& gridPen() const {return mGridPen;} | |||
void setGridStyle( GridStyle s ); | void setGridStyle( GridStyle s ); | |||
GridStyle gridStyle() const {return mGridStyle;} | GridStyle gridStyle() const {return mGridStyle;} | |||
void setAlignmentSnap( bool s ) { mAlignmentSnap = s; } | ||||
bool alignmentSnap() const { return mAlignmentSnap; } | ||||
void setAlignmentSnapTolerance( double t ) { mAlignmentSnapTolerance = t; } | void setAlignmentSnapTolerance( double t ) { mAlignmentSnapTolerance = t; } | |||
double alignmentSnapTolerance() const { return mAlignmentSnapTolerance; } | double alignmentSnapTolerance() const { return mAlignmentSnapTolerance; } | |||
/**Returns pointer to undo/redo command storage*/ | /**Returns pointer to undo/redo command storage*/ | |||
QUndoStack* undoStack() { return &mUndoStack; } | QUndoStack* undoStack() { return &mUndoStack; } | |||
/**Returns the topmost composer item. Ignores mPaperItem*/ | /**Returns the topmost composer item. Ignores mPaperItem*/ | |||
QgsComposerItem* composerItemAt( const QPointF & position ); | QgsComposerItem* composerItemAt( const QPointF & position ); | |||
/**Returns the highest composer item at a specified position which is b | ||||
elow a specified item. Ignores mPaperItem | ||||
@note Added in QGIS 2.1 | ||||
*/ | ||||
QgsComposerItem* composerItemAt( const QPointF & position, const QgsCom | ||||
poserItem* belowItem ); | ||||
/** Returns the page number (0-bsaed) given a coordinate */ | /** Returns the page number (0-bsaed) given a coordinate */ | |||
int pageNumberAt( const QPointF& position ) const; | int pageNumberAt( const QPointF& position ) const; | |||
/** Returns on which page number (0-based) is displayed an item */ | /** Returns on which page number (0-based) is displayed an item */ | |||
int itemPageNumber( const QgsComposerItem* ) const; | int itemPageNumber( const QgsComposerItem* ) const; | |||
QList<QgsComposerItem*> selectedComposerItems(); | QList<QgsComposerItem*> selectedComposerItems(); | |||
/**Returns pointers to all composer maps in the scene | /**Returns pointers to all composer maps in the scene | |||
@note available in python bindings only with PyQt >= 4.8.4 | @note available in python bindings only with PyQt >= 4.8.4 | |||
skipping to change at line 185 | skipping to change at line 246 | |||
@param theUuid A QString representing the UUID of the item to | @param theUuid A QString representing the UUID of the item to | |||
**/ | **/ | |||
const QgsComposerItem* getComposerItemByUuid( QString theUuid ) const; | const QgsComposerItem* getComposerItemByUuid( QString theUuid ) const; | |||
int printResolution() const {return mPrintResolution;} | int printResolution() const {return mPrintResolution;} | |||
void setPrintResolution( int dpi ) {mPrintResolution = dpi;} | void setPrintResolution( int dpi ) {mPrintResolution = dpi;} | |||
bool printAsRaster() const {return mPrintAsRaster;} | bool printAsRaster() const {return mPrintAsRaster;} | |||
void setPrintAsRaster( bool enabled ) { mPrintAsRaster = enabled; } | void setPrintAsRaster( bool enabled ) { mPrintAsRaster = enabled; } | |||
bool generateWorldFile() const { return mGenerateWorldFile; } | ||||
void setGenerateWorldFile( bool enabled ) { mGenerateWorldFile = enable | ||||
d; } | ||||
QgsComposerMap* worldFileMap() const { return mWorldFileMap; } | ||||
void setWorldFileMap( QgsComposerMap* map ) { mWorldFileMap = map; } | ||||
/**Returns true if a composition should use advanced effects such as bl end modes | /**Returns true if a composition should use advanced effects such as bl end modes | |||
@note added in 1.9*/ | @note added in 1.9*/ | |||
bool useAdvancedEffects() const {return mUseAdvancedEffects;} | bool useAdvancedEffects() const {return mUseAdvancedEffects;} | |||
/**Used to enable or disable advanced effects such as blend modes in a composition | /**Used to enable or disable advanced effects such as blend modes in a composition | |||
@note: added in version 1.9*/ | @note: added in version 1.9*/ | |||
void setUseAdvancedEffects( bool effectsEnabled ); | void setUseAdvancedEffects( bool effectsEnabled ); | |||
double selectionTolerance() const { return mSelectionTolerance; } | ||||
void setSelectionTolerance( double tol ); | ||||
/**Returns pointer to map renderer of qgis map canvas*/ | /**Returns pointer to map renderer of qgis map canvas*/ | |||
QgsMapRenderer* mapRenderer() {return mMapRenderer;} | QgsMapRenderer* mapRenderer() {return mMapRenderer;} | |||
QgsComposition::PlotStyle plotStyle() const {return mPlotStyle;} | QgsComposition::PlotStyle plotStyle() const {return mPlotStyle;} | |||
void setPlotStyle( QgsComposition::PlotStyle style ) {mPlotStyle = styl e;} | void setPlotStyle( QgsComposition::PlotStyle style ) {mPlotStyle = styl e;} | |||
/**Returns the pixel font size for a font that has point size set. | /**Returns the pixel font size for a font that has point size set. | |||
The result depends on the resolution (dpi) and of the preview mode. Ea ch item that sets | The result depends on the resolution (dpi) and of the preview mode. Ea ch item that sets | |||
a font should call this function before drawing text*/ | a font should call this function before drawing text*/ | |||
int pixelFontSize( double pointSize ) const; | int pixelFontSize( double pointSize ) const; | |||
skipping to change at line 249 | skipping to change at line 313 | |||
//functions to move selected items in hierarchy | //functions to move selected items in hierarchy | |||
void raiseSelectedItems(); | void raiseSelectedItems(); | |||
void raiseItem( QgsComposerItem* item ); | void raiseItem( QgsComposerItem* item ); | |||
void lowerSelectedItems(); | void lowerSelectedItems(); | |||
void lowerItem( QgsComposerItem* item ); | void lowerItem( QgsComposerItem* item ); | |||
void moveSelectedItemsToTop(); | void moveSelectedItemsToTop(); | |||
void moveItemToTop( QgsComposerItem* item ); | void moveItemToTop( QgsComposerItem* item ); | |||
void moveSelectedItemsToBottom(); | void moveSelectedItemsToBottom(); | |||
void moveItemToBottom( QgsComposerItem* item ); | void moveItemToBottom( QgsComposerItem* item ); | |||
//functions to find items by their position in the z list | ||||
void selectNextByZOrder( ZValueDirection direction ); | ||||
QgsComposerItem* getComposerItemBelow( QgsComposerItem* item ); | ||||
QgsComposerItem* getComposerItemAbove( QgsComposerItem* item ); | ||||
//functions to align selected items | //functions to align selected items | |||
void alignSelectedItemsLeft(); | void alignSelectedItemsLeft(); | |||
void alignSelectedItemsHCenter(); | void alignSelectedItemsHCenter(); | |||
void alignSelectedItemsRight(); | void alignSelectedItemsRight(); | |||
void alignSelectedItemsTop(); | void alignSelectedItemsTop(); | |||
void alignSelectedItemsVCenter(); | void alignSelectedItemsVCenter(); | |||
void alignSelectedItemsBottom(); | void alignSelectedItemsBottom(); | |||
//functions to lock and unlock items | ||||
/**Lock the selected items*/ | ||||
void lockSelectedItems(); | ||||
/**Unlock all items*/ | ||||
void unlockAllItems(); | ||||
/**Sorts the zList. The only time where this function needs to be calle d is from QgsComposer | /**Sorts the zList. The only time where this function needs to be calle d is from QgsComposer | |||
after reading all the items from xml file*/ | after reading all the items from xml file*/ | |||
void sortZList(); | void sortZList(); | |||
/**Rebuilds the z order list based on current order of items in scene*/ | ||||
void refreshZList(); | ||||
/**Snaps a scene coordinate point to grid*/ | /**Snaps a scene coordinate point to grid*/ | |||
QPointF snapPointToGrid( const QPointF& scenePoint ) const; | QPointF snapPointToGrid( const QPointF& scenePoint ) const; | |||
/**Snaps item position to align with other items (left / middle / right | /**Returns pointer to snap lines collection*/ | |||
or top / middle / bottom | QList< QGraphicsLineItem* >* snapLines() {return &mSnapLines;} | |||
@param item current item | ||||
@param alignX x-coordinate of align or -1 if not aligned to x | /**Returns pointer to selection handles | |||
@param alignY y-coordinate of align or -1 if not aligned to y | * @note not available in python bindings | |||
@param dx item shift in x direction | */ | |||
@param dy item shift in y direction | QgsComposerMouseHandles* selectionHandles() {return mSelectionHandles;} | |||
@return new upper left point after the align*/ | ||||
QPointF alignItem( const QgsComposerItem* item, double& alignX, double& | ||||
alignY, double dx = 0, double dy = 0 ); | ||||
/**Snaps position to align with the boundaries of other items | ||||
@param pos position to snap | ||||
@param excludeItem item to exclude | ||||
@param alignX snapped x coordinate or -1 if not snapped | ||||
@param alignY snapped y coordinate or -1 if not snapped | ||||
@return snapped position or original position if no snap*/ | ||||
QPointF alignPos( const QPointF& pos, const QgsComposerItem* excludeIte | ||||
m, double& alignX, double& alignY ); | ||||
/**Add a custom snap line (can be horizontal or vertical)*/ | /**Add a custom snap line (can be horizontal or vertical)*/ | |||
QGraphicsLineItem* addSnapLine(); | QGraphicsLineItem* addSnapLine(); | |||
/**Remove custom snap line (and delete the object)*/ | /**Remove custom snap line (and delete the object)*/ | |||
void removeSnapLine( QGraphicsLineItem* line ); | void removeSnapLine( QGraphicsLineItem* line ); | |||
/**Get nearest snap line | /**Get nearest snap line | |||
* @note not available in python bindings | * @note not available in python bindings | |||
*/ | */ | |||
QGraphicsLineItem* nearestSnapLine( bool horizontal, double x, double y , double tolerance, QList< QPair< QgsComposerItem*, QgsComposerItem::ItemPo sitionMode > >& snappedItems ); | QGraphicsLineItem* nearestSnapLine( bool horizontal, double x, double y , double tolerance, QList< QPair< QgsComposerItem*, QgsComposerItem::ItemPo sitionMode > >& snappedItems ); | |||
/**Hides / shows custom snap lines*/ | ||||
void setSnapLinesVisible( bool visible ); | ||||
/**Allocates new item command and saves initial state in it | /**Allocates new item command and saves initial state in it | |||
@param item target item | @param item target item | |||
@param commandText descriptive command text | @param commandText descriptive command text | |||
@param c context for merge commands (unknown for non-mergeable comman ds)*/ | @param c context for merge commands (unknown for non-mergeable comman ds)*/ | |||
void beginCommand( QgsComposerItem* item, const QString& commandText, Q gsComposerMergeCommand::Context c = QgsComposerMergeCommand::Unknown ); | void beginCommand( QgsComposerItem* item, const QString& commandText, Q gsComposerMergeCommand::Context c = QgsComposerMergeCommand::Unknown ); | |||
/**Saves end state of item and pushes command to the undo history*/ | /**Saves end state of item and pushes command to the undo history*/ | |||
void endCommand(); | void endCommand(); | |||
/**Deletes current command*/ | /**Deletes current command*/ | |||
skipping to change at line 336 | skipping to change at line 403 | |||
void addComposerTable( QgsComposerAttributeTable* table ); | void addComposerTable( QgsComposerAttributeTable* table ); | |||
/**Adds composer html frame and advices composer to create a widget for it (through signal)*/ | /**Adds composer html frame and advices composer to create a widget for it (through signal)*/ | |||
void addComposerHtmlFrame( QgsComposerHtml* html, QgsComposerFrame* fra me ); | void addComposerHtmlFrame( QgsComposerHtml* html, QgsComposerFrame* fra me ); | |||
/**Remove item from the graphics scene. Additionally to QGraphicsScene: :removeItem, this function considers undo/redo command*/ | /**Remove item from the graphics scene. Additionally to QGraphicsScene: :removeItem, this function considers undo/redo command*/ | |||
void removeComposerItem( QgsComposerItem* item, bool createCommand = tr ue ); | void removeComposerItem( QgsComposerItem* item, bool createCommand = tr ue ); | |||
/**Convenience function to create a QgsAddRemoveItemCommand, connect it s signals and push it to the undo stack*/ | /**Convenience function to create a QgsAddRemoveItemCommand, connect it s signals and push it to the undo stack*/ | |||
void pushAddRemoveCommand( QgsComposerItem* item, const QString& text, QgsAddRemoveItemCommand::State state = QgsAddRemoveItemCommand::Added ); | void pushAddRemoveCommand( QgsComposerItem* item, const QString& text, QgsAddRemoveItemCommand::State state = QgsAddRemoveItemCommand::Added ); | |||
/**If true, prevents any mouse cursor changes by the composition or by | ||||
any composer items | ||||
Used by QgsComposer and QgsComposerView to prevent unwanted cursor ch | ||||
anges*/ | ||||
void setPreventCursorChange( bool preventChange ) { mPreventCursorChang | ||||
e = preventChange; } | ||||
bool preventCursorChange() { return mPreventCursorChange; } | ||||
//printing | //printing | |||
/** Prepare the printer for printing */ | /** Prepare the printer for printing */ | |||
void beginPrint( QPrinter& printer ); | void beginPrint( QPrinter& printer ); | |||
/** Prepare the printer for printing in a PDF */ | /** Prepare the printer for printing in a PDF */ | |||
void beginPrintAsPDF( QPrinter& printer, const QString& file ); | void beginPrintAsPDF( QPrinter& printer, const QString& file ); | |||
/** Print on a preconfigured printer */ | /** Print on a preconfigured printer */ | |||
void doPrint( QPrinter& printer, QPainter& painter ); | void doPrint( QPrinter& printer, QPainter& painter ); | |||
/** Convenience function that prepares the printer and prints */ | /** Convenience function that prepares the printer and prints */ | |||
skipping to change at line 359 | skipping to change at line 431 | |||
void exportAsPDF( const QString& file ); | void exportAsPDF( const QString& file ); | |||
//! print composer page to image | //! print composer page to image | |||
//! If the image does not fit into memory, a null image is returned | //! If the image does not fit into memory, a null image is returned | |||
QImage printPageAsRaster( int page ); | QImage printPageAsRaster( int page ); | |||
/**Render a page to a paint device | /**Render a page to a paint device | |||
@note added in version 1.9*/ | @note added in version 1.9*/ | |||
void renderPage( QPainter* p, int page ); | void renderPage( QPainter* p, int page ); | |||
/** Compute world file parameters */ | ||||
void computeWorldFileParameters( double& a, double& b, double& c, doubl | ||||
e& d, double& e, double& f ) const; | ||||
QgsAtlasComposition& atlasComposition() { return mAtlasComposition; } | QgsAtlasComposition& atlasComposition() { return mAtlasComposition; } | |||
/**Resizes a QRectF relative to the change from boundsBefore to boundsA | ||||
fter*/ | ||||
static void relativeResizeRect( QRectF& rectToResize, const QRectF& bou | ||||
ndsBefore, const QRectF& boundsAfter ); | ||||
/**Returns a scaled position given a before and after range*/ | ||||
static double relativePosition( double position, double beforeMin, doub | ||||
le beforeMax, double afterMin, double afterMax ); | ||||
/** Returns the current atlas mode of the composition */ | ||||
QgsComposition::AtlasMode atlasMode() const { return mAtlasMode; } | ||||
/** Sets the current atlas mode of the composition. Returns false if th | ||||
e mode could not be changed. */ | ||||
bool setAtlasMode( QgsComposition::AtlasMode mode ); | ||||
public slots: | public slots: | |||
/**Casts object to the proper subclass type and calls corresponding ite mAdded signal*/ | /**Casts object to the proper subclass type and calls corresponding ite mAdded signal*/ | |||
void sendItemAddedSignal( QgsComposerItem* item ); | void sendItemAddedSignal( QgsComposerItem* item ); | |||
/**Updates the scene bounds of the composition | ||||
@note added in version 2.2*/ | ||||
void updateBounds(); | ||||
private: | private: | |||
/**Pointer to map renderer of QGIS main map*/ | /**Pointer to map renderer of QGIS main map*/ | |||
QgsMapRenderer* mMapRenderer; | QgsMapRenderer* mMapRenderer; | |||
QgsComposition::PlotStyle mPlotStyle; | QgsComposition::PlotStyle mPlotStyle; | |||
double mPageWidth; | double mPageWidth; | |||
double mPageHeight; | double mPageHeight; | |||
QList< QgsPaperItem* > mPages; | QList< QgsPaperItem* > mPages; | |||
double mSpaceBetweenPages; //space in preview between pages | double mSpaceBetweenPages; //space in preview between pages | |||
/**Drawing style for page*/ | ||||
QgsFillSymbolV2* mPageStyleSymbol; | ||||
void createDefaultPageStyleSymbol(); | ||||
/**Maintains z-Order of items. Starts with item at position 1 (position 0 is always paper item)*/ | /**Maintains z-Order of items. Starts with item at position 1 (position 0 is always paper item)*/ | |||
QLinkedList<QgsComposerItem*> mItemZList; | QLinkedList<QgsComposerItem*> mItemZList; | |||
/**List multiframe objects*/ | /**List multiframe objects*/ | |||
QSet<QgsComposerMultiFrame*> mMultiFrames; | QSet<QgsComposerMultiFrame*> mMultiFrames; | |||
/**Dpi for printout*/ | /**Dpi for printout*/ | |||
int mPrintResolution; | int mPrintResolution; | |||
/**Flag if map should be printed as a raster (via QImage). False by def ault*/ | /**Flag if map should be printed as a raster (via QImage). False by def ault*/ | |||
bool mPrintAsRaster; | bool mPrintAsRaster; | |||
/**Flag if a world file should be generated on raster export */ | ||||
bool mGenerateWorldFile; | ||||
/** Composer map to use for the world file generation */ | ||||
QgsComposerMap* mWorldFileMap; | ||||
/**Flag if advanced visual effects such as blend modes should be used. True by default*/ | /**Flag if advanced visual effects such as blend modes should be used. True by default*/ | |||
bool mUseAdvancedEffects; | bool mUseAdvancedEffects; | |||
/**Distance tolerance for item selection (in mm)*/ | ||||
double mSelectionTolerance; | ||||
/**Parameters for snap to grid function*/ | /**Parameters for snap to grid function*/ | |||
bool mSnapToGrid; | bool mSnapToGrid; | |||
bool mGridVisible; | ||||
double mSnapGridResolution; | double mSnapGridResolution; | |||
double mSnapGridTolerance; | ||||
double mSnapGridOffsetX; | double mSnapGridOffsetX; | |||
double mSnapGridOffsetY; | double mSnapGridOffsetY; | |||
QPen mGridPen; | QPen mGridPen; | |||
GridStyle mGridStyle; | GridStyle mGridStyle; | |||
/**Parameters for alignment snap*/ | /**Parameters for alignment snap*/ | |||
bool mAlignmentSnap; | bool mAlignmentSnap; | |||
bool mGuidesVisible; | ||||
bool mSmartGuides; | ||||
double mAlignmentSnapTolerance; | double mAlignmentSnapTolerance; | |||
/**Arbitraty snap lines (horizontal and vertical)*/ | /**Arbitraty snap lines (horizontal and vertical)*/ | |||
QList< QGraphicsLineItem* > mSnapLines; | QList< QGraphicsLineItem* > mSnapLines; | |||
QgsComposerMouseHandles* mSelectionHandles; | ||||
QUndoStack mUndoStack; | QUndoStack mUndoStack; | |||
QgsComposerItemCommand* mActiveItemCommand; | QgsComposerItemCommand* mActiveItemCommand; | |||
QgsComposerMultiFrameCommand* mActiveMultiFrameCommand; | QgsComposerMultiFrameCommand* mActiveMultiFrameCommand; | |||
/** The atlas composition object. It is held by the QgsComposition */ | /** The atlas composition object. It is held by the QgsComposition */ | |||
QgsAtlasComposition mAtlasComposition; | QgsAtlasComposition mAtlasComposition; | |||
QgsComposition::AtlasMode mAtlasMode; | ||||
QgsComposition(); //default constructor is forbidden | QgsComposition(); //default constructor is forbidden | |||
/**Calculates the bounds of all non-gui items in the composition. Ignor | ||||
es snap lines and mouse handles*/ | ||||
QRectF compositionBounds() const; | ||||
/**Reset z-values of items based on position in z list*/ | /**Reset z-values of items based on position in z list*/ | |||
void updateZValues(); | void updateZValues( bool addUndoCommands = true ); | |||
/**Returns the bounding rectangle of the selected items in scene coordi nates | /**Returns the bounding rectangle of the selected items in scene coordi nates | |||
@return 0 in case of success*/ | @return 0 in case of success*/ | |||
int boundingRectOfSelectedItems( QRectF& bRect ); | int boundingRectOfSelectedItems( QRectF& bRect ); | |||
/**Loads default composer settings*/ | ||||
void loadDefaults(); | ||||
/**Loads composer settings which may change, eg grid color*/ | ||||
void loadSettings(); | void loadSettings(); | |||
void saveSettings(); | ||||
/**Calculates the item minimum position from an xml string*/ | ||||
QPointF minPointFromXml( const QDomElement& elem ) const; | ||||
void connectAddRemoveCommandSignals( QgsAddRemoveItemCommand* c ); | void connectAddRemoveCommandSignals( QgsAddRemoveItemCommand* c ); | |||
void updatePaperItems(); | void updatePaperItems(); | |||
void addPaperItem(); | void addPaperItem(); | |||
void removePaperItems(); | void removePaperItems(); | |||
void deleteAndRemoveMultiFrames(); | void deleteAndRemoveMultiFrames(); | |||
static QString encodeStringForXML( const QString& str ); | static QString encodeStringForXML( const QString& str ); | |||
//helper functions for item align | bool mPreventCursorChange; | |||
void collectAlignCoordinates( QMap< double, const QgsComposerItem* >& a | ||||
lignCoordsX, | ||||
QMap< double, const QgsComposerItem* >& a | ||||
lignCoordsY, const QgsComposerItem* excludeItem ); | ||||
void checkNearestItem( double checkCoord, const QMap< double, const Qgs | ||||
ComposerItem* >& alignCoords, double& smallestDiff, | ||||
double itemCoordOffset, double& itemCoord, doubl | ||||
e& alignCoord ) const; | ||||
/**Find nearest item in coordinate map to a double. | ||||
@return true if item found, false if coords is empty*/ | ||||
static bool nearestItem( const QMap< double, const QgsComposerItem* >& | ||||
coords, double value, double& nearestValue ); | ||||
signals: | signals: | |||
void paperSizeChanged(); | void paperSizeChanged(); | |||
void nPagesChanged(); | void nPagesChanged(); | |||
/**Is emitted when selected item changed. If 0, no item is selected*/ | /**Is emitted when selected item changed. If 0, no item is selected*/ | |||
void selectedItemChanged( QgsComposerItem* selected ); | void selectedItemChanged( QgsComposerItem* selected ); | |||
/**Is emitted when new composer arrow has been added to the view*/ | /**Is emitted when new composer arrow has been added to the view*/ | |||
void composerArrowAdded( QgsComposerArrow* arrow ); | void composerArrowAdded( QgsComposerArrow* arrow ); | |||
/**Is emitted when a new composer html has been added to the view*/ | /**Is emitted when a new composer html has been added to the view*/ | |||
skipping to change at line 473 | skipping to change at line 576 | |||
/**Is emitted when a new composer legend has been added*/ | /**Is emitted when a new composer legend has been added*/ | |||
void composerLegendAdded( QgsComposerLegend* legend ); | void composerLegendAdded( QgsComposerLegend* legend ); | |||
/**Is emitted when a new composer picture has been added*/ | /**Is emitted when a new composer picture has been added*/ | |||
void composerPictureAdded( QgsComposerPicture* picture ); | void composerPictureAdded( QgsComposerPicture* picture ); | |||
/**Is emitted when a new composer shape has been added*/ | /**Is emitted when a new composer shape has been added*/ | |||
void composerShapeAdded( QgsComposerShape* shape ); | void composerShapeAdded( QgsComposerShape* shape ); | |||
/**Is emitted when a new composer table has been added*/ | /**Is emitted when a new composer table has been added*/ | |||
void composerTableAdded( QgsComposerAttributeTable* table ); | void composerTableAdded( QgsComposerAttributeTable* table ); | |||
/**Is emitted when a composer item has been removed from the scene*/ | /**Is emitted when a composer item has been removed from the scene*/ | |||
void itemRemoved( QgsComposerItem* ); | void itemRemoved( QgsComposerItem* ); | |||
/**Is emitted when the composition has an updated status bar message fo | ||||
r the composer window*/ | ||||
void statusMsgChanged( QString message ); | ||||
}; | }; | |||
template<class T> void QgsComposition::composerItems( QList<T*>& itemList ) | template<class T> void QgsComposition::composerItems( QList<T*>& itemList ) | |||
{ | { | |||
itemList.clear(); | itemList.clear(); | |||
QList<QGraphicsItem *> graphicsItemList = items(); | QList<QGraphicsItem *> graphicsItemList = items(); | |||
QList<QGraphicsItem *>::iterator itemIt = graphicsItemList.begin(); | QList<QGraphicsItem *>::iterator itemIt = graphicsItemList.begin(); | |||
for ( ; itemIt != graphicsItemList.end(); ++itemIt ) | for ( ; itemIt != graphicsItemList.end(); ++itemIt ) | |||
{ | { | |||
T* item = dynamic_cast<T*>( *itemIt ); | T* item = dynamic_cast<T*>( *itemIt ); | |||
End of changes. 33 change blocks. | ||||
47 lines changed or deleted | 158 lines changed or added | |||
qgsconfig.h | qgsconfig.h | |||
---|---|---|---|---|
// QGSCONFIG.H | // QGSCONFIG.H | |||
#ifndef QGSCONFIG_H | #ifndef QGSCONFIG_H | |||
#define QGSCONFIG_H | #define QGSCONFIG_H | |||
// Version must be specified according to | // Version must be specified according to | |||
// <int>.<int>.<int>-<any text>. | // <int>.<int>.<int>-<any text>. | |||
// or else upgrading old project file will not work | // or else upgrading old project file will not work | |||
// reliably. | // reliably. | |||
#define VERSION "2.0.1-Dufour" | #define VERSION "2.2.0-Valmiera" | |||
//used in vim src/core/qgis.cpp | //used in vim src/core/qgis.cpp | |||
//The way below should work but it resolves to a number like 0110 which the compiler treats as octal I think | //The way below should work but it resolves to a number like 0110 which the compiler treats as octal I think | |||
//because debuggin it out shows the decimal number 72 which results in inco rrect version status. | //because debuggin it out shows the decimal number 72 which results in inco rrect version status. | |||
//As a short term fix I (Tim) am defining the version in top level cmake. I t would be good to | //As a short term fix I (Tim) am defining the version in top level cmake. I t would be good to | |||
//reinstate this more generic approach below at some point though | //reinstate this more generic approach below at some point though | |||
//#define VERSION_INT 201 | //#define VERSION_INT 220 | |||
#define VERSION_INT 20001 | #define VERSION_INT 20200 | |||
#define ABISYM(x) x ## 20001 | #define ABISYM(x) x ## 20200 | |||
//used in main.cpp and anywhere else where the release name is needed | //used in main.cpp and anywhere else where the release name is needed | |||
#define RELEASE_NAME "Dufour" | #define RELEASE_NAME "Valmiera" | |||
#define QGIS_PLUGIN_SUBDIR "lib/qgis/plugins" | #define QGIS_PLUGIN_SUBDIR "lib/qgis/plugins" | |||
#define QGIS_DATA_SUBDIR "share/qgis" | #define QGIS_DATA_SUBDIR "share/qgis" | |||
#define QGIS_LIBEXEC_SUBDIR "lib/qgis" | #define QGIS_LIBEXEC_SUBDIR "lib/qgis" | |||
#define QGIS_LIB_SUBDIR "lib" | #define QGIS_LIB_SUBDIR "lib" | |||
#define CMAKE_INSTALL_PREFIX "/home/ut/testing/qgis/2.0.1" | #define CMAKE_INSTALL_PREFIX "/home/ut/testing/qgis/2.2.0" | |||
#define CMAKE_SOURCE_DIR "/home/ut/repository/qgis/install/qgis-2.0.1" | #define CMAKE_SOURCE_DIR "/home/ut/repository/qgis/install/qgis-2.2.0" | |||
#define QSCINTILLA_VERSION_STR "" | #define QSCINTILLA_VERSION_STR "" | |||
//used by Mac to find system Qt plugins when bundle is run from build direc tory | //used by Mac to find system Qt plugins when bundle is run from build direc tory | |||
#define QTPLUGINSDIR "/usr/plugins" | #define QTPLUGINSDIR "/usr/plugins" | |||
//used by Mac to find system Open Scene Graph plugins when bundle is run fr | ||||
om build directory | ||||
#define OSG_PLUGINS_PATH "" | ||||
/* #undef USING_NMAKE */ | /* #undef USING_NMAKE */ | |||
#define HAVE_POSTGRESQL | #define HAVE_POSTGRESQL | |||
#define HAVE_SPATIALITE | #define HAVE_SPATIALITE | |||
#define HAVE_MSSQL | #define HAVE_MSSQL | |||
/* #undef HAVE_ORACLE */ | /* #undef HAVE_ORACLE */ | |||
/* #undef HAVE_PYTHON */ | /* #undef HAVE_PYTHON */ | |||
/* #undef HAVE_TOUCH */ | /* #undef HAVE_TOUCH */ | |||
/* #undef HAVE_OSGEARTHQT */ | /* #undef HAVE_OSGEARTHQT */ | |||
/* #undef MAPSERVER_SKIP_ECW */ | /* #undef MAPSERVER_SKIP_ECW */ | |||
/* #undef HAVE_MACAPP_BUNDLED_OSG */ | ||||
#endif | #endif | |||
End of changes. 6 change blocks. | ||||
7 lines changed or deleted | 13 lines changed or added | |||
qgscoordinatereferencesystem.h | qgscoordinatereferencesystem.h | |||
---|---|---|---|---|
skipping to change at line 119 | skipping to change at line 119 | |||
/*! Set up this srs using a Wkt spatial ref sys definition. | /*! Set up this srs using a Wkt spatial ref sys definition. | |||
* The wkt will be converted to a proj4 string using OGR helper | * The wkt will be converted to a proj4 string using OGR helper | |||
* functions. After this the srs databasses will be searched for matche s. | * functions. After this the srs databasses will be searched for matche s. | |||
* First the system level read only srs.db will be checked | * First the system level read only srs.db will be checked | |||
* and then the users ~/.qgis/qgis.db database will be checked for a ma tch. | * and then the users ~/.qgis/qgis.db database will be checked for a ma tch. | |||
* @note Any members will be overwritten during this process. | * @note Any members will be overwritten during this process. | |||
* @note SRID and EpsgCrsId may be blank if no match can be found on sr s db. | * @note SRID and EpsgCrsId may be blank if no match can be found on sr s db. | |||
* @param theWkt The Wkt for the desired spatial reference system. | * @param theWkt The Wkt for the desired spatial reference system. | |||
* @return bool TRUE if success else false | * @return bool TRUE if success else false | |||
*/ | */ | |||
bool createFromWkt( const QString theWkt ); | bool createFromWkt( const QString &theWkt ); | |||
/*! Set up this srs by fetching the appropriate information from the | /*! Set up this srs by fetching the appropriate information from the | |||
* sqlite backend. If the srsid is < 100000, only the system srs.db | * sqlite backend. If the srsid is < 100000, only the system srs.db | |||
* will be checked. If the srsid > 100000 the srs will be retrieved fro m | * will be checked. If the srsid > 100000 the srs will be retrieved fro m | |||
* the ~/.qgis/qgis.db | * the ~/.qgis/qgis.db | |||
* @note Any members will be overwritten during this process. | * @note Any members will be overwritten during this process. | |||
* @param theSrsId The QGIS SrsId for the desired spatial reference sys tem. | * @param theSrsId The QGIS SrsId for the desired spatial reference sys tem. | |||
* @return bool TRUE if success else false | * @return bool TRUE if success else false | |||
*/ | */ | |||
bool createFromSrsId( const long theSrsId ); | bool createFromSrsId( const long theSrsId ); | |||
skipping to change at line 157 | skipping to change at line 157 | |||
* then sequentially walk through the database (first users qgis.db s rs tbl then | * then sequentially walk through the database (first users qgis.db s rs tbl then | |||
* system srs.db tbl), converting each entry into an ogr srs and usin g isSame | * system srs.db tbl), converting each entry into an ogr srs and usin g isSame | |||
* or isSameGeocs (essentially calling the == overloaded operator). W e'll try to | * or isSameGeocs (essentially calling the == overloaded operator). W e'll try to | |||
* be smart about this and first parse out the proj and ellpse string s and only | * be smart about this and first parse out the proj and ellpse string s and only | |||
* check for a match in entities that have the same ellps and proj en tries so | * check for a match in entities that have the same ellps and proj en tries so | |||
* that it doesn't munch yer cpu so much. | * that it doesn't munch yer cpu so much. | |||
* | * | |||
* @param theProjString A proj4 format string | * @param theProjString A proj4 format string | |||
* @return bool TRUE if success else false | * @return bool TRUE if success else false | |||
*/ | */ | |||
bool createFromProj4( const QString theProjString ); | bool createFromProj4( const QString &theProjString ); | |||
/*! Set up this srs from a string definition, by default a WKT definiti on. Otherwise | /*! Set up this srs from a string definition, by default a WKT definiti on. Otherwise | |||
* the string defines a authority, followed by a colon, followed by the definition. | * the string defines a authority, followed by a colon, followed by the definition. | |||
* The authority can be one of "epsg", "postgis", "internal" for intege r definitions, | * The authority can be one of "epsg", "postgis", "internal" for intege r definitions, | |||
* and "wkt" or "proj4" for string definitions. The implementation of each authority | * and "wkt" or "proj4" for string definitions. The implementation of each authority | |||
* uses the corresponding createFrom... function. | * uses the corresponding createFrom... function. | |||
* @param theDefinition A String containing a coordinate reference syst em definition. | * @param theDefinition A String containing a coordinate reference syst em definition. | |||
*/ | */ | |||
bool createFromString( const QString theDefinition ); | bool createFromString( const QString &theDefinition ); | |||
/*! Set up this srs from a various text formats. | /*! Set up this srs from a various text formats. | |||
* | * | |||
* Valid formats: WKT string, "EPSG:n", "EPSGA:n", "AUTO:proj_id,unit_i d,lon0,lat0", | * Valid formats: WKT string, "EPSG:n", "EPSGA:n", "AUTO:proj_id,unit_i d,lon0,lat0", | |||
* "urn:ogc:def:crs:EPSG::n", PROJ.4 string, filename (with WKT, XML or PROJ.4 string), | * "urn:ogc:def:crs:EPSG::n", PROJ.4 string, filename (with WKT, XML or PROJ.4 string), | |||
* well known name (such as NAD27, NAD83, WGS84 or WGS72), | * well known name (such as NAD27, NAD83, WGS84 or WGS72), | |||
* ESRI::[WKT string] (directly or in a file), "IGNF:xxx" | * ESRI::[WKT string] (directly or in a file), "IGNF:xxx" | |||
* | * | |||
* For more details on supported formats see OGRSpatialReference::SetFr omUserInput() | * For more details on supported formats see OGRSpatialReference::SetFr omUserInput() | |||
* ( http://www.gdal.org/ogr/classOGRSpatialReference.html#aec3c6a49533 fe457ddc763d699ff8796 ) | * ( http://www.gdal.org/ogr/classOGRSpatialReference.html#aec3c6a49533 fe457ddc763d699ff8796 ) | |||
* @note this function generates a WKT string using OSRSetFromUserInput () and | * @note this function generates a WKT string using OSRSetFromUserInput () and | |||
* passes it to createFromWkt() function. | * passes it to createFromWkt() function. | |||
* @param theDefinition A String containing a coordinate reference syst em definition. | * @param theDefinition A String containing a coordinate reference syst em definition. | |||
* | * | |||
* @note added in 1.8 | * @note added in 1.8 | |||
*/ | */ | |||
bool createFromUserInput( const QString theDefinition ); | bool createFromUserInput( const QString &theDefinition ); | |||
/*! Make sure that ESRI WKT import is done properly. | /*! Make sure that ESRI WKT import is done properly. | |||
* This is required for proper shapefile CRS import when using gdal>= 1 .9. | * This is required for proper shapefile CRS import when using gdal>= 1 .9. | |||
* @note This function is called by createFromUserInput() and QgsOgrPro vider::crs(), there is usually | * @note This function is called by createFromUserInput() and QgsOgrPro vider::crs(), there is usually | |||
* no need to call it from elsewhere. | * no need to call it from elsewhere. | |||
* @note This function sets CPL config option GDAL_FIX_ESRI_WKT to a pr oper value, | * @note This function sets CPL config option GDAL_FIX_ESRI_WKT to a pr oper value, | |||
* unless it has been set by the user through the commandline or an env ironment variable. | * unless it has been set by the user through the commandline or an env ironment variable. | |||
* For more details refer to OGRSpatialReference::morphFromESRI() . | * For more details refer to OGRSpatialReference::morphFromESRI() . | |||
* | * | |||
* @note added in 1.8 | * @note added in 1.8 | |||
skipping to change at line 354 | skipping to change at line 354 | |||
* negative number of failed updates in case of errors. | * negative number of failed updates in case of errors. | |||
* @note added in 1.8 | * @note added in 1.8 | |||
*/ | */ | |||
static int syncDb(); | static int syncDb(); | |||
/*! Save the proj4-string as a custom CRS | /*! Save the proj4-string as a custom CRS | |||
* @returns bool true if success else false | * @returns bool true if success else false | |||
*/ | */ | |||
bool saveAsUserCRS( QString name ); | bool saveAsUserCRS( QString name ); | |||
/**Returns auth id of related geographic CRS*/ | ||||
QString geographicCRSAuthId() const; | ||||
// Mutators ----------------------------------- | // Mutators ----------------------------------- | |||
// We don't want to expose these to the public api since they wont crea te | // We don't want to expose these to the public api since they wont crea te | |||
// a fully valid crs. Programmers should use the createFrom* methods ra ther | // a fully valid crs. Programmers should use the createFrom* methods ra ther | |||
private: | private: | |||
/** A static helper function to find out the proj4 string for a srsid | /** A static helper function to find out the proj4 string for a srsid | |||
* @param theSrsId The srsid used for the lookup | * @param theSrsId The srsid used for the lookup | |||
* @return QString The proj4 string | * @return QString The proj4 string | |||
*/ | */ | |||
static QString proj4FromSrsId( const int theSrsId ); | static QString proj4FromSrsId( const int theSrsId ); | |||
skipping to change at line 462 | skipping to change at line 465 | |||
//! Helper for sql-safe value quoting | //! Helper for sql-safe value quoting | |||
static QString quotedValue( QString value ); | static QString quotedValue( QString value ); | |||
OGRSpatialReferenceH mCRS; | OGRSpatialReferenceH mCRS; | |||
bool loadFromDb( QString db, QString expression, QString value ); | bool loadFromDb( QString db, QString expression, QString value ); | |||
QString mValidationHint; | QString mValidationHint; | |||
mutable QString mWkt; | mutable QString mWkt; | |||
mutable QString mProj4; | ||||
static bool loadIDs( QHash<int, QString> &wkts ); | static bool loadIDs( QHash<int, QString> &wkts ); | |||
static bool loadWkts( QHash<int, QString> &wkts, const char *filename ) ; | static bool loadWkts( QHash<int, QString> &wkts, const char *filename ) ; | |||
static bool syncDatumTransform( const QString& dbPath ); | ||||
//!Whether this is a coordinate system has inverted axis | //!Whether this is a coordinate system has inverted axis | |||
mutable int mAxisInverted; | mutable int mAxisInverted; | |||
static CUSTOM_CRS_VALIDATION mCustomSrsValidation; | static CUSTOM_CRS_VALIDATION mCustomSrsValidation; | |||
}; | }; | |||
//! Output stream operator | //! Output stream operator | |||
inline std::ostream& operator << ( std::ostream& os, const QgsCoordinateRef erenceSystem &r ) | inline std::ostream& operator << ( std::ostream& os, const QgsCoordinateRef erenceSystem &r ) | |||
{ | { | |||
End of changes. 7 change blocks. | ||||
4 lines changed or deleted | 9 lines changed or added | |||
qgscoordinatetransform.h | qgscoordinatetransform.h | |||
---|---|---|---|---|
skipping to change at line 91 | skipping to change at line 91 | |||
* @param theDestWkt Wkt of the map canvas coordinate system | * @param theDestWkt Wkt of the map canvas coordinate system | |||
* @param theSourceCRSType On of the enum members defined in QgsCoordin ateReferenceSystem::CrsType | * @param theSourceCRSType On of the enum members defined in QgsCoordin ateReferenceSystem::CrsType | |||
*/ | */ | |||
QgsCoordinateTransform( long theSourceSrid, | QgsCoordinateTransform( long theSourceSrid, | |||
QString theDestWkt, | QString theDestWkt, | |||
QgsCoordinateReferenceSystem::CrsType theSource CRSType = QgsCoordinateReferenceSystem::PostgisCrsId ); | QgsCoordinateReferenceSystem::CrsType theSource CRSType = QgsCoordinateReferenceSystem::PostgisCrsId ); | |||
//! destructor | //! destructor | |||
~QgsCoordinateTransform(); | ~QgsCoordinateTransform(); | |||
QgsCoordinateTransform* clone() const; | ||||
//! Enum used to indicate the direction (forward or inverse) of the tra nsform | //! Enum used to indicate the direction (forward or inverse) of the tra nsform | |||
enum TransformDirection | enum TransformDirection | |||
{ | { | |||
ForwardTransform, /*!< Transform from source to destination CRS. */ | ForwardTransform, /*!< Transform from source to destination CRS. */ | |||
ReverseTransform /*!< Transform from destination to source CRS. */ | ReverseTransform /*!< Transform from destination to source CRS. */ | |||
}; | }; | |||
/*! | /*! | |||
* Set the source (layer) QgsCoordinateReferenceSystem | * Set the source (layer) QgsCoordinateReferenceSystem | |||
* @param theCRS QgsCoordinateReferenceSystem representation of the lay er's coordinate system | * @param theCRS QgsCoordinateReferenceSystem representation of the lay er's coordinate system | |||
skipping to change at line 214 | skipping to change at line 216 | |||
* A QGIS srsid is a unique key value to an entry on the tbl_srs in the | * A QGIS srsid is a unique key value to an entry on the tbl_srs in the | |||
* srs.db sqlite database. | * srs.db sqlite database. | |||
* @note This slot will usually be called if the | * @note This slot will usually be called if the | |||
* project properties change and a different coordinate system is | * project properties change and a different coordinate system is | |||
* selected. | * selected. | |||
* @note This coord transform will be reinitialised when this slot is ca lled | * @note This coord transform will be reinitialised when this slot is ca lled | |||
* to check if short circuiting is needed or not etc. | * to check if short circuiting is needed or not etc. | |||
* @param theCRSID - A long representing the srsid of the srs to be use d */ | * @param theCRSID - A long representing the srsid of the srs to be use d */ | |||
void setDestCRSID( long theCRSID ); | void setDestCRSID( long theCRSID ); | |||
/**Returns list of datum transformations for the given src and dest CRS | ||||
* @note not available in python bindings | ||||
*/ | ||||
static QList< QList< int > > datumTransformations( const QgsCoordinateR | ||||
eferenceSystem& srcCRS, const QgsCoordinateReferenceSystem& destCRS ); | ||||
static QString datumTransformString( int datumTransform ); | ||||
/**Gets name of source and dest geographical CRS (to show in a tooltip) | ||||
@return epsgNr epsg code of the transformation (or 0 if not in epsg | ||||
db)*/ | ||||
static bool datumTransformCrsInfo( int datumTransform, int& epsgNr, QSt | ||||
ring& srcProjection, QString& dstProjection, QString &remarks, QString &sco | ||||
pe, bool &preferred, bool &deprecated ); | ||||
int sourceDatumTransform() const { return mSourceDatumTransform; } | ||||
void setSourceDatumTransform( int dt ) { mSourceDatumTransform = dt; } | ||||
int destinationDatumTransform() const { return mDestinationDatumTransfo | ||||
rm; } | ||||
void setDestinationDatumTransform( int dt ) { mDestinationDatumTransfor | ||||
m = dt; } | ||||
public slots: | public slots: | |||
//!initialise is used to actually create the Transformer instance | //!initialise is used to actually create the Transformer instance | |||
void initialise(); | void initialise(); | |||
/*! Restores state from the given Dom node. | /*! Restores state from the given Dom node. | |||
* @param theNode The node from which state will be restored | * @param theNode The node from which state will be restored | |||
* @return bool True on success, False on failure | * @return bool True on success, False on failure | |||
*/ | */ | |||
bool readXML( QDomNode & theNode ); | bool readXML( QDomNode & theNode ); | |||
skipping to change at line 268 | skipping to change at line 284 | |||
/*! | /*! | |||
* Proj4 data structure of the source projection (layer coordinate syst em) | * Proj4 data structure of the source projection (layer coordinate syst em) | |||
*/ | */ | |||
projPJ mSourceProjection; | projPJ mSourceProjection; | |||
/*! | /*! | |||
* Proj4 data structure of the destination projection (map canvas coord inate system) | * Proj4 data structure of the destination projection (map canvas coord inate system) | |||
*/ | */ | |||
projPJ mDestinationProjection; | projPJ mDestinationProjection; | |||
int mSourceDatumTransform; | ||||
int mDestinationDatumTransform; | ||||
/*! | /*! | |||
* Finder for PROJ grid files. | * Finder for PROJ grid files. | |||
*/ | */ | |||
void setFinder(); | void setFinder(); | |||
/**Removes +nadgrids and +towgs84 from proj4 string*/ | ||||
static QString stripDatumTransform( const QString& proj4 ); | ||||
static void searchDatumTransform( const QString& sql, QList< int >& tra | ||||
nsforms ); | ||||
/**In certain situations, null grid shifts have to be added to src / ds | ||||
t proj string*/ | ||||
void addNullGridShifts( QString& srcProjString, QString& destProjString | ||||
); | ||||
}; | }; | |||
//! Output stream operator | //! Output stream operator | |||
inline std::ostream& operator << ( std::ostream& os, const QgsCoordinateTra nsform &r ) | inline std::ostream& operator << ( std::ostream& os, const QgsCoordinateTra nsform &r ) | |||
{ | { | |||
QString mySummary( "\n%%%%%%%%%%%%%%%%%%%%%%%%\nCoordinate Transform def begins:" ); | QString mySummary( "\n%%%%%%%%%%%%%%%%%%%%%%%%\nCoordinate Transform def begins:" ); | |||
mySummary += "\n\tInitialised? : "; | mySummary += "\n\tInitialised? : "; | |||
//prevent warnings | //prevent warnings | |||
if ( r.isInitialised() ) | if ( r.isInitialised() ) | |||
{ | { | |||
End of changes. 4 change blocks. | ||||
0 lines changed or deleted | 34 lines changed or added | |||
qgscptcityarchive.h | qgscptcityarchive.h | |||
---|---|---|---|---|
skipping to change at line 310 | skipping to change at line 310 | |||
class CORE_EXPORT QgsCptCityBrowserModel : public QAbstractItemModel | class CORE_EXPORT QgsCptCityBrowserModel : public QAbstractItemModel | |||
{ | { | |||
Q_OBJECT | Q_OBJECT | |||
public: | public: | |||
enum ViewType | enum ViewType | |||
{ | { | |||
Authors = 0, | Authors = 0, | |||
Selections = 1, | Selections = 1, | |||
List = 2 | List = 2 // not used anymore | |||
}; | }; | |||
QgsCptCityBrowserModel( QObject* parent = 0, | QgsCptCityBrowserModel( QObject* parent = 0, | |||
QgsCptCityArchive* archive = QgsCptCityArchive: :defaultArchive(), | QgsCptCityArchive* archive = QgsCptCityArchive: :defaultArchive(), | |||
ViewType Type = Authors ); | ViewType Type = Authors ); | |||
~QgsCptCityBrowserModel(); | ~QgsCptCityBrowserModel(); | |||
// implemented methods from QAbstractItemModel for read-only access | // implemented methods from QAbstractItemModel for read-only access | |||
/** Used by other components to obtain information about each item prov ided by the model. | /** Used by other components to obtain information about each item prov ided by the model. | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
qgscptcitycolorrampv2dialog.h | qgscptcitycolorrampv2dialog.h | |||
---|---|---|---|---|
skipping to change at line 49 | skipping to change at line 49 | |||
QString selectedName() const | QString selectedName() const | |||
{ return mRamp ? QFileInfo( mRamp->schemeName() ).baseName() + mRamp->v ariantName() : QString(); } | { return mRamp ? QFileInfo( mRamp->schemeName() ).baseName() + mRamp->v ariantName() : QString(); } | |||
bool saveAsGradientRamp() const; | bool saveAsGradientRamp() const; | |||
public slots: | public slots: | |||
void populateVariants(); | void populateVariants(); | |||
void on_mTreeView_clicked( const QModelIndex & ); | void on_mTreeView_clicked( const QModelIndex & ); | |||
void on_mListWidget_itemClicked( QListWidgetItem * item ); | void on_mListWidget_itemClicked( QListWidgetItem * item ); | |||
void on_mListWidget_itemSelectionChanged(); | ||||
void on_tabBar_currentChanged( int index ); | void on_tabBar_currentChanged( int index ); | |||
void on_pbtnLicenseDetails_pressed(); | void on_pbtnLicenseDetails_pressed(); | |||
void on_cboVariantName_currentIndexChanged( int index ); | void on_cboVariantName_currentIndexChanged( int index ); | |||
void onFinished(); | void onFinished(); | |||
void on_buttonBox_helpRequested(); | void on_buttonBox_helpRequested(); | |||
/* void refresh(); */ | /* void refresh(); */ | |||
protected: | protected: | |||
void updatePreview( bool clear = false ); | void updatePreview( bool clear = false ); | |||
skipping to change at line 71 | skipping to change at line 72 | |||
void updateTreeView( QgsCptCityDataItem *item, bool resetRamp = true ); | void updateTreeView( QgsCptCityDataItem *item, bool resetRamp = true ); | |||
void updateListWidget( QgsCptCityDataItem *item ); | void updateListWidget( QgsCptCityDataItem *item ); | |||
bool eventFilter( QObject *obj, QEvent *event ); | bool eventFilter( QObject *obj, QEvent *event ); | |||
QgsCptCityColorRampV2* mRamp; | QgsCptCityColorRampV2* mRamp; | |||
QgsCptCityArchive* mArchive; | QgsCptCityArchive* mArchive; | |||
QgsCptCityBrowserModel::ViewType mArchiveViewType; | QgsCptCityBrowserModel::ViewType mArchiveViewType; | |||
/* void refreshModel( const QModelIndex& index ); */ | /* void refreshModel( const QModelIndex& index ); */ | |||
bool updateRamp(); | bool updateRamp(); | |||
void showAll(); | ||||
void setTreeModel( QgsCptCityBrowserModel* model ); | void setTreeModel( QgsCptCityBrowserModel* model ); | |||
QgsCptCityBrowserModel* mModel; | QgsCptCityBrowserModel* mModel; | |||
QgsCptCityBrowserModel* mAuthorsModel; | QgsCptCityBrowserModel* mAuthorsModel; | |||
QgsCptCityBrowserModel* mSelectionsModel; | QgsCptCityBrowserModel* mSelectionsModel; | |||
TreeFilterProxyModel* mTreeFilter; | TreeFilterProxyModel* mTreeFilter; | |||
QVector<QgsCptCityColorRampItem*> mListRamps; | QVector<QgsCptCityColorRampItem*> mListRamps; | |||
}; | }; | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 2 lines changed or added | |||
qgscrscache.h | qgscrscache.h | |||
---|---|---|---|---|
skipping to change at line 35 | skipping to change at line 35 | |||
/**Cache coordinate transform by authid of source/dest transformation to av oid the | /**Cache coordinate transform by authid of source/dest transformation to av oid the | |||
overhead of initialisation for each redraw*/ | overhead of initialisation for each redraw*/ | |||
class CORE_EXPORT QgsCoordinateTransformCache | class CORE_EXPORT QgsCoordinateTransformCache | |||
{ | { | |||
public: | public: | |||
static QgsCoordinateTransformCache* instance(); | static QgsCoordinateTransformCache* instance(); | |||
~QgsCoordinateTransformCache(); | ~QgsCoordinateTransformCache(); | |||
/**Returns coordinate transformation. Cache keeps ownership | /**Returns coordinate transformation. Cache keeps ownership | |||
@param srcAuthId auth id string of source crs | @param srcAuthId auth id string of source crs | |||
@param destAuthId auth id string of dest crs*/ | @param destAuthId auth id string of dest crs | |||
const QgsCoordinateTransform* transform( const QString& srcAuthId, cons | @param srcDatumTransform id of source's datum transform | |||
t QString& destAuthId ); | @param destDatumTransform id of destinations's datum transform | |||
*/ | ||||
const QgsCoordinateTransform* transform( const QString& srcAuthId, cons | ||||
t QString& destAuthId, int srcDatumTransform = -1, int destDatumTransform = | ||||
-1 ); | ||||
/**Removes transformations where a changed crs is involved from the cac he*/ | /**Removes transformations where a changed crs is involved from the cac he*/ | |||
void invalidateCrs( const QString& crsAuthId ); | void invalidateCrs( const QString& crsAuthId ); | |||
private: | private: | |||
static QgsCoordinateTransformCache* mInstance; | static QgsCoordinateTransformCache* mInstance; | |||
QHash< QPair< QString, QString >, QgsCoordinateTransform* > mTransforms ; | QMultiHash< QPair< QString, QString >, QgsCoordinateTransform* > mTrans forms; //same auth_id pairs might have different datum transformations | |||
}; | }; | |||
class CORE_EXPORT QgsCRSCache | class CORE_EXPORT QgsCRSCache | |||
{ | { | |||
public: | public: | |||
static QgsCRSCache* instance(); | static QgsCRSCache* instance(); | |||
~QgsCRSCache(); | ~QgsCRSCache(); | |||
/**Returns the CRS for authid, e.g. 'EPSG:4326' (or an invalid CRS in c ase of error)*/ | /**Returns the CRS for authid, e.g. 'EPSG:4326' (or an invalid CRS in c ase of error)*/ | |||
const QgsCoordinateReferenceSystem& crsByAuthId( const QString& authid ); | const QgsCoordinateReferenceSystem& crsByAuthId( const QString& authid ); | |||
const QgsCoordinateReferenceSystem& crsByEpsgId( long epsg ); | const QgsCoordinateReferenceSystem& crsByEpsgId( long epsg ); | |||
void updateCRSCache( const QString &authid ); | void updateCRSCache( const QString &authid ); | |||
protected: | protected: | |||
QgsCRSCache(); | QgsCRSCache(); | |||
private: | private: | |||
static QgsCRSCache* mInstance; | ||||
QHash< QString, QgsCoordinateReferenceSystem > mCRS; | QHash< QString, QgsCoordinateReferenceSystem > mCRS; | |||
/**CRS that is not initialised (returned in case of error)*/ | /**CRS that is not initialised (returned in case of error)*/ | |||
QgsCoordinateReferenceSystem mInvalidCRS; | QgsCoordinateReferenceSystem mInvalidCRS; | |||
}; | }; | |||
#endif // QGSCRSCACHE_H | #endif // QGSCRSCACHE_H | |||
End of changes. 3 change blocks. | ||||
5 lines changed or deleted | 8 lines changed or added | |||
qgsdatadefinedsymboldialog.h | qgsdatadefinedsymboldialog.h | |||
---|---|---|---|---|
skipping to change at line 34 | skipping to change at line 34 | |||
QgsDataDefinedSymbolDialog( const QList< DataDefinedSymbolEntry >& entr ies, const QgsVectorLayer* vl, QWidget * parent = 0, Qt::WindowFlags f = 0 ); | QgsDataDefinedSymbolDialog( const QList< DataDefinedSymbolEntry >& entr ies, const QgsVectorLayer* vl, QWidget * parent = 0, Qt::WindowFlags f = 0 ); | |||
~QgsDataDefinedSymbolDialog(); | ~QgsDataDefinedSymbolDialog(); | |||
QMap< QString, QString > dataDefinedProperties() const; | QMap< QString, QString > dataDefinedProperties() const; | |||
//common help texts | //common help texts | |||
static QString doubleHelpText(); | static QString doubleHelpText(); | |||
static QString colorHelpText(); | static QString colorHelpText(); | |||
static QString offsetHelpText(); | static QString offsetHelpText(); | |||
static QString fileNameHelpText(); | static QString fileNameHelpText(); | |||
static QString horizontalAnchorHelpText(); | ||||
static QString verticalAnchorHelpText(); | ||||
static QString gradientTypeHelpText(); | ||||
static QString gradientCoordModeHelpText(); | ||||
static QString gradientSpreadHelpText(); | ||||
static QString boolHelpText(); | ||||
private slots: | private slots: | |||
void expressionButtonClicked(); | void expressionButtonClicked(); | |||
private: | private: | |||
const QgsVectorLayer* mVectorLayer; | const QgsVectorLayer* mVectorLayer; | |||
/**Tries to fiend a combo box field for an expression string (consideri ng whitespaces, brackets around attribute names) | /**Tries to fiend a combo box field for an expression string (consideri ng whitespaces, brackets around attribute names) | |||
@return index or -1 in case not found*/ | @return index or -1 in case not found*/ | |||
int comboIndexForExpressionString( const QString& expr, const QComboBox * cb ); | int comboIndexForExpressionString( const QString& expr, const QComboBox * cb ); | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 6 lines changed or added | |||
qgsdataitem.h | qgsdataitem.h | |||
---|---|---|---|---|
skipping to change at line 73 | skipping to change at line 73 | |||
// Create vector of children | // Create vector of children | |||
virtual QVector<QgsDataItem*> createChildren(); | virtual QVector<QgsDataItem*> createChildren(); | |||
// Populate children using children vector created by createChildren() | // Populate children using children vector created by createChildren() | |||
virtual void populate(); | virtual void populate(); | |||
bool isPopulated() { return mPopulated; } | bool isPopulated() { return mPopulated; } | |||
// Insert new child using alphabetical order based on mName, emits nece ssary signal to model before and after, sets parent and connects signals | // Insert new child using alphabetical order based on mName, emits nece ssary signal to model before and after, sets parent and connects signals | |||
// refresh - refresh populated item, emit signals to model | // refresh - refresh populated item, emit signals to model | |||
virtual void addChildItem( QgsDataItem * child, bool refresh = false ); | virtual void addChildItem( QgsDataItem *child, bool refresh = false ); | |||
// remove and delete child item, signals to browser are emitted | // remove and delete child item, signals to browser are emitted | |||
virtual void deleteChildItem( QgsDataItem * child ); | virtual void deleteChildItem( QgsDataItem * child ); | |||
// remove child item but don't delete it, signals to browser are emitte d | // remove child item but don't delete it, signals to browser are emitte d | |||
// returns pointer to the removed item or null if no such item was foun d | // returns pointer to the removed item or null if no such item was foun d | |||
virtual QgsDataItem * removeChildItem( QgsDataItem * child ); | virtual QgsDataItem *removeChildItem( QgsDataItem * child ); | |||
virtual bool equal( const QgsDataItem *other ); | virtual bool equal( const QgsDataItem *other ); | |||
virtual QWidget * paramWidget() { return 0; } | virtual QWidget * paramWidget() { return 0; } | |||
// list of actions provided by this item - usually used for popup menu on right-click | // list of actions provided by this item - usually used for popup menu on right-click | |||
virtual QList<QAction*> actions() { return QList<QAction*>(); } | virtual QList<QAction*> actions() { return QList<QAction*>(); } | |||
// whether accepts drag&drop'd layers - e.g. for import | // whether accepts drag&drop'd layers - e.g. for import | |||
virtual bool acceptDrop() { return false; } | virtual bool acceptDrop() { return false; } | |||
skipping to change at line 260 | skipping to change at line 260 | |||
Data item that can be used to report problems (e.g. network error) | Data item that can be used to report problems (e.g. network error) | |||
*/ | */ | |||
class CORE_EXPORT QgsErrorItem : public QgsDataItem | class CORE_EXPORT QgsErrorItem : public QgsDataItem | |||
{ | { | |||
Q_OBJECT | Q_OBJECT | |||
public: | public: | |||
QgsErrorItem( QgsDataItem* parent, QString error, QString path ); | QgsErrorItem( QgsDataItem* parent, QString error, QString path ); | |||
~QgsErrorItem(); | ~QgsErrorItem(); | |||
//QVector<QgsDataItem*> createChildren(); | ||||
//virtual bool equal( const QgsDataItem *other ); | ||||
}; | }; | |||
// --------- | // --------- | |||
class CORE_EXPORT QgsDirectoryParamWidget : public QTreeWidget | class CORE_EXPORT QgsDirectoryParamWidget : public QTreeWidget | |||
{ | { | |||
Q_OBJECT | Q_OBJECT | |||
public: | public: | |||
QgsDirectoryParamWidget( QString path, QWidget* parent = NULL ); | QgsDirectoryParamWidget( QString path, QWidget* parent = NULL ); | |||
skipping to change at line 316 | skipping to change at line 314 | |||
QgsZipItem( QgsDataItem* parent, QString name, QString path ); | QgsZipItem( QgsDataItem* parent, QString name, QString path ); | |||
~QgsZipItem(); | ~QgsZipItem(); | |||
QVector<QgsDataItem*> createChildren(); | QVector<QgsDataItem*> createChildren(); | |||
const QStringList & getZipFileList(); | const QStringList & getZipFileList(); | |||
//! @note not available via python bindings | //! @note not available via python bindings | |||
static QVector<dataItem_t *> mDataItemPtr; | static QVector<dataItem_t *> mDataItemPtr; | |||
static QStringList mProviderNames; | static QStringList mProviderNames; | |||
static QString vsiPrefix( QString uri ); | static QString vsiPrefix( QString uri ) { return qgsVsiPrefix( uri ); } | |||
static QgsDataItem* itemFromPath( QgsDataItem* parent, QString path, QS tring name ); | static QgsDataItem* itemFromPath( QgsDataItem* parent, QString path, QS tring name ); | |||
static const QIcon &iconZip(); | static const QIcon &iconZip(); | |||
}; | }; | |||
#endif // QGSDATAITEM_H | #endif // QGSDATAITEM_H | |||
End of changes. 4 change blocks. | ||||
5 lines changed or deleted | 3 lines changed or added | |||
qgsdiagram.h | qgsdiagram.h | |||
---|---|---|---|---|
skipping to change at line 29 | skipping to change at line 29 | |||
#include <QPen> | #include <QPen> | |||
#include <QBrush> | #include <QBrush> | |||
class QPainter; | class QPainter; | |||
class QPointF; | class QPointF; | |||
class QgsDiagramSettings; | class QgsDiagramSettings; | |||
class QgsDiagramInterpolationSettings; | class QgsDiagramInterpolationSettings; | |||
class QgsRenderContext; | class QgsRenderContext; | |||
class QgsExpression; | ||||
/**Base class for all diagram types*/ | /**Base class for all diagram types*/ | |||
class CORE_EXPORT QgsDiagram | class CORE_EXPORT QgsDiagram | |||
{ | { | |||
public: | public: | |||
virtual ~QgsDiagram() {} | virtual ~QgsDiagram() { clearCache(); } | |||
void clearCache(); | ||||
QgsExpression* getExpression( const QString& expression, const QgsField | ||||
s* fields ); | ||||
/** @deprecated `void renderDiagram( const QgsFeature& feature, QgsRend | ||||
erContext& c, const QgsDiagramSettings& s, const QPointF& position )` shoul | ||||
d be used instead */ | ||||
virtual Q_DECL_DEPRECATED void renderDiagram( const QgsAttributes& att, | ||||
QgsRenderContext& c, const QgsDiagramSettings& s, const QPointF& position | ||||
); | ||||
/**Draws the diagram at the given position (in pixel coordinates)*/ | /**Draws the diagram at the given position (in pixel coordinates)*/ | |||
virtual void renderDiagram( const QgsAttributes& att, QgsRenderContext& c, const QgsDiagramSettings& s, const QPointF& position ) = 0; | virtual void renderDiagram( const QgsFeature& feature, QgsRenderContext & c, const QgsDiagramSettings& s, const QPointF& position ) = 0; | |||
virtual QString diagramName() const = 0; | virtual QString diagramName() const = 0; | |||
/**Returns the size in map units the diagram will use to render.*/ | /**Returns the size in map units the diagram will use to render.*/ | |||
virtual QSizeF diagramSize( const QgsAttributes& attributes, const QgsR enderContext& c, const QgsDiagramSettings& s ) = 0; | virtual QSizeF diagramSize( const QgsAttributes& attributes, const QgsR enderContext& c, const QgsDiagramSettings& s ) = 0; | |||
/** @deprecated `QSizeF diagramSize( const QgsFeature& feature, const Q | ||||
gsRenderContext& c, const QgsDiagramSettings& s, const QgsDiagramInterpolat | ||||
ionSettings& is )` should be used instead */ | ||||
virtual Q_DECL_DEPRECATED QSizeF diagramSize( const QgsAttributes& attr | ||||
ibutes, const QgsRenderContext& c, const QgsDiagramSettings& s, const QgsDi | ||||
agramInterpolationSettings& is ); | ||||
/**Returns the size in map units the diagram will use to render. Interp olate size*/ | /**Returns the size in map units the diagram will use to render. Interp olate size*/ | |||
virtual QSizeF diagramSize( const QgsAttributes& attributes, const QgsR enderContext& c, const QgsDiagramSettings& s, const QgsDiagramInterpolation Settings& is ) = 0; | virtual QSizeF diagramSize( const QgsFeature& feature, const QgsRenderC ontext& c, const QgsDiagramSettings& s, const QgsDiagramInterpolationSettin gs& is ) = 0; | |||
protected: | protected: | |||
/** Changes the pen width to match the current settings and rendering c ontext | /** Changes the pen width to match the current settings and rendering c ontext | |||
* @param pen The pen to modify | * @param pen The pen to modify | |||
* @param s The settings that specify the pen width | * @param s The settings that specify the pen width | |||
* @param c The rendering specifying the proper scale units for pixe l conversion | * @param c The rendering specifying the proper scale units for pixe l conversion | |||
*/ | */ | |||
void setPenWidth( QPen& pen, const QgsDiagramSettings& s, const QgsRend erContext& c ); | void setPenWidth( QPen& pen, const QgsDiagramSettings& s, const QgsRend erContext& c ); | |||
/** Calculates a size to match the current settings and rendering conte xt | /** Calculates a size to match the current settings and rendering conte xt | |||
skipping to change at line 75 | skipping to change at line 83 | |||
*/ | */ | |||
float sizePainterUnits( float l, const QgsDiagramSettings& s, const Qgs RenderContext& c ); | float sizePainterUnits( float l, const QgsDiagramSettings& s, const Qgs RenderContext& c ); | |||
/** Calculates a size to match the current settings and rendering conte xt | /** Calculates a size to match the current settings and rendering conte xt | |||
* @param s The settings that contain the font size and size type | * @param s The settings that contain the font size and size type | |||
* @param c The rendering specifying the proper scale units for pix el conversion | * @param c The rendering specifying the proper scale units for pix el conversion | |||
* | * | |||
* @return The properly scaled font for rendering | * @return The properly scaled font for rendering | |||
*/ | */ | |||
QFont scaledFont( const QgsDiagramSettings& s, const QgsRenderContext& c ); | QFont scaledFont( const QgsDiagramSettings& s, const QgsRenderContext& c ); | |||
private: | ||||
QMap<QString, QgsExpression*> mExpressions; | ||||
}; | }; | |||
#endif // QGSDIAGRAM_H | #endif // QGSDIAGRAM_H | |||
End of changes. 6 change blocks. | ||||
3 lines changed or deleted | 23 lines changed or added | |||
qgsdiagramrendererv2.h | qgsdiagramrendererv2.h | |||
---|---|---|---|---|
skipping to change at line 126 | skipping to change at line 126 | |||
Up, | Up, | |||
Down, | Down, | |||
Left, | Left, | |||
Right | Right | |||
}; | }; | |||
QgsDiagramSettings(): sizeType( MM ), minScaleDenominator( -1 ), maxSca leDenominator( -1 ) | QgsDiagramSettings(): sizeType( MM ), minScaleDenominator( -1 ), maxSca leDenominator( -1 ) | |||
{} | {} | |||
QFont font; | QFont font; | |||
QList< QColor > categoryColors; | QList< QColor > categoryColors; | |||
QList< int > categoryIndices; | QList< QString > categoryAttributes; | |||
QSizeF size; //size | QSizeF size; //size | |||
SizeType sizeType; //mm or map units | SizeType sizeType; //mm or map units | |||
QColor backgroundColor; | QColor backgroundColor; | |||
QColor penColor; | QColor penColor; | |||
double penWidth; | double penWidth; | |||
LabelPlacementMethod labelPlacementMethod; | LabelPlacementMethod labelPlacementMethod; | |||
DiagramOrientation diagramOrientation; | DiagramOrientation diagramOrientation; | |||
double barWidth; | double barWidth; | |||
int transparency; // 0 - 100 | int transparency; // 0 - 100 | |||
bool scaleByArea; | bool scaleByArea; | |||
skipping to change at line 160 | skipping to change at line 160 | |||
//additional diagram settings for interpolated size rendering | //additional diagram settings for interpolated size rendering | |||
class CORE_EXPORT QgsDiagramInterpolationSettings | class CORE_EXPORT QgsDiagramInterpolationSettings | |||
{ | { | |||
public: | public: | |||
QSizeF lowerSize; | QSizeF lowerSize; | |||
QSizeF upperSize; | QSizeF upperSize; | |||
double lowerValue; | double lowerValue; | |||
double upperValue; | double upperValue; | |||
/**Index of the classification attribute*/ | /**Index of the classification attribute*/ | |||
int classificationAttribute; | int classificationAttribute; | |||
QString classificationAttributeExpression; | ||||
bool classificationAttributeIsExpression; | ||||
}; | }; | |||
/**Returns diagram settings for a feature*/ | /**Returns diagram settings for a feature*/ | |||
class CORE_EXPORT QgsDiagramRendererV2 | class CORE_EXPORT QgsDiagramRendererV2 | |||
{ | { | |||
public: | public: | |||
QgsDiagramRendererV2(); | QgsDiagramRendererV2(); | |||
virtual ~QgsDiagramRendererV2(); | virtual ~QgsDiagramRendererV2(); | |||
/**Returns size of the diagram for feature f in map units. Returns an i | /**Returns size of the diagram for a feature in map units. Returns an i | |||
nvalid QSizeF in case of error*/ | nvalid QSizeF in case of error*/ | |||
virtual QSizeF sizeMapUnits( const QgsAttributes& attributes, const Qgs | virtual QSizeF sizeMapUnits( const QgsFeature& feature, const QgsRender | |||
RenderContext& c ); | Context& c ); | |||
virtual QString rendererName() const = 0; | virtual QString rendererName() const = 0; | |||
/**Returns attribute indices needed for diagram rendering*/ | /**Returns attribute indices needed for diagram rendering*/ | |||
virtual QList<int> diagramAttributes() const = 0; | virtual QList<QString> diagramAttributes() const = 0; | |||
void renderDiagram( const QgsAttributes& att, QgsRenderContext& c, cons t QPointF& pos ); | void renderDiagram( const QgsFeature& feature, QgsRenderContext& c, con st QPointF& pos ); | |||
void setDiagram( QgsDiagram* d ); | void setDiagram( QgsDiagram* d ); | |||
const QgsDiagram* diagram() const { return mDiagram; } | QgsDiagram* diagram() const { return mDiagram; } | |||
/**Returns list with all diagram settings in the renderer*/ | /**Returns list with all diagram settings in the renderer*/ | |||
virtual QList<QgsDiagramSettings> diagramSettings() const = 0; | virtual QList<QgsDiagramSettings> diagramSettings() const = 0; | |||
virtual void readXML( const QDomElement& elem, const QgsVectorLayer* la yer ) = 0; | virtual void readXML( const QDomElement& elem, const QgsVectorLayer* la yer ) = 0; | |||
virtual void writeXML( QDomElement& layerElem, QDomDocument& doc, const QgsVectorLayer* layer ) const = 0; | virtual void writeXML( QDomElement& layerElem, QDomDocument& doc, const QgsVectorLayer* layer ) const = 0; | |||
protected: | protected: | |||
/**Returns diagram settings for a feature (or false if the diagram for the feature is not to be rendered). Used internally within renderDiagram() | /**Returns diagram settings for a feature (or false if the diagram for the feature is not to be rendered). Used internally within renderDiagram() | |||
* @param att attribute map | * @param feature the feature | |||
* @param c render context | * @param c render context | |||
* @param s out: diagram settings for the feature | * @param s out: diagram settings for the feature | |||
*/ | */ | |||
virtual bool diagramSettings( const QgsAttributes& att, const QgsRender Context& c, QgsDiagramSettings& s ) = 0; | virtual bool diagramSettings( const QgsFeature &feature, const QgsRende rContext& c, QgsDiagramSettings& s ) = 0; | |||
/**Returns size of the diagram (in painter units) or an invalid size in case of error*/ | /**Returns size of the diagram (in painter units) or an invalid size in case of error*/ | |||
virtual QSizeF diagramSize( const QgsAttributes& attributes, const QgsR enderContext& c ) = 0; | virtual QSizeF diagramSize( const QgsFeature& features, const QgsRender Context& c ) = 0; | |||
/**Converts size from mm to map units*/ | /**Converts size from mm to map units*/ | |||
void convertSizeToMapUnits( QSizeF& size, const QgsRenderContext& conte xt ) const; | void convertSizeToMapUnits( QSizeF& size, const QgsRenderContext& conte xt ) const; | |||
/**Returns the paint device dpi (or -1 in case of error*/ | /**Returns the paint device dpi (or -1 in case of error*/ | |||
static int dpiPaintDevice( const QPainter* ); | static int dpiPaintDevice( const QPainter* ); | |||
//read / write diagram | //read / write diagram | |||
void _readXML( const QDomElement& elem, const QgsVectorLayer* layer ); | void _readXML( const QDomElement& elem, const QgsVectorLayer* layer ); | |||
void _writeXML( QDomElement& rendererElem, QDomDocument& doc, const Qgs VectorLayer* layer ) const; | void _writeXML( QDomElement& rendererElem, QDomDocument& doc, const Qgs VectorLayer* layer ) const; | |||
skipping to change at line 224 | skipping to change at line 226 | |||
/**Renders the diagrams for all features with the same settings*/ | /**Renders the diagrams for all features with the same settings*/ | |||
class CORE_EXPORT QgsSingleCategoryDiagramRenderer : public QgsDiagramRende rerV2 | class CORE_EXPORT QgsSingleCategoryDiagramRenderer : public QgsDiagramRende rerV2 | |||
{ | { | |||
public: | public: | |||
QgsSingleCategoryDiagramRenderer(); | QgsSingleCategoryDiagramRenderer(); | |||
~QgsSingleCategoryDiagramRenderer(); | ~QgsSingleCategoryDiagramRenderer(); | |||
QString rendererName() const { return "SingleCategory"; } | QString rendererName() const { return "SingleCategory"; } | |||
QList<int> diagramAttributes() const { return mSettings.categoryIndices ; } | QList<QString> diagramAttributes() const { return mSettings.categoryAtt ributes; } | |||
void setDiagramSettings( const QgsDiagramSettings& s ) { mSettings = s; } | void setDiagramSettings( const QgsDiagramSettings& s ) { mSettings = s; } | |||
QList<QgsDiagramSettings> diagramSettings() const; | QList<QgsDiagramSettings> diagramSettings() const; | |||
void readXML( const QDomElement& elem, const QgsVectorLayer* layer ); | void readXML( const QDomElement& elem, const QgsVectorLayer* layer ); | |||
void writeXML( QDomElement& layerElem, QDomDocument& doc, const QgsVect orLayer* layer ) const; | void writeXML( QDomElement& layerElem, QDomDocument& doc, const QgsVect orLayer* layer ) const; | |||
protected: | protected: | |||
bool diagramSettings( const QgsAttributes&, const QgsRenderContext& c, QgsDiagramSettings& s ); | bool diagramSettings( const QgsFeature &feature, const QgsRenderContext & c, QgsDiagramSettings& s ); | |||
QSizeF diagramSize( const QgsAttributes& attributes, const QgsRenderCon text& c ); | QSizeF diagramSize( const QgsFeature&, const QgsRenderContext& c ); | |||
private: | private: | |||
QgsDiagramSettings mSettings; | QgsDiagramSettings mSettings; | |||
}; | }; | |||
class CORE_EXPORT QgsLinearlyInterpolatedDiagramRenderer : public QgsDiagra mRendererV2 | class CORE_EXPORT QgsLinearlyInterpolatedDiagramRenderer : public QgsDiagra mRendererV2 | |||
{ | { | |||
public: | public: | |||
QgsLinearlyInterpolatedDiagramRenderer(); | QgsLinearlyInterpolatedDiagramRenderer(); | |||
~QgsLinearlyInterpolatedDiagramRenderer(); | ~QgsLinearlyInterpolatedDiagramRenderer(); | |||
/**Returns list with all diagram settings in the renderer*/ | /**Returns list with all diagram settings in the renderer*/ | |||
QList<QgsDiagramSettings> diagramSettings() const; | QList<QgsDiagramSettings> diagramSettings() const; | |||
void setDiagramSettings( const QgsDiagramSettings& s ) { mSettings = s; } | void setDiagramSettings( const QgsDiagramSettings& s ) { mSettings = s; } | |||
QList<int> diagramAttributes() const; | QList<QString> diagramAttributes() const; | |||
QString rendererName() const { return "LinearlyInterpolated"; } | QString rendererName() const { return "LinearlyInterpolated"; } | |||
void setLowerValue( double val ) { mInterpolationSettings.lowerValue = val; } | void setLowerValue( double val ) { mInterpolationSettings.lowerValue = val; } | |||
double lowerValue() const { return mInterpolationSettings.lowerValue; } | double lowerValue() const { return mInterpolationSettings.lowerValue; } | |||
void setUpperValue( double val ) { mInterpolationSettings.upperValue = val; } | void setUpperValue( double val ) { mInterpolationSettings.upperValue = val; } | |||
double upperValue() const { return mInterpolationSettings.upperValue; } | double upperValue() const { return mInterpolationSettings.upperValue; } | |||
void setLowerSize( QSizeF s ) { mInterpolationSettings.lowerSize = s; } | void setLowerSize( QSizeF s ) { mInterpolationSettings.lowerSize = s; } | |||
QSizeF lowerSize() const { return mInterpolationSettings.lowerSize; } | QSizeF lowerSize() const { return mInterpolationSettings.lowerSize; } | |||
void setUpperSize( QSizeF s ) { mInterpolationSettings.upperSize = s; } | void setUpperSize( QSizeF s ) { mInterpolationSettings.upperSize = s; } | |||
QSizeF upperSize() const { return mInterpolationSettings.upperSize; } | QSizeF upperSize() const { return mInterpolationSettings.upperSize; } | |||
int classificationAttribute() const { return mInterpolationSettings.cla ssificationAttribute; } | int classificationAttribute() const { return mInterpolationSettings.cla ssificationAttribute; } | |||
void setClassificationAttribute( int index ) { mInterpolationSettings.c lassificationAttribute = index; } | void setClassificationAttribute( int index ) { mInterpolationSettings.c lassificationAttribute = index; } | |||
QString classificationAttributeExpression() const { return mInterpolati | ||||
onSettings.classificationAttributeExpression; } | ||||
void setClassificationAttributeExpression( QString expression ) { mInte | ||||
rpolationSettings.classificationAttributeExpression = expression; } | ||||
bool classificationAttributeIsExpression() const { return mInterpolatio | ||||
nSettings.classificationAttributeIsExpression; } | ||||
void setClassificationAttributeIsExpression( bool isExpression ) { mInt | ||||
erpolationSettings.classificationAttributeIsExpression = isExpression; } | ||||
void readXML( const QDomElement& elem, const QgsVectorLayer* layer ); | void readXML( const QDomElement& elem, const QgsVectorLayer* layer ); | |||
void writeXML( QDomElement& layerElem, QDomDocument& doc, const QgsVect orLayer* layer ) const; | void writeXML( QDomElement& layerElem, QDomDocument& doc, const QgsVect orLayer* layer ) const; | |||
protected: | protected: | |||
bool diagramSettings( const QgsAttributes&, const QgsRenderContext& c, QgsDiagramSettings& s ); | bool diagramSettings( const QgsFeature &feature, const QgsRenderContext & c, QgsDiagramSettings& s ); | |||
QSizeF diagramSize( const QgsAttributes& attributes, const QgsRenderCon text& c ); | QSizeF diagramSize( const QgsFeature&, const QgsRenderContext& c ); | |||
private: | private: | |||
QgsDiagramSettings mSettings; | QgsDiagramSettings mSettings; | |||
QgsDiagramInterpolationSettings mInterpolationSettings; | QgsDiagramInterpolationSettings mInterpolationSettings; | |||
}; | }; | |||
#endif // QGSDIAGRAMRENDERERV2_H | #endif // QGSDIAGRAMRENDERERV2_H | |||
End of changes. 16 change blocks. | ||||
17 lines changed or deleted | 29 lines changed or added | |||
qgsdistancearea.h | qgsdistancearea.h | |||
---|---|---|---|---|
skipping to change at line 58 | skipping to change at line 58 | |||
//! sets whether coordinates must be projected to ellipsoid before meas uring | //! sets whether coordinates must be projected to ellipsoid before meas uring | |||
void setEllipsoidalMode( bool flag ); | void setEllipsoidalMode( bool flag ); | |||
//! returns projections enabled flag | //! returns projections enabled flag | |||
bool ellipsoidalEnabled() const { return mEllipsoidalMode; } | bool ellipsoidalEnabled() const { return mEllipsoidalMode; } | |||
//! sets source spatial reference system (by QGIS CRS) | //! sets source spatial reference system (by QGIS CRS) | |||
void setSourceCrs( long srsid ); | void setSourceCrs( long srsid ); | |||
/** | ||||
* Sets source spatial reference system (by QGIS CRS) | ||||
* @note: missing in Python bindings in QGIS < 2.2 | ||||
*/ | ||||
void setSourceCrs( const QgsCoordinateReferenceSystem& srcCRS ); | ||||
//! sets source spatial reference system by authid | //! sets source spatial reference system by authid | |||
void setSourceAuthId( QString authid ); | void setSourceAuthId( QString authid ); | |||
//! returns source spatial reference system | //! returns source spatial reference system | |||
long sourceCrs() { return mSourceRefSys; } | long sourceCrs() const { return mSourceRefSys; } | |||
//! What sort of coordinate system is being used? | //! What sort of coordinate system is being used? | |||
bool geographic() { return mCoordTransform->sourceCrs().geographicFlag( ); } | bool geographic() const { return mCoordTransform->sourceCrs().geographi cFlag(); } | |||
//! sets ellipsoid by its acronym | //! sets ellipsoid by its acronym | |||
bool setEllipsoid( const QString& ellipsoid ); | bool setEllipsoid( const QString& ellipsoid ); | |||
//! Sets ellipsoid by supplied radii | //! Sets ellipsoid by supplied radii | |||
// Inverse flattening is calculated with invf = a/(a-b) | // Inverse flattening is calculated with invf = a/(a-b) | |||
bool setEllipsoid( double semiMajor, double semiMinor ); | bool setEllipsoid( double semiMajor, double semiMinor ); | |||
//! returns ellipsoid's acronym | //! returns ellipsoid's acronym | |||
const QString& ellipsoid() { return mEllipsoid; } | const QString& ellipsoid() const { return mEllipsoid; } | |||
//! returns ellipsoid's semi major axis | //! returns ellipsoid's semi major axis | |||
double ellipsoidSemiMajor() { return mSemiMajor; } | double ellipsoidSemiMajor() const { return mSemiMajor; } | |||
//! returns ellipsoid's semi minor axis | //! returns ellipsoid's semi minor axis | |||
double ellipsoidSemiMinor() { return mSemiMinor; } | double ellipsoidSemiMinor() const { return mSemiMinor; } | |||
//! returns ellipsoid's inverse flattening | //! returns ellipsoid's inverse flattening | |||
double ellipsoidInverseFlattening() { return mInvFlattening; } | double ellipsoidInverseFlattening() const { return mInvFlattening; } | |||
//! general measurement (line distance or polygon area) | //! general measurement (line distance or polygon area) | |||
double measure( QgsGeometry* geometry ); | double measure( QgsGeometry* geometry ); | |||
//! measures perimeter of polygon | //! measures perimeter of polygon | |||
double measurePerimeter( QgsGeometry* geometry ); | double measurePerimeter( QgsGeometry* geometry ); | |||
//! measures line | //! measures line | |||
double measureLine( const QList<QgsPoint>& points ); | double measureLine( const QList<QgsPoint>& points ); | |||
End of changes. 7 change blocks. | ||||
6 lines changed or deleted | 12 lines changed or added | |||
qgsdualview.h | qgsdualview.h | |||
---|---|---|---|---|
skipping to change at line 21 | skipping to change at line 21 | |||
* the Free Software Foundation; either version 2 of the License, or * | * the Free Software Foundation; either version 2 of the License, or * | |||
* (at your option) any later version. * | * (at your option) any later version. * | |||
* * | * * | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef QGSFEATURELIST_H | #ifndef QGSFEATURELIST_H | |||
#define QGSFEATURELIST_H | #define QGSFEATURELIST_H | |||
#include <QStackedWidget> | #include <QStackedWidget> | |||
#include "qgsdistancearea.h" | #include "ui_qgsdualviewbase.h" | |||
#include "qgsattributeeditorcontext.h" | ||||
#include "qgsattributetablefiltermodel.h" | #include "qgsattributetablefiltermodel.h" | |||
#include "qgscachedfeatureiterator.h" | #include "qgscachedfeatureiterator.h" | |||
#include "ui_qgsdualviewbase.h" | #include "qgsdistancearea.h" | |||
class QgsFeatureRequest; | ||||
class QgsAttributeDialog; | class QgsAttributeDialog; | |||
class QgsFeatureRequest; | ||||
class QSignalMapper; | class QSignalMapper; | |||
class QgsMapLayerAction; | ||||
/** | /** | |||
* This widget is used to show the attributes of a set of features of a {@l ink QgsVectorLayer}. | * This widget is used to show the attributes of a set of features of a {@l ink QgsVectorLayer}. | |||
* The attributes can be edited. | * The attributes can be edited. | |||
* It supports two different layouts: the table layout, in which the attrib utes for the features | * It supports two different layouts: the table layout, in which the attrib utes for the features | |||
* are shown in a table and the editor layout, where the features are shown as a selectable list | * are shown in a table and the editor layout, where the features are shown as a selectable list | |||
* and the attributes for the currently selected feature are shown in a for m. | * and the attributes for the currently selected feature are shown in a for m. | |||
* | * | |||
* @note Added in 2.0 | * @note Added in 2.0 | |||
*/ | */ | |||
skipping to change at line 77 | skipping to change at line 80 | |||
*/ | */ | |||
explicit QgsDualView( QWidget* parent = 0 ); | explicit QgsDualView( QWidget* parent = 0 ); | |||
virtual ~QgsDualView(); | virtual ~QgsDualView(); | |||
/** | /** | |||
* Has to be called to initialize the dual view. | * Has to be called to initialize the dual view. | |||
* | * | |||
* @param layer The layer which should be used to fetch features | * @param layer The layer which should be used to fetch features | |||
* @param mapCanvas The mapCanvas (used for the FilterMode | * @param mapCanvas The mapCanvas (used for the FilterMode | |||
* {@link QgsAttributeTableFilterModel::ShowVisible} | * {@link QgsAttributeTableFilterModel::ShowVisible} | |||
* @param myDa Used for attribute dialog creation | * @param request Use a modified request to limit the shown features | |||
* @param context The context in which this view is shown | ||||
*/ | */ | |||
void init( QgsVectorLayer* layer, QgsMapCanvas* mapCanvas, QgsDistanceA rea myDa ); | void init( QgsVectorLayer* layer, QgsMapCanvas* mapCanvas, const QgsFea tureRequest& request = QgsFeatureRequest(), QgsAttributeEditorContext conte xt = QgsAttributeEditorContext() ); | |||
/** | /** | |||
* Change the current view mode. | * Change the current view mode. | |||
* | * | |||
* @param view The view mode to set | * @param view The view mode to set | |||
*/ | */ | |||
void setView( ViewMode view ); | void setView( ViewMode view ); | |||
/** | /** | |||
* Set the filter mode | * Set the filter mode | |||
skipping to change at line 133 | skipping to change at line 137 | |||
*/ | */ | |||
void setFilteredFeatures( QgsFeatureIds filteredFeatures ); | void setFilteredFeatures( QgsFeatureIds filteredFeatures ); | |||
/** | /** | |||
* Returns the model which has the information about all features (not only filtered) | * Returns the model which has the information about all features (not only filtered) | |||
* | * | |||
* @return The master model | * @return The master model | |||
*/ | */ | |||
QgsAttributeTableModel* masterModel() const { return mMasterModel; } | QgsAttributeTableModel* masterModel() const { return mMasterModel; } | |||
void setRequest( const QgsFeatureRequest& request ); | ||||
void setFeatureSelectionManager( QgsIFeatureSelectionManager* featureSe | ||||
lectionManager ); | ||||
protected: | protected: | |||
/** | /** | |||
* Initializes widgets which depend on the attributes of this layer | * Initializes widgets which depend on the attributes of this layer | |||
*/ | */ | |||
void columnBoxInit(); | void columnBoxInit(); | |||
virtual void hideEvent( QHideEvent * ); | virtual void hideEvent( QHideEvent * ); | |||
virtual void focusOutEvent( QFocusEvent * ); | virtual void focusOutEvent( QFocusEvent * ); | |||
public slots: | public slots: | |||
/** | /** | |||
* @brief Set the current edit selection in the {@link AttributeEditor} mode. | * @brief Set the current edit selection in the {@link AttributeEditor} mode. | |||
* | * | |||
* @param fids A list of edited features (Currently only one at a tim e is supported) | * @param fids A list of edited features (Currently only one at a tim e is supported) | |||
*/ | */ | |||
void setCurrentEditSelection( const QgsFeatureIds& fids ); | void setCurrentEditSelection( const QgsFeatureIds& fids ); | |||
/** | /** | |||
* @brief saveEditChanges | * @brief saveEditChanges | |||
* | ||||
* @return true if the saving was ok. false is possible due to connecte | ||||
d | ||||
* validation logic. | ||||
*/ | */ | |||
void saveEditChanges(); | bool saveEditChanges(); | |||
/** | /** | |||
* Update the shown feature if an attribute changed | * Update the shown feature if an attribute changed | |||
*/ | */ | |||
void reloadAttribute( const int& attribute ); | void reloadAttribute( const int& attribute ); | |||
signals: | signals: | |||
/** | /** | |||
* Is emitted, whenever the display expression is successfully changed | * Is emitted, whenever the display expression is successfully changed | |||
* @param expression The expression that was applied | * @param expression The expression that was applied | |||
skipping to change at line 232 | skipping to change at line 243 | |||
virtual void progress( int i, bool& cancel ); | virtual void progress( int i, bool& cancel ); | |||
/** | /** | |||
* Will be called, once all the features are loaded. | * Will be called, once all the features are loaded. | |||
* Use e.g. to close a dialog created from {@link progress(int i,bool& cancel )} | * Use e.g. to close a dialog created from {@link progress(int i,bool& cancel )} | |||
*/ | */ | |||
virtual void finished(); | virtual void finished(); | |||
private: | private: | |||
void initLayerCache( QgsVectorLayer *layer ); | void initLayerCache( QgsVectorLayer *layer ); | |||
void initModels( QgsMapCanvas* mapCanvas ); | void initModels( QgsMapCanvas* mapCanvas, const QgsFeatureRequest& requ est ); | |||
QgsAttributeEditorContext mEditorContext; | ||||
QgsAttributeTableModel* mMasterModel; | QgsAttributeTableModel* mMasterModel; | |||
QgsAttributeTableFilterModel* mFilterModel; | QgsAttributeTableFilterModel* mFilterModel; | |||
QgsFeatureListModel* mFeatureListModel; | QgsFeatureListModel* mFeatureListModel; | |||
QgsAttributeDialog* mAttributeDialog; | QgsAttributeDialog* mAttributeDialog; | |||
QgsCachedFeatureIterator* mFeatureCache; | QgsCachedFeatureIterator* mFeatureCache; | |||
QSignalMapper* mPreviewActionMapper; | QSignalMapper* mPreviewActionMapper; | |||
QMenu* mPreviewColumnsMenu; | QMenu* mPreviewColumnsMenu; | |||
QgsVectorLayerCache* mLayerCache; | QgsVectorLayerCache* mLayerCache; | |||
QProgressDialog* mProgressDlg; | QProgressDialog* mProgressDlg; | |||
QgsIFeatureSelectionManager* mFeatureSelectionManager; | ||||
QgsDistanceArea mDistanceArea; | QgsDistanceArea mDistanceArea; | |||
friend class TestQgsDualView; | friend class TestQgsDualView; | |||
}; | }; | |||
class GUI_EXPORT QgsAttributeTableAction : public QAction | class GUI_EXPORT QgsAttributeTableAction : public QAction | |||
{ | { | |||
Q_OBJECT | Q_OBJECT | |||
public: | public: | |||
skipping to change at line 268 | skipping to change at line 280 | |||
public slots: | public slots: | |||
void execute(); | void execute(); | |||
void featureForm(); | void featureForm(); | |||
private: | private: | |||
QgsDualView* mDualView; | QgsDualView* mDualView; | |||
int mAction; | int mAction; | |||
QModelIndex mFieldIdx; | QModelIndex mFieldIdx; | |||
}; | }; | |||
class GUI_EXPORT QgsAttributeTableMapLayerAction : public QAction | ||||
{ | ||||
Q_OBJECT | ||||
public: | ||||
QgsAttributeTableMapLayerAction( const QString &name, QgsDualView *dual | ||||
View, QgsMapLayerAction* action, const QModelIndex &fieldIdx ) : | ||||
QAction( name, dualView ), mDualView( dualView ), mAction( action ) | ||||
, mFieldIdx( fieldIdx ) | ||||
{} | ||||
public slots: | ||||
void execute(); | ||||
private: | ||||
QgsDualView* mDualView; | ||||
QgsMapLayerAction* mAction; | ||||
QModelIndex mFieldIdx; | ||||
}; | ||||
#endif // QGSFEATURELIST_H | #endif // QGSFEATURELIST_H | |||
End of changes. 14 change blocks. | ||||
8 lines changed or deleted | 42 lines changed or added | |||
qgsellipsesymbollayerv2.h | qgsellipsesymbollayerv2.h | |||
---|---|---|---|---|
skipping to change at line 43 | skipping to change at line 43 | |||
void renderPoint( const QPointF& point, QgsSymbolV2RenderContext& conte xt ); | void renderPoint( const QPointF& point, QgsSymbolV2RenderContext& conte xt ); | |||
QString layerType() const; | QString layerType() const; | |||
void startRender( QgsSymbolV2RenderContext& context ); | void startRender( QgsSymbolV2RenderContext& context ); | |||
void stopRender( QgsSymbolV2RenderContext& context ); | void stopRender( QgsSymbolV2RenderContext& context ); | |||
QgsSymbolLayerV2* clone() const; | QgsSymbolLayerV2* clone() const; | |||
QgsStringMap properties() const; | QgsStringMap properties() const; | |||
void toSld( QDomDocument& doc, QDomElement &element, QgsStringMap props ) const; | void toSld( QDomDocument& doc, QDomElement &element, QgsStringMap props ) const; | |||
void writeSldMarker( QDomDocument& doc, QDomElement &element, QgsString Map props ) const; | void writeSldMarker( QDomDocument& doc, QDomElement &element, QgsString Map props ) const; | |||
bool writeDxf( QgsDxfExport& e, double mmMapUnitScaleFactor, const QStr | ||||
ing& layerName, const QgsSymbolV2RenderContext* context, const QgsFeature* | ||||
f, const QPointF& shift = QPointF( 0.0, 0.0 ) ) const; | ||||
void setSymbolName( const QString& name ) { mSymbolName = name; } | void setSymbolName( const QString& name ) { mSymbolName = name; } | |||
QString symbolName() const { return mSymbolName; } | QString symbolName() const { return mSymbolName; } | |||
void setSymbolWidth( double w ) { mSymbolWidth = w; } | void setSymbolWidth( double w ) { mSymbolWidth = w; } | |||
double symbolWidth() const { return mSymbolWidth; } | double symbolWidth() const { return mSymbolWidth; } | |||
void setSymbolHeight( double h ) { mSymbolHeight = h; } | void setSymbolHeight( double h ) { mSymbolHeight = h; } | |||
double symbolHeight() const { return mSymbolHeight; } | double symbolHeight() const { return mSymbolHeight; } | |||
Qt::PenStyle outlineStyle() const { return mOutlineStyle; } | ||||
void setOutlineStyle( Qt::PenStyle outlineStyle ) { mOutlineStyle = out | ||||
lineStyle; } | ||||
void setOutlineWidth( double w ) { mOutlineWidth = w; } | void setOutlineWidth( double w ) { mOutlineWidth = w; } | |||
double outlineWidth() const { return mOutlineWidth; } | double outlineWidth() const { return mOutlineWidth; } | |||
void setFillColor( const QColor& c ) { mFillColor = c;} | void setFillColor( const QColor& c ) { mFillColor = c;} | |||
QColor fillColor() const { return mFillColor; } | QColor fillColor() const { return mFillColor; } | |||
void setOutlineColor( const QColor& c ) { mOutlineColor = c; } | void setOutlineColor( const QColor& c ) { mOutlineColor = c; } | |||
QColor outlineColor() const { return mOutlineColor; } | QColor outlineColor() const { return mOutlineColor; } | |||
void setSymbolWidthUnit( QgsSymbolV2::OutputUnit unit ) { mSymbolWidthU nit = unit; } | void setSymbolWidthUnit( QgsSymbolV2::OutputUnit unit ) { mSymbolWidthU nit = unit; } | |||
skipping to change at line 81 | skipping to change at line 86 | |||
QgsSymbolV2::OutputUnit outputUnit() const; | QgsSymbolV2::OutputUnit outputUnit() const; | |||
private: | private: | |||
QString mSymbolName; | QString mSymbolName; | |||
double mSymbolWidth; | double mSymbolWidth; | |||
QgsSymbolV2::OutputUnit mSymbolWidthUnit; | QgsSymbolV2::OutputUnit mSymbolWidthUnit; | |||
double mSymbolHeight; | double mSymbolHeight; | |||
QgsSymbolV2::OutputUnit mSymbolHeightUnit; | QgsSymbolV2::OutputUnit mSymbolHeightUnit; | |||
QColor mFillColor; | QColor mFillColor; | |||
QColor mOutlineColor; | QColor mOutlineColor; | |||
Qt::PenStyle mOutlineStyle; | ||||
double mOutlineWidth; | double mOutlineWidth; | |||
QgsSymbolV2::OutputUnit mOutlineWidthUnit; | QgsSymbolV2::OutputUnit mOutlineWidthUnit; | |||
QPainterPath mPainterPath; | QPainterPath mPainterPath; | |||
QPen mPen; | QPen mPen; | |||
QBrush mBrush; | QBrush mBrush; | |||
/**Setup mPainterPath | /**Setup mPainterPath | |||
@param symbolName name of symbol | @param symbolName name of symbol | |||
End of changes. 3 change blocks. | ||||
0 lines changed or deleted | 9 lines changed or added | |||
qgsellipsesymbollayerv2widget.h | qgsellipsesymbollayerv2widget.h | |||
---|---|---|---|---|
skipping to change at line 47 | skipping to change at line 47 | |||
QgsEllipseSymbolLayerV2* mLayer; | QgsEllipseSymbolLayerV2* mLayer; | |||
private: | private: | |||
void blockComboSignals( bool block ); | void blockComboSignals( bool block ); | |||
private slots: | private slots: | |||
void on_mShapeListWidget_itemSelectionChanged(); | void on_mShapeListWidget_itemSelectionChanged(); | |||
void on_mWidthSpinBox_valueChanged( double d ); | void on_mWidthSpinBox_valueChanged( double d ); | |||
void on_mHeightSpinBox_valueChanged( double d ); | void on_mHeightSpinBox_valueChanged( double d ); | |||
void on_mRotationSpinBox_valueChanged( double d ); | void on_mRotationSpinBox_valueChanged( double d ); | |||
void on_mOutlineStyleComboBox_currentIndexChanged( int index ); | ||||
void on_mOutlineWidthSpinBox_valueChanged( double d ); | void on_mOutlineWidthSpinBox_valueChanged( double d ); | |||
void on_btnChangeColorBorder_colorChanged( const QColor& newColor ); | void on_btnChangeColorBorder_colorChanged( const QColor& newColor ); | |||
void on_btnChangeColorFill_colorChanged( const QColor& newColor ); | void on_btnChangeColorFill_colorChanged( const QColor& newColor ); | |||
void on_mSymbolWidthUnitComboBox_currentIndexChanged( int index ); | void on_mSymbolWidthUnitComboBox_currentIndexChanged( int index ); | |||
void on_mOutlineWidthUnitComboBox_currentIndexChanged( int index ); | void on_mOutlineWidthUnitComboBox_currentIndexChanged( int index ); | |||
void on_mSymbolHeightUnitComboBox_currentIndexChanged( int index ); | void on_mSymbolHeightUnitComboBox_currentIndexChanged( int index ); | |||
void on_mOffsetUnitComboBox_currentIndexChanged( int index ); | void on_mOffsetUnitComboBox_currentIndexChanged( int index ); | |||
void on_mHorizontalAnchorComboBox_currentIndexChanged( int index ); | ||||
void on_mVerticalAnchorComboBox_currentIndexChanged( int index ); | ||||
void on_mDataDefinedPropertiesButton_clicked(); | void on_mDataDefinedPropertiesButton_clicked(); | |||
void setOffset(); | void setOffset(); | |||
}; | }; | |||
#endif // QGSELLIPSESYMBOLLAYERV2WIDGET_H | #endif // QGSELLIPSESYMBOLLAYERV2WIDGET_H | |||
End of changes. 3 change blocks. | ||||
1 lines changed or deleted | 4 lines changed or added | |||
qgsexpression.h | qgsexpression.h | |||
---|---|---|---|---|
skipping to change at line 32 | skipping to change at line 32 | |||
#include <QList> | #include <QList> | |||
#include <QDomDocument> | #include <QDomDocument> | |||
#include "qgsfield.h" | #include "qgsfield.h" | |||
#include "qgsdistancearea.h" | #include "qgsdistancearea.h" | |||
class QgsFeature; | class QgsFeature; | |||
class QgsGeometry; | class QgsGeometry; | |||
class QgsOgcUtils; | class QgsOgcUtils; | |||
class QgsVectorLayer; | class QgsVectorLayer; | |||
class QgsVectorDataProvider; | ||||
class QDomElement; | class QDomElement; | |||
/** | /** | |||
Class for parsing and evaluation of expressions (formerly called "search st rings"). | Class for parsing and evaluation of expressions (formerly called "search st rings"). | |||
The expressions try to follow both syntax and semantics of SQL expressions. | The expressions try to follow both syntax and semantics of SQL expressions. | |||
Usage: | Usage: | |||
QgsExpression exp("gid*2 > 10 and type not in ('D','F')); | QgsExpression exp("gid*2 > 10 and type not in ('D','F')); | |||
skipping to change at line 105 | skipping to change at line 106 | |||
bool hasParserError() const { return !mParserErrorString.isNull(); } | bool hasParserError() const { return !mParserErrorString.isNull(); } | |||
//! Returns parser error | //! Returns parser error | |||
QString parserErrorString() const { return mParserErrorString; } | QString parserErrorString() const { return mParserErrorString; } | |||
class Node; | class Node; | |||
//! Returns root node of the expression. Root node is null is parsing h as failed | //! Returns root node of the expression. Root node is null is parsing h as failed | |||
const Node* rootNode() const { return mRootNode; } | const Node* rootNode() const { return mRootNode; } | |||
//! Get the expression ready for evaluation - find out column indexes. | //! Get the expression ready for evaluation - find out column indexes. | |||
bool prepare( const QgsFields& fields ); | bool prepare( const QgsFields &fields ); | |||
//! Get list of columns referenced by the expression | //! Get list of columns referenced by the expression | |||
QStringList referencedColumns(); | QStringList referencedColumns(); | |||
//! Returns true if the expression uses feature geometry for some compu tation | //! Returns true if the expression uses feature geometry for some compu tation | |||
bool needsGeometry(); | bool needsGeometry(); | |||
// evaluation | // evaluation | |||
//! Evaluate the feature and return the result | //! Evaluate the feature and return the result | |||
//! @note prepare() should be called before calling this method | //! @note prepare() should be called before calling this method | |||
QVariant evaluate( const QgsFeature* f = NULL ); | QVariant evaluate( const QgsFeature* f = NULL ); | |||
//! Evaluate the feature and return the result | //! Evaluate the feature and return the result | |||
//! @note prepare() should be called before calling this method | //! @note prepare() should be called before calling this method | |||
//! @note available in python bindings as evaluatePrepared | ||||
inline QVariant evaluate( const QgsFeature& f ) { return evaluate( &f ) ; } | inline QVariant evaluate( const QgsFeature& f ) { return evaluate( &f ) ; } | |||
//! Evaluate the feature and return the result | //! Evaluate the feature and return the result | |||
//! @note this method does not expect that prepare() has been called on this instance | //! @note this method does not expect that prepare() has been called on this instance | |||
QVariant evaluate( const QgsFeature* f, const QgsFields& fields ); | QVariant evaluate( const QgsFeature* f, const QgsFields& fields ); | |||
//! Evaluate the feature and return the result | //! Evaluate the feature and return the result | |||
//! @note this method does not expect that prepare() has been called on this instance | //! @note this method does not expect that prepare() has been called on this instance | |||
inline QVariant evaluate( const QgsFeature& f, const QgsFields& fields ) { return evaluate( &f, fields ); } | inline QVariant evaluate( const QgsFeature& f, const QgsFields& fields ) { return evaluate( &f, fields ); } | |||
skipping to change at line 148 | skipping to change at line 150 | |||
void setCurrentRowNumber( int rowNumber ) { mRowNumber = rowNumber; } | void setCurrentRowNumber( int rowNumber ) { mRowNumber = rowNumber; } | |||
//! Return the number used for $rownum special column | //! Return the number used for $rownum special column | |||
int currentRowNumber() { return mRowNumber; } | int currentRowNumber() { return mRowNumber; } | |||
//! Assign a special column | //! Assign a special column | |||
static void setSpecialColumn( const QString& name, QVariant value ); | static void setSpecialColumn( const QString& name, QVariant value ); | |||
//! Unset a special column | //! Unset a special column | |||
static void unsetSpecialColumn( const QString& name ); | static void unsetSpecialColumn( const QString& name ); | |||
//! Return the value of the given special column or a null QVariant if undefined | //! Return the value of the given special column or a null QVariant if undefined | |||
static QVariant specialColumn( const QString& name ); | static QVariant specialColumn( const QString& name ); | |||
//! Check whether a special column exists | ||||
//! @note added in 2.2 | ||||
static bool hasSpecialColumn( const QString& name ); | ||||
void setScale( double scale ) { mScale = scale; } | void setScale( double scale ) { mScale = scale; } | |||
int scale() {return mScale; } | int scale() {return mScale; } | |||
const QString& expression() const { return mExpression; } | //! Return the expression string that was given when created. | |||
const QString expression() const { return dump(); } | ||||
//! Return the parsed expression as a string - useful for debugging | //! Return the expression string that represents this QgsExpression. | |||
QString dump() const; | QString dump() const; | |||
//! Return calculator used for distance and area calculations | //! Return calculator used for distance and area calculations | |||
//! (used by internal functions) | //! (used by internal functions) | |||
QgsDistanceArea *geomCalculator() { initGeomCalculator(); return mCalc; } | QgsDistanceArea *geomCalculator() { initGeomCalculator(); return mCalc; } | |||
//! Sets the geometry calculator used in evaluation of expressions, | //! Sets the geometry calculator used in evaluation of expressions, | |||
// instead of the default. | // instead of the default. | |||
void setGeomCalculator( QgsDistanceArea &calc ); | void setGeomCalculator( const QgsDistanceArea &calc ); | |||
/** This function currently replaces each expression between [% and %] | /** This function currently replaces each expression between [% and %] | |||
in the string with the result of its evaluation on the feature | in the string with the result of its evaluation on the feature | |||
passed as argument. | passed as argument. | |||
Additional substitutions can be passed through the substitutionMap | Additional substitutions can be passed through the substitutionMap | |||
parameter | parameter | |||
*/ | */ | |||
static QString replaceExpressionText( QString action, QgsFeature* feat, | static QString replaceExpressionText( const QString &action, const QgsF | |||
QgsVectorLayer* layer, | eature *feat, | |||
const QMap<QString, QVariant> *su | QgsVectorLayer *layer, | |||
bstitutionMap = 0 ); | ||||
static QString replaceExpressionText( QString action, QgsFeature& feat, | ||||
QgsVectorLayer* layer, | ||||
const QMap<QString, QVariant> *su bstitutionMap = 0 ); | const QMap<QString, QVariant> *su bstitutionMap = 0 ); | |||
enum UnaryOperator | enum UnaryOperator | |||
{ | { | |||
uoNot, | uoNot, | |||
uoMinus, | uoMinus, | |||
}; | }; | |||
enum BinaryOperator | enum BinaryOperator | |||
{ | { | |||
// logical | // logical | |||
boOr, | boOr, | |||
skipping to change at line 287 | skipping to change at line 289 | |||
virtual QVariant func( const QVariantList& values, const QgsFeature * f, QgsExpression* parent ) | virtual QVariant func( const QVariantList& values, const QgsFeature * f, QgsExpression* parent ) | |||
{ | { | |||
return mFnc( values, f, parent ); | return mFnc( values, f, parent ); | |||
} | } | |||
private: | private: | |||
FcnEval mFnc; | FcnEval mFnc; | |||
}; | }; | |||
const static QList<Function*> &Functions(); | static const QList<Function*> &Functions(); | |||
static QList<Function*> gmFunctions; | static QList<Function*> gmFunctions; | |||
static QStringList gmBuiltinFunctions; | static QStringList gmBuiltinFunctions; | |||
const static QStringList &BuiltinFunctions(); | static const QStringList &BuiltinFunctions(); | |||
static bool registerFunction( Function* function ); | static bool registerFunction( Function* function ); | |||
static bool unregisterFunction( QString name ); | static bool unregisterFunction( QString name ); | |||
// tells whether the identifier is a name of existing function | // tells whether the identifier is a name of existing function | |||
static bool isFunctionName( QString name ); | static bool isFunctionName( QString name ); | |||
// return index of the function in Functions array | // return index of the function in Functions array | |||
static int functionIndex( QString name ); | static int functionIndex( QString name ); | |||
skipping to change at line 343 | skipping to change at line 345 | |||
{ | { | |||
public: | public: | |||
virtual ~Node() {} | virtual ~Node() {} | |||
virtual NodeType nodeType() const = 0; | virtual NodeType nodeType() const = 0; | |||
// abstract virtual eval function | // abstract virtual eval function | |||
// errors are reported to the parent | // errors are reported to the parent | |||
virtual QVariant eval( QgsExpression* parent, const QgsFeature* f ) = 0; | virtual QVariant eval( QgsExpression* parent, const QgsFeature* f ) = 0; | |||
// abstract virtual preparation function | // abstract virtual preparation function | |||
// errors are reported to the parent | // errors are reported to the parent | |||
virtual bool prepare( QgsExpression* parent, const QgsFields& field s ) = 0; | virtual bool prepare( QgsExpression* parent, const QgsFields &field s ) = 0; | |||
virtual QString dump() const = 0; | virtual QString dump() const = 0; | |||
virtual QStringList referencedColumns() const = 0; | virtual QStringList referencedColumns() const = 0; | |||
virtual bool needsGeometry() const = 0; | virtual bool needsGeometry() const = 0; | |||
// support for visitor pattern | // support for visitor pattern | |||
virtual void accept( Visitor& v ) const = 0; | virtual void accept( Visitor& v ) const = 0; | |||
}; | }; | |||
class CORE_EXPORT NodeList | class CORE_EXPORT NodeList | |||
{ | { | |||
public: | public: | |||
NodeList() {} | NodeList() {} | |||
virtual ~NodeList() { foreach ( Node* n, mList ) delete n; } | virtual ~NodeList() { qDeleteAll( mList ); } | |||
void append( Node* node ) { mList.append( node ); } | void append( Node* node ) { mList.append( node ); } | |||
int count() { return mList.count(); } | int count() { return mList.count(); } | |||
QList<Node*> list() { return mList; } | QList<Node*> list() { return mList; } | |||
virtual QString dump() const; | virtual QString dump() const; | |||
protected: | protected: | |||
QList<Node*> mList; | QList<Node*> mList; | |||
}; | }; | |||
skipping to change at line 380 | skipping to change at line 382 | |||
{ | { | |||
// YEAR const value taken from postgres query | // YEAR const value taken from postgres query | |||
// SELECT EXTRACT(EPOCH FROM interval '1 year') | // SELECT EXTRACT(EPOCH FROM interval '1 year') | |||
static const int YEARS = 31557600; | static const int YEARS = 31557600; | |||
static const int MONTHS = 60 * 60 * 24 * 30; | static const int MONTHS = 60 * 60 * 24 * 30; | |||
static const int WEEKS = 60 * 60 * 24 * 7; | static const int WEEKS = 60 * 60 * 24 * 7; | |||
static const int DAY = 60 * 60 * 24; | static const int DAY = 60 * 60 * 24; | |||
static const int HOUR = 60 * 60; | static const int HOUR = 60 * 60; | |||
static const int MINUTE = 60; | static const int MINUTE = 60; | |||
public: | public: | |||
Interval( double seconds = 0 ): mSeconds( seconds ), mValid( true ) { } | Interval( double seconds = 0 ) : mSeconds( seconds ), mValid( true ) { } | |||
~Interval(); | ~Interval(); | |||
double years() { return mSeconds / YEARS;} | double years() { return mSeconds / YEARS;} | |||
double months() { return mSeconds / MONTHS; } | double months() { return mSeconds / MONTHS; } | |||
double weeks() { return mSeconds / WEEKS;} | double weeks() { return mSeconds / WEEKS;} | |||
double days() { return mSeconds / DAY;} | double days() { return mSeconds / DAY;} | |||
double hours() { return mSeconds / HOUR;} | double hours() { return mSeconds / HOUR;} | |||
double minutes() { return mSeconds / MINUTE;} | double minutes() { return mSeconds / MINUTE;} | |||
double seconds() { return mSeconds; } | ||||
bool isValid() { return mValid; } | bool isValid() { return mValid; } | |||
void setValid( bool valid ) { mValid = valid; } | void setValid( bool valid ) { mValid = valid; } | |||
double seconds() { return mSeconds; } | ||||
bool operator==( const QgsExpression::Interval& other ) const; | bool operator==( const QgsExpression::Interval& other ) const; | |||
static QgsExpression::Interval invalidInterVal(); | static QgsExpression::Interval invalidInterVal(); | |||
static QgsExpression::Interval fromString( QString string ); | static QgsExpression::Interval fromString( QString string ); | |||
private: | private: | |||
double mSeconds; | double mSeconds; | |||
bool mValid; | bool mValid; | |||
}; | }; | |||
class CORE_EXPORT NodeUnaryOperator : public Node | class CORE_EXPORT NodeUnaryOperator : public Node | |||
{ | { | |||
public: | public: | |||
NodeUnaryOperator( UnaryOperator op, Node* operand ) : mOp( op ), m Operand( operand ) {} | NodeUnaryOperator( UnaryOperator op, Node* operand ) : mOp( op ), m Operand( operand ) {} | |||
~NodeUnaryOperator() { delete mOperand; } | ~NodeUnaryOperator() { delete mOperand; } | |||
UnaryOperator op() const { return mOp; } | UnaryOperator op() const { return mOp; } | |||
Node* operand() const { return mOperand; } | Node* operand() const { return mOperand; } | |||
virtual NodeType nodeType() const { return ntUnaryOperator; } | virtual NodeType nodeType() const { return ntUnaryOperator; } | |||
virtual bool prepare( QgsExpression* parent, const QgsFields& field s ); | virtual bool prepare( QgsExpression* parent, const QgsFields &field s ); | |||
virtual QVariant eval( QgsExpression* parent, const QgsFeature* f ) ; | virtual QVariant eval( QgsExpression* parent, const QgsFeature* f ) ; | |||
virtual QString dump() const; | virtual QString dump() const; | |||
virtual QStringList referencedColumns() const { return mOperand->re ferencedColumns(); } | virtual QStringList referencedColumns() const { return mOperand->re ferencedColumns(); } | |||
virtual bool needsGeometry() const { return mOperand->needsGeometry (); } | virtual bool needsGeometry() const { return mOperand->needsGeometry (); } | |||
virtual void accept( Visitor& v ) const { v.visit( *this ); } | virtual void accept( Visitor& v ) const { v.visit( *this ); } | |||
protected: | protected: | |||
UnaryOperator mOp; | UnaryOperator mOp; | |||
Node* mOperand; | Node* mOperand; | |||
skipping to change at line 433 | skipping to change at line 435 | |||
{ | { | |||
public: | public: | |||
NodeBinaryOperator( BinaryOperator op, Node* opLeft, Node* opRight ) : mOp( op ), mOpLeft( opLeft ), mOpRight( opRight ) {} | NodeBinaryOperator( BinaryOperator op, Node* opLeft, Node* opRight ) : mOp( op ), mOpLeft( opLeft ), mOpRight( opRight ) {} | |||
~NodeBinaryOperator() { delete mOpLeft; delete mOpRight; } | ~NodeBinaryOperator() { delete mOpLeft; delete mOpRight; } | |||
BinaryOperator op() const { return mOp; } | BinaryOperator op() const { return mOp; } | |||
Node* opLeft() const { return mOpLeft; } | Node* opLeft() const { return mOpLeft; } | |||
Node* opRight() const { return mOpRight; } | Node* opRight() const { return mOpRight; } | |||
virtual NodeType nodeType() const { return ntBinaryOperator; } | virtual NodeType nodeType() const { return ntBinaryOperator; } | |||
virtual bool prepare( QgsExpression* parent, const QgsFields& field s ); | virtual bool prepare( QgsExpression* parent, const QgsFields &field s ); | |||
virtual QVariant eval( QgsExpression* parent, const QgsFeature* f ) ; | virtual QVariant eval( QgsExpression* parent, const QgsFeature* f ) ; | |||
virtual QString dump() const; | virtual QString dump() const; | |||
virtual QStringList referencedColumns() const { return mOpLeft->ref erencedColumns() + mOpRight->referencedColumns(); } | virtual QStringList referencedColumns() const { return mOpLeft->ref erencedColumns() + mOpRight->referencedColumns(); } | |||
virtual bool needsGeometry() const { return mOpLeft->needsGeometry( ) || mOpRight->needsGeometry(); } | virtual bool needsGeometry() const { return mOpLeft->needsGeometry( ) || mOpRight->needsGeometry(); } | |||
virtual void accept( Visitor& v ) const { v.visit( *this ); } | virtual void accept( Visitor& v ) const { v.visit( *this ); } | |||
protected: | protected: | |||
bool compare( double diff ); | bool compare( double diff ); | |||
int computeInt( int x, int y ); | int computeInt( int x, int y ); | |||
skipping to change at line 463 | skipping to change at line 465 | |||
{ | { | |||
public: | public: | |||
NodeInOperator( Node* node, NodeList* list, bool notin = false ) : mNode( node ), mList( list ), mNotIn( notin ) {} | NodeInOperator( Node* node, NodeList* list, bool notin = false ) : mNode( node ), mList( list ), mNotIn( notin ) {} | |||
virtual ~NodeInOperator() { delete mNode; delete mList; } | virtual ~NodeInOperator() { delete mNode; delete mList; } | |||
Node* node() const { return mNode; } | Node* node() const { return mNode; } | |||
bool isNotIn() const { return mNotIn; } | bool isNotIn() const { return mNotIn; } | |||
NodeList* list() const { return mList; } | NodeList* list() const { return mList; } | |||
virtual NodeType nodeType() const { return ntInOperator; } | virtual NodeType nodeType() const { return ntInOperator; } | |||
virtual bool prepare( QgsExpression* parent, const QgsFields& field s ); | virtual bool prepare( QgsExpression* parent, const QgsFields &field s ); | |||
virtual QVariant eval( QgsExpression* parent, const QgsFeature* f ) ; | virtual QVariant eval( QgsExpression* parent, const QgsFeature* f ) ; | |||
virtual QString dump() const; | virtual QString dump() const; | |||
virtual QStringList referencedColumns() const { QStringList lst( mN ode->referencedColumns() ); foreach ( Node* n, mList->list() ) lst.append( n->referencedColumns() ); return lst; } | virtual QStringList referencedColumns() const { QStringList lst( mN ode->referencedColumns() ); foreach ( Node* n, mList->list() ) lst.append( n->referencedColumns() ); return lst; } | |||
virtual bool needsGeometry() const { bool needs = false; foreach ( Node* n, mList->list() ) needs |= n->needsGeometry(); return needs; } | virtual bool needsGeometry() const { bool needs = false; foreach ( Node* n, mList->list() ) needs |= n->needsGeometry(); return needs; } | |||
virtual void accept( Visitor& v ) const { v.visit( *this ); } | virtual void accept( Visitor& v ) const { v.visit( *this ); } | |||
protected: | protected: | |||
Node* mNode; | Node* mNode; | |||
NodeList* mList; | NodeList* mList; | |||
bool mNotIn; | bool mNotIn; | |||
}; | }; | |||
class CORE_EXPORT NodeFunction : public Node | class CORE_EXPORT NodeFunction : public Node | |||
{ | { | |||
public: | public: | |||
NodeFunction( int fnIndex, NodeList* args ): mFnIndex( fnIndex ), m Args( args ) {} | NodeFunction( int fnIndex, NodeList* args ) : mFnIndex( fnIndex ), mArgs( args ) {} | |||
//NodeFunction( QString name, NodeList* args ) : mName(name), mArgs (args) {} | //NodeFunction( QString name, NodeList* args ) : mName(name), mArgs (args) {} | |||
virtual ~NodeFunction() { delete mArgs; } | virtual ~NodeFunction() { delete mArgs; } | |||
int fnIndex() const { return mFnIndex; } | int fnIndex() const { return mFnIndex; } | |||
NodeList* args() const { return mArgs; } | NodeList* args() const { return mArgs; } | |||
virtual NodeType nodeType() const { return ntFunction; } | virtual NodeType nodeType() const { return ntFunction; } | |||
virtual bool prepare( QgsExpression* parent, const QgsFields& field s ); | virtual bool prepare( QgsExpression* parent, const QgsFields &field s ); | |||
virtual QVariant eval( QgsExpression* parent, const QgsFeature* f ) ; | virtual QVariant eval( QgsExpression* parent, const QgsFeature* f ) ; | |||
virtual QString dump() const; | virtual QString dump() const; | |||
virtual QStringList referencedColumns() const { QStringList lst; if ( !mArgs ) return lst; foreach ( Node* n, mArgs->list() ) lst.append( n->r eferencedColumns() ); return lst; } | virtual QStringList referencedColumns() const { QStringList lst; if ( !mArgs ) return lst; foreach ( Node* n, mArgs->list() ) lst.append( n->r eferencedColumns() ); return lst; } | |||
virtual bool needsGeometry() const { bool needs = Functions()[mFnIn dex]->usesgeometry(); if ( mArgs ) { foreach ( Node* n, mArgs->list() ) nee ds |= n->needsGeometry(); } return needs; } | virtual bool needsGeometry() const { bool needs = Functions()[mFnIn dex]->usesgeometry(); if ( mArgs ) { foreach ( Node* n, mArgs->list() ) nee ds |= n->needsGeometry(); } return needs; } | |||
virtual void accept( Visitor& v ) const { v.visit( *this ); } | virtual void accept( Visitor& v ) const { v.visit( *this ); } | |||
protected: | protected: | |||
//QString mName; | //QString mName; | |||
int mFnIndex; | int mFnIndex; | |||
skipping to change at line 510 | skipping to change at line 512 | |||
}; | }; | |||
class CORE_EXPORT NodeLiteral : public Node | class CORE_EXPORT NodeLiteral : public Node | |||
{ | { | |||
public: | public: | |||
NodeLiteral( QVariant value ) : mValue( value ) {} | NodeLiteral( QVariant value ) : mValue( value ) {} | |||
QVariant value() const { return mValue; } | QVariant value() const { return mValue; } | |||
virtual NodeType nodeType() const { return ntLiteral; } | virtual NodeType nodeType() const { return ntLiteral; } | |||
virtual bool prepare( QgsExpression* parent, const QgsFields& field s ); | virtual bool prepare( QgsExpression* parent, const QgsFields &field s ); | |||
virtual QVariant eval( QgsExpression* parent, const QgsFeature* f ) ; | virtual QVariant eval( QgsExpression* parent, const QgsFeature* f ) ; | |||
virtual QString dump() const; | virtual QString dump() const; | |||
virtual QStringList referencedColumns() const { return QStringList( ); } | virtual QStringList referencedColumns() const { return QStringList( ); } | |||
virtual bool needsGeometry() const { return false; } | virtual bool needsGeometry() const { return false; } | |||
virtual void accept( Visitor& v ) const { v.visit( *this ); } | virtual void accept( Visitor& v ) const { v.visit( *this ); } | |||
protected: | protected: | |||
QVariant mValue; | QVariant mValue; | |||
}; | }; | |||
class CORE_EXPORT NodeColumnRef : public Node | class CORE_EXPORT NodeColumnRef : public Node | |||
{ | { | |||
public: | public: | |||
NodeColumnRef( QString name ) : mName( name ), mIndex( -1 ) {} | NodeColumnRef( QString name ) : mName( name ), mIndex( -1 ) {} | |||
QString name() const { return mName; } | QString name() const { return mName; } | |||
virtual NodeType nodeType() const { return ntColumnRef; } | virtual NodeType nodeType() const { return ntColumnRef; } | |||
virtual bool prepare( QgsExpression* parent, const QgsFields& field s ); | virtual bool prepare( QgsExpression* parent, const QgsFields &field s ); | |||
virtual QVariant eval( QgsExpression* parent, const QgsFeature* f ) ; | virtual QVariant eval( QgsExpression* parent, const QgsFeature* f ) ; | |||
virtual QString dump() const; | virtual QString dump() const; | |||
virtual QStringList referencedColumns() const { return QStringList( mName ); } | virtual QStringList referencedColumns() const { return QStringList( mName ); } | |||
virtual bool needsGeometry() const { return false; } | virtual bool needsGeometry() const { return false; } | |||
virtual void accept( Visitor& v ) const { v.visit( *this ); } | virtual void accept( Visitor& v ) const { v.visit( *this ); } | |||
protected: | protected: | |||
QString mName; | QString mName; | |||
int mIndex; | int mIndex; | |||
}; | }; | |||
class CORE_EXPORT WhenThen | class CORE_EXPORT WhenThen | |||
{ | { | |||
public: | public: | |||
skipping to change at line 559 | skipping to change at line 562 | |||
//protected: | //protected: | |||
Node* mWhenExp; | Node* mWhenExp; | |||
Node* mThenExp; | Node* mThenExp; | |||
}; | }; | |||
typedef QList<WhenThen*> WhenThenList; | typedef QList<WhenThen*> WhenThenList; | |||
class CORE_EXPORT NodeCondition : public Node | class CORE_EXPORT NodeCondition : public Node | |||
{ | { | |||
public: | public: | |||
NodeCondition( WhenThenList* conditions, Node* elseExp = NULL ) : m Conditions( *conditions ), mElseExp( elseExp ) { delete conditions; } | NodeCondition( WhenThenList* conditions, Node* elseExp = NULL ) : m Conditions( *conditions ), mElseExp( elseExp ) { delete conditions; } | |||
~NodeCondition() { delete mElseExp; foreach ( WhenThen* cond, mCond itions ) delete cond; } | ~NodeCondition() { delete mElseExp; qDeleteAll( mConditions ); } | |||
virtual NodeType nodeType() const { return ntCondition; } | virtual NodeType nodeType() const { return ntCondition; } | |||
virtual QVariant eval( QgsExpression* parent, const QgsFeature* f ) ; | virtual QVariant eval( QgsExpression* parent, const QgsFeature* f ) ; | |||
virtual bool prepare( QgsExpression* parent, const QgsFields& field s ); | virtual bool prepare( QgsExpression* parent, const QgsFields &field s ); | |||
virtual QString dump() const; | virtual QString dump() const; | |||
virtual QStringList referencedColumns() const; | virtual QStringList referencedColumns() const; | |||
virtual bool needsGeometry() const; | virtual bool needsGeometry() const; | |||
virtual void accept( Visitor& v ) const { v.visit( *this ); } | virtual void accept( Visitor& v ) const { v.visit( *this ); } | |||
protected: | protected: | |||
WhenThenList mConditions; | WhenThenList mConditions; | |||
Node* mElseExp; | Node* mElseExp; | |||
}; | }; | |||
skipping to change at line 604 | skipping to change at line 607 | |||
static QString helptext( QString name ); | static QString helptext( QString name ); | |||
static QString group( QString group ); | static QString group( QString group ); | |||
protected: | protected: | |||
// internally used to create an empty expression | // internally used to create an empty expression | |||
QgsExpression() : mRootNode( 0 ), mRowNumber( 0 ), mCalc( 0 ) {} | QgsExpression() : mRootNode( 0 ), mRowNumber( 0 ), mCalc( 0 ) {} | |||
void initGeomCalculator(); | void initGeomCalculator(); | |||
QString mExpression; | ||||
Node* mRootNode; | Node* mRootNode; | |||
QString mParserErrorString; | QString mParserErrorString; | |||
QString mEvalErrorString; | QString mEvalErrorString; | |||
int mRowNumber; | int mRowNumber; | |||
double mScale; | double mScale; | |||
QString mExp; | ||||
static QMap<QString, QVariant> gmSpecialColumns; | static QMap<QString, QVariant> gmSpecialColumns; | |||
QgsDistanceArea *mCalc; | QgsDistanceArea *mCalc; | |||
friend class QgsOgcUtils; | friend class QgsOgcUtils; | |||
static void initFunctionHelp(); | static void initFunctionHelp(); | |||
static QHash<QString, QString> gFunctionHelpTexts; | static QHash<QString, QString> gFunctionHelpTexts; | |||
static QHash<QString, QString> gGroups; | static QHash<QString, QString> gGroups; | |||
}; | }; | |||
End of changes. 27 change blocks. | ||||
27 lines changed or deleted | 30 lines changed or added | |||
qgsexpressionbuilderdialog.h | qgsexpressionbuilderdialog.h | |||
---|---|---|---|---|
skipping to change at line 29 | skipping to change at line 29 | |||
#include <QDialog> | #include <QDialog> | |||
#include "qgsdistancearea.h" | #include "qgsdistancearea.h" | |||
#include "ui_qgsexpressionbuilderdialogbase.h" | #include "ui_qgsexpressionbuilderdialogbase.h" | |||
/** A generic dialog for building expression strings | /** A generic dialog for building expression strings | |||
* @remarks This class also shows an example on how to use QgsExpressionBu ilderWidget | * @remarks This class also shows an example on how to use QgsExpressionBu ilderWidget | |||
*/ | */ | |||
class GUI_EXPORT QgsExpressionBuilderDialog : public QDialog, private Ui::Q gsExpressionBuilderDialogBase | class GUI_EXPORT QgsExpressionBuilderDialog : public QDialog, private Ui::Q gsExpressionBuilderDialogBase | |||
{ | { | |||
public: | public: | |||
QgsExpressionBuilderDialog( QgsVectorLayer* layer, QString startText = QString(), QWidget* parent = NULL ); | QgsExpressionBuilderDialog( QgsVectorLayer* layer, QString startText = QString(), QWidget* parent = NULL, QString key = "generic" ); | |||
/** The builder widget that is used by the dialog */ | /** The builder widget that is used by the dialog */ | |||
QgsExpressionBuilderWidget* expressionBuilder(); | QgsExpressionBuilderWidget* expressionBuilder(); | |||
void setExpressionText( const QString& text ); | void setExpressionText( const QString& text ); | |||
QString expressionText(); | QString expressionText(); | |||
/** Sets geometry calculator used in distance/area calculations. | /** Sets geometry calculator used in distance/area calculations. | |||
* @note added in version 2.0 | * @note added in version 2.0 | |||
skipping to change at line 51 | skipping to change at line 51 | |||
void setGeomCalculator( const QgsDistanceArea & da ); | void setGeomCalculator( const QgsDistanceArea & da ); | |||
protected: | protected: | |||
/** | /** | |||
* Is called when the dialog get accepted or rejected | * Is called when the dialog get accepted or rejected | |||
* Used to save geometry | * Used to save geometry | |||
* | * | |||
* @param r result value (unused) | * @param r result value (unused) | |||
*/ | */ | |||
virtual void done( int r ); | virtual void done( int r ); | |||
virtual void accept(); | ||||
private: | ||||
QString mRecentKey; | ||||
}; | }; | |||
#endif | #endif | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 6 lines changed or added | |||
qgsexpressionbuilderwidget.h | qgsexpressionbuilderwidget.h | |||
---|---|---|---|---|
skipping to change at line 79 | skipping to change at line 79 | |||
QgsExpressionItem( QString label, | QgsExpressionItem( QString label, | |||
QString expressionText, | QString expressionText, | |||
QgsExpressionItem::ItemType itemType = ExpressionNod e ) | QgsExpressionItem::ItemType itemType = ExpressionNod e ) | |||
: QStandardItem( label ) | : QStandardItem( label ) | |||
{ | { | |||
mExpressionText = expressionText; | mExpressionText = expressionText; | |||
mType = itemType; | mType = itemType; | |||
} | } | |||
QString getExpressionText() { return mExpressionText; } | QString getExpressionText() { return mExpressionText; } | |||
/** Get the help text that is associated with this expression item. | /** Get the help text that is associated with this expression item. | |||
* | * | |||
* @return The help text. | * @return The help text. | |||
*/ | */ | |||
QString getHelpText() { return mHelpText; } | QString getHelpText() { return mHelpText; } | |||
/** Set the help text for the current item | /** Set the help text for the current item | |||
* | * | |||
* @note The help text can be set as a html string. | * @note The help text can be set as a html string. | |||
*/ | */ | |||
skipping to change at line 151 | skipping to change at line 151 | |||
* @param expressionText The text that is inserted into the expression area when the user double clicks on the item. | * @param expressionText The text that is inserted into the expression area when the user double clicks on the item. | |||
* @param helpText The help text that the user will see when item is s elected. | * @param helpText The help text that the user will see when item is s elected. | |||
* @param type The type of the expression item. | * @param type The type of the expression item. | |||
*/ | */ | |||
void registerItem( QString group, QString label, QString expressionText , | void registerItem( QString group, QString label, QString expressionText , | |||
QString helpText = "", | QString helpText = "", | |||
QgsExpressionItem::ItemType type = QgsExpressionItem ::ExpressionNode ); | QgsExpressionItem::ItemType type = QgsExpressionItem ::ExpressionNode ); | |||
bool isExpressionValid(); | bool isExpressionValid(); | |||
void saveToRecent( QString key ); | ||||
void loadRecent( QString key ); | ||||
public slots: | public slots: | |||
void currentChanged( const QModelIndex &index, const QModelIndex & ); | void currentChanged( const QModelIndex &index, const QModelIndex & ); | |||
void on_expressionTree_doubleClicked( const QModelIndex &index ); | void on_expressionTree_doubleClicked( const QModelIndex &index ); | |||
void on_txtExpressionString_textChanged(); | void on_txtExpressionString_textChanged(); | |||
void on_txtSearchEdit_textChanged(); | void on_txtSearchEdit_textChanged(); | |||
void on_lblPreview_linkActivated( QString link ); | void on_lblPreview_linkActivated( QString link ); | |||
void on_mValueListWidget_itemDoubleClicked( QListWidgetItem* item ); | void on_mValueListWidget_itemDoubleClicked( QListWidgetItem* item ); | |||
void operatorButtonClicked(); | void operatorButtonClicked(); | |||
void showContextMenu( const QPoint & ); | void showContextMenu( const QPoint & ); | |||
void loadSampleValues(); | void loadSampleValues(); | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 5 lines changed or added | |||
qgsexpressionselectiondialog.h | qgsexpressionselectiondialog.h | |||
---|---|---|---|---|
skipping to change at line 41 | skipping to change at line 41 | |||
{ | { | |||
Q_OBJECT | Q_OBJECT | |||
public: | public: | |||
/** | /** | |||
* Creates a new selection dialog. | * Creates a new selection dialog. | |||
* @param layer The layer on which the selection is to be performed . | * @param layer The layer on which the selection is to be performed . | |||
* @param startText A default expression text to be applied (Defaults t o empty) | * @param startText A default expression text to be applied (Defaults t o empty) | |||
* @param parent parent object (owner) | * @param parent parent object (owner) | |||
*/ | */ | |||
QgsExpressionSelectionDialog( QgsVectorLayer* layer, QString startText = QString(), QWidget* parent = NULL ); | QgsExpressionSelectionDialog( QgsVectorLayer* layer, QString startText = QString(), QWidget* parent = 0 ); | |||
/** | /** | |||
* The builder widget that is used by the dialog | * The builder widget that is used by the dialog | |||
* @return The builder widget that is used by the dialog | * @return The builder widget that is used by the dialog | |||
*/ | */ | |||
QgsExpressionBuilderWidget* expressionBuilder(); | QgsExpressionBuilderWidget* expressionBuilder(); | |||
/** | /** | |||
* Sets the current expression text | * Sets the current expression text | |||
* @param text the expression text to set | * @param text the expression text to set | |||
skipping to change at line 89 | skipping to change at line 89 | |||
virtual void closeEvent( QCloseEvent *closeEvent ); | virtual void closeEvent( QCloseEvent *closeEvent ); | |||
/** | /** | |||
* Implementation for done (default behavior when pressing esc) | * Implementation for done (default behavior when pressing esc) | |||
* Calls close, so the window geometry gets saved and the object delete d. | * Calls close, so the window geometry gets saved and the object delete d. | |||
* @param r Result value. Unused. | * @param r Result value. Unused. | |||
*/ | */ | |||
virtual void done( int r ); | virtual void done( int r ); | |||
private: | private: | |||
void saveRecent(); | ||||
QgsVectorLayer* mLayer; | QgsVectorLayer* mLayer; | |||
}; | }; | |||
#endif | #endif | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 2 lines changed or added | |||
qgsfeature.h | qgsfeature.h | |||
---|---|---|---|---|
skipping to change at line 241 | skipping to change at line 241 | |||
* @param name The name of the field to set | * @param name The name of the field to set | |||
* @param value The value to set | * @param value The value to set | |||
* | * | |||
* @return false if attribute name could not be converted to index (C+ + only) | * @return false if attribute name could not be converted to index (C+ + only) | |||
* | * | |||
* @note For Python: raises a KeyError exception instead of returning false | * @note For Python: raises a KeyError exception instead of returning false | |||
* @note added in 2.0 | * @note added in 2.0 | |||
*/ | */ | |||
bool setAttribute( const QString& name, QVariant value ); | bool setAttribute( const QString& name, QVariant value ); | |||
/** Remove an attribute value. Returns false if attribute name could no | /** Remove an attribute value. | |||
t be converted to index. | * Returns false if attribute name could not be converted to index. | |||
* Field map must be associated to make this work. | * Field map must be associated to make this work. | |||
* | * | |||
* @param name The name of the field to delete | * @param name The name of the field to delete | |||
* | * | |||
* @return false if attribute name could not be converted to index (C+ + only) | * @return false if attribute name could not be converted to index (C+ + only) | |||
* | * | |||
* @note For Python: raises a KeyError exception instead of returning false | * @note For Python: raises a KeyError exception instead of returning false | |||
* @note added in 2.0 | * @note added in 2.0 | |||
*/ | */ | |||
bool deleteAttribute( const QString& name ); | bool deleteAttribute( const QString& name ); | |||
skipping to change at line 324 | skipping to change at line 325 | |||
// key = feature id, value = changed geometry | // key = feature id, value = changed geometry | |||
typedef QMap<QgsFeatureId, QgsGeometry> QgsGeometryMap; | typedef QMap<QgsFeatureId, QgsGeometry> QgsGeometryMap; | |||
typedef QSet<QgsFeatureId> QgsFeatureIds; | typedef QSet<QgsFeatureId> QgsFeatureIds; | |||
// key = field index, value = field name | // key = field index, value = field name | |||
typedef QMap<int, QString> QgsFieldNameMap; | typedef QMap<int, QString> QgsFieldNameMap; | |||
typedef QList<QgsFeature> QgsFeatureList; | typedef QList<QgsFeature> QgsFeatureList; | |||
Q_DECLARE_METATYPE( QgsFeatureList ); | Q_DECLARE_METATYPE( QgsFeatureList ) | |||
#endif | #endif | |||
End of changes. 2 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added | |||
qgsfeatureiterator.h | qgsfeatureiterator.h | |||
---|---|---|---|---|
skipping to change at line 19 | skipping to change at line 19 | |||
* This program is free software; you can redistribute it and/or modify * | * This program is free software; you can redistribute it and/or modify * | |||
* it under the terms of the GNU General Public License as published by * | * it under the terms of the GNU General Public License as published by * | |||
* the Free Software Foundation; either version 2 of the License, or * | * the Free Software Foundation; either version 2 of the License, or * | |||
* (at your option) any later version. * | * (at your option) any later version. * | |||
* * | * * | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef QGSFEATUREITERATOR_H | #ifndef QGSFEATUREITERATOR_H | |||
#define QGSFEATUREITERATOR_H | #define QGSFEATUREITERATOR_H | |||
#include "qgsfeaturerequest.h" | #include "qgsfeaturerequest.h" | |||
#include "qgslogger.h" | ||||
class QgsAbstractGeometrySimplifier; | ||||
/** \ingroup core | /** \ingroup core | |||
* Internal feature iterator to be implemented within data providers | * Internal feature iterator to be implemented within data providers | |||
*/ | */ | |||
class CORE_EXPORT QgsAbstractFeatureIterator | class CORE_EXPORT QgsAbstractFeatureIterator | |||
{ | { | |||
public: | public: | |||
//! base class constructor - stores the iteration parameters | //! base class constructor - stores the iteration parameters | |||
QgsAbstractFeatureIterator( const QgsFeatureRequest& request ); | QgsAbstractFeatureIterator( const QgsFeatureRequest& request ); | |||
//! destructor makes sure that the iterator is closed properly | //! destructor makes sure that the iterator is closed properly | |||
virtual ~QgsAbstractFeatureIterator(); | virtual ~QgsAbstractFeatureIterator(); | |||
//! fetch next feature, return true on success | //! fetch next feature, return true on success | |||
virtual bool nextFeature( QgsFeature& f ) = 0; | virtual bool nextFeature( QgsFeature& f ); | |||
//! reset the iterator to the starting position | //! reset the iterator to the starting position | |||
virtual bool rewind() = 0; | virtual bool rewind() = 0; | |||
//! end of iterating: free the resources / lock | //! end of iterating: free the resources / lock | |||
virtual bool close() = 0; | virtual bool close() = 0; | |||
protected: | protected: | |||
/** | ||||
* If you write a feature iterator for your provider, this is the metho | ||||
d you | ||||
* need to implement!! | ||||
* | ||||
* @param f The feature to write to | ||||
* @return true if a feature was written to f | ||||
*/ | ||||
virtual bool fetchFeature( QgsFeature& f ) = 0; | ||||
/** | ||||
* By default, the iterator will fetch all features and check if the fe | ||||
ature | ||||
* matches the expression. | ||||
* If you have a more sophisticated metodology (SQL request for the fea | ||||
tures...) | ||||
* and you check for the expression in your fetchFeature method, you ca | ||||
n just | ||||
* redirect this call to fetchFeature so the default check will be omit | ||||
ted. | ||||
* | ||||
* @param f The feature to write to | ||||
* @return true if a feature was written to f | ||||
*/ | ||||
virtual bool nextFeatureFilterExpression( QgsFeature &f ); | ||||
/** | ||||
* By default, the iterator will fetch all features and check if the id | ||||
* is in the request. | ||||
* If you have a more sophisticated metodology (SQL request for the fea | ||||
tures...) | ||||
* and you are sure, that any feature you return from fetchFeature will | ||||
match | ||||
* if the request was FilterFids you can just redirect this call to fet | ||||
chFeature | ||||
* so the default check will be omitted. | ||||
* | ||||
* @param f The feature to write to | ||||
* @return true if a feature was written to f | ||||
*/ | ||||
virtual bool nextFeatureFilterFids( QgsFeature & f ); | ||||
/** A copy of the feature request. */ | ||||
QgsFeatureRequest mRequest; | QgsFeatureRequest mRequest; | |||
/** Set to true, as soon as the iterator is closed. */ | ||||
bool mClosed; | bool mClosed; | |||
// reference counting (to allow seamless copying of QgsFeatureIterator instances) | //! reference counting (to allow seamless copying of QgsFeatureIterator instances) | |||
int refs; | int refs; | |||
void ref(); // add reference | void ref(); //!< add reference | |||
void deref(); // remove reference, delete if refs == 0 | void deref(); //!< remove reference, delete if refs == 0 | |||
friend class QgsFeatureIterator; | friend class QgsFeatureIterator; | |||
//! Setup the simplification of geometries to fetch using the specified | ||||
simplify method | ||||
virtual bool prepareSimplification( const QgsSimplifyMethod& simplifyMe | ||||
thod ); | ||||
private: | ||||
//! optional object to locally simplify geometries fetched by this feat | ||||
ure iterator | ||||
QgsAbstractGeometrySimplifier* mGeometrySimplifier; | ||||
//! this iterator runs local simplification | ||||
bool mLocalSimplification; | ||||
//! returns whether the iterator supports simplify geometries on provid | ||||
er side | ||||
virtual bool providerCanSimplify( QgsSimplifyMethod::MethodType methodT | ||||
ype ) const; | ||||
//! simplify the specified geometry if it was configured | ||||
virtual bool simplify( QgsFeature& feature ); | ||||
}; | }; | |||
/** | /** | |||
* \ingroup core | * \ingroup core | |||
* Wrapper for iterator of features from vector data provider or vector lay er | * Wrapper for iterator of features from vector data provider or vector lay er | |||
*/ | */ | |||
class CORE_EXPORT QgsFeatureIterator | class CORE_EXPORT QgsFeatureIterator | |||
{ | { | |||
public: | public: | |||
//! construct invalid iterator | //! construct invalid iterator | |||
End of changes. 7 change blocks. | ||||
4 lines changed or deleted | 72 lines changed or added | |||
qgsfeaturelistmodel.h | qgsfeaturelistmodel.h | |||
---|---|---|---|---|
skipping to change at line 59 | skipping to change at line 59 | |||
* for a meaningful error message. | * for a meaningful error message. | |||
*/ | */ | |||
bool setDisplayExpression( const QString expression ); | bool setDisplayExpression( const QString expression ); | |||
/** | /** | |||
* @brief Returns a detailed message about errors while parsing a QgsEx pression. | * @brief Returns a detailed message about errors while parsing a QgsEx pression. | |||
* @return A message containg information about the parser error. | * @return A message containg information about the parser error. | |||
*/ | */ | |||
QString parserErrorString(); | QString parserErrorString(); | |||
const QString& displayExpression() const; | QString displayExpression() const; | |||
bool featureByIndex( const QModelIndex& index, QgsFeature& feat ); | bool featureByIndex( const QModelIndex& index, QgsFeature& feat ); | |||
QgsFeatureId idxToFid( const QModelIndex& index ) const; | QgsFeatureId idxToFid( const QModelIndex& index ) const; | |||
QModelIndex fidToIdx( const QgsFeatureId fid ) const; | QModelIndex fidToIdx( const QgsFeatureId fid ) const; | |||
virtual QModelIndex mapToSource( const QModelIndex& proxyIndex ) const; | virtual QModelIndex mapToSource( const QModelIndex& proxyIndex ) const; | |||
virtual QModelIndex mapFromSource( const QModelIndex& sourceIndex ) con st; | virtual QModelIndex mapFromSource( const QModelIndex& sourceIndex ) con st; | |||
virtual QModelIndex mapToMaster( const QModelIndex& proxyIndex ) const; | virtual QModelIndex mapToMaster( const QModelIndex& proxyIndex ) const; | |||
virtual QModelIndex mapFromMaster( const QModelIndex& sourceIndex ) con st; | virtual QModelIndex mapFromMaster( const QModelIndex& sourceIndex ) con st; | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
qgsfeaturelistview.h | qgsfeaturelistview.h | |||
---|---|---|---|---|
skipping to change at line 94 | skipping to change at line 94 | |||
*/ | */ | |||
bool setDisplayExpression( const QString displayExpression ); | bool setDisplayExpression( const QString displayExpression ); | |||
/** | /** | |||
* Returns the expression which is currently used to render the feature s. | * Returns the expression which is currently used to render the feature s. | |||
* | * | |||
* @return A string containing the currend display expression | * @return A string containing the currend display expression | |||
* | * | |||
* @see QgsExpression | * @see QgsExpression | |||
*/ | */ | |||
const QString& displayExpression() const; | const QString displayExpression() const; | |||
/** | /** | |||
* Returns a detailed message about errors while parsing a QgsExpressio n. | * Returns a detailed message about errors while parsing a QgsExpressio n. | |||
* | * | |||
* @return A message containg information about the parser error. | * @return A message containg information about the parser error. | |||
*/ | */ | |||
QString parserErrorString(); | QString parserErrorString(); | |||
/** | ||||
* Get the currentEditSelection | ||||
* | ||||
* @return A list of edited feature ids | ||||
*/ | ||||
QgsFeatureIds currentEditSelection(); | ||||
protected: | protected: | |||
virtual void mouseMoveEvent( QMouseEvent *event ); | virtual void mouseMoveEvent( QMouseEvent *event ); | |||
virtual void mousePressEvent( QMouseEvent *event ); | virtual void mousePressEvent( QMouseEvent *event ); | |||
virtual void mouseReleaseEvent( QMouseEvent *event ); | virtual void mouseReleaseEvent( QMouseEvent *event ); | |||
virtual void keyPressEvent( QKeyEvent *event ); | virtual void keyPressEvent( QKeyEvent *event ); | |||
signals: | signals: | |||
/** | /** | |||
* Is emitted, whenever the current edit selection has been changed. | * Is emitted, whenever the current edit selection has been changed. | |||
* | * | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 8 lines changed or added | |||
qgsfeaturelistviewdelegate.h | qgsfeaturelistviewdelegate.h | |||
---|---|---|---|---|
skipping to change at line 38 | skipping to change at line 38 | |||
void setEditSelectionModel( QItemSelectionModel* editSelectionModel ); | void setEditSelectionModel( QItemSelectionModel* editSelectionModel ); | |||
Element positionToElement( const QPoint& pos ); | Element positionToElement( const QPoint& pos ); | |||
void setFeatureSelectionModel( QgsFeatureSelectionModel* featureSelecti onModel ); | void setFeatureSelectionModel( QgsFeatureSelectionModel* featureSelecti onModel ); | |||
signals: | signals: | |||
void editButtonClicked( QModelIndex& index ); | void editButtonClicked( QModelIndex& index ); | |||
public slots: | ||||
protected: | protected: | |||
virtual QSize sizeHint( const QStyleOptionViewItem& option, const QMode lIndex& index ) const; | virtual QSize sizeHint( const QStyleOptionViewItem& option, const QMode lIndex& index ) const; | |||
virtual void paint( QPainter* painter, const QStyleOptionViewItem& opti on, const QModelIndex& index ) const; | virtual void paint( QPainter* painter, const QStyleOptionViewItem& opti on, const QModelIndex& index ) const; | |||
private: | private: | |||
QgsFeatureSelectionModel* mFeatureSelectionModel; | QgsFeatureSelectionModel* mFeatureSelectionModel; | |||
QItemSelectionModel* mEditSelectionModel; | QItemSelectionModel* mEditSelectionModel; | |||
QgsFeatureListModel* mListModel; | QgsFeatureListModel* mListModel; | |||
}; | }; | |||
End of changes. 1 change blocks. | ||||
2 lines changed or deleted | 0 lines changed or added | |||
qgsfeaturerequest.h | qgsfeaturerequest.h | |||
---|---|---|---|---|
skipping to change at line 22 | skipping to change at line 22 | |||
* (at your option) any later version. * | * (at your option) any later version. * | |||
* * | * * | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef QGSFEATUREREQUEST_H | #ifndef QGSFEATUREREQUEST_H | |||
#define QGSFEATUREREQUEST_H | #define QGSFEATUREREQUEST_H | |||
#include <QFlags> | #include <QFlags> | |||
#include "qgsfeature.h" | #include "qgsfeature.h" | |||
#include "qgsrectangle.h" | #include "qgsrectangle.h" | |||
#include "qgsexpression.h" | ||||
#include "qgssimplifymethod.h" | ||||
#include <QList> | #include <QList> | |||
typedef QList<int> QgsAttributeList; | typedef QList<int> QgsAttributeList; | |||
/** | /** | |||
* This class wraps a request for features to a vector layer (or directly i ts vector data provider). | * This class wraps a request for features to a vector layer (or directly i ts vector data provider). | |||
* The request may apply a filter to fetch only a particular subset of feat ures. Currently supported filters: | * The request may apply a filter to fetch only a particular subset of feat ures. Currently supported filters: | |||
* - no filter - all features are returned | * - no filter - all features are returned | |||
* - feature id - only feature that matches given feature id is returned | * - feature id - only feature that matches given feature id is returned | |||
* - rectangle - only features that intersect given rectangle should be fet ched. For the sake of speed, | * - rectangle - only features that intersect given rectangle should be fet ched. For the sake of speed, | |||
* the intersection is often done only using feature's boundi ng box. There is a flag | * the intersection is often done only using feature's boundi ng box. There is a flag | |||
* ExactIntersect that makes sure that only intersecting feat ures will be returned. | * ExactIntersect that makes sure that only intersecting feat ures will be returned. | |||
* | * | |||
* For efficiency, it is also possible to tell provider that some data is n ot required: | * For efficiency, it is also possible to tell provider that some data is n ot required: | |||
* - NoGeometry flag | * - NoGeometry flag | |||
* - SubsetOfAttributes flag | * - SubsetOfAttributes flag | |||
* - SimplifyMethod for geometries to fetch | ||||
* | * | |||
* The options may be chained, e.g.: | * The options may be chained, e.g.: | |||
* QgsFeatureRequest().setFilterRect(QgsRectangle(0,0,1,1)).setFlags(QgsF eatureRequest::ExactIntersect) | * QgsFeatureRequest().setFilterRect(QgsRectangle(0,0,1,1)).setFlags(QgsF eatureRequest::ExactIntersect) | |||
* | * | |||
* Examples: | * Examples: | |||
* - fetch all features: | * - fetch all features: | |||
* QgsFeatureRequest() | * QgsFeatureRequest() | |||
* - fetch all features, only one attribute | * - fetch all features, only one attribute | |||
* QgsFeatureRequest().setSubsetOfAttributes(QStringList("myfield"), pr ovider->fieldMap()) | * QgsFeatureRequest().setSubsetOfAttributes(QStringList("myfield"), pr ovider->fieldMap()) | |||
* - fetch all features, without geometries | * - fetch all features, without geometries | |||
skipping to change at line 61 | skipping to change at line 64 | |||
* - fetch only one feature | * - fetch only one feature | |||
* QgsFeatureRequest().setFilterFid(45) | * QgsFeatureRequest().setFilterFid(45) | |||
* | * | |||
*/ | */ | |||
class CORE_EXPORT QgsFeatureRequest | class CORE_EXPORT QgsFeatureRequest | |||
{ | { | |||
public: | public: | |||
enum Flag | enum Flag | |||
{ | { | |||
NoFlags = 0, | NoFlags = 0, | |||
NoGeometry = 1, //!< Do not fetch geometry | NoGeometry = 1, //!< Geometry is not required. It may still be returned if e.g. required for a filter condition. | |||
SubsetOfAttributes = 2, //!< Fetch only a subset of attributes (setS ubsetOfAttributes sets this flag) | SubsetOfAttributes = 2, //!< Fetch only a subset of attributes (setS ubsetOfAttributes sets this flag) | |||
ExactIntersect = 4 //!< Use exact geometry intersection (slower ) instead of bounding boxes | ExactIntersect = 4 //!< Use exact geometry intersection (slower ) instead of bounding boxes | |||
}; | }; | |||
Q_DECLARE_FLAGS( Flags, Flag ) | Q_DECLARE_FLAGS( Flags, Flag ) | |||
enum FilterType | enum FilterType | |||
{ | { | |||
FilterNone, //!< No filter is applied | FilterNone, //!< No filter is applied | |||
FilterRect, //!< Filter using a rectangle | FilterRect, //!< Filter using a rectangle, no need to set NoGeo | |||
FilterFid //!< Filter using feature ID | metry | |||
FilterFid, //!< Filter using feature ID | ||||
FilterExpression, //!< Filter using expression | ||||
FilterFids //!< Filter using feature IDs | ||||
}; | }; | |||
//! construct a default request: for all features get attributes and ge ometries | //! construct a default request: for all features get attributes and ge ometries | |||
QgsFeatureRequest(); | QgsFeatureRequest(); | |||
//! construct a request with feature ID filter | //! construct a request with feature ID filter | |||
explicit QgsFeatureRequest( QgsFeatureId fid ); | explicit QgsFeatureRequest( QgsFeatureId fid ); | |||
//! construct a request with rectangle filter | //! construct a request with rectangle filter | |||
explicit QgsFeatureRequest( const QgsRectangle& rect ); | explicit QgsFeatureRequest( const QgsRectangle& rect ); | |||
//! construct a request with a filter expression | ||||
explicit QgsFeatureRequest( const QgsExpression& expr ); | ||||
//! copy constructor | //! copy constructor | |||
QgsFeatureRequest( const QgsFeatureRequest& rh ); | QgsFeatureRequest( const QgsFeatureRequest& rh ); | |||
QgsFeatureRequest& operator=( const QgsFeatureRequest& rh ); | ||||
~QgsFeatureRequest(); | ||||
FilterType filterType() const { return mFilter; } | FilterType filterType() const { return mFilter; } | |||
//! Set rectangle from which features will be taken. Empty rectangle re moves the filter. | //! Set rectangle from which features will be taken. Empty rectangle re moves the filter. | |||
//! | //! | |||
QgsFeatureRequest& setFilterRect( const QgsRectangle& rect ); | QgsFeatureRequest& setFilterRect( const QgsRectangle& rect ); | |||
const QgsRectangle& filterRect() const { return mFilterRect; } | const QgsRectangle& filterRect() const { return mFilterRect; } | |||
//! Set feature ID that should be fetched. | //! Set feature ID that should be fetched. | |||
QgsFeatureRequest& setFilterFid( QgsFeatureId fid ); | QgsFeatureRequest& setFilterFid( QgsFeatureId fid ); | |||
const QgsFeatureId& filterFid() const { return mFilterFid; } | const QgsFeatureId& filterFid() const { return mFilterFid; } | |||
//! Set feature ID that should be fetched. | ||||
QgsFeatureRequest& setFilterFids( QgsFeatureIds fids ); | ||||
const QgsFeatureIds& filterFids() const { return mFilterFids; } | ||||
//! Set filter expression. {@see QgsExpression} | ||||
QgsFeatureRequest& setFilterExpression( const QString& expression ); | ||||
QgsExpression* filterExpression() const { return mFilterExpression; } | ||||
//! Set flags that affect how features will be fetched | //! Set flags that affect how features will be fetched | |||
QgsFeatureRequest& setFlags( Flags flags ); | QgsFeatureRequest& setFlags( Flags flags ); | |||
const Flags& flags() const { return mFlags; } | const Flags& flags() const { return mFlags; } | |||
//! Set a subset of attributes that will be fetched. Empty list means t hat all attributes are used. | //! Set a subset of attributes that will be fetched. Empty list means t hat all attributes are used. | |||
//! To disable fetching attributes, reset the FetchAttributes flag (whi ch is set by default) | //! To disable fetching attributes, reset the FetchAttributes flag (whi ch is set by default) | |||
QgsFeatureRequest& setSubsetOfAttributes( const QgsAttributeList& attrs ); | QgsFeatureRequest& setSubsetOfAttributes( const QgsAttributeList& attrs ); | |||
const QgsAttributeList& subsetOfAttributes() const { return mAttrs; } | const QgsAttributeList& subsetOfAttributes() const { return mAttrs; } | |||
//! Set a subset of attributes by names that will be fetched | //! Set a subset of attributes by names that will be fetched | |||
QgsFeatureRequest& setSubsetOfAttributes( const QStringList& attrNames, const QgsFields& fields ); | QgsFeatureRequest& setSubsetOfAttributes( const QStringList& attrNames, const QgsFields& fields ); | |||
//! Set a simplification method for geometries that will be fetched | ||||
//! @note added in 2.2 | ||||
QgsFeatureRequest& setSimplifyMethod( const QgsSimplifyMethod& simplify | ||||
Method ); | ||||
//! Get simplification method for geometries that will be fetched | ||||
//! @note added in 2.2 | ||||
const QgsSimplifyMethod& simplifyMethod() const { return mSimplifyMetho | ||||
d; } | ||||
/** | ||||
* Check if a feature is accepted by this requests filter | ||||
* | ||||
* @param feature The feature which will be tested | ||||
* | ||||
* @return true, if the filter accepts the feature | ||||
* | ||||
* @note added in 2.1 | ||||
*/ | ||||
bool acceptFeature( const QgsFeature& feature ); | ||||
// TODO: in future | // TODO: in future | |||
// void setFilterExpression(const QString& expression); // using QgsExp ression | ||||
// void setFilterNativeExpression(con QString& expr); // using provid er's SQL (if supported) | // void setFilterNativeExpression(con QString& expr); // using provid er's SQL (if supported) | |||
// void setLimit(int limit); | // void setLimit(int limit); | |||
protected: | protected: | |||
FilterType mFilter; | FilterType mFilter; | |||
QgsRectangle mFilterRect; | QgsRectangle mFilterRect; | |||
QgsFeatureId mFilterFid; | QgsFeatureId mFilterFid; | |||
QgsFeatureIds mFilterFids; | ||||
QgsExpression* mFilterExpression; | ||||
Flags mFlags; | Flags mFlags; | |||
QgsAttributeList mAttrs; | QgsAttributeList mAttrs; | |||
QgsSimplifyMethod mSimplifyMethod; | ||||
}; | }; | |||
Q_DECLARE_OPERATORS_FOR_FLAGS( QgsFeatureRequest::Flags ) | Q_DECLARE_OPERATORS_FOR_FLAGS( QgsFeatureRequest::Flags ) | |||
#endif // QGSFEATUREREQUEST_H | #endif // QGSFEATUREREQUEST_H | |||
End of changes. 11 change blocks. | ||||
5 lines changed or deleted | 47 lines changed or added | |||
qgsfeatureselectionmodel.h | qgsfeatureselectionmodel.h | |||
---|---|---|---|---|
#ifndef QGSFEATURESELECTIONMODEL_H | #ifndef QGSFEATURESELECTIONMODEL_H | |||
#define QGSFEATURESELECTIONMODEL_H | #define QGSFEATURESELECTIONMODEL_H | |||
#include <QItemSelectionModel> | #include <QItemSelectionModel> | |||
#include "qgsfeature.h" | #include "qgsfeature.h" | |||
class QgsVectorLayer; | class QgsVectorLayer; | |||
class QgsFeatureModel; | class QgsFeatureModel; | |||
class QgsIFeatureSelectionManager; | ||||
class GUI_EXPORT QgsFeatureSelectionModel : public QItemSelectionModel | class GUI_EXPORT QgsFeatureSelectionModel : public QItemSelectionModel | |||
{ | { | |||
Q_OBJECT | Q_OBJECT | |||
public: | public: | |||
explicit QgsFeatureSelectionModel( QAbstractItemModel* model, QgsFeatur eModel* featureModel, QgsVectorLayer* layer, QObject* parent ); | explicit QgsFeatureSelectionModel( QAbstractItemModel* model, QgsFeatur eModel* featureModel, QgsIFeatureSelectionManager* featureSelectionHandler, QObject* parent ); | |||
/** | /** | |||
* Enables or disables synchronisation to the {@link QgsVectorLayer} | * Enables or disables synchronisation to the {@link QgsVectorLayer} | |||
* When synchronisation is disabled, any selection change will be buffe red inside this selection model. | * When synchronisation is disabled, any selection change will be buffe red inside this selection model. | |||
* When enabled, any buffered changes are communicated to the layer and the buffer is emptied. | * When enabled, any buffered changes are communicated to the layer and the buffer is emptied. | |||
* Mainly to be used for performance reasons, because selection change on the layer can cost time as it | * Mainly to be used for performance reasons, because selection change on the layer can cost time as it | |||
* repaints the layer. | * repaints the layer. | |||
* | * | |||
* @param enable The synchronisation status to set. | * @param enable The synchronisation status to set. | |||
*/ | */ | |||
skipping to change at line 84 | skipping to change at line 85 | |||
virtual void select( const QItemSelection &selection, SelectionFlags co mmand ) { Q_UNUSED( selection ); Q_UNUSED( command ); } | virtual void select( const QItemSelection &selection, SelectionFlags co mmand ) { Q_UNUSED( selection ); Q_UNUSED( command ); } | |||
/** | /** | |||
* Select features on this table. Is to be used in favor of the stock s elect methods. | * Select features on this table. Is to be used in favor of the stock s elect methods. | |||
* | * | |||
* @param selection The QItemSelection which will be selected | * @param selection The QItemSelection which will be selected | |||
* @param command The command to apply. Select, Deselect and ClearAn dSelect are processed. | * @param command The command to apply. Select, Deselect and ClearAn dSelect are processed. | |||
*/ | */ | |||
virtual void selectFeatures( const QItemSelection &selection, Selection Flags command ); | virtual void selectFeatures( const QItemSelection &selection, Selection Flags command ); | |||
virtual void setFeatureSelectionManager( QgsIFeatureSelectionManager* f | ||||
eatureSelectionManager ); | ||||
private slots: | private slots: | |||
virtual void layerSelectionChanged( QgsFeatureIds selected, QgsFeatureI ds deselected, bool clearAndSelect ); | virtual void layerSelectionChanged( QgsFeatureIds selected, QgsFeatureI ds deselected, bool clearAndSelect ); | |||
private: | private: | |||
QModelIndexList expandIndexToRow( const QModelIndex& index ) const; | QModelIndexList expandIndexToRow( const QModelIndex& index ) const; | |||
private: | private: | |||
QgsFeatureModel* mFeatureModel; | QgsFeatureModel* mFeatureModel; | |||
QgsVectorLayer* mLayer; | QgsIFeatureSelectionManager* mFeatureSelectionManager; | |||
bool mSyncEnabled; | bool mSyncEnabled; | |||
//! If sync is disabled | ||||
//! Holds a list of newly selected features which will be synced when r | ||||
e-enabled | ||||
QgsFeatureIds mSelectedBuffer; | QgsFeatureIds mSelectedBuffer; | |||
//! If sync is disabled | ||||
//! Holds a list of newly deselected features which will be synced when | ||||
re-enabled | ||||
QgsFeatureIds mDeselectedBuffer; | QgsFeatureIds mDeselectedBuffer; | |||
//! If sync is disabled | ||||
//! Is set to true, if a clear and select operation should be performed | ||||
before syncing | ||||
bool mClearAndSelectBuffer; | bool mClearAndSelectBuffer; | |||
}; | }; | |||
#endif // QGSFEATURESELECTIONMODEL_H | #endif // QGSFEATURESELECTIONMODEL_H | |||
End of changes. 7 change blocks. | ||||
2 lines changed or deleted | 18 lines changed or added | |||
qgsfeaturestore.h | qgsfeaturestore.h | |||
---|---|---|---|---|
skipping to change at line 48 | skipping to change at line 48 | |||
//! Constructor | //! Constructor | |||
QgsFeatureStore( const QgsFields& fields, const QgsCoordinateReferenceS ystem& crs ); | QgsFeatureStore( const QgsFields& fields, const QgsCoordinateReferenceS ystem& crs ); | |||
//! Destructor | //! Destructor | |||
~QgsFeatureStore(); | ~QgsFeatureStore(); | |||
/** Get fields list */ | /** Get fields list */ | |||
QgsFields& fields() { return mFields; } | QgsFields& fields() { return mFields; } | |||
/** Set fields */ | /** Set fields. Resets feauters fields to pointer to new internal field | |||
void setFields( const QgsFields & fields ) { mFields = fields; } | s. */ | |||
void setFields( const QgsFields & fields ); | ||||
/** Get crs */ | /** Get crs */ | |||
QgsCoordinateReferenceSystem crs() const { return mCrs; } | QgsCoordinateReferenceSystem crs() const { return mCrs; } | |||
/** Set crs */ | /** Set crs */ | |||
void setCrs( const QgsCoordinateReferenceSystem& crs ) { mCrs = crs; } | void setCrs( const QgsCoordinateReferenceSystem& crs ) { mCrs = crs; } | |||
/** Add feature. Feature's fields will be set to pointer to the store f | ||||
ields. | ||||
* @param feature | ||||
* @note added in 2.1 | ||||
*/ | ||||
void addFeature( const QgsFeature& feature ); | ||||
/** Get features list reference */ | /** Get features list reference */ | |||
QgsFeatureList& features() { return mFeatures; } | QgsFeatureList& features() { return mFeatures; } | |||
/** Set map of optional parameters */ | /** Set map of optional parameters */ | |||
void setParams( const QMap<QString, QVariant> &theParams ) { mParams = theParams; } | void setParams( const QMap<QString, QVariant> &theParams ) { mParams = theParams; } | |||
/** Get map of optional parameters */ | /** Get map of optional parameters */ | |||
QMap<QString, QVariant> params() const { return mParams; } | QMap<QString, QVariant> params() const { return mParams; } | |||
private: | private: | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 10 lines changed or added | |||
qgsfield.h | qgsfield.h | |||
---|---|---|---|---|
skipping to change at line 186 | skipping to change at line 186 | |||
FieldOrigin origin; //!< origin of the field | FieldOrigin origin; //!< origin of the field | |||
int originIndex; //!< index specific to the origin | int originIndex; //!< index specific to the origin | |||
} Field; | } Field; | |||
//! Remove all fields | //! Remove all fields | |||
void clear(); | void clear(); | |||
//! Append a field. The field must have unique name, otherwise it is re jected (returns false) | //! Append a field. The field must have unique name, otherwise it is re jected (returns false) | |||
bool append( const QgsField& field, FieldOrigin origin = OriginProvider , int originIndex = -1 ); | bool append( const QgsField& field, FieldOrigin origin = OriginProvider , int originIndex = -1 ); | |||
//! Remove a field with the given index | //! Remove a field with the given index | |||
void remove( int fieldIdx ); | void remove( int fieldIdx ); | |||
//! Extend with fields from an other QgsFields container | //! Extend with fields from another QgsFields container | |||
void extend( const QgsFields& other ); | void extend( const QgsFields& other ); | |||
//! Check whether the container is empty | //! Check whether the container is empty | |||
inline bool isEmpty() const { return mFields.isEmpty(); } | inline bool isEmpty() const { return mFields.isEmpty(); } | |||
//! Return number of items | //! Return number of items | |||
inline int count() const { return mFields.count(); } | inline int count() const { return mFields.count(); } | |||
//! Return number of items | //! Return number of items | |||
inline int size() const { return mFields.count(); } | inline int size() const { return mFields.count(); } | |||
//! Return if a field index is valid | ||||
//! @param i Index of the field which needs to be checked | ||||
//! @return True if the field exists | ||||
inline bool exists( int i ) const { return i >= 0 && i < mFields.count( | ||||
); } | ||||
//! Get field at particular index (must be in range 0..N-1) | //! Get field at particular index (must be in range 0..N-1) | |||
inline const QgsField& operator[]( int i ) const { return mFields[i].fi eld; } | inline const QgsField& operator[]( int i ) const { return mFields[i].fi eld; } | |||
//! Get field at particular index (must be in range 0..N-1) | //! Get field at particular index (must be in range 0..N-1) | |||
inline QgsField& operator[]( int i ) { return mFields[i].field; } | inline QgsField& operator[]( int i ) { return mFields[i].field; } | |||
//! Get field at particular index (must be in range 0..N-1) | //! Get field at particular index (must be in range 0..N-1) | |||
const QgsField& at( int i ) const { return mFields[i].field; } | const QgsField& at( int i ) const { return mFields[i].field; } | |||
//! Get field at particular index (must be in range 0..N-1) | //! Get field at particular index (must be in range 0..N-1) | |||
const QgsField& field( int fieldIdx ) const { return mFields[fieldIdx]. field; } | const QgsField& field( int fieldIdx ) const { return mFields[fieldIdx]. field; } | |||
//! Get field at particular index (must be in range 0..N-1) | //! Get field at particular index (must be in range 0..N-1) | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 6 lines changed or added | |||
qgsfillsymbollayerv2.h | qgsfillsymbollayerv2.h | |||
---|---|---|---|---|
skipping to change at line 68 | skipping to change at line 68 | |||
void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const; | void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const; | |||
QString ogrFeatureStyle( double mmScaleFactor, double mapUnitScaleFacto r ) const; | QString ogrFeatureStyle( double mmScaleFactor, double mapUnitScaleFacto r ) const; | |||
Qt::BrushStyle brushStyle() const { return mBrushStyle; } | Qt::BrushStyle brushStyle() const { return mBrushStyle; } | |||
void setBrushStyle( Qt::BrushStyle style ) { mBrushStyle = style; } | void setBrushStyle( Qt::BrushStyle style ) { mBrushStyle = style; } | |||
QColor borderColor() const { return mBorderColor; } | QColor borderColor() const { return mBorderColor; } | |||
void setBorderColor( QColor borderColor ) { mBorderColor = borderColor; } | void setBorderColor( QColor borderColor ) { mBorderColor = borderColor; } | |||
/** Get outline color. | ||||
* @note added in 2.1 */ | ||||
QColor outlineColor() const { return borderColor(); } | ||||
/** Set outline color. | ||||
* @note added in 2.1 */ | ||||
void setOutlineColor( const QColor& color ) { setBorderColor( color ); | ||||
} | ||||
/** Get fill color. | ||||
* @note added in 2.1 */ | ||||
QColor fillColor() const { return color(); } | ||||
/** Set fill color. | ||||
* @note added in 2.1 */ | ||||
void setFillColor( const QColor& color ) { setColor( color ); } | ||||
Qt::PenStyle borderStyle() const { return mBorderStyle; } | Qt::PenStyle borderStyle() const { return mBorderStyle; } | |||
void setBorderStyle( Qt::PenStyle borderStyle ) { mBorderStyle = border Style; } | void setBorderStyle( Qt::PenStyle borderStyle ) { mBorderStyle = border Style; } | |||
double borderWidth() const { return mBorderWidth; } | double borderWidth() const { return mBorderWidth; } | |||
void setBorderWidth( double borderWidth ) { mBorderWidth = borderWidth; } | void setBorderWidth( double borderWidth ) { mBorderWidth = borderWidth; } | |||
void setOffset( QPointF offset ) { mOffset = offset; } | void setOffset( QPointF offset ) { mOffset = offset; } | |||
QPointF offset() { return mOffset; } | QPointF offset() { return mOffset; } | |||
void setBorderWidthUnit( QgsSymbolV2::OutputUnit unit ) { mBorderWidthU nit = unit; } | void setBorderWidthUnit( QgsSymbolV2::OutputUnit unit ) { mBorderWidthU nit = unit; } | |||
QgsSymbolV2::OutputUnit borderWidthUnit() const { return mBorderWidthUn it; } | QgsSymbolV2::OutputUnit borderWidthUnit() const { return mBorderWidthUn it; } | |||
void setOffsetUnit( QgsSymbolV2::OutputUnit unit ) { mOffsetUnit = unit ; } | void setOffsetUnit( QgsSymbolV2::OutputUnit unit ) { mOffsetUnit = unit ; } | |||
QgsSymbolV2::OutputUnit offsetUnit() const { return mOffsetUnit; } | QgsSymbolV2::OutputUnit offsetUnit() const { return mOffsetUnit; } | |||
void setOutputUnit( QgsSymbolV2::OutputUnit unit ); | void setOutputUnit( QgsSymbolV2::OutputUnit unit ); | |||
QgsSymbolV2::OutputUnit outputUnit() const; | QgsSymbolV2::OutputUnit outputUnit() const; | |||
double estimateMaxBleed() const; | ||||
double dxfWidth( const QgsDxfExport& e, const QgsSymbolV2RenderContext& | ||||
context ) const; | ||||
QColor dxfColor( const QgsSymbolV2RenderContext& context ) const; | ||||
Qt::PenStyle dxfPenStyle() const; | ||||
protected: | protected: | |||
QBrush mBrush; | QBrush mBrush; | |||
QBrush mSelBrush; | QBrush mSelBrush; | |||
Qt::BrushStyle mBrushStyle; | Qt::BrushStyle mBrushStyle; | |||
QColor mBorderColor; | QColor mBorderColor; | |||
Qt::PenStyle mBorderStyle; | Qt::PenStyle mBorderStyle; | |||
double mBorderWidth; | double mBorderWidth; | |||
QgsSymbolV2::OutputUnit mBorderWidthUnit; | QgsSymbolV2::OutputUnit mBorderWidthUnit; | |||
QPen mPen; | QPen mPen; | |||
QPen mSelPen; | QPen mSelPen; | |||
QPointF mOffset; | QPointF mOffset; | |||
QgsSymbolV2::OutputUnit mOffsetUnit; | QgsSymbolV2::OutputUnit mOffsetUnit; | |||
private: | private: | |||
//helper functions for data defined symbology | //helper functions for data defined symbology | |||
void applyDataDefinedSymbology( QgsSymbolV2RenderContext& context, QBru sh& brush, QPen& pen, QPen& selPen ); | void applyDataDefinedSymbology( QgsSymbolV2RenderContext& context, QBru sh& brush, QPen& pen, QPen& selPen ); | |||
}; | }; | |||
class QgsVectorColorRampV2; | ||||
class CORE_EXPORT QgsGradientFillSymbolLayerV2 : public QgsFillSymbolLayerV | ||||
2 | ||||
{ | ||||
public: | ||||
enum GradientColorType | ||||
{ | ||||
SimpleTwoColor, | ||||
ColorRamp | ||||
}; | ||||
enum GradientType | ||||
{ | ||||
Linear, | ||||
Radial, | ||||
Conical | ||||
}; | ||||
enum GradientCoordinateMode | ||||
{ | ||||
Feature, | ||||
Viewport | ||||
}; | ||||
enum GradientSpread | ||||
{ | ||||
Pad, | ||||
Reflect, | ||||
Repeat | ||||
}; | ||||
QgsGradientFillSymbolLayerV2( QColor color = DEFAULT_SIMPLEFILL_COLOR, | ||||
QColor color2 = Qt::white, | ||||
GradientColorType gradientColorType = Sim | ||||
pleTwoColor, | ||||
GradientType gradientType = Linear, | ||||
GradientCoordinateMode coordinateMode = F | ||||
eature, | ||||
GradientSpread gradientSpread = Pad | ||||
); | ||||
virtual ~QgsGradientFillSymbolLayerV2(); | ||||
// static stuff | ||||
static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsSt | ||||
ringMap() ); | ||||
// implemented from base classes | ||||
QString layerType() const; | ||||
void startRender( QgsSymbolV2RenderContext& context ); | ||||
void stopRender( QgsSymbolV2RenderContext& context ); | ||||
void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, Q | ||||
gsSymbolV2RenderContext& context ); | ||||
QgsStringMap properties() const; | ||||
QgsSymbolLayerV2* clone() const; | ||||
double estimateMaxBleed() const; | ||||
/**Type of gradient, eg linear or radial*/ | ||||
GradientType gradientType() const { return mGradientType; }; | ||||
void setGradientType( GradientType gradientType ) { mGradientType = gra | ||||
dientType; }; | ||||
/**Gradient color mode, controls how gradient color stops are created*/ | ||||
GradientColorType gradientColorType() const { return mGradientColorType | ||||
; }; | ||||
void setGradientColorType( GradientColorType gradientColorType ) { mGra | ||||
dientColorType = gradientColorType; }; | ||||
/**Color ramp used for the gradient fill, only used if the gradient col | ||||
or type is set to ColorRamp*/ | ||||
QgsVectorColorRampV2* colorRamp() { return mGradientRamp; }; | ||||
void setColorRamp( QgsVectorColorRampV2* ramp ); | ||||
/**Color for endpoint of gradient, only used if the gradient color type | ||||
is set to SimpleTwoColor*/ | ||||
QColor color2() const { return mColor2; }; | ||||
void setColor2( QColor color2 ) { mColor2 = color2; }; | ||||
/**Coordinate mode for gradient. Controls how the gradient stops are po | ||||
sitioned.*/ | ||||
GradientCoordinateMode coordinateMode() const { return mCoordinateMode; | ||||
}; | ||||
void setCoordinateMode( GradientCoordinateMode coordinateMode ) { mCoor | ||||
dinateMode = coordinateMode; }; | ||||
/**Gradient spread mode. Controls how the gradient behaves outside of t | ||||
he predefined stops*/ | ||||
GradientSpread gradientSpread() const { return mGradientSpread; }; | ||||
void setGradientSpread( GradientSpread gradientSpread ) { mGradientSpre | ||||
ad = gradientSpread; }; | ||||
/**Starting point of gradient fill, in the range [0,0] - [1,1]*/ | ||||
void setReferencePoint1( QPointF referencePoint ) { mReferencePoint1 = | ||||
referencePoint; }; | ||||
QPointF referencePoint1() const { return mReferencePoint1; }; | ||||
/**Sets the starting point of the gradient to be the feature centroid*/ | ||||
void setReferencePoint1IsCentroid( bool isCentroid ) { mReferencePoint1 | ||||
IsCentroid = isCentroid; }; | ||||
bool referencePoint1IsCentroid() const { return mReferencePoint1IsCentr | ||||
oid; }; | ||||
/**End point of gradient fill, in the range [0,0] - [1,1]*/ | ||||
void setReferencePoint2( QPointF referencePoint ) { mReferencePoint2 = | ||||
referencePoint; }; | ||||
QPointF referencePoint2() const { return mReferencePoint2; }; | ||||
/**Sets the end point of the gradient to be the feature centroid*/ | ||||
void setReferencePoint2IsCentroid( bool isCentroid ) { mReferencePoint2 | ||||
IsCentroid = isCentroid; }; | ||||
bool referencePoint2IsCentroid() const { return mReferencePoint2IsCentr | ||||
oid; }; | ||||
/**Rotation angle for gradient fill. Can be used to rotate a gradient a | ||||
round its centre point*/ | ||||
void setAngle( double angle ) { mAngle = angle; }; | ||||
double angle() const { return mAngle; }; | ||||
/**Offset for gradient fill*/ | ||||
void setOffset( QPointF offset ) { mOffset = offset; }; | ||||
QPointF offset() const { return mOffset; }; | ||||
/**Units for gradient fill offset*/ | ||||
void setOffsetUnit( QgsSymbolV2::OutputUnit unit ) { mOffsetUnit = unit | ||||
; }; | ||||
QgsSymbolV2::OutputUnit offsetUnit() const { return mOffsetUnit; }; | ||||
protected: | ||||
QBrush mBrush; | ||||
QBrush mSelBrush; | ||||
GradientColorType mGradientColorType; | ||||
QColor mColor2; | ||||
QgsVectorColorRampV2* mGradientRamp; | ||||
GradientType mGradientType; | ||||
GradientCoordinateMode mCoordinateMode; | ||||
GradientSpread mGradientSpread; | ||||
QPointF mReferencePoint1; | ||||
bool mReferencePoint1IsCentroid; | ||||
QPointF mReferencePoint2; | ||||
bool mReferencePoint2IsCentroid; | ||||
double mAngle; | ||||
QPointF mOffset; | ||||
QgsSymbolV2::OutputUnit mOffsetUnit; | ||||
private: | ||||
//helper functions for data defined symbology | ||||
void applyDataDefinedSymbology( QgsSymbolV2RenderContext& context, cons | ||||
t QPolygonF& points ); | ||||
/**Applies the gradient to a brush*/ | ||||
void applyGradient( const QgsSymbolV2RenderContext& context, QBrush& br | ||||
ush, const QColor& color, const QColor& color2, | ||||
const GradientColorType &gradientColorType, QgsVect | ||||
orColorRampV2 *gradientRamp, const GradientType &gradientType, | ||||
const GradientCoordinateMode &coordinateMode, const | ||||
GradientSpread &gradientSpread, | ||||
const QPointF &referencePoint1, const QPointF &refe | ||||
rencePoint2, const double angle ); | ||||
/**rotates a reference point by a specified angle around the point (0.5 | ||||
, 0.5)*/ | ||||
QPointF rotateReferencePoint( const QPointF & refPoint, double angle ); | ||||
}; | ||||
/**Base class for polygon renderers generating texture images*/ | /**Base class for polygon renderers generating texture images*/ | |||
class CORE_EXPORT QgsImageFillSymbolLayer: public QgsFillSymbolLayerV2 | class CORE_EXPORT QgsImageFillSymbolLayer: public QgsFillSymbolLayerV2 | |||
{ | { | |||
public: | public: | |||
QgsImageFillSymbolLayer(); | QgsImageFillSymbolLayer(); | |||
virtual ~QgsImageFillSymbolLayer(); | virtual ~QgsImageFillSymbolLayer(); | |||
void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, Q gsSymbolV2RenderContext& context ); | void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, Q gsSymbolV2RenderContext& context ); | |||
virtual QgsSymbolV2* subSymbol() { return mOutline; } | virtual QgsSymbolV2* subSymbol() { return mOutline; } | |||
virtual bool setSubSymbol( QgsSymbolV2* symbol ); | virtual bool setSubSymbol( QgsSymbolV2* symbol ); | |||
void setOutlineWidthUnit( QgsSymbolV2::OutputUnit unit ) { mOutlineWidt hUnit = unit; } | void setOutlineWidthUnit( QgsSymbolV2::OutputUnit unit ) { mOutlineWidt hUnit = unit; } | |||
QgsSymbolV2::OutputUnit outlineWidthUnit() const { return mOutlineWidth Unit; } | QgsSymbolV2::OutputUnit outlineWidthUnit() const { return mOutlineWidth Unit; } | |||
virtual double estimateMaxBleed() const; | ||||
virtual double dxfWidth( const QgsDxfExport& e, const QgsSymbolV2Render | ||||
Context& context ) const; | ||||
virtual QColor dxfColor( const QgsSymbolV2RenderContext& context ) cons | ||||
t; | ||||
virtual Qt::PenStyle dxfPenStyle() const; | ||||
protected: | protected: | |||
QBrush mBrush; | QBrush mBrush; | |||
double mNextAngle; // mAngle / data defined angle | double mNextAngle; // mAngle / data defined angle | |||
/**Outline width*/ | /**Outline width*/ | |||
double mOutlineWidth; | double mOutlineWidth; | |||
QgsSymbolV2::OutputUnit mOutlineWidthUnit; | QgsSymbolV2::OutputUnit mOutlineWidthUnit; | |||
/**Custom outline*/ | /**Custom outline*/ | |||
QgsLineSymbolV2* mOutline; | QgsLineSymbolV2* mOutline; | |||
skipping to change at line 235 | skipping to change at line 410 | |||
void startRender( QgsSymbolV2RenderContext& context ); | void startRender( QgsSymbolV2RenderContext& context ); | |||
void stopRender( QgsSymbolV2RenderContext& context ); | void stopRender( QgsSymbolV2RenderContext& context ); | |||
QgsStringMap properties() const; | QgsStringMap properties() const; | |||
QgsSymbolLayerV2* clone() const; | QgsSymbolLayerV2* clone() const; | |||
void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const; | void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const; | |||
double estimateMaxBleed() const; | ||||
QString ogrFeatureStyleWidth( double widthScaleFactor ) const; | QString ogrFeatureStyleWidth( double widthScaleFactor ) const; | |||
//getters and setters | //getters and setters | |||
void setLineAngle( double a ) { mLineAngle = a; } | void setLineAngle( double a ) { mLineAngle = a; } | |||
double lineAngle() const { return mLineAngle; } | double lineAngle() const { return mLineAngle; } | |||
void setDistance( double d ) { mDistance = d; } | void setDistance( double d ) { mDistance = d; } | |||
double distance() const { return mDistance; } | double distance() const { return mDistance; } | |||
void setLineWidth( double w ) { mLineWidth = w; } | void setLineWidth( double w ); | |||
double lineWidth() const { return mLineWidth; } | double lineWidth() const { return mLineWidth; } | |||
void setColor( const QColor& c ) { mColor = c; } | void setColor( const QColor& c ); | |||
QColor color() const { return mColor; } | QColor color() const { return mColor; } | |||
void setOffset( double offset ) { mOffset = offset; } | void setOffset( double offset ) { mOffset = offset; } | |||
double offset() const { return mOffset; } | double offset() const { return mOffset; } | |||
void setDistanceUnit( QgsSymbolV2::OutputUnit unit ) { mDistanceUnit = unit; } | void setDistanceUnit( QgsSymbolV2::OutputUnit unit ) { mDistanceUnit = unit; } | |||
QgsSymbolV2::OutputUnit distanceUnit() const { return mDistanceUnit; } | QgsSymbolV2::OutputUnit distanceUnit() const { return mDistanceUnit; } | |||
void setLineWidthUnit( QgsSymbolV2::OutputUnit unit ) { mLineWidthUnit = unit; } | void setLineWidthUnit( QgsSymbolV2::OutputUnit unit ) { mLineWidthUnit = unit; } | |||
QgsSymbolV2::OutputUnit lineWidthUnit() const { return mLineWidthUnit; } | QgsSymbolV2::OutputUnit lineWidthUnit() const { return mLineWidthUnit; } | |||
void setOffsetUnit( QgsSymbolV2::OutputUnit unit ) { mOffsetUnit = unit ; } | void setOffsetUnit( QgsSymbolV2::OutputUnit unit ) { mOffsetUnit = unit ; } | |||
QgsSymbolV2::OutputUnit offsetUnit() const { return mOffsetUnit; } | QgsSymbolV2::OutputUnit offsetUnit() const { return mOffsetUnit; } | |||
void setOutputUnit( QgsSymbolV2::OutputUnit unit ); | void setOutputUnit( QgsSymbolV2::OutputUnit unit ); | |||
QgsSymbolV2::OutputUnit outputUnit() const; | QgsSymbolV2::OutputUnit outputUnit() const; | |||
bool setSubSymbol( QgsSymbolV2* symbol ); | ||||
QgsSymbolV2* subSymbol(); | ||||
protected: | protected: | |||
/**Distance (in mm or map units) between lines*/ | /**Distance (in mm or map units) between lines*/ | |||
double mDistance; | double mDistance; | |||
QgsSymbolV2::OutputUnit mDistanceUnit; | QgsSymbolV2::OutputUnit mDistanceUnit; | |||
/**Line width (in mm or map units)*/ | /**Line width (in mm or map units)*/ | |||
double mLineWidth; | double mLineWidth; | |||
QgsSymbolV2::OutputUnit mLineWidthUnit; | QgsSymbolV2::OutputUnit mLineWidthUnit; | |||
QColor mColor; | QColor mColor; | |||
/**Vector line angle in degrees (0 = horizontal, counterclockwise)*/ | /**Vector line angle in degrees (0 = horizontal, counterclockwise)*/ | |||
double mLineAngle; | double mLineAngle; | |||
/**Offset perpendicular to line direction*/ | /**Offset perpendicular to line direction*/ | |||
double mOffset; | double mOffset; | |||
QgsSymbolV2::OutputUnit mOffsetUnit; | QgsSymbolV2::OutputUnit mOffsetUnit; | |||
void applyDataDefinedSettings( const QgsSymbolV2RenderContext& context ); | void applyDataDefinedSettings( const QgsSymbolV2RenderContext& context ); | |||
private: | private: | |||
/**Applies the svg pattern to the brush*/ | /**Applies the svg pattern to the brush*/ | |||
void applyPattern( const QgsSymbolV2RenderContext& context, QBrush& bru sh, double lineAngle, double distance, double lineWidth, const QColor& colo r ); | void applyPattern( const QgsSymbolV2RenderContext& context, QBrush& bru sh, double lineAngle, double distance, double lineWidth, const QColor& colo r ); | |||
/**Fill line*/ | ||||
QgsLineSymbolV2* mFillLineSymbol; | ||||
}; | }; | |||
class CORE_EXPORT QgsPointPatternFillSymbolLayer: public QgsImageFillSymbol Layer | class CORE_EXPORT QgsPointPatternFillSymbolLayer: public QgsImageFillSymbol Layer | |||
{ | { | |||
public: | public: | |||
QgsPointPatternFillSymbolLayer(); | QgsPointPatternFillSymbolLayer(); | |||
~QgsPointPatternFillSymbolLayer(); | ~QgsPointPatternFillSymbolLayer(); | |||
static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsSt ringMap() ); | static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsSt ringMap() ); | |||
static QgsSymbolLayerV2* createFromSld( QDomElement &element ); | static QgsSymbolLayerV2* createFromSld( QDomElement &element ); | |||
skipping to change at line 303 | skipping to change at line 486 | |||
void startRender( QgsSymbolV2RenderContext& context ); | void startRender( QgsSymbolV2RenderContext& context ); | |||
void stopRender( QgsSymbolV2RenderContext& context ); | void stopRender( QgsSymbolV2RenderContext& context ); | |||
QgsStringMap properties() const; | QgsStringMap properties() const; | |||
QgsSymbolLayerV2* clone() const; | QgsSymbolLayerV2* clone() const; | |||
void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const; | void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const; | |||
double estimateMaxBleed() const; | ||||
//getters and setters | //getters and setters | |||
double distanceX() const { return mDistanceX; } | double distanceX() const { return mDistanceX; } | |||
void setDistanceX( double d ) { mDistanceX = d; } | void setDistanceX( double d ) { mDistanceX = d; } | |||
double distanceY() const { return mDistanceY; } | double distanceY() const { return mDistanceY; } | |||
void setDistanceY( double d ) { mDistanceY = d; } | void setDistanceY( double d ) { mDistanceY = d; } | |||
double displacementX() const { return mDisplacementX; } | double displacementX() const { return mDisplacementX; } | |||
void setDisplacementX( double d ) { mDisplacementX = d; } | void setDisplacementX( double d ) { mDisplacementX = d; } | |||
skipping to change at line 334 | skipping to change at line 519 | |||
void setDisplacementXUnit( QgsSymbolV2::OutputUnit unit ) { mDisplaceme ntXUnit = unit; } | void setDisplacementXUnit( QgsSymbolV2::OutputUnit unit ) { mDisplaceme ntXUnit = unit; } | |||
QgsSymbolV2::OutputUnit displacementXUnit() const { return mDisplacemen tXUnit; } | QgsSymbolV2::OutputUnit displacementXUnit() const { return mDisplacemen tXUnit; } | |||
void setDisplacementYUnit( QgsSymbolV2::OutputUnit unit ) { mDisplaceme ntYUnit = unit; } | void setDisplacementYUnit( QgsSymbolV2::OutputUnit unit ) { mDisplaceme ntYUnit = unit; } | |||
QgsSymbolV2::OutputUnit displacementYUnit() const { return mDisplacemen tYUnit; } | QgsSymbolV2::OutputUnit displacementYUnit() const { return mDisplacemen tYUnit; } | |||
void setOutputUnit( QgsSymbolV2::OutputUnit unit ); | void setOutputUnit( QgsSymbolV2::OutputUnit unit ); | |||
QgsSymbolV2::OutputUnit outputUnit() const; | QgsSymbolV2::OutputUnit outputUnit() const; | |||
virtual QSet<QString> usedAttributes() const; | ||||
protected: | protected: | |||
QgsMarkerSymbolV2* mMarkerSymbol; | QgsMarkerSymbolV2* mMarkerSymbol; | |||
double mDistanceX; | double mDistanceX; | |||
QgsSymbolV2::OutputUnit mDistanceXUnit; | QgsSymbolV2::OutputUnit mDistanceXUnit; | |||
double mDistanceY; | double mDistanceY; | |||
QgsSymbolV2::OutputUnit mDistanceYUnit; | QgsSymbolV2::OutputUnit mDistanceYUnit; | |||
double mDisplacementX; | double mDisplacementX; | |||
QgsSymbolV2::OutputUnit mDisplacementXUnit; | QgsSymbolV2::OutputUnit mDisplacementXUnit; | |||
double mDisplacementY; | double mDisplacementY; | |||
QgsSymbolV2::OutputUnit mDisplacementYUnit; | QgsSymbolV2::OutputUnit mDisplacementYUnit; | |||
End of changes. 11 change blocks. | ||||
2 lines changed or deleted | 222 lines changed or added | |||
qgsfontutils.h | qgsfontutils.h | |||
---|---|---|---|---|
skipping to change at line 37 | skipping to change at line 37 | |||
*/ | */ | |||
static bool fontMatchOnSystem( const QFont& f ); | static bool fontMatchOnSystem( const QFont& f ); | |||
/** Check whether font family is on system in a quick manner, which doe s not compare [foundry] | /** Check whether font family is on system in a quick manner, which doe s not compare [foundry] | |||
* @param family The family to test | * @param family The family to test | |||
* @returns Whether family was found on system | * @returns Whether family was found on system | |||
* @note This is good for use in loops of large lists, e.g. registering many features for labeling | * @note This is good for use in loops of large lists, e.g. registering many features for labeling | |||
*/ | */ | |||
static bool fontFamilyOnSystem( const QString& family ); | static bool fontFamilyOnSystem( const QString& family ); | |||
/** Check whether font family on system has specific style | ||||
* @param family The family to test | ||||
* @param style The style to test for | ||||
* @returns Whether family has style | ||||
* @note Added in QGIS 2.1 | ||||
*/ | ||||
static bool fontFamilyHasStyle( const QString& family, const QString& s | ||||
tyle ); | ||||
/** Check whether font family is on system | /** Check whether font family is on system | |||
* @param family The family to test | * @param family The family to test | |||
* @param chosen The actual family (possibly from different foundry) re turned by system | * @param chosen The actual family (possibly from different foundry) re turned by system | |||
* @param match Whether the family [foundry] returned by system is a ma tch | * @param match Whether the family [foundry] returned by system is a ma tch | |||
* @returns Whether family was found on system | * @returns Whether family was found on system | |||
*/ | */ | |||
static bool fontFamilyMatchOnSystem( const QString& family, QString* ch osen = 0, bool* match = 0 ); | static bool fontFamilyMatchOnSystem( const QString& family, QString* ch osen = 0, bool* match = 0 ); | |||
/** Updates font with named style and retain all font properties | /** Updates font with named style and retain all font properties | |||
* @param f The font to update | * @param f The font to update | |||
* @param fontstyle The style to try and switch the font to | * @param fontstyle The style to try and switch the font to | |||
* @param fallback If no matching fontstyle found for font, assign most similar or first style found to font | * @param fallback If no matching fontstyle found for font, assign most similar or first style found to font | |||
* @returns Whether the font was updated (also returns true if the requ ested style matches font's current style) | * @returns Whether the font was updated (also returns true if the requ ested style matches font's current style) | |||
* @note This is a more featured replacement for a Qt 4.8+ function: vo id QFont::setStyleName ( const QString & styleName ) | * @note This is a more featured replacement for a Qt 4.8+ function: vo id QFont::setStyleName ( const QString & styleName ) | |||
*/ | */ | |||
static bool updateFontViaStyle( QFont& f, const QString& fontstyle, boo l fallback = false ); | static bool updateFontViaStyle( QFont& f, const QString& fontstyle, boo l fallback = false ); | |||
/** Get standard test font family | ||||
* @note Added in QGIS 2.1 | ||||
*/ | ||||
static QString standardTestFontFamily(); | ||||
/** Loads standard test fonts from filesystem or qrc resource | ||||
* @param loadstyles List of styles to load, e.g. All, Roman, Oblique, | ||||
Bold, Bold Oblique | ||||
* @returns Whether any font was loaded | ||||
* @note Done by default on debug app/server startup to ensure fonts av | ||||
ailable for unit tests (Roman and Bold) | ||||
* @note Added in QGIS 2.1 | ||||
*/ | ||||
static bool loadStandardTestFonts( QStringList loadstyles ); | ||||
/** Get standard test font with specific style | ||||
* @param style Style to load, e.g. Roman, Oblique, Bold, Bold Oblique | ||||
* @param pointsize Font point size to set | ||||
* @returns QFont | ||||
* @note Added in QGIS 2.1 | ||||
*/ | ||||
static QFont getStandardTestFont( const QString& style = "Roman", int p | ||||
ointsize = 12 ); | ||||
}; | }; | |||
#endif // QGSFONTUTILS_H | #endif // QGSFONTUTILS_H | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 32 lines changed or added | |||
qgsgeometry.h | qgsgeometry.h | |||
---|---|---|---|---|
skipping to change at line 71 | skipping to change at line 71 | |||
* various functions for geoprocessing of the geometry. | * various functions for geoprocessing of the geometry. | |||
* | * | |||
* The geometry is represented internally by the OGC WKB format or | * The geometry is represented internally by the OGC WKB format or | |||
* as GEOS geometry. Some functions use WKB for their work, others | * as GEOS geometry. Some functions use WKB for their work, others | |||
* use GEOS. | * use GEOS. | |||
* | * | |||
* TODO: migrate completely to GEOS and only support WKB/Wkt import/export. | * TODO: migrate completely to GEOS and only support WKB/Wkt import/export. | |||
* | * | |||
* @author Brendan Morley | * @author Brendan Morley | |||
*/ | */ | |||
class QgsConstWkbPtr; | ||||
class QgsWkbPtr; | ||||
class CORE_EXPORT QgsGeometry | class CORE_EXPORT QgsGeometry | |||
{ | { | |||
public: | public: | |||
//! Constructor | //! Constructor | |||
QgsGeometry(); | QgsGeometry(); | |||
/** copy constructor will prompt a deep copy of the object */ | /** copy constructor will prompt a deep copy of the object */ | |||
QgsGeometry( const QgsGeometry & ); | QgsGeometry( const QgsGeometry & ); | |||
skipping to change at line 266 | skipping to change at line 268 | |||
double closestSegmentWithContext( const QgsPoint& point, QgsPoint& minD istPoint, int& afterVertex, double* leftOf = 0, double epsilon = DEFAULT_SE GMENT_EPSILON ); | double closestSegmentWithContext( const QgsPoint& point, QgsPoint& minD istPoint, int& afterVertex, double* leftOf = 0, double epsilon = DEFAULT_SE GMENT_EPSILON ); | |||
/**Adds a new ring to this geometry. This makes only sense for polygon and multipolygons. | /**Adds a new ring to this geometry. This makes only sense for polygon and multipolygons. | |||
@return 0 in case of success (ring added), 1 problem with geometry typ e, 2 ring not closed, | @return 0 in case of success (ring added), 1 problem with geometry typ e, 2 ring not closed, | |||
3 ring is not valid geometry, 4 ring not disjoint with existing rings, 5 no polygon found which contained the ring*/ | 3 ring is not valid geometry, 4 ring not disjoint with existing rings, 5 no polygon found which contained the ring*/ | |||
int addRing( const QList<QgsPoint>& ring ); | int addRing( const QList<QgsPoint>& ring ); | |||
/**Adds a new island polygon to a multipolygon feature | /**Adds a new island polygon to a multipolygon feature | |||
@return 0 in case of success, 1 if not a multipolygon, 2 if ring is no t a valid geometry, 3 if new polygon ring | @return 0 in case of success, 1 if not a multipolygon, 2 if ring is no t a valid geometry, 3 if new polygon ring | |||
not disjoint with existing polygons of the feature*/ | not disjoint with existing polygons of the feature*/ | |||
int addPart( const QList<QgsPoint> &points ); | int addPart( const QList<QgsPoint> &points, QGis::GeometryType geomType | |||
= QGis::UnknownGeometry ); | ||||
/**Adds a new island polygon to a multipolygon feature | ||||
@return 0 in case of success, 1 if not a multipolygon, 2 if ring is no | ||||
t a valid geometry, 3 if new polygon ring | ||||
not disjoint with existing polygons of the feature | ||||
@note not available in python bindings | ||||
*/ | ||||
int addPart( GEOSGeometry *newPart ); | ||||
/**Adds a new island polygon to a multipolygon feature | ||||
@return 0 in case of success, 1 if not a multipolygon, 2 if ring is no | ||||
t a valid geometry, 3 if new polygon ring | ||||
not disjoint with existing polygons of the feature | ||||
@note available in python bindings as addPartGeometry (added in 2.2) | ||||
*/ | ||||
int addPart( QgsGeometry *newPart ); | ||||
/**Translate this geometry by dx, dy | /**Translate this geometry by dx, dy | |||
@return 0 in case of success*/ | @return 0 in case of success*/ | |||
int translate( double dx, double dy ); | int translate( double dx, double dy ); | |||
/**Transform this geometry as described by CoordinateTranasform ct | /**Transform this geometry as described by CoordinateTranasform ct | |||
@return 0 in case of success*/ | @return 0 in case of success*/ | |||
int transform( const QgsCoordinateTransform& ct ); | int transform( const QgsCoordinateTransform& ct ); | |||
/**Splits this geometry according to a given line. Note that the geomet ry is only split once. If there are several intersections | /**Splits this geometry according to a given line. Note that the geomet ry is only split once. If there are several intersections | |||
skipping to change at line 310 | skipping to change at line 326 | |||
/** Test for intersection with a rectangle (uses GEOS) */ | /** Test for intersection with a rectangle (uses GEOS) */ | |||
bool intersects( const QgsRectangle& r ) const; | bool intersects( const QgsRectangle& r ) const; | |||
/** Test for intersection with a geometry (uses GEOS) */ | /** Test for intersection with a geometry (uses GEOS) */ | |||
bool intersects( const QgsGeometry* geometry ) const; | bool intersects( const QgsGeometry* geometry ) const; | |||
/** Test for containment of a point (uses GEOS) */ | /** Test for containment of a point (uses GEOS) */ | |||
bool contains( const QgsPoint* p ) const; | bool contains( const QgsPoint* p ) const; | |||
/** Test for if geometry is contained in an other (uses GEOS) | /** Test for if geometry is contained in another (uses GEOS) | |||
* @note added in 1.5 */ | * @note added in 1.5 */ | |||
bool contains( const QgsGeometry* geometry ) const; | bool contains( const QgsGeometry* geometry ) const; | |||
/** Test for if geometry is disjoint of an other (uses GEOS) | /** Test for if geometry is disjoint of another (uses GEOS) | |||
* @note added in 1.5 */ | * @note added in 1.5 */ | |||
bool disjoint( const QgsGeometry* geometry ) const; | bool disjoint( const QgsGeometry* geometry ) const; | |||
/** Test for if geometry equals an other (uses GEOS) | /** Test for if geometry equals another (uses GEOS) | |||
* @note added in 1.5 */ | * @note added in 1.5 */ | |||
bool equals( const QgsGeometry* geometry ) const; | bool equals( const QgsGeometry* geometry ) const; | |||
/** Test for if geometry touch an other (uses GEOS) | /** Test for if geometry touch another (uses GEOS) | |||
* @note added in 1.5 */ | * @note added in 1.5 */ | |||
bool touches( const QgsGeometry* geometry ) const; | bool touches( const QgsGeometry* geometry ) const; | |||
/** Test for if geometry overlaps an other (uses GEOS) | /** Test for if geometry overlaps another (uses GEOS) | |||
* @note added in 1.5 */ | * @note added in 1.5 */ | |||
bool overlaps( const QgsGeometry* geometry ) const; | bool overlaps( const QgsGeometry* geometry ) const; | |||
/** Test for if geometry is within an other (uses GEOS) | /** Test for if geometry is within another (uses GEOS) | |||
* @note added in 1.5 */ | * @note added in 1.5 */ | |||
bool within( const QgsGeometry* geometry ) const; | bool within( const QgsGeometry* geometry ) const; | |||
/** Test for if geometry crosses an other (uses GEOS) | /** Test for if geometry crosses another (uses GEOS) | |||
* @note added in 1.5 */ | * @note added in 1.5 */ | |||
bool crosses( const QgsGeometry* geometry ) const; | bool crosses( const QgsGeometry* geometry ) const; | |||
/** Returns a buffer region around this geometry having the given width and with a specified number | /** Returns a buffer region around this geometry having the given width and with a specified number | |||
of segments used to approximate curves */ | of segments used to approximate curves */ | |||
QgsGeometry* buffer( double distance, int segments ); | QgsGeometry* buffer( double distance, int segments ); | |||
/** Returns a simplified version of this geometry using a specified tol erance value */ | /** Returns a simplified version of this geometry using a specified tol erance value */ | |||
QgsGeometry* simplify( double tolerance ); | QgsGeometry* simplify( double tolerance ); | |||
skipping to change at line 517 | skipping to change at line 533 | |||
* @param new_sequence The updated sequence (The caller becomes the owner if the function returns true). | * @param new_sequence The updated sequence (The caller becomes the owner if the function returns true). | |||
* Returns false if beforeVertex does not correspond to a valid vertex number | * Returns false if beforeVertex does not correspond to a valid vertex number | |||
* on the Coordinate Sequence. | * on the Coordinate Sequence. | |||
*/ | */ | |||
bool insertVertex( double x, double y, | bool insertVertex( double x, double y, | |||
int beforeVertex, | int beforeVertex, | |||
const GEOSCoordSequence* old_sequence, | const GEOSCoordSequence* old_sequence, | |||
GEOSCoordSequence** new_sequence ); | GEOSCoordSequence** new_sequence ); | |||
/**Translates a single vertex by dx and dy. | /**Translates a single vertex by dx and dy. | |||
@param wkbPosition position in wkb array. Is increased automatically by | @param wkbPtr pointer to current position in wkb array. Is increased au | |||
the function | tomatically by the function | |||
@param dx translation of x-coordinate | @param dx translation of x coordinate | |||
@param dy translation of y-coordinate | @param dy translation of y coordinate | |||
@param hasZValue 25D type?*/ | @param hasZValue 25D type?*/ | |||
void translateVertex( int& wkbPosition, double dx, double dy, bool hasZ Value ); | void translateVertex( QgsWkbPtr &wkbPtr, double dx, double dy, bool has ZValue ); | |||
/**Transforms a single vertex by ct. | /**Transforms a single vertex by ct. | |||
@param wkbPosition position in wkb array. Is increased automatically by the function | @param wkbPtr pointer to current position in wkb. Is increased automati cally by the function | |||
@param ct the QgsCoordinateTransform | @param ct the QgsCoordinateTransform | |||
@param hasZValue 25D type?*/ | @param hasZValue 25D type?*/ | |||
void transformVertex( int& wkbPosition, const QgsCoordinateTransform& c t, bool hasZValue ); | void transformVertex( QgsWkbPtr &wkbPtr, const QgsCoordinateTransform& ct, bool hasZValue ); | |||
//helper functions for geometry splitting | //helper functions for geometry splitting | |||
/**Splits line/multiline geometries | /**Splits line/multiline geometries | |||
@param splitLine the line that splits the feature | @param splitLine the line that splits the feature | |||
@param newGeometries new geometries if splitting was successful | @param newGeometries new geometries if splitting was successful | |||
@return 0 in case of success, 1 if geometry has not been split, error else*/ | @return 0 in case of success, 1 if geometry has not been split, error else*/ | |||
int splitLinearGeometry( GEOSGeometry *splitLine, QList<QgsGeometry*>& newGeometries ); | int splitLinearGeometry( GEOSGeometry *splitLine, QList<QgsGeometry*>& newGeometries ); | |||
/**Splits polygon/multipolygon geometries | /**Splits polygon/multipolygon geometries | |||
@return 0 in case of success, 1 if geometry has not been split, erro r else*/ | @return 0 in case of success, 1 if geometry has not been split, erro r else*/ | |||
skipping to change at line 580 | skipping to change at line 596 | |||
/**Tests if geom bounding rect is within -180 <= x <= 180, -90 <= y <= 90. Other methods may use more accurate tolerances if this is true*/ | /**Tests if geom bounding rect is within -180 <= x <= 180, -90 <= y <= 90. Other methods may use more accurate tolerances if this is true*/ | |||
static bool geomInDegrees( const GEOSGeometry* geom ); | static bool geomInDegrees( const GEOSGeometry* geom ); | |||
/**Returns number of single geometry in a geos geometry. Is save for ge os 2 and 3*/ | /**Returns number of single geometry in a geos geometry. Is save for ge os 2 and 3*/ | |||
int numberOfGeometries( GEOSGeometry* g ) const; | int numberOfGeometries( GEOSGeometry* g ) const; | |||
int mergeGeometriesMultiTypeSplit( QVector<GEOSGeometry*>& splitResult ); | int mergeGeometriesMultiTypeSplit( QVector<GEOSGeometry*>& splitResult ); | |||
/** return point from wkb */ | /** return point from wkb */ | |||
QgsPoint asPoint( unsigned char*& ptr, bool hasZValue ) const; | QgsPoint asPoint( QgsConstWkbPtr &wkbPtr, bool hasZValue ) const; | |||
/** return polyline from wkb */ | /** return polyline from wkb */ | |||
QgsPolyline asPolyline( unsigned char*& ptr, bool hasZValue ) const; | QgsPolyline asPolyline( QgsConstWkbPtr &wkbPtr, bool hasZValue ) const; | |||
/** return polygon from wkb */ | /** return polygon from wkb */ | |||
QgsPolygon asPolygon( unsigned char*& ptr, bool hasZValue ) const; | QgsPolygon asPolygon( QgsConstWkbPtr &wkbPtr, bool hasZValue ) const; | |||
static bool geosRelOp( char( *op )( const GEOSGeometry*, const GEOSGeom etry * ), | static bool geosRelOp( char( *op )( const GEOSGeometry*, const GEOSGeom etry * ), | |||
const QgsGeometry* a, const QgsGeometry* b ); | const QgsGeometry* a, const QgsGeometry* b ); | |||
/**Returns < 0 if point(x/y) is left of the line x1,y1 -> x1,y2*/ | /**Returns < 0 if point(x/y) is left of the line x1,y1 -> x1,y2*/ | |||
double leftOf( double x, double y, double& x1, double& y1, double& x2, double& y2 ); | double leftOf( double x, double y, double& x1, double& y1, double& x2, double& y2 ); | |||
static inline bool moveVertex( QgsWkbPtr &wkbPtr, const double &x, cons | ||||
t double &y, int atVertex, bool hasZValue, int &pointIndex, bool isRing ); | ||||
static inline bool deleteVertex( QgsConstWkbPtr &srcPtr, QgsWkbPtr &dst | ||||
Ptr, int atVertex, bool hasZValue, int &pointIndex, bool isRing, bool lastI | ||||
tem ); | ||||
static inline bool insertVertex( QgsConstWkbPtr &srcPtr, QgsWkbPtr &dst | ||||
Ptr, int beforeVertex, const double &x, const double &y, bool hasZValue, in | ||||
t &pointIndex, bool isRing ); | ||||
}; // class QgsGeometry | }; // class QgsGeometry | |||
Q_DECLARE_METATYPE( QgsGeometry ); | Q_DECLARE_METATYPE( QgsGeometry ); | |||
class CORE_EXPORT QgsWkbPtr | ||||
{ | ||||
mutable unsigned char *mP; | ||||
public: | ||||
QgsWkbPtr( unsigned char *p ) { mP = p; } | ||||
inline const QgsWkbPtr &operator>>( double &v ) const { memcpy( &v, mP, | ||||
sizeof( v ) ); mP += sizeof( v ); return *this; } | ||||
inline const QgsWkbPtr &operator>>( int &v ) const { memcpy( &v, mP, si | ||||
zeof( v ) ); mP += sizeof( v ); return *this; } | ||||
inline const QgsWkbPtr &operator>>( unsigned int &v ) const { memcpy( & | ||||
v, mP, sizeof( v ) ); mP += sizeof( v ); return *this; } | ||||
inline const QgsWkbPtr &operator>>( char &v ) const { memcpy( &v, mP, s | ||||
izeof( v ) ); mP += sizeof( v ); return *this; } | ||||
inline const QgsWkbPtr &operator>>( QGis::WkbType &v ) const { memcpy( | ||||
&v, mP, sizeof( v ) ); mP += sizeof( v ); return *this; } | ||||
inline QgsWkbPtr &operator<<( const double &v ) { memcpy( mP, &v, sizeo | ||||
f( v ) ); mP += sizeof( v ); return *this; } | ||||
inline QgsWkbPtr &operator<<( const int &v ) { memcpy( mP, &v, sizeof( | ||||
v ) ); mP += sizeof( v ); return *this; } | ||||
inline QgsWkbPtr &operator<<( const unsigned int &v ) { memcpy( mP, &v, | ||||
sizeof( v ) ); mP += sizeof( v ); return *this; } | ||||
inline QgsWkbPtr &operator<<( const char &v ) { memcpy( mP, &v, sizeof( | ||||
v ) ); mP += sizeof( v ); return *this; } | ||||
inline QgsWkbPtr &operator<<( const QGis::WkbType &v ) { memcpy( mP, &v | ||||
, sizeof( v ) ); mP += sizeof( v ); return *this; } | ||||
inline void operator+=( int n ) { mP += n; } | ||||
inline operator unsigned char *() const { return mP; } | ||||
}; | ||||
class CORE_EXPORT QgsConstWkbPtr | ||||
{ | ||||
mutable unsigned char *mP; | ||||
public: | ||||
QgsConstWkbPtr( const unsigned char *p ) { mP = ( unsigned char * ) p; | ||||
} | ||||
inline const QgsConstWkbPtr &operator>>( double &v ) const { memcpy( &v | ||||
, mP, sizeof( v ) ); mP += sizeof( v ); return *this; } | ||||
inline const QgsConstWkbPtr &operator>>( int &v ) const { memcpy( &v, m | ||||
P, sizeof( v ) ); mP += sizeof( v ); return *this; } | ||||
inline const QgsConstWkbPtr &operator>>( unsigned int &v ) const { memc | ||||
py( &v, mP, sizeof( v ) ); mP += sizeof( v ); return *this; } | ||||
inline const QgsConstWkbPtr &operator>>( char &v ) const { memcpy( &v, | ||||
mP, sizeof( v ) ); mP += sizeof( v ); return *this; } | ||||
inline const QgsConstWkbPtr &operator>>( QGis::WkbType &v ) const { mem | ||||
cpy( &v, mP, sizeof( v ) ); mP += sizeof( v ); return *this; } | ||||
inline void operator+=( int n ) { mP += n; } | ||||
inline operator const unsigned char *() const { return mP; } | ||||
}; | ||||
#endif | #endif | |||
End of changes. 18 change blocks. | ||||
18 lines changed or deleted | 104 lines changed or added | |||
qgsgml.h | qgsgml.h | |||
---|---|---|---|---|
skipping to change at line 21 | skipping to change at line 21 | |||
* the Free Software Foundation; either version 2 of the License, or * | * the Free Software Foundation; either version 2 of the License, or * | |||
* (at your option) any later version. * | * (at your option) any later version. * | |||
* * | * * | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef QGSGML_H | #ifndef QGSGML_H | |||
#define QGSGML_H | #define QGSGML_H | |||
#include <expat.h> | #include <expat.h> | |||
#include "qgis.h" | #include "qgis.h" | |||
#include "qgsapplication.h" | #include "qgsapplication.h" | |||
#include "qgscoordinatereferencesystem.h" | ||||
#include "qgsdataprovider.h" | #include "qgsdataprovider.h" | |||
#include "qgsfeature.h" | #include "qgsfeature.h" | |||
#include "qgsfield.h" | #include "qgsfield.h" | |||
#include "qgslogger.h" | #include "qgslogger.h" | |||
#include "qgspoint.h" | #include "qgspoint.h" | |||
#include "qgsrectangle.h" | #include "qgsrectangle.h" | |||
#include <QPair> | #include <QPair> | |||
#include <QByteArray> | #include <QByteArray> | |||
#include <QDomElement> | #include <QDomElement> | |||
#include <QStringList> | #include <QStringList> | |||
#include <QStack> | #include <QStack> | |||
class QgsRectangle; | class QgsRectangle; | |||
class QgsCoordinateReferenceSystem; | ||||
/**This class reads data from a WFS server or alternatively from a GML file . It | /**This class reads data from a WFS server or alternatively from a GML file . It | |||
* uses the expat XML parser and an event based model to keep performance h igh. | * uses the expat XML parser and an event based model to keep performance h igh. | |||
* The parsing starts when the first data arrives, it does not wait until t he | * The parsing starts when the first data arrives, it does not wait until t he | |||
* request is finished */ | * request is finished */ | |||
class CORE_EXPORT QgsGml : public QObject | class CORE_EXPORT QgsGml : public QObject | |||
{ | { | |||
Q_OBJECT | Q_OBJECT | |||
public: | public: | |||
QgsGml( | QgsGml( | |||
const QString& typeName, | const QString& typeName, | |||
const QString& geometryAttribute, | const QString& geometryAttribute, | |||
const QgsFields & fields ); | const QgsFields & fields ); | |||
~QgsGml(); | ~QgsGml(); | |||
/** Does the Http GET request to the wfs server | /** Does the Http GET request to the wfs server | |||
* Supports only UTF-8, UTF-16, ISO-8859-1, ISO-8859-1 XML encodings. | ||||
* @param uri GML URL | * @param uri GML URL | |||
* @param wkbType wkbType to retrieve | * @param wkbType wkbType to retrieve | |||
* @param extent retrieved extents | * @param extent retrieved extents | |||
* @return 0 in case of success | * @return 0 in case of success | |||
*/ | */ | |||
int getFeatures( const QString& uri, QGis::WkbType* wkbType, QgsRectang le* extent = 0 ); | int getFeatures( const QString& uri, QGis::WkbType* wkbType, QgsRectang le* extent = 0 ); | |||
/** Read from GML data. Constructor uri param is ignored */ | /** Read from GML data. Constructor uri param is ignored | |||
* Supports only UTF-8, UTF-16, ISO-8859-1, ISO-8859-1 XML encodings. | ||||
*/ | ||||
int getFeatures( const QByteArray &data, QGis::WkbType* wkbType, QgsRec tangle* extent = 0 ); | int getFeatures( const QByteArray &data, QGis::WkbType* wkbType, QgsRec tangle* extent = 0 ); | |||
/** Get parsed features for given type name */ | /** Get parsed features for given type name */ | |||
QMap<QgsFeatureId, QgsFeature* > featuresMap() const { return mFeatures ; } | QMap<QgsFeatureId, QgsFeature* > featuresMap() const { return mFeatures ; } | |||
/** Get feature ids map */ | /** Get feature ids map */ | |||
QMap<QgsFeatureId, QString > idsMap() const { return mIdMap; } | QMap<QgsFeatureId, QString > idsMap() const { return mIdMap; } | |||
/** Returns features spatial reference system | ||||
@note Added in QGIS 2.1 */ | ||||
QgsCoordinateReferenceSystem crs() const; | ||||
private slots: | private slots: | |||
void setFinished(); | void setFinished(); | |||
/**Takes progress value and total steps and emit signals 'dataReadProgr ess' and 'totalStepUpdate'*/ | /**Takes progress value and total steps and emit signals 'dataReadProgr ess' and 'totalStepUpdate'*/ | |||
void handleProgressEvent( qint64 progress, qint64 totalSteps ); | void handleProgressEvent( qint64 progress, qint64 totalSteps ); | |||
signals: | signals: | |||
void dataReadProgress( int progress ); | void dataReadProgress( int progress ); | |||
void totalStepsUpdate( int totalSteps ); | void totalStepsUpdate( int totalSteps ); | |||
skipping to change at line 92 | skipping to change at line 99 | |||
private: | private: | |||
enum ParseMode | enum ParseMode | |||
{ | { | |||
none, | none, | |||
boundingBox, | boundingBox, | |||
feature, // feature element containing attrs and geo (inside gml:fea tureMember) | feature, // feature element containing attrs and geo (inside gml:fea tureMember) | |||
attribute, | attribute, | |||
geometry, | geometry, | |||
coordinate, | coordinate, | |||
posList, | ||||
multiPoint, | multiPoint, | |||
multiLine, | multiLine, | |||
multiPolygon | multiPolygon | |||
}; | }; | |||
/**XML handler methods*/ | /**XML handler methods*/ | |||
void startElement( const XML_Char* el, const XML_Char** attr ); | void startElement( const XML_Char* el, const XML_Char** attr ); | |||
void endElement( const XML_Char* el ); | void endElement( const XML_Char* el ); | |||
void characters( const XML_Char* chars, int len ); | void characters( const XML_Char* chars, int len ); | |||
static void start( void* data, const XML_Char* el, const XML_Char** att r ) | static void start( void* data, const XML_Char* el, const XML_Char** att r ) | |||
skipping to change at line 138 | skipping to change at line 146 | |||
/**Creates a rectangle from a coordinate string. | /**Creates a rectangle from a coordinate string. | |||
@return 0 in case of success*/ | @return 0 in case of success*/ | |||
int createBBoxFromCoordinateString( QgsRectangle &bb, const QString& co ordString ) const; | int createBBoxFromCoordinateString( QgsRectangle &bb, const QString& co ordString ) const; | |||
/**Creates a set of points from a coordinate string. | /**Creates a set of points from a coordinate string. | |||
@param points list that will contain the created points | @param points list that will contain the created points | |||
@param coordString the text containing the coordinates | @param coordString the text containing the coordinates | |||
@return 0 in case of success | @return 0 in case of success | |||
*/ | */ | |||
int pointsFromCoordinateString( QList<QgsPoint>& points, const QString& coordString ) const; | int pointsFromCoordinateString( QList<QgsPoint>& points, const QString& coordString ) const; | |||
/**Creates a set of points from a gml:posList or gml:pos coordinate str | ||||
ing. | ||||
@param points list that will contain the created points | ||||
@param coordString the text containing the coordinates | ||||
@param dimension number of dimensions | ||||
@return 0 in case of success | ||||
*/ | ||||
int pointsFromPosListString( QList<QgsPoint>& points, const QString& co | ||||
ordString, int dimension ) const; | ||||
int pointsFromString( QList<QgsPoint>& points, const QString& coordStri | ||||
ng ) const; | ||||
int getPointWKB( unsigned char** wkb, int* size, const QgsPoint& ) cons t; | int getPointWKB( unsigned char** wkb, int* size, const QgsPoint& ) cons t; | |||
int getLineWKB( unsigned char** wkb, int* size, const QList<QgsPoint>& lineCoordinates ) const; | int getLineWKB( unsigned char** wkb, int* size, const QList<QgsPoint>& lineCoordinates ) const; | |||
int getRingWKB( unsigned char** wkb, int* size, const QList<QgsPoint>& ringCoordinates ) const; | int getRingWKB( unsigned char** wkb, int* size, const QList<QgsPoint>& ringCoordinates ) const; | |||
/**Creates a multiline from the information in mCurrentWKBFragments and | /**Creates a multiline from the information in mCurrentWKBFragments and | |||
* mCurrentWKBFragmentSizes. Assign the result. The multiline is in | * mCurrentWKBFragmentSizes. Assign the result. The multiline is in | |||
* mCurrentWKB and mCurrentWKBSize. The function deletes the memory in | * mCurrentWKB and mCurrentWKBSize. The function deletes the memory in | |||
* mCurrentWKBFragments. Returns 0 in case of success. | * mCurrentWKBFragments. Returns 0 in case of success. | |||
*/ | */ | |||
int createMultiLineFromFragments(); | int createMultiLineFromFragments(); | |||
int createMultiPointFromFragments(); | int createMultiPointFromFragments(); | |||
skipping to change at line 215 | skipping to change at line 232 | |||
* are used*/ | * are used*/ | |||
QList< QList<unsigned char*> > mCurrentWKBFragments; | QList< QList<unsigned char*> > mCurrentWKBFragments; | |||
/**Similar to mCurrentWKB, but only the size*/ | /**Similar to mCurrentWKB, but only the size*/ | |||
QList< QList<int> > mCurrentWKBFragmentSizes; | QList< QList<int> > mCurrentWKBFragmentSizes; | |||
QString mAttributeName; | QString mAttributeName; | |||
QgsApplication::endian_t mEndian; | QgsApplication::endian_t mEndian; | |||
/**Coordinate separator for coordinate strings. Usually "," */ | /**Coordinate separator for coordinate strings. Usually "," */ | |||
QString mCoordinateSeparator; | QString mCoordinateSeparator; | |||
/**Tuple separator for coordinate strings. Usually " " */ | /**Tuple separator for coordinate strings. Usually " " */ | |||
QString mTupleSeparator; | QString mTupleSeparator; | |||
/** Number of dimensions in pos or posList */ | ||||
int mDimension; | ||||
/** Coordinates mode, coordinate or posList */ | ||||
ParseMode mCoorMode; | ||||
/** EPSG of parsed features geometries */ | ||||
int mEpsg; | ||||
}; | }; | |||
#endif | #endif | |||
End of changes. 8 change blocks. | ||||
2 lines changed or deleted | 28 lines changed or added | |||
qgsgmlschema.h | qgsgmlschema.h | |||
---|---|---|---|---|
skipping to change at line 22 | skipping to change at line 22 | |||
* (at your option) any later version. * | * (at your option) any later version. * | |||
* * | * * | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef QGSGMLSCHEMA_H | #ifndef QGSGMLSCHEMA_H | |||
#define QGSGMLSCHEMA_H | #define QGSGMLSCHEMA_H | |||
#include <expat.h> | #include <expat.h> | |||
#include "qgis.h" | #include "qgis.h" | |||
#include "qgsapplication.h" | #include "qgsapplication.h" | |||
#include "qgsdataprovider.h" | #include "qgsdataprovider.h" | |||
#include "qgserror.h" | ||||
#include "qgsfeature.h" | #include "qgsfeature.h" | |||
#include "qgsfield.h" | #include "qgsfield.h" | |||
#include "qgslogger.h" | #include "qgslogger.h" | |||
#include "qgspoint.h" | #include "qgspoint.h" | |||
#include <list> | #include <list> | |||
#include <set> | #include <set> | |||
#include <stack> | #include <stack> | |||
#include <QPair> | #include <QPair> | |||
#include <QByteArray> | #include <QByteArray> | |||
#include <QDomElement> | #include <QDomElement> | |||
skipping to change at line 74 | skipping to change at line 75 | |||
/* Fields */ | /* Fields */ | |||
// Do not use QMap to keep original fields order. If it gets to perform ance, | // Do not use QMap to keep original fields order. If it gets to perform ance, | |||
// add a field index map | // add a field index map | |||
QList<QgsField> mFields; | QList<QgsField> mFields; | |||
/* Geometry attribute */ | /* Geometry attribute */ | |||
QStringList mGeometryAttributes; | QStringList mGeometryAttributes; | |||
}; | }; | |||
class CORE_EXPORT QgsGmlSchema: public QObject | class CORE_EXPORT QgsGmlSchema : public QObject | |||
{ | { | |||
Q_OBJECT | Q_OBJECT | |||
public: | public: | |||
QgsGmlSchema(); | QgsGmlSchema(); | |||
~QgsGmlSchema(); | ~QgsGmlSchema(); | |||
/** Get fields info from XSD */ | /** Get fields info from XSD */ | |||
bool parseXSD( const QByteArray &xml ); | bool parseXSD( const QByteArray &xml ); | |||
/** Guess GML schema from data if XSD does not exist. | /** Guess GML schema from data if XSD does not exist. | |||
* Currently only recognizes UMN Mapserver GetFeatureInfo GML response . | * Currently only recognizes UMN Mapserver GetFeatureInfo GML response . | |||
* Supports only UTF-8, UTF-16, ISO-8859-1, US-ASCII XML encodings. | ||||
* @param data GML data | * @param data GML data | |||
* @return true in case of success */ | * @return true in case of success */ | |||
bool guessSchema( const QByteArray &data ); | bool guessSchema( const QByteArray &data ); | |||
/** Get list of dot separated paths to feature classes parsed from GML or XSD */ | /** Get list of dot separated paths to feature classes parsed from GML or XSD */ | |||
QStringList typeNames() const; | QStringList typeNames() const; | |||
/** Get fields for type/class name parsed from GML or XSD */ | /** Get fields for type/class name parsed from GML or XSD */ | |||
QList<QgsField> fields( const QString & typeName ); | QList<QgsField> fields( const QString & typeName ); | |||
/** Get list of geometry attributes for type/class name */ | /** Get list of geometry attributes for type/class name */ | |||
QStringList geometryAttributes( const QString & typeName ); | QStringList geometryAttributes( const QString & typeName ); | |||
/** Get error if parseXSD() or guessSchema() failed */ | ||||
QgsError error() const { return mError; } | ||||
private: | private: | |||
enum ParseMode | enum ParseMode | |||
{ | { | |||
none, | none, | |||
boundingBox, | boundingBox, | |||
featureMembers, // gml:featureMembers | ||||
featureMember, // gml:featureMember | featureMember, // gml:featureMember | |||
feature, // feature element containint attrs and geo (inside gml:fea tureMember) | feature, // feature element containint attrs and geo (inside gml:fea tureMember) | |||
attribute, | attribute, | |||
geometry | geometry | |||
}; | }; | |||
/**XML handler methods*/ | /**XML handler methods*/ | |||
void startElement( const XML_Char* el, const XML_Char** attr ); | void startElement( const XML_Char* el, const XML_Char** attr ); | |||
void endElement( const XML_Char* el ); | void endElement( const XML_Char* el ); | |||
void characters( const XML_Char* chars, int len ); | void characters( const XML_Char* chars, int len ); | |||
skipping to change at line 201 | skipping to change at line 207 | |||
/** Path to current level */ | /** Path to current level */ | |||
QStringList mParsePathStack; | QStringList mParsePathStack; | |||
QString mCurrentFeatureName; | QString mCurrentFeatureName; | |||
// List of know geometries (Point, Multipoint,...) | // List of know geometries (Point, Multipoint,...) | |||
QStringList mGeometryTypes; | QStringList mGeometryTypes; | |||
/* Feature classes map with element paths as keys */ | /* Feature classes map with element paths as keys */ | |||
QMap<QString, QgsGmlFeatureClass> mFeatureClassMap; | QMap<QString, QgsGmlFeatureClass> mFeatureClassMap; | |||
/* Error set if something failed */ | ||||
QgsError mError; | ||||
}; | }; | |||
#endif | #endif | |||
End of changes. 6 change blocks. | ||||
1 lines changed or deleted | 10 lines changed or added | |||
qgsgraduatedsymbolrendererv2.h | qgsgraduatedsymbolrendererv2.h | |||
---|---|---|---|---|
skipping to change at line 20 | skipping to change at line 20 | |||
* it under the terms of the GNU General Public License as published by * | * it under the terms of the GNU General Public License as published by * | |||
* the Free Software Foundation; either version 2 of the License, or * | * the Free Software Foundation; either version 2 of the License, or * | |||
* (at your option) any later version. * | * (at your option) any later version. * | |||
* * | * * | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef QGSGRADUATEDSYMBOLRENDERERV2_H | #ifndef QGSGRADUATEDSYMBOLRENDERERV2_H | |||
#define QGSGRADUATEDSYMBOLRENDERERV2_H | #define QGSGRADUATEDSYMBOLRENDERERV2_H | |||
#include "qgssymbolv2.h" | #include "qgssymbolv2.h" | |||
#include "qgsrendererv2.h" | #include "qgsrendererv2.h" | |||
#include "qgsexpression.h" | ||||
#include <QScopedPointer> | ||||
class CORE_EXPORT QgsRendererRangeV2 | class CORE_EXPORT QgsRendererRangeV2 | |||
{ | { | |||
public: | public: | |||
QgsRendererRangeV2(); | QgsRendererRangeV2(); | |||
QgsRendererRangeV2( double lowerValue, double upperValue, QgsSymbolV2* symbol, QString label ); | QgsRendererRangeV2( double lowerValue, double upperValue, QgsSymbolV2* symbol, QString label ); | |||
QgsRendererRangeV2( const QgsRendererRangeV2& range ); | QgsRendererRangeV2( const QgsRendererRangeV2& range ); | |||
~QgsRendererRangeV2(); | // default dtor is ok | |||
QgsRendererRangeV2& operator=( const QgsRendererRangeV2& range ); | QgsRendererRangeV2& operator=( QgsRendererRangeV2 range ); | |||
double lowerValue() const; | double lowerValue() const; | |||
double upperValue() const; | double upperValue() const; | |||
QgsSymbolV2* symbol() const; | QgsSymbolV2* symbol() const; | |||
QString label() const; | QString label() const; | |||
void setSymbol( QgsSymbolV2* s ); | void setSymbol( QgsSymbolV2* s ); | |||
void setLabel( QString label ); | void setLabel( QString label ); | |||
void setLowerValue( double lowerValue ); | void setLowerValue( double lowerValue ); | |||
void setUpperValue( double upperValue ); | void setUpperValue( double upperValue ); | |||
// debugging | // debugging | |||
QString dump() const; | QString dump() const; | |||
void toSld( QDomDocument& doc, QDomElement &element, QgsStringMap props ) const; | void toSld( QDomDocument& doc, QDomElement &element, QgsStringMap props ) const; | |||
protected: | protected: | |||
double mLowerValue, mUpperValue; | double mLowerValue, mUpperValue; | |||
QgsSymbolV2* mSymbol; | QScopedPointer<QgsSymbolV2> mSymbol; | |||
QString mLabel; | QString mLabel; | |||
// for cpy+swap idiom | ||||
void swap( QgsRendererRangeV2 & other ); | ||||
}; | }; | |||
typedef QList<QgsRendererRangeV2> QgsRangeList; | typedef QList<QgsRendererRangeV2> QgsRangeList; | |||
class QgsVectorLayer; | class QgsVectorLayer; | |||
class QgsVectorColorRampV2; | class QgsVectorColorRampV2; | |||
class CORE_EXPORT QgsGraduatedSymbolRendererV2 : public QgsFeatureRendererV 2 | class CORE_EXPORT QgsGraduatedSymbolRendererV2 : public QgsFeatureRendererV 2 | |||
{ | { | |||
public: | public: | |||
QgsGraduatedSymbolRendererV2( QString attrName = QString(), QgsRangeLis t ranges = QgsRangeList() ); | QgsGraduatedSymbolRendererV2( QString attrName = QString(), QgsRangeLis t ranges = QgsRangeList() ); | |||
QgsGraduatedSymbolRendererV2( const QgsGraduatedSymbolRendererV2 & othe r ); | ||||
virtual ~QgsGraduatedSymbolRendererV2(); | virtual ~QgsGraduatedSymbolRendererV2(); | |||
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature ); | virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature ); | |||
virtual void startRender( QgsRenderContext& context, const QgsVectorLay er *vlayer ); | virtual void startRender( QgsRenderContext& context, const QgsVectorLay er *vlayer ); | |||
virtual void stopRender( QgsRenderContext& context ); | virtual void stopRender( QgsRenderContext& context ); | |||
virtual QList<QString> usedAttributes(); | virtual QList<QString> usedAttributes(); | |||
skipping to change at line 97 | skipping to change at line 103 | |||
void setClassAttribute( QString attr ) { mAttrName = attr; } | void setClassAttribute( QString attr ) { mAttrName = attr; } | |||
const QgsRangeList& ranges() { return mRanges; } | const QgsRangeList& ranges() { return mRanges; } | |||
bool updateRangeSymbol( int rangeIndex, QgsSymbolV2* symbol ); | bool updateRangeSymbol( int rangeIndex, QgsSymbolV2* symbol ); | |||
bool updateRangeLabel( int rangeIndex, QString label ); | bool updateRangeLabel( int rangeIndex, QString label ); | |||
bool updateRangeUpperValue( int rangeIndex, double value ); | bool updateRangeUpperValue( int rangeIndex, double value ); | |||
bool updateRangeLowerValue( int rangeIndex, double value ); | bool updateRangeLowerValue( int rangeIndex, double value ); | |||
void addClass( QgsSymbolV2* symbol ); | void addClass( QgsSymbolV2* symbol ); | |||
//! @note available in python bindings as addClassRange | ||||
void addClass( QgsRendererRangeV2 range ); | ||||
void deleteClass( int idx ); | void deleteClass( int idx ); | |||
void deleteAllClasses(); | void deleteAllClasses(); | |||
//! Moves the category at index position from to index position to. | //! Moves the category at index position from to index position to. | |||
void moveClass( int from, int to ); | void moveClass( int from, int to ); | |||
void sortByValue( Qt::SortOrder order = Qt::AscendingOrder ); | void sortByValue( Qt::SortOrder order = Qt::AscendingOrder ); | |||
void sortByLabel( Qt::SortOrder order = Qt::AscendingOrder ); | void sortByLabel( Qt::SortOrder order = Qt::AscendingOrder ); | |||
enum Mode | enum Mode | |||
skipping to change at line 125 | skipping to change at line 133 | |||
Mode mode() const { return mMode; } | Mode mode() const { return mMode; } | |||
void setMode( Mode mode ) { mMode = mode; } | void setMode( Mode mode ) { mMode = mode; } | |||
static QgsGraduatedSymbolRendererV2* createRenderer( | static QgsGraduatedSymbolRendererV2* createRenderer( | |||
QgsVectorLayer* vlayer, | QgsVectorLayer* vlayer, | |||
QString attrName, | QString attrName, | |||
int classes, | int classes, | |||
Mode mode, | Mode mode, | |||
QgsSymbolV2* symbol, | QgsSymbolV2* symbol, | |||
QgsVectorColorRampV2* ramp ); | QgsVectorColorRampV2* ramp, | |||
bool inverted = false ); | ||||
//! create renderer from XML element | //! create renderer from XML element | |||
static QgsFeatureRendererV2* create( QDomElement& element ); | static QgsFeatureRendererV2* create( QDomElement& element ); | |||
//! store renderer info to XML element | //! store renderer info to XML element | |||
virtual QDomElement save( QDomDocument& doc ); | virtual QDomElement save( QDomDocument& doc ); | |||
//! return a list of symbology items for the legend | //! return a list of symbology items for the legend | |||
virtual QgsLegendSymbologyList legendSymbologyItems( QSize iconSize ); | virtual QgsLegendSymbologyList legendSymbologyItems( QSize iconSize ); | |||
//! return a list of item text / symbol | //! return a list of item text / symbol | |||
//! @note: this method was added in version 1.5 | //! @note: this method was added in version 1.5 | |||
//! @note not available in python bindings | //! @note not available in python bindings | |||
virtual QgsLegendSymbolList legendSymbolItems(); | virtual QgsLegendSymbolList legendSymbolItems( double scaleDenominator = -1, QString rule = QString() ); | |||
QgsSymbolV2* sourceSymbol(); | QgsSymbolV2* sourceSymbol(); | |||
void setSourceSymbol( QgsSymbolV2* sym ); | void setSourceSymbol( QgsSymbolV2* sym ); | |||
QgsVectorColorRampV2* sourceColorRamp(); | QgsVectorColorRampV2* sourceColorRamp(); | |||
void setSourceColorRamp( QgsVectorColorRampV2* ramp ); | void setSourceColorRamp( QgsVectorColorRampV2* ramp ); | |||
//! @note added in 2.1 | ||||
bool invertedColorRamp() { return mInvertedColorRamp; } | ||||
void setInvertedColorRamp( bool inverted ) { mInvertedColorRamp = inver | ||||
ted; } | ||||
/** Update the color ramp used. Also updates all symbols colors. | /** Update the color ramp used. Also updates all symbols colors. | |||
* Doesn't alter current breaks. | * Doesn't alter current breaks. | |||
*/ | */ | |||
void updateColorRamp( QgsVectorColorRampV2* ramp ); | void updateColorRamp( QgsVectorColorRampV2* ramp, bool inverted = false ); | |||
/** Update the all symbols but leave breaks and colors. */ | /** Update the all symbols but leave breaks and colors. */ | |||
void updateSymbols( QgsSymbolV2* sym ); | void updateSymbols( QgsSymbolV2* sym ); | |||
//! @note added in 1.6 | //! @note added in 1.6 | |||
void setRotationField( QString fieldName ) { mRotationField = fieldName ; } | void setRotationField( QString fieldOrExpression ); | |||
//! @note added in 1.6 | //! @note added in 1.6 | |||
QString rotationField() const { return mRotationField; } | QString rotationField() const; | |||
//! @note added in 1.6 | //! @note added in 1.6 | |||
void setSizeScaleField( QString fieldName ) { mSizeScaleField = fieldNa me; } | void setSizeScaleField( QString fieldOrExpression ); | |||
//! @note added in 1.6 | //! @note added in 1.6 | |||
QString sizeScaleField() const { return mSizeScaleField; } | QString sizeScaleField() const; | |||
//! @note added in 2.0 | //! @note added in 2.0 | |||
void setScaleMethod( QgsSymbolV2::ScaleMethod scaleMethod ); | void setScaleMethod( QgsSymbolV2::ScaleMethod scaleMethod ); | |||
//! @note added in 2.0 | //! @note added in 2.0 | |||
QgsSymbolV2::ScaleMethod scaleMethod() const { return mScaleMethod; } | QgsSymbolV2::ScaleMethod scaleMethod() const { return mScaleMethod; } | |||
protected: | protected: | |||
QString mAttrName; | QString mAttrName; | |||
QgsRangeList mRanges; | QgsRangeList mRanges; | |||
Mode mMode; | Mode mMode; | |||
QgsSymbolV2* mSourceSymbol; | QScopedPointer<QgsSymbolV2> mSourceSymbol; | |||
QgsVectorColorRampV2* mSourceColorRamp; | QScopedPointer<QgsVectorColorRampV2> mSourceColorRamp; | |||
QString mRotationField; | bool mInvertedColorRamp; | |||
QString mSizeScaleField; | QScopedPointer<QgsExpression> mRotation; | |||
QScopedPointer<QgsExpression> mSizeScale; | ||||
QgsSymbolV2::ScaleMethod mScaleMethod; | QgsSymbolV2::ScaleMethod mScaleMethod; | |||
QScopedPointer<QgsExpression> mExpression; | ||||
//! attribute index (derived from attribute name in startRender) | //! attribute index (derived from attribute name in startRender) | |||
int mAttrNum; | int mAttrNum; | |||
int mRotationFieldIdx, mSizeScaleFieldIdx; | ||||
//! temporary symbols, used for data-defined rotation and scaling | //! temporary symbols, used for data-defined rotation and scaling | |||
#if QT_VERSION < 0x40600 | ||||
QMap<QgsSymbolV2*, QgsSymbolV2*> mTempSymbols; | ||||
#else | ||||
QHash<QgsSymbolV2*, QgsSymbolV2*> mTempSymbols; | QHash<QgsSymbolV2*, QgsSymbolV2*> mTempSymbols; | |||
#endif | ||||
QgsSymbolV2* symbolForValue( double value ); | QgsSymbolV2* symbolForValue( double value ); | |||
}; | }; | |||
#endif // QGSGRADUATEDSYMBOLRENDERERV2_H | #endif // QGSGRADUATEDSYMBOLRENDERERV2_H | |||
End of changes. 21 change blocks. | ||||
20 lines changed or deleted | 30 lines changed or added | |||
qgsgraduatedsymbolrendererv2widget.h | qgsgraduatedsymbolrendererv2widget.h | |||
---|---|---|---|---|
skipping to change at line 46 | skipping to change at line 46 | |||
int rowCount( const QModelIndex &parent = QModelIndex() ) const; | int rowCount( const QModelIndex &parent = QModelIndex() ) const; | |||
int columnCount( const QModelIndex & = QModelIndex() ) const; | int columnCount( const QModelIndex & = QModelIndex() ) const; | |||
QModelIndex index( int row, int column, const QModelIndex &parent = QMo delIndex() ) const; | QModelIndex index( int row, int column, const QModelIndex &parent = QMo delIndex() ) const; | |||
QModelIndex parent( const QModelIndex &index ) const; | QModelIndex parent( const QModelIndex &index ) const; | |||
QStringList mimeTypes() const; | QStringList mimeTypes() const; | |||
QMimeData *mimeData( const QModelIndexList &indexes ) const; | QMimeData *mimeData( const QModelIndexList &indexes ) const; | |||
bool dropMimeData( const QMimeData *data, Qt::DropAction action, int ro w, int column, const QModelIndex &parent ); | bool dropMimeData( const QMimeData *data, Qt::DropAction action, int ro w, int column, const QModelIndex &parent ); | |||
void setRenderer( QgsGraduatedSymbolRendererV2* renderer ); | void setRenderer( QgsGraduatedSymbolRendererV2* renderer ); | |||
QgsRendererRangeV2 rendererRange( const QModelIndex &index ); | ||||
void addClass( QgsSymbolV2* symbol ); | void addClass( QgsSymbolV2* symbol ); | |||
void addClass( QgsRendererRangeV2 range ); | ||||
void deleteRows( QList<int> rows ); | void deleteRows( QList<int> rows ); | |||
void removeAllRows( ); | void removeAllRows( ); | |||
void sort( int column, Qt::SortOrder order = Qt::AscendingOrder ); | void sort( int column, Qt::SortOrder order = Qt::AscendingOrder ); | |||
signals: | signals: | |||
void rowsMoved(); | void rowsMoved(); | |||
private: | private: | |||
QgsGraduatedSymbolRendererV2* mRenderer; | QgsGraduatedSymbolRendererV2* mRenderer; | |||
QString mMimeFormat; | QString mMimeFormat; | |||
skipping to change at line 83 | skipping to change at line 85 | |||
static QgsRendererV2Widget* create( QgsVectorLayer* layer, QgsStyleV2* style, QgsFeatureRendererV2* renderer ); | static QgsRendererV2Widget* create( QgsVectorLayer* layer, QgsStyleV2* style, QgsFeatureRendererV2* renderer ); | |||
QgsGraduatedSymbolRendererV2Widget( QgsVectorLayer* layer, QgsStyleV2* style, QgsFeatureRendererV2* renderer ); | QgsGraduatedSymbolRendererV2Widget( QgsVectorLayer* layer, QgsStyleV2* style, QgsFeatureRendererV2* renderer ); | |||
~QgsGraduatedSymbolRendererV2Widget(); | ~QgsGraduatedSymbolRendererV2Widget(); | |||
virtual QgsFeatureRendererV2* renderer(); | virtual QgsFeatureRendererV2* renderer(); | |||
public slots: | public slots: | |||
void changeGraduatedSymbol(); | void changeGraduatedSymbol(); | |||
void graduatedColumnChanged(); | void graduatedColumnChanged(); | |||
void setExpression(); | ||||
void classifyGraduated(); | void classifyGraduated(); | |||
void reapplyColorRamp(); | void reapplyColorRamp(); | |||
void rangesDoubleClicked( const QModelIndex & idx ); | void rangesDoubleClicked( const QModelIndex & idx ); | |||
void rangesClicked( const QModelIndex & idx ); | void rangesClicked( const QModelIndex & idx ); | |||
void changeCurrentValue( QStandardItem * item ); | void changeCurrentValue( QStandardItem * item ); | |||
/**Adds a class manually to the classification*/ | /**Adds a class manually to the classification*/ | |||
void addClass(); | void addClass(); | |||
/**Removes currently selected classes */ | /**Removes currently selected classes */ | |||
void deleteClasses(); | void deleteClasses(); | |||
skipping to change at line 111 | skipping to change at line 114 | |||
void rowsMoved(); | void rowsMoved(); | |||
protected: | protected: | |||
void updateUiFromRenderer(); | void updateUiFromRenderer(); | |||
void updateGraduatedSymbolIcon(); | void updateGraduatedSymbolIcon(); | |||
//! return a list of indexes for the classes under selection | //! return a list of indexes for the classes under selection | |||
QList<int> selectedClasses(); | QList<int> selectedClasses(); | |||
QgsRangeList selectedRanges(); | ||||
//! populate column combos in categorized and graduated page | //! populate column combos in categorized and graduated page | |||
void populateColumns(); | void populateColumns(); | |||
void changeRangeSymbol( int rangeIdx ); | void changeRangeSymbol( int rangeIdx ); | |||
void changeRange( int rangeIdx ); | void changeRange( int rangeIdx ); | |||
void changeSelectedSymbols(); | void changeSelectedSymbols(); | |||
QList<QgsSymbolV2*> selectedSymbols(); | QList<QgsSymbolV2*> selectedSymbols(); | |||
QgsSymbolV2* findSymbolForRange( double lowerBound, double upperBound, const QgsRangeList& ranges ) const; | QgsSymbolV2* findSymbolForRange( double lowerBound, double upperBound, const QgsRangeList& ranges ) const; | |||
void refreshSymbolView(); | void refreshSymbolView(); | |||
void keyPressEvent( QKeyEvent* event ); | ||||
protected: | protected: | |||
QgsGraduatedSymbolRendererV2* mRenderer; | QgsGraduatedSymbolRendererV2* mRenderer; | |||
QgsSymbolV2* mGraduatedSymbol; | QgsSymbolV2* mGraduatedSymbol; | |||
int mRowSelected; | int mRowSelected; | |||
QgsRendererV2DataDefinedMenus* mDataDefinedMenus; | QgsRendererV2DataDefinedMenus* mDataDefinedMenus; | |||
QgsGraduatedSymbolRendererV2Model* mModel; | QgsGraduatedSymbolRendererV2Model* mModel; | |||
QgsRangeList mCopyBuffer; | ||||
}; | }; | |||
#endif // QGSGRADUATEDSYMBOLRENDERERV2WIDGET_H | #endif // QGSGRADUATEDSYMBOLRENDERERV2WIDGET_H | |||
End of changes. 6 change blocks. | ||||
0 lines changed or deleted | 7 lines changed or added | |||
qgshighlight.h | qgshighlight.h | |||
---|---|---|---|---|
skipping to change at line 19 | skipping to change at line 19 | |||
* This program is free software; you can redistribute it and/or modify * | * This program is free software; you can redistribute it and/or modify * | |||
* it under the terms of the GNU General Public License as published by * | * it under the terms of the GNU General Public License as published by * | |||
* the Free Software Foundation; either version 2 of the License, or * | * the Free Software Foundation; either version 2 of the License, or * | |||
* (at your option) any later version. * | * (at your option) any later version. * | |||
* * | * * | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef QGSHIGHLIGHT_H | #ifndef QGSHIGHLIGHT_H | |||
#define QGSHIGHLIGHT_H | #define QGSHIGHLIGHT_H | |||
#include "qgsmapcanvasitem.h" | #include "qgsmapcanvasitem.h" | |||
#include "qgsfeaturestore.h" | ||||
#include "qgsgeometry.h" | #include "qgsgeometry.h" | |||
#include "qgsrendererv2.h" | ||||
#include <QBrush> | #include <QBrush> | |||
#include <QColor> | ||||
#include <QList> | #include <QList> | |||
#include <QPen> | #include <QPen> | |||
#include <QPainter> | #include <QPainter> | |||
#include <QPainterPath> | #include <QPainterPath> | |||
class QgsMapLayer; | ||||
class QgsVectorLayer; | class QgsVectorLayer; | |||
class QgsSymbolV2; | ||||
/** A class for highlight features on the map. | /** A class for highlight features on the map. | |||
*/ | */ | |||
class GUI_EXPORT QgsHighlight: public QgsMapCanvasItem | class GUI_EXPORT QgsHighlight: public QgsMapCanvasItem | |||
{ | { | |||
public: | public: | |||
QgsHighlight( QgsMapCanvas *mapCanvas, QgsGeometry *geom, QgsMapLayer * layer ); | ||||
QgsHighlight( QgsMapCanvas *mapCanvas, QgsGeometry *geom, QgsVectorLaye r *layer ); | QgsHighlight( QgsMapCanvas *mapCanvas, QgsGeometry *geom, QgsVectorLaye r *layer ); | |||
/** Constructor for highlighting true feature shape using feature attri | ||||
butes | ||||
* and renderer. | ||||
* @param mapCanvas map canvas | ||||
* @param feature | ||||
* @param layer vector layer | ||||
*/ | ||||
QgsHighlight( QgsMapCanvas *mapCanvas, const QgsFeature& feature, QgsVe | ||||
ctorLayer *layer ); | ||||
~QgsHighlight(); | ~QgsHighlight(); | |||
void setColor( const QColor & color ); | void setColor( const QColor & color ); | |||
/** Set width. Ignored in feature mode. */ | ||||
void setWidth( int width ); | void setWidth( int width ); | |||
protected: | protected: | |||
virtual void paint( QPainter* p ); | virtual void paint( QPainter* p ); | |||
//! recalculates needed rectangle | //! recalculates needed rectangle | |||
void updateRect(); | void updateRect(); | |||
private: | private: | |||
void init(); | ||||
void setSymbolColor( QgsSymbolV2* symbol, const QColor & color ); | ||||
void paintPoint( QPainter *p, QgsPoint point ); | void paintPoint( QPainter *p, QgsPoint point ); | |||
void paintLine( QPainter *p, QgsPolyline line ); | void paintLine( QPainter *p, QgsPolyline line ); | |||
void paintPolygon( QPainter *p, QgsPolygon polygon ); | void paintPolygon( QPainter *p, QgsPolygon polygon ); | |||
QgsVectorLayer *vectorLayer(); | ||||
QgsHighlight(); | QgsHighlight(); | |||
QBrush mBrush; | QBrush mBrush; | |||
QPen mPen; | QPen mPen; | |||
QgsGeometry *mGeometry; | QgsGeometry *mGeometry; | |||
QgsVectorLayer *mLayer; | QgsMapLayer *mLayer; | |||
QgsFeature mFeature; | ||||
QgsFeatureRendererV2 *mRenderer; | ||||
QColor mTemporaryFillColor; | ||||
}; | }; | |||
#endif | #endif | |||
End of changes. 11 change blocks. | ||||
1 lines changed or deleted | 25 lines changed or added | |||
qgshistogramdiagram.h | qgshistogramdiagram.h | |||
---|---|---|---|---|
skipping to change at line 39 | skipping to change at line 39 | |||
class QgsDiagramInterpolationSettings; | class QgsDiagramInterpolationSettings; | |||
class QgsRenderContext; | class QgsRenderContext; | |||
class CORE_EXPORT QgsHistogramDiagram: public QgsDiagram | class CORE_EXPORT QgsHistogramDiagram: public QgsDiagram | |||
{ | { | |||
public: | public: | |||
QgsHistogramDiagram(); | QgsHistogramDiagram(); | |||
~QgsHistogramDiagram(); | ~QgsHistogramDiagram(); | |||
void renderDiagram( const QgsAttributes& att, QgsRenderContext& c, cons t QgsDiagramSettings& s, const QPointF& position ); | void renderDiagram( const QgsFeature& feature, QgsRenderContext& c, con st QgsDiagramSettings& s, const QPointF& position ); | |||
QSizeF diagramSize( const QgsAttributes& attributes, const QgsRenderCon text& c, const QgsDiagramSettings& s ); | QSizeF diagramSize( const QgsAttributes& attributes, const QgsRenderCon text& c, const QgsDiagramSettings& s ); | |||
QSizeF diagramSize( const QgsAttributes& attributes, const QgsRenderCon text& c, const QgsDiagramSettings& s, const QgsDiagramInterpolationSettings & is ); | QSizeF diagramSize( const QgsFeature& feature, const QgsRenderContext& c, const QgsDiagramSettings& s, const QgsDiagramInterpolationSettings& is ) ; | |||
QString diagramName() const { return DIAGRAM_NAME_HISTOGRAM; } | QString diagramName() const { return DIAGRAM_NAME_HISTOGRAM; } | |||
private: | private: | |||
QBrush mCategoryBrush; | QBrush mCategoryBrush; | |||
QPen mPen; | QPen mPen; | |||
double mScaleFactor; | double mScaleFactor; | |||
}; | }; | |||
#endif // QGSHISTOGRAMDIAGRAM_H | #endif // QGSHISTOGRAMDIAGRAM_H | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
qgslegendmodel.h | qgslegendmodel.h | |||
---|---|---|---|---|
skipping to change at line 39 | skipping to change at line 39 | |||
class QgsVectorLayer; | class QgsVectorLayer; | |||
//Information about relationship between groups and layers | //Information about relationship between groups and layers | |||
//key: group name (or null strings for single layers without groups) | //key: group name (or null strings for single layers without groups) | |||
//value: containter with layer ids contained in the group | //value: containter with layer ids contained in the group | |||
typedef QPair< QString, QList<QString> > GroupLayerInfo; | typedef QPair< QString, QList<QString> > GroupLayerInfo; | |||
/** \ingroup MapComposer | /** \ingroup MapComposer | |||
* A model that provides group, layer and classification items. | * A model that provides group, layer and classification items. | |||
*/ | */ | |||
class CORE_EXPORT QgsLegendModel: public QStandardItemModel | class CORE_EXPORT QgsLegendModel : public QStandardItemModel | |||
{ | { | |||
Q_OBJECT | Q_OBJECT | |||
public: | public: | |||
enum ItemType | enum ItemType | |||
{ | { | |||
GroupItem = 0, | GroupItem = 0, | |||
LayerItem, | LayerItem, | |||
ClassificationItem | ClassificationItem | |||
}; | }; | |||
QgsLegendModel(); | QgsLegendModel(); | |||
~QgsLegendModel(); | ~QgsLegendModel(); | |||
/**Sets layer set and groups*/ | /**Sets layer set and groups*/ | |||
void setLayerSetAndGroups( const QStringList& layerIds, const QList< Gr oupLayerInfo >& groupInfo ); | void setLayerSetAndGroups( const QStringList& layerIds, const QList< Gr oupLayerInfo >& groupInfo ); | |||
void setLayerSet( const QStringList& layerIds ); | void setLayerSet( const QStringList& layerIds, double scaleDenominator = -1, QString rule = "" ); | |||
/**Adds a group | /**Adds a group | |||
@param text name of group (defaults to translation of "Group") | @param text name of group (defaults to translation of "Group") | |||
@param position insertion position (toplevel position (or -1 if it sh ould be placed at the end of the legend). | @param position insertion position (toplevel position (or -1 if it sh ould be placed at the end of the legend). | |||
@returns a pointer to the added group | @returns a pointer to the added group | |||
*/ | */ | |||
QStandardItem *addGroup( QString text = QString::null, int position = - 1 ); | QStandardItem *addGroup( QString text = QString::null, int position = - 1 ); | |||
/**Tries to automatically update a model entry (e.g. a whole layer or o nly a single item)*/ | /**Tries to automatically update a model entry (e.g. a whole layer or o nly a single item)*/ | |||
void updateItem( QStandardItem* item ); | void updateItem( QStandardItem* item ); | |||
/**Updates the whole symbology of a layer*/ | /**Updates the whole symbology of a layer*/ | |||
skipping to change at line 99 | skipping to change at line 99 | |||
QStringList mimeTypes() const; | QStringList mimeTypes() const; | |||
/**Implements the drop operation*/ | /**Implements the drop operation*/ | |||
bool dropMimeData( const QMimeData *data, Qt::DropAction action, int ro w, int column, const QModelIndex &parent ); | bool dropMimeData( const QMimeData *data, Qt::DropAction action, int ro w, int column, const QModelIndex &parent ); | |||
void setAutoUpdate( bool autoUpdate ); | void setAutoUpdate( bool autoUpdate ); | |||
bool autoUpdate() { return mAutoUpdate; } | bool autoUpdate() { return mAutoUpdate; } | |||
public slots: | public slots: | |||
void removeLayer( const QString& layerId ); | void removeLayer( const QString& layerId ); | |||
void addLayer( QgsMapLayer* theMapLayer ); | void addLayer( QgsMapLayer* theMapLayer, double scaleDenominator = -1, QString rule = "" ); | |||
signals: | signals: | |||
void layersChanged(); | void layersChanged(); | |||
private: | private: | |||
/**Adds classification items of vector layers using new symbology*/ | /**Adds classification items of vector layers using new symbology*/ | |||
int addVectorLayerItemsV2( QStandardItem* layerItem, QgsVectorLayer* vl ayer ); | int addVectorLayerItemsV2( QStandardItem* layerItem, QgsVectorLayer* vl ayer, double scaleDenominator = -1, QString rule = "" ); | |||
/**Adds item of raster layer | /**Adds item of raster layer | |||
@return 0 in case of success*/ | @return 0 in case of success*/ | |||
int addRasterLayerItems( QStandardItem* layerItem, QgsMapLayer* rlayer ); | int addRasterLayerItems( QStandardItem* layerItem, QgsMapLayer* rlayer ); | |||
void updateLayerItemText( QStandardItem* layerItem ); | void updateLayerItemText( QStandardItem* layerItem ); | |||
void updateSymbolV2ItemText( QStandardItem* symbolItem ); | void updateSymbolV2ItemText( QStandardItem* symbolItem ); | |||
void updateRasterSymbolItemText( QStandardItem* symbolItem ); | void updateRasterSymbolItemText( QStandardItem* symbolItem ); | |||
protected: | protected: | |||
End of changes. 4 change blocks. | ||||
4 lines changed or deleted | 4 lines changed or added | |||
qgslinesymbollayerv2.h | qgslinesymbollayerv2.h | |||
---|---|---|---|---|
skipping to change at line 65 | skipping to change at line 65 | |||
QgsSymbolLayerV2* clone() const; | QgsSymbolLayerV2* clone() const; | |||
void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const; | void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const; | |||
QString ogrFeatureStyle( double mmScaleFactor, double mapUnitScaleFacto r ) const; | QString ogrFeatureStyle( double mmScaleFactor, double mapUnitScaleFacto r ) const; | |||
void setOutputUnit( QgsSymbolV2::OutputUnit unit ); | void setOutputUnit( QgsSymbolV2::OutputUnit unit ); | |||
QgsSymbolV2::OutputUnit outputUnit() const; | QgsSymbolV2::OutputUnit outputUnit() const; | |||
double estimateMaxBleed() const; | ||||
// new stuff | // new stuff | |||
Qt::PenStyle penStyle() const { return mPenStyle; } | Qt::PenStyle penStyle() const { return mPenStyle; } | |||
void setPenStyle( Qt::PenStyle style ) { mPenStyle = style; } | void setPenStyle( Qt::PenStyle style ) { mPenStyle = style; } | |||
Qt::PenJoinStyle penJoinStyle() const { return mPenJoinStyle; } | Qt::PenJoinStyle penJoinStyle() const { return mPenJoinStyle; } | |||
void setPenJoinStyle( Qt::PenJoinStyle style ) { mPenJoinStyle = style; } | void setPenJoinStyle( Qt::PenJoinStyle style ) { mPenJoinStyle = style; } | |||
Qt::PenCapStyle penCapStyle() const { return mPenCapStyle; } | Qt::PenCapStyle penCapStyle() const { return mPenCapStyle; } | |||
void setPenCapStyle( Qt::PenCapStyle style ) { mPenCapStyle = style; } | void setPenCapStyle( Qt::PenCapStyle style ) { mPenCapStyle = style; } | |||
skipping to change at line 91 | skipping to change at line 93 | |||
bool useCustomDashPattern() const { return mUseCustomDashPattern; } | bool useCustomDashPattern() const { return mUseCustomDashPattern; } | |||
void setUseCustomDashPattern( bool b ) { mUseCustomDashPattern = b; } | void setUseCustomDashPattern( bool b ) { mUseCustomDashPattern = b; } | |||
QgsSymbolV2::OutputUnit customDashPatternUnit() const { return mCustomD ashPatternUnit; } | QgsSymbolV2::OutputUnit customDashPatternUnit() const { return mCustomD ashPatternUnit; } | |||
void setCustomDashPatternUnit( QgsSymbolV2::OutputUnit unit ) { mCustom DashPatternUnit = unit; } | void setCustomDashPatternUnit( QgsSymbolV2::OutputUnit unit ) { mCustom DashPatternUnit = unit; } | |||
QVector<qreal> customDashVector() const { return mCustomDashVector; } | QVector<qreal> customDashVector() const { return mCustomDashVector; } | |||
void setCustomDashVector( const QVector<qreal>& vector ) { mCustomDashV ector = vector; } | void setCustomDashVector( const QVector<qreal>& vector ) { mCustomDashV ector = vector; } | |||
//Returns true if the line should only be drawn inside the polygon | ||||
bool drawInsidePolygon() const { return mDrawInsidePolygon; } | ||||
//Set to true if the line should only be drawn inside the polygon | ||||
void setDrawInsidePolygon( bool drawInsidePolygon ) { mDrawInsidePolygo | ||||
n = drawInsidePolygon; } | ||||
QVector<qreal> dxfCustomDashPattern( QgsSymbolV2::OutputUnit& unit ) co | ||||
nst; | ||||
Qt::PenStyle dxfPenStyle() const; | ||||
double dxfWidth( const QgsDxfExport& e, const QgsSymbolV2RenderContext& | ||||
context ) const; | ||||
QColor dxfColor( const QgsSymbolV2RenderContext& context ) const; | ||||
protected: | protected: | |||
Qt::PenStyle mPenStyle; | Qt::PenStyle mPenStyle; | |||
Qt::PenJoinStyle mPenJoinStyle; | Qt::PenJoinStyle mPenJoinStyle; | |||
Qt::PenCapStyle mPenCapStyle; | Qt::PenCapStyle mPenCapStyle; | |||
QPen mPen; | QPen mPen; | |||
QPen mSelPen; | QPen mSelPen; | |||
double mOffset; | double mOffset; | |||
QgsSymbolV2::OutputUnit mOffsetUnit; | QgsSymbolV2::OutputUnit mOffsetUnit; | |||
//use a custom dash dot pattern instead of the predefined ones | //use a custom dash dot pattern instead of the predefined ones | |||
bool mUseCustomDashPattern; | bool mUseCustomDashPattern; | |||
QgsSymbolV2::OutputUnit mCustomDashPatternUnit; | QgsSymbolV2::OutputUnit mCustomDashPatternUnit; | |||
/**Vector with an even number of entries for the */ | /**Vector with an even number of entries for the */ | |||
QVector<qreal> mCustomDashVector; | QVector<qreal> mCustomDashVector; | |||
bool mDrawInsidePolygon; | ||||
private: | private: | |||
//helper functions for data defined symbology | //helper functions for data defined symbology | |||
void applyDataDefinedSymbology( QgsSymbolV2RenderContext& context, QPen & pen, QPen& selPen, double& offset ); | void applyDataDefinedSymbology( QgsSymbolV2RenderContext& context, QPen & pen, QPen& selPen, double& offset ); | |||
}; | }; | |||
///////// | ///////// | |||
#define DEFAULT_MARKERLINE_ROTATE true | #define DEFAULT_MARKERLINE_ROTATE true | |||
#define DEFAULT_MARKERLINE_INTERVAL 3 | #define DEFAULT_MARKERLINE_INTERVAL 3 | |||
skipping to change at line 163 | skipping to change at line 178 | |||
void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const; | void toSld( QDomDocument &doc, QDomElement &element, QgsStringMap props ) const; | |||
void setColor( const QColor& color ); | void setColor( const QColor& color ); | |||
QgsSymbolV2* subSymbol(); | QgsSymbolV2* subSymbol(); | |||
bool setSubSymbol( QgsSymbolV2* symbol ); | bool setSubSymbol( QgsSymbolV2* symbol ); | |||
virtual void setWidth( double width ); | virtual void setWidth( double width ); | |||
virtual double width() const; | virtual double width() const; | |||
double estimateMaxBleed() const; | ||||
// new stuff | // new stuff | |||
bool rotateMarker() const { return mRotateMarker; } | bool rotateMarker() const { return mRotateMarker; } | |||
void setRotateMarker( bool rotate ) { mRotateMarker = rotate; } | void setRotateMarker( bool rotate ) { mRotateMarker = rotate; } | |||
double interval() const { return mInterval; } | double interval() const { return mInterval; } | |||
void setInterval( double interval ) { mInterval = interval; } | void setInterval( double interval ) { mInterval = interval; } | |||
double offset() const { return mOffset; } | double offset() const { return mOffset; } | |||
void setOffset( double offset ) { mOffset = offset; } | void setOffset( double offset ) { mOffset = offset; } | |||
End of changes. 4 change blocks. | ||||
0 lines changed or deleted | 20 lines changed or added | |||
qgslinevectorlayerdirector.h | qgslinevectorlayerdirector.h | |||
---|---|---|---|---|
skipping to change at line 38 | skipping to change at line 38 | |||
/** | /** | |||
* \ingroup networkanalysis | * \ingroup networkanalysis | |||
* \class QgsLineVectorLayerDirector | * \class QgsLineVectorLayerDirector | |||
* \brief Determine making the graph from vector line layer | * \brief Determine making the graph from vector line layer | |||
*/ | */ | |||
class ANALYSIS_EXPORT QgsLineVectorLayerDirector : public QgsGraphDirector | class ANALYSIS_EXPORT QgsLineVectorLayerDirector : public QgsGraphDirector | |||
{ | { | |||
public: | public: | |||
/** | /** | |||
* @param myLayer source vector layer | * @param myLayer source vector layer | |||
* @param directionFieldId feield contain road direction value | * @param directionFieldId feield contain road direction value | |||
* @param directDirectionValue value for one-way road | * @param directDirectionValue value for one-way road | |||
* @param reverseDirectionValue value for reverse one-way road | * @param reverseDirectionValue value for reverse one-way road | |||
* @param bothDirectionValue value for road | * @param bothDirectionValue value for road | |||
* @param defaultDirection 1 - direct direction, 2 - reverse direction, 3 - both direction | * @param defaultDirection 1 - direct direction, 2 - reverse direction, 3 - both direction | |||
*/ | */ | |||
QgsLineVectorLayerDirector( QgsVectorLayer* myLayer, | QgsLineVectorLayerDirector( QgsVectorLayer* myLayer, | |||
int directionFieldId, | int directionFieldId, | |||
const QString& directDirectionValue, | const QString& directDirectionValue, | |||
const QString& reverseDirectionValue, | const QString& reverseDirectionValue, | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
qgsmanageconnectionsdialog.h | qgsmanageconnectionsdialog.h | |||
---|---|---|---|---|
skipping to change at line 54 | skipping to change at line 54 | |||
// constructor | // constructor | |||
// mode argument must be 0 for export and 1 for import | // mode argument must be 0 for export and 1 for import | |||
// type argument must be 0 for WMS and 1 for PostGIS | // type argument must be 0 for WMS and 1 for PostGIS | |||
QgsManageConnectionsDialog( QWidget *parent = NULL, Mode mode = Export, Type type = WMS, QString fileName = "" ); | QgsManageConnectionsDialog( QWidget *parent = NULL, Mode mode = Export, Type type = WMS, QString fileName = "" ); | |||
public slots: | public slots: | |||
void doExportImport(); | void doExportImport(); | |||
void selectAll(); | void selectAll(); | |||
void clearSelection(); | void clearSelection(); | |||
void selectionChanged(); | ||||
private: | private: | |||
bool populateConnections(); | bool populateConnections(); | |||
QDomDocument saveOWSConnections( const QStringList &connections, const QString &service ); | QDomDocument saveOWSConnections( const QStringList &connections, const QString &service ); | |||
QDomDocument saveWFSConnections( const QStringList &connections ); | QDomDocument saveWFSConnections( const QStringList &connections ); | |||
QDomDocument savePgConnections( const QStringList & connections ); | QDomDocument savePgConnections( const QStringList & connections ); | |||
QDomDocument saveMssqlConnections( const QStringList & connections ); | QDomDocument saveMssqlConnections( const QStringList & connections ); | |||
QDomDocument saveOracleConnections( const QStringList & connections ); | QDomDocument saveOracleConnections( const QStringList & connections ); | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 1 lines changed or added | |||
qgsmapcanvas.h | qgsmapcanvas.h | |||
---|---|---|---|---|
skipping to change at line 305 | skipping to change at line 305 | |||
//! show whatever error is exposed by the QgsMapLayer. | //! show whatever error is exposed by the QgsMapLayer. | |||
void showError( QgsMapLayer * mapLayer ); | void showError( QgsMapLayer * mapLayer ); | |||
//! called to read map canvas settings from project | //! called to read map canvas settings from project | |||
void readProject( const QDomDocument & ); | void readProject( const QDomDocument & ); | |||
//! called to write map canvas settings to project | //! called to write map canvas settings to project | |||
void writeProject( QDomDocument & ); | void writeProject( QDomDocument & ); | |||
//! ask user about datum transformation | ||||
void getDatumTransformInfo( const QgsMapLayer* ml, const QString& srcAu | ||||
thId, const QString& destAuthId ); | ||||
private slots: | private slots: | |||
//! called when current maptool is destroyed | //! called when current maptool is destroyed | |||
void mapToolDestroyed(); | void mapToolDestroyed(); | |||
signals: | signals: | |||
/** Let the owner know how far we are with render operations */ | /** Let the owner know how far we are with render operations */ | |||
void setProgress( int, int ); | void setProgress( int, int ); | |||
/** emits current mouse position | /** emits current mouse position | |||
\note changed in 1.3 */ | \note changed in 1.3 */ | |||
skipping to change at line 412 | skipping to change at line 415 | |||
//! called on resize or changed extent to notify canvas items to change their rectangle | //! called on resize or changed extent to notify canvas items to change their rectangle | |||
void updateCanvasItemPositions(); | void updateCanvasItemPositions(); | |||
/// implementation struct | /// implementation struct | |||
class CanvasProperties; | class CanvasProperties; | |||
/// Handle pattern for implementation object | /// Handle pattern for implementation object | |||
std::auto_ptr<CanvasProperties> mCanvasProperties; | std::auto_ptr<CanvasProperties> mCanvasProperties; | |||
/**debugging member | ||||
invoked when a connect() is made to this object | ||||
*/ | ||||
void connectNotify( const char * signal ); | ||||
private slots: | private slots: | |||
void crsTransformEnabled( bool ); | void crsTransformEnabled( bool ); | |||
private: | private: | |||
/// this class is non-copyable | /// this class is non-copyable | |||
/** | /** | |||
@note | @note | |||
Otherwise std::auto_ptr would pass the object responsiblity on to th e | Otherwise std::auto_ptr would pass the object responsiblity on to th e | |||
copy like a hot potato leaving the copyer in a weird state. | copy like a hot potato leaving the copyer in a weird state. | |||
skipping to change at line 461 | skipping to change at line 469 | |||
bool mDirty; | bool mDirty; | |||
//! determines whether user has requested to suppress rendering | //! determines whether user has requested to suppress rendering | |||
bool mRenderFlag; | bool mRenderFlag; | |||
/**Resize events that have been ignored because the canvas is busy with | /**Resize events that have been ignored because the canvas is busy with | |||
rendering may put their sizes into this list. The canvas then picks up | rendering may put their sizes into this list. The canvas then picks up | |||
the last entry in case a lot of resize events arrive in short time*/ | the last entry in case a lot of resize events arrive in short time*/ | |||
QList< QPair<int, int> > mResizeQueue; | QList< QPair<int, int> > mResizeQueue; | |||
/**debugging member | ||||
invoked when a connect() is made to this object | ||||
*/ | ||||
void connectNotify( const char * signal ); | ||||
//! current layer in legend | //! current layer in legend | |||
QgsMapLayer* mCurrentLayer; | QgsMapLayer* mCurrentLayer; | |||
//! graphics scene manages canvas items | //! graphics scene manages canvas items | |||
QGraphicsScene* mScene; | QGraphicsScene* mScene; | |||
//! pointer to current map tool | //! pointer to current map tool | |||
QgsMapTool* mMapTool; | QgsMapTool* mMapTool; | |||
//! previous tool if current is for zooming/panning | //! previous tool if current is for zooming/panning | |||
skipping to change at line 496 | skipping to change at line 499 | |||
WheelAction mWheelAction; | WheelAction mWheelAction; | |||
//! resize canvas size | //! resize canvas size | |||
QSize mNewSize; | QSize mNewSize; | |||
//! currently in paint event | //! currently in paint event | |||
bool mPainting; | bool mPainting; | |||
//! indicates whether antialiasing will be used for rendering | //! indicates whether antialiasing will be used for rendering | |||
bool mAntiAliasing; | bool mAntiAliasing; | |||
QTimer *mResizeTimer; | ||||
}; // class QgsMapCanvas | }; // class QgsMapCanvas | |||
#endif | #endif | |||
End of changes. 4 change blocks. | ||||
5 lines changed or deleted | 11 lines changed or added | |||
qgsmaplayer.h | qgsmaplayer.h | |||
---|---|---|---|---|
skipping to change at line 123 | skipping to change at line 123 | |||
/* Layer metadataUrl information */ | /* Layer metadataUrl information */ | |||
void setMetadataUrl( const QString& metaUrl ) { mMetadataUrl = metaUrl; } | void setMetadataUrl( const QString& metaUrl ) { mMetadataUrl = metaUrl; } | |||
const QString& metadataUrl() const { return mMetadataUrl; } | const QString& metadataUrl() const { return mMetadataUrl; } | |||
void setMetadataUrlType( const QString& metaUrlType ) { mMetadataUrlTyp e = metaUrlType; } | void setMetadataUrlType( const QString& metaUrlType ) { mMetadataUrlTyp e = metaUrlType; } | |||
const QString& metadataUrlType() const { return mMetadataUrlType; } | const QString& metadataUrlType() const { return mMetadataUrlType; } | |||
void setMetadataUrlFormat( const QString& metaUrlFormat ) { mMetadataUr lFormat = metaUrlFormat; } | void setMetadataUrlFormat( const QString& metaUrlFormat ) { mMetadataUr lFormat = metaUrlFormat; } | |||
const QString& metadataUrlFormat() const { return mMetadataUrlFormat; } | const QString& metadataUrlFormat() const { return mMetadataUrlFormat; } | |||
/* Set the blending mode used for rendering a layer */ | /* Set the blending mode used for rendering a layer */ | |||
void setBlendMode( const QPainter::CompositionMode blendMode ); | void setBlendMode( const QPainter::CompositionMode &blendMode ); | |||
/* Returns the current blending mode for a layer */ | /* Returns the current blending mode for a layer */ | |||
QPainter::CompositionMode blendMode() const; | QPainter::CompositionMode blendMode() const; | |||
/**Synchronises with changes in the datasource | /**Synchronises with changes in the datasource | |||
@note added in version 1.6*/ | @note added in version 1.6*/ | |||
virtual void reload() {} | virtual void reload() {} | |||
/** This is the method that does the actual work of | /** This is the method that does the actual work of | |||
* drawing the layer onto a paint device. | * drawing the layer onto a paint device. | |||
* @param rendererContext describes the extents, | * @param rendererContext describes the extents, | |||
skipping to change at line 289 | skipping to change at line 289 | |||
* @param theURI - the file name or other URI for the | * @param theURI - the file name or other URI for the | |||
* style file. First an attempt will be made to see if this | * style file. First an attempt will be made to see if this | |||
* is a file and load that, if that fails the qgis.db styles | * is a file and load that, if that fails the qgis.db styles | |||
* table will be consulted to see if there is a style who's | * table will be consulted to see if there is a style who's | |||
* key matches the URI. | * key matches the URI. | |||
* @param theResultFlag a reference to a flag that will be set to false if | * @param theResultFlag a reference to a flag that will be set to false if | |||
* we did not manage to load the default style. | * we did not manage to load the default style. | |||
* @return a QString with any status messages | * @return a QString with any status messages | |||
* @see also loadDefaultStyle (); | * @see also loadDefaultStyle (); | |||
*/ | */ | |||
virtual QString loadNamedStyle( const QString theURI, bool & theResultF lag ); | virtual QString loadNamedStyle( const QString &theURI, bool &theResultF lag ); | |||
virtual bool loadNamedStyleFromDb( const QString db, const QString theU RI, QString &qml ); | virtual bool loadNamedStyleFromDb( const QString &db, const QString &th eURI, QString &qml ); | |||
//TODO edit infos | //TODO edit infos | |||
/** | /** | |||
* Export the properties of this layer as named style in a QDomDocument | * Export the properties of this layer as named style in a QDomDocument | |||
* @param doc the target QDomDocument | * @param doc the target QDomDocument | |||
* @param errorMsg this QString will be initialized on error | * @param errorMsg this QString will be initialized on error | |||
* during the execution of writeSymbology | * during the execution of writeSymbology | |||
*/ | */ | |||
virtual void exportNamedStyle( QDomDocument &doc, QString &errorMsg ); | virtual void exportNamedStyle( QDomDocument &doc, QString &errorMsg ); | |||
skipping to change at line 333 | skipping to change at line 333 | |||
* @param theURI the file name or other URI for the | * @param theURI the file name or other URI for the | |||
* style file. First an attempt will be made to see if this | * style file. First an attempt will be made to see if this | |||
* is a file and save to that, if that fails the qgis.db styles | * is a file and save to that, if that fails the qgis.db styles | |||
* table will be used to create a style entry who's | * table will be used to create a style entry who's | |||
* key matches the URI. | * key matches the URI. | |||
* @param theResultFlag a reference to a flag that will be set to false if | * @param theResultFlag a reference to a flag that will be set to false if | |||
* we did not manage to save the default style. | * we did not manage to save the default style. | |||
* @return a QString with any status messages | * @return a QString with any status messages | |||
* @sa saveDefaultStyle() | * @sa saveDefaultStyle() | |||
*/ | */ | |||
virtual QString saveNamedStyle( const QString theURI, bool & theResultF lag ); | virtual QString saveNamedStyle( const QString &theURI, bool &theResultF lag ); | |||
virtual QString saveSldStyle( const QString theURI, bool & theResultFla | virtual QString saveSldStyle( const QString &theURI, bool &theResultFla | |||
g ); | g ); | |||
virtual QString loadSldStyle( const QString theURI, bool &theResultFlag | virtual QString loadSldStyle( const QString &theURI, bool &theResultFla | |||
); | g ); | |||
virtual bool readSld( const QDomNode& node, QString& errorMessage ) | virtual bool readSld( const QDomNode &node, QString &errorMessage ) | |||
{ Q_UNUSED( node ); errorMessage = QString( "Layer type %1 not supporte d" ).arg( type() ); return false; } | { Q_UNUSED( node ); errorMessage = QString( "Layer type %1 not supporte d" ).arg( type() ); return false; } | |||
/** Read the symbology for the current layer from the Dom node supplied . | /** Read the symbology for the current layer from the Dom node supplied . | |||
* @param node node that will contain the symbology definition for this layer. | * @param node node that will contain the symbology definition for this layer. | |||
* @param errorMessage reference to string that will be updated with an y error messages | * @param errorMessage reference to string that will be updated with an y error messages | |||
* @return true in case of success. | * @return true in case of success. | |||
*/ | */ | |||
virtual bool readSymbology( const QDomNode& node, QString& errorMessage ) = 0; | virtual bool readSymbology( const QDomNode& node, QString& errorMessage ) = 0; | |||
/** Write the symbology for the layer into the docment provided. | /** Write the symbology for the layer into the docment provided. | |||
* @param node the node that will have the style element added to it. | * @param node the node that will have the style element added to it. | |||
* @param doc the document that will have the QDomNode added. | * @param doc the document that will have the QDomNode added. | |||
* @param errorMessage reference to string that will be updated with a ny error messages | * @param errorMessage reference to string that will be updated with a ny error messages | |||
* @return true in case of success. | * @return true in case of success. | |||
*/ | */ | |||
virtual bool writeSymbology( QDomNode &node, QDomDocument& doc, QString & errorMessage ) const = 0; | virtual bool writeSymbology( QDomNode &node, QDomDocument& doc, QString & errorMessage ) const = 0; | |||
/** Return pointer to layer's undo stack */ | /** Return pointer to layer's undo stack */ | |||
QUndoStack* undoStack(); | QUndoStack *undoStack(); | |||
/** Get the QImage used for caching render operations | /** Get the QImage used for caching render operations | |||
* @note This method was added in QGIS 1.4 **/ | * @note This method was added in QGIS 1.4 **/ | |||
QImage *cacheImage() { return mpCacheImage; } | QImage *cacheImage() { return mpCacheImage; } | |||
/** Set the QImage used for caching render operations | /** Set the QImage used for caching render operations | |||
* @note This method was added in QGIS 1.4 **/ | * @note This method was added in QGIS 1.4 **/ | |||
void setCacheImage( QImage * thepImage ); | void setCacheImage( QImage * thepImage ); | |||
/** | /** | |||
* @brief Is called when the cache image is being deleted. Overwrite an d use to clean up. | * @brief Is called when the cache image is being deleted. Overwrite an d use to clean up. | |||
skipping to change at line 379 | skipping to change at line 379 | |||
*/ | */ | |||
virtual void onCacheImageDelete() {} | virtual void onCacheImageDelete() {} | |||
public slots: | public slots: | |||
/** Event handler for when a coordinate transform fails due to bad vert ex error */ | /** Event handler for when a coordinate transform fails due to bad vert ex error */ | |||
virtual void invalidTransformInput(); | virtual void invalidTransformInput(); | |||
/** Accessor and mutator for the minimum scale denominator member */ | /** Accessor and mutator for the minimum scale denominator member */ | |||
void setMinimumScale( float theMinScale ); | void setMinimumScale( float theMinScale ); | |||
float minimumScale(); | float minimumScale() const; | |||
/** Accessor and mutator for the maximum scale denominator member */ | /** Accessor and mutator for the maximum scale denominator member */ | |||
void setMaximumScale( float theMaxScale ); | void setMaximumScale( float theMaxScale ); | |||
float maximumScale(); | float maximumScale() const; | |||
/** Accessor and mutator for the scale based visilibility flag */ | /** Accessor and mutator for the scale based visilibility flag */ | |||
void toggleScaleBasedVisibility( bool theVisibilityFlag ); | void toggleScaleBasedVisibility( bool theVisibilityFlag ); | |||
bool hasScaleBasedVisibility(); | bool hasScaleBasedVisibility() const; | |||
/** Clear cached image | /** Clear cached image | |||
* added in 1.5 */ | * added in 1.5 */ | |||
void clearCacheImage(); | void clearCacheImage(); | |||
/** \brief Obtain Metadata for this layer */ | /** \brief Obtain Metadata for this layer */ | |||
virtual QString metadata(); | virtual QString metadata(); | |||
/** Time stamp of data source in the moment when data/metadata were loa ded by provider */ | /** Time stamp of data source in the moment when data/metadata were loa ded by provider */ | |||
virtual QDateTime timestamp() const { return QDateTime() ; } | virtual QDateTime timestamp() const { return QDateTime() ; } | |||
skipping to change at line 431 | skipping to change at line 431 | |||
This signal should be connected with the slot QgsMapCanvas::updateMap( )*/ | This signal should be connected with the slot QgsMapCanvas::updateMap( )*/ | |||
void screenUpdateRequested(); | void screenUpdateRequested(); | |||
/** This is used to send a request that any mapcanvas using this layer update its extents */ | /** This is used to send a request that any mapcanvas using this layer update its extents */ | |||
void recalculateExtents(); | void recalculateExtents(); | |||
/** data of layer changed | /** data of layer changed | |||
* added in 1.5 */ | * added in 1.5 */ | |||
void dataChanged(); | void dataChanged(); | |||
/** Signal emitted when the blend mode is changed, through QgsMapLayer: | ||||
:setBlendMode() */ | ||||
void blendModeChanged( const QPainter::CompositionMode &blendMode ); | ||||
protected: | protected: | |||
/** Set the extent */ | /** Set the extent */ | |||
virtual void setExtent( const QgsRectangle &rect ); | virtual void setExtent( const QgsRectangle &rect ); | |||
/** set whether layer is valid or not - should be used in constructor. | /** set whether layer is valid or not - should be used in constructor. | |||
\note added in v1.5 */ | \note added in v1.5 */ | |||
void setValid( bool valid ); | void setValid( bool valid ); | |||
/** called by readLayerXML(), used by children to read state specific t o them from | /** called by readLayerXML(), used by children to read state specific t o them from | |||
project files. | project files. | |||
skipping to change at line 465 | skipping to change at line 468 | |||
void writeCustomProperties( QDomNode & layerNode, QDomDocument & doc ) const; | void writeCustomProperties( QDomNode & layerNode, QDomDocument & doc ) const; | |||
/** debugging member - invoked when a connect() is made to this object */ | /** debugging member - invoked when a connect() is made to this object */ | |||
void connectNotify( const char * signal ); | void connectNotify( const char * signal ); | |||
/** Add error message */ | /** Add error message */ | |||
void appendError( const QgsErrorMessage & theMessage ) { mError.append( theMessage );} | void appendError( const QgsErrorMessage & theMessage ) { mError.append( theMessage );} | |||
/** Set error message */ | /** Set error message */ | |||
void setError( const QgsError & theError ) { mError = theError;} | void setError( const QgsError & theError ) { mError = theError;} | |||
/** Transparency level for this layer should be 0-255 (255 being opaque | ||||
) */ | ||||
unsigned int mTransparencyLevel; | ||||
/** Extent of the layer */ | /** Extent of the layer */ | |||
QgsRectangle mExtent; | QgsRectangle mExtent; | |||
/** Indicates if the layer is valid and can be drawn */ | /** Indicates if the layer is valid and can be drawn */ | |||
bool mValid; | bool mValid; | |||
/** data source description string, varies by layer type */ | /** data source description string, varies by layer type */ | |||
QString mDataSource; | QString mDataSource; | |||
/** Name of the layer - used for display */ | /** Name of the layer - used for display */ | |||
End of changes. 12 change blocks. | ||||
17 lines changed or deleted | 17 lines changed or added | |||
qgsmaplayerregistry.h | qgsmaplayerregistry.h | |||
---|---|---|---|---|
skipping to change at line 76 | skipping to change at line 76 | |||
* @param takeOwnership Ownership will be transferred to the layer regi stry. | * @param takeOwnership Ownership will be transferred to the layer regi stry. | |||
* If you specify false here, you have take care o f deleting | * If you specify false here, you have take care o f deleting | |||
* the layers yourself. Not available in python. | * the layers yourself. Not available in python. | |||
* | * | |||
* @return QList<QgsMapLayer *> - a list of the map layers that were ad ded | * @return QList<QgsMapLayer *> - a list of the map layers that were ad ded | |||
* successfully. If a layer is invalid, or already exists in th e registry, | * successfully. If a layer is invalid, or already exists in th e registry, | |||
* it will not be part of the returned QList. | * it will not be part of the returned QList. | |||
* | * | |||
* @note As a side-effect QgsProject is made dirty. | * @note As a side-effect QgsProject is made dirty. | |||
* @note Added in QGIS 1.8 | * @note Added in QGIS 1.8 | |||
* @note takeOwner not available in python binding - always takes owner ship | ||||
*/ | */ | |||
QList<QgsMapLayer *> addMapLayers( QList<QgsMapLayer *> theMapLayers, | QList<QgsMapLayer *> addMapLayers( QList<QgsMapLayer *> theMapLayers, | |||
bool addToLegend = true, | bool addToLegend = true, | |||
bool takeOwnership = true ); | bool takeOwnership = true ); | |||
/** | /** | |||
* @brief | * @brief | |||
* Add a layer to the map of loaded layers | * Add a layer to the map of loaded layers | |||
* | * | |||
* The layersAdded() and layersWasAdded() signals will be emitted in an y case. | * The layersAdded() and layersWasAdded() signals will be emitted in an y case. | |||
skipping to change at line 104 | skipping to change at line 105 | |||
* @param takeOwnership Ownership will be transferred to the layer regi stry. | * @param takeOwnership Ownership will be transferred to the layer regi stry. | |||
* If you specify false here, you have take care o f deleting | * If you specify false here, you have take care o f deleting | |||
* the layer yourself. Not available in python. | * the layer yourself. Not available in python. | |||
* | * | |||
* @return NULL if unable to add layer, otherwise pointer to newly adde d layer | * @return NULL if unable to add layer, otherwise pointer to newly adde d layer | |||
* | * | |||
* @see addMapLayers | * @see addMapLayers | |||
* | * | |||
* @note As a side-effect QgsProject is made dirty. | * @note As a side-effect QgsProject is made dirty. | |||
* @note Use addMapLayers if adding more than one layer at a time | * @note Use addMapLayers if adding more than one layer at a time | |||
* @note takeOwner not available in python binding - always takes owner ship | ||||
*/ | */ | |||
QgsMapLayer* addMapLayer( QgsMapLayer * theMapLayer, bool addToLegend = true, bool takeOwnership = true ); | QgsMapLayer* addMapLayer( QgsMapLayer * theMapLayer, bool addToLegend = true, bool takeOwnership = true ); | |||
/** | /** | |||
* @brief | * @brief | |||
* Remove a set of layers from the registry | * Remove a set of layers from the registry | |||
* | * | |||
* Any canvases using the affected layers will need to remove them | * Any canvases using the affected layers will need to remove them | |||
* | * | |||
* The layers being removed are deleted as well as the registry | * The layers being removed are deleted as well as the registry | |||
skipping to change at line 241 | skipping to change at line 243 | |||
* @param theMapLayers The {@link QgsMapLayer}s which are added to the legend. | * @param theMapLayers The {@link QgsMapLayer}s which are added to the legend. | |||
* | * | |||
* @note Added in 2.0 | * @note Added in 2.0 | |||
*/ | */ | |||
void legendLayersAdded( QList<QgsMapLayer*> theMapLayers ); | void legendLayersAdded( QList<QgsMapLayer*> theMapLayers ); | |||
protected: | protected: | |||
//! protected constructor | //! protected constructor | |||
QgsMapLayerRegistry( QObject * parent = 0 ); | QgsMapLayerRegistry( QObject * parent = 0 ); | |||
private: | ||||
static QgsMapLayerRegistry* mInstance; | ||||
QMap<QString, QgsMapLayer*> mMapLayers; | ||||
QSet<QgsMapLayer*> mOwnedLayers; | ||||
/** debugging member | /** debugging member | |||
invoked when a connect() is made to this object | invoked when a connect() is made to this object | |||
*/ | */ | |||
void connectNotify( const char * signal ); | void connectNotify( const char * signal ); | |||
private: | ||||
static QgsMapLayerRegistry *mInstance; | ||||
QMap<QString, QgsMapLayer*> mMapLayers; | ||||
QSet<QgsMapLayer*> mOwnedLayers; | ||||
}; // class QgsMapLayerRegistry | }; // class QgsMapLayerRegistry | |||
#endif //QgsMapLayerRegistry_H | #endif //QgsMapLayerRegistry_H | |||
End of changes. 4 change blocks. | ||||
7 lines changed or deleted | 6 lines changed or added | |||
qgsmaprenderer.h | qgsmaprenderer.h | |||
---|---|---|---|---|
skipping to change at line 113 | skipping to change at line 113 | |||
//! @note: this method was added in version 1.7 | //! @note: this method was added in version 1.7 | |||
virtual QList<QgsLabelPosition> labelsAtPosition( const QgsPoint& p ) = 0; | virtual QList<QgsLabelPosition> labelsAtPosition( const QgsPoint& p ) = 0; | |||
//! return infos about labels within a given (map) rectangle | //! return infos about labels within a given (map) rectangle | |||
//! @note: this method was added in version 1.9 | //! @note: this method was added in version 1.9 | |||
virtual QList<QgsLabelPosition> labelsWithinRect( const QgsRectangle& r ) = 0; | virtual QList<QgsLabelPosition> labelsWithinRect( const QgsRectangle& r ) = 0; | |||
//! called when passing engine among map renderers | //! called when passing engine among map renderers | |||
virtual QgsLabelingEngineInterface* clone() = 0; | virtual QgsLabelingEngineInterface* clone() = 0; | |||
}; | }; | |||
struct CORE_EXPORT QgsLayerCoordinateTransform | ||||
{ | ||||
QString srcAuthId; | ||||
QString destAuthId; | ||||
int srcDatumTransform; //-1 if unknown or not specified | ||||
int destDatumTransform; | ||||
}; | ||||
/** \ingroup core | /** \ingroup core | |||
* A non GUI class for rendering a map layer set onto a QPainter. | * A non GUI class for rendering a map layer set onto a QPainter. | |||
*/ | */ | |||
class CORE_EXPORT QgsMapRenderer : public QObject | class CORE_EXPORT QgsMapRenderer : public QObject | |||
{ | { | |||
Q_OBJECT | Q_OBJECT | |||
public: | public: | |||
skipping to change at line 244 | skipping to change at line 252 | |||
*/ | */ | |||
QgsRectangle mapToLayerCoordinates( QgsMapLayer* theLayer, QgsRectangle rect ); | QgsRectangle mapToLayerCoordinates( QgsMapLayer* theLayer, QgsRectangle rect ); | |||
//! sets whether to use projections for this layer set | //! sets whether to use projections for this layer set | |||
void setProjectionsEnabled( bool enabled ); | void setProjectionsEnabled( bool enabled ); | |||
//! returns true if projections are enabled for this layer set | //! returns true if projections are enabled for this layer set | |||
bool hasCrsTransformEnabled() const; | bool hasCrsTransformEnabled() const; | |||
//! sets destination coordinate reference system | //! sets destination coordinate reference system | |||
void setDestinationCrs( const QgsCoordinateReferenceSystem& crs ); | void setDestinationCrs( const QgsCoordinateReferenceSystem& crs, bool r efreshCoordinateTransformInfo = true ); | |||
//! returns CRS of destination coordinate reference system | //! returns CRS of destination coordinate reference system | |||
const QgsCoordinateReferenceSystem& destinationCrs() const; | const QgsCoordinateReferenceSystem& destinationCrs() const; | |||
void setOutputUnits( OutputUnits u ) {mOutputUnits = u;} | void setOutputUnits( OutputUnits u ) {mOutputUnits = u;} | |||
OutputUnits outputUnits() const {return mOutputUnits;} | OutputUnits outputUnits() const {return mOutputUnits;} | |||
//! returns current extent of layer set | //! returns current extent of layer set | |||
QgsRectangle fullExtent(); | QgsRectangle fullExtent(); | |||
skipping to change at line 285 | skipping to change at line 293 | |||
//! \note Added in QGIS v1.4 | //! \note Added in QGIS v1.4 | |||
QgsLabelingEngineInterface* labelingEngine() { return mLabelingEngine; } | QgsLabelingEngineInterface* labelingEngine() { return mLabelingEngine; } | |||
//! Set labeling engine. Previous engine (if any) is deleted. | //! Set labeling engine. Previous engine (if any) is deleted. | |||
//! Takes ownership of the engine. | //! Takes ownership of the engine. | |||
//! Added in QGIS v1.4 | //! Added in QGIS v1.4 | |||
void setLabelingEngine( QgsLabelingEngineInterface* iface ); | void setLabelingEngine( QgsLabelingEngineInterface* iface ); | |||
//! Returns a QPainter::CompositionMode corresponding to a BlendMode | //! Returns a QPainter::CompositionMode corresponding to a BlendMode | |||
//! Added in 1.9 | //! Added in 1.9 | |||
static QPainter::CompositionMode getCompositionMode( const QgsMapRender er::BlendMode blendMode ); | static QPainter::CompositionMode getCompositionMode( const QgsMapRender er::BlendMode &blendMode ); | |||
//! Returns a BlendMode corresponding to a QPainter::CompositionMode | //! Returns a BlendMode corresponding to a QPainter::CompositionMode | |||
//! Added in 1.9 | //! Added in 1.9 | |||
static QgsMapRenderer::BlendMode getBlendModeEnum( const QPainter::Comp | static QgsMapRenderer::BlendMode getBlendModeEnum( const QPainter::Comp | |||
ositionMode blendMode ); | ositionMode &blendMode ); | |||
void addLayerCoordinateTransform( const QString& layerId, const QString | ||||
& srcAuthId, const QString& destAuthId, int srcDatumTransform = -1, int des | ||||
tDatumTransform = -1 ); | ||||
void clearLayerCoordinateTransforms(); | ||||
const QgsCoordinateTransform* transformation( const QgsMapLayer *layer | ||||
) const; | ||||
signals: | signals: | |||
void drawingProgress( int current, int total ); | void drawingProgress( int current, int total ); | |||
/** This signal is emitted when CRS transformation is enabled/disabled. | ||||
* @param flag true if transformation is enabled. | ||||
* @deprecated Use hasCrsTransformEnabledChanged( bool flag ) | ||||
* to avoid conflict with method of the same name). */ | ||||
#ifndef Q_MOC_RUN | ||||
Q_DECL_DEPRECATED | ||||
#endif | ||||
void hasCrsTransformEnabled( bool flag ); | void hasCrsTransformEnabled( bool flag ); | |||
/** This signal is emitted when CRS transformation is enabled/disabled. | ||||
* @param flag true if transformation is enabled. | ||||
* @note Added in 2.1 */ | ||||
void hasCrsTransformEnabledChanged( bool flag ); | ||||
void destinationSrsChanged(); | void destinationSrsChanged(); | |||
void updateMap(); | void updateMap(); | |||
void mapUnitsChanged(); | void mapUnitsChanged(); | |||
//! emitted when layer's draw() returned false | //! emitted when layer's draw() returned false | |||
void drawError( QgsMapLayer* ); | void drawError( QgsMapLayer* ); | |||
//! Notifies higher level components to show the datum transform dialog | ||||
and add a QgsLayerCoordinateTransformInfo for that layer | ||||
void datumTransformInfoRequested( const QgsMapLayer* ml, const QString& | ||||
srcAuthId, const QString& destAuthId ) const; | ||||
public slots: | public slots: | |||
//! called by signal from layer current being drawn | //! called by signal from layer current being drawn | |||
void onDrawingProgress( int current, int total ); | void onDrawingProgress( int current, int total ); | |||
protected: | protected: | |||
//! adjust extent to fit the pixmap size | //! adjust extent to fit the pixmap size | |||
void adjustExtentToSize(); | void adjustExtentToSize(); | |||
skipping to change at line 377 | skipping to change at line 405 | |||
//!Output units | //!Output units | |||
OutputUnits mOutputUnits; | OutputUnits mOutputUnits; | |||
//! Labeling engine (NULL by default) | //! Labeling engine (NULL by default) | |||
QgsLabelingEngineInterface* mLabelingEngine; | QgsLabelingEngineInterface* mLabelingEngine; | |||
//! Locks rendering loop for concurrent draws | //! Locks rendering loop for concurrent draws | |||
QMutex mRenderMutex; | QMutex mRenderMutex; | |||
private: | QHash< QString, QgsLayerCoordinateTransform > mLayerCoordinateTransform | |||
const QgsCoordinateTransform* tr( QgsMapLayer *layer ); | Info; | |||
}; | }; | |||
#endif | #endif | |||
End of changes. 8 change blocks. | ||||
6 lines changed or deleted | 40 lines changed or added | |||
qgsmaptoolidentify.h | qgsmaptoolidentify.h | |||
---|---|---|---|---|
skipping to change at line 33 | skipping to change at line 33 | |||
#include "qgsdistancearea.h" | #include "qgsdistancearea.h" | |||
#include "qgsmaplayer.h" | #include "qgsmaplayer.h" | |||
#include <QObject> | #include <QObject> | |||
#include <QPointer> | #include <QPointer> | |||
class QgsRasterLayer; | class QgsRasterLayer; | |||
class QgsVectorLayer; | class QgsVectorLayer; | |||
class QgsMapLayer; | class QgsMapLayer; | |||
class QgsMapCanvas; | class QgsMapCanvas; | |||
class QgsHighlight; | ||||
/** | /** | |||
\brief Map tool for identifying features in layers | \brief Map tool for identifying features in layers | |||
after selecting a point, performs the identification: | after selecting a point, performs the identification: | |||
- for raster layers shows value of underlying pixel | - for raster layers shows value of underlying pixel | |||
- for vector layers shows feature attributes within search radius | - for vector layers shows feature attributes within search radius | |||
(allows to edit values when vector layer is in editing mode) | (allows to edit values when vector layer is in editing mode) | |||
*/ | */ | |||
class GUI_EXPORT QgsMapToolIdentify : public QgsMapTool | class GUI_EXPORT QgsMapToolIdentify : public QgsMapTool | |||
{ | { | |||
Q_OBJECT | Q_OBJECT | |||
public: | public: | |||
enum IdentifyMode | enum IdentifyMode | |||
{ | { | |||
DefaultQgsSetting = -1, | DefaultQgsSetting = -1, | |||
ActiveLayer, | ActiveLayer, | |||
TopDownStopAtFirst, | TopDownStopAtFirst, | |||
TopDownAll | TopDownAll, | |||
LayerSelection | ||||
}; | }; | |||
enum LayerType | enum LayerType | |||
{ | { | |||
AllLayers = -1, | AllLayers = -1, | |||
VectorLayer, | VectorLayer, | |||
RasterLayer | RasterLayer | |||
}; | }; | |||
struct IdentifyResult | struct IdentifyResult | |||
skipping to change at line 121 | skipping to change at line 123 | |||
/** Performs the identification. | /** Performs the identification. | |||
To avoid beeing forced to specify IdentifyMode with a list of layers | To avoid beeing forced to specify IdentifyMode with a list of layers | |||
this has been made private and two publics methods are offered | this has been made private and two publics methods are offered | |||
@param x x coordinates of mouseEvent | @param x x coordinates of mouseEvent | |||
@param y y coordinates of mouseEvent | @param y y coordinates of mouseEvent | |||
@param mode Identification mode. Can use Qgis default settings or a def ined mode. | @param mode Identification mode. Can use Qgis default settings or a def ined mode. | |||
@param layerType Only performs identification in a certain type of laye rs (raster, vector). Default value is AllLayers. | @param layerType Only performs identification in a certain type of laye rs (raster, vector). Default value is AllLayers. | |||
@return a list of IdentifyResult*/ | @return a list of IdentifyResult*/ | |||
QList<IdentifyResult> identify( int x, int y, IdentifyMode mode, LayerT ype layerType = AllLayers ); | QList<IdentifyResult> identify( int x, int y, IdentifyMode mode, LayerT ype layerType = AllLayers ); | |||
protected: | ||||
//! rubber bands for layer select mode | ||||
void deleteRubberBands(); | ||||
public slots: | public slots: | |||
void formatChanged( QgsRasterLayer *layer ); | void formatChanged( QgsRasterLayer *layer ); | |||
signals: | signals: | |||
void identifyProgress( int, int ); | void identifyProgress( int, int ); | |||
void identifyMessage( QString ); | void identifyMessage( QString ); | |||
void changedRasterResults( QList<IdentifyResult>& ); | void changedRasterResults( QList<IdentifyResult>& ); | |||
private: | private: | |||
/** Performs the identification. | /** Performs the identification. | |||
skipping to change at line 155 | skipping to change at line 161 | |||
bool identifyVectorLayer( QList<IdentifyResult> *results, QgsVectorLaye r *layer, QgsPoint point ); | bool identifyVectorLayer( QList<IdentifyResult> *results, QgsVectorLaye r *layer, QgsPoint point ); | |||
//! Private helper | //! Private helper | |||
virtual void convertMeasurement( QgsDistanceArea &calc, double &measure , QGis::UnitType &u, bool isArea ); | virtual void convertMeasurement( QgsDistanceArea &calc, double &measure , QGis::UnitType &u, bool isArea ); | |||
/** Transforms the measurements of derived attributes in the desired un its*/ | /** Transforms the measurements of derived attributes in the desired un its*/ | |||
virtual QGis::UnitType displayUnits(); | virtual QGis::UnitType displayUnits(); | |||
QMap< QString, QString > featureDerivedAttributes( QgsFeature *feature, QgsMapLayer *layer ); | QMap< QString, QString > featureDerivedAttributes( QgsFeature *feature, QgsMapLayer *layer ); | |||
// specific to layer selection mode | ||||
//! layer id map for layer select mode | ||||
QMap< QgsMapLayer*, QList<IdentifyResult> > mLayerIdResults; | ||||
//! rubber bands for layer select mode | ||||
QList<QgsHighlight*> mRubberBands; | ||||
// Last point in canvas CRS | // Last point in canvas CRS | |||
QgsPoint mLastPoint; | QgsPoint mLastPoint; | |||
double mLastMapUnitsPerPixel; | double mLastMapUnitsPerPixel; | |||
QgsRectangle mLastExtent; | QgsRectangle mLastExtent; | |||
private slots: | ||||
//! menu for layer selection | ||||
void handleMenuHover(); | ||||
}; | }; | |||
#endif | #endif | |||
End of changes. 5 change blocks. | ||||
1 lines changed or deleted | 17 lines changed or added | |||
qgsmarkersymbollayerv2.h | qgsmarkersymbollayerv2.h | |||
---|---|---|---|---|
skipping to change at line 73 | skipping to change at line 73 | |||
void writeSldMarker( QDomDocument &doc, QDomElement &element, QgsString Map props ) const; | void writeSldMarker( QDomDocument &doc, QDomElement &element, QgsString Map props ) const; | |||
QString ogrFeatureStyle( double mmScaleFactor, double mapUnitScaleFacto r ) const; | QString ogrFeatureStyle( double mmScaleFactor, double mapUnitScaleFacto r ) const; | |||
QString name() const { return mName; } | QString name() const { return mName; } | |||
void setName( QString name ) { mName = name; } | void setName( QString name ) { mName = name; } | |||
QColor borderColor() const { return mBorderColor; } | QColor borderColor() const { return mBorderColor; } | |||
void setBorderColor( QColor color ) { mBorderColor = color; } | void setBorderColor( QColor color ) { mBorderColor = color; } | |||
Qt::PenStyle outlineStyle() const { return mOutlineStyle; } | ||||
void setOutlineStyle( Qt::PenStyle outlineStyle ) { mOutlineStyle = out | ||||
lineStyle; } | ||||
/** Get outline color. | ||||
* @note added in 2.1 */ | ||||
QColor outlineColor() const { return borderColor(); } | ||||
/** Set outline color. | ||||
* @note added in 2.1 */ | ||||
void setOutlineColor( const QColor& color ) { setBorderColor( color ); | ||||
} | ||||
/** Get fill color. | ||||
* @note added in 2.1 */ | ||||
QColor fillColor() const { return color(); } | ||||
/** Set fill color. | ||||
* @note added in 2.1 */ | ||||
void setFillColor( const QColor& color ) { setColor( color ); } | ||||
double outlineWidth() const { return mOutlineWidth; } | double outlineWidth() const { return mOutlineWidth; } | |||
void setOutlineWidth( double w ) { mOutlineWidth = w; } | void setOutlineWidth( double w ) { mOutlineWidth = w; } | |||
QgsSymbolV2::OutputUnit outlineWidthUnit() const { return mOutlineWidth Unit; } | QgsSymbolV2::OutputUnit outlineWidthUnit() const { return mOutlineWidth Unit; } | |||
void setOutlineWidthUnit( QgsSymbolV2::OutputUnit u ) { mOutlineWidthUn it = u; } | void setOutlineWidthUnit( QgsSymbolV2::OutputUnit u ) { mOutlineWidthUn it = u; } | |||
bool writeDxf( QgsDxfExport& e, double mmMapUnitScaleFactor, const QStr | ||||
ing& layerName, const QgsSymbolV2RenderContext* context, const QgsFeature* | ||||
f, const QPointF& shift = QPointF( 0.0, 0.0 ) ) const; | ||||
protected: | protected: | |||
void drawMarker( QPainter* p, QgsSymbolV2RenderContext& context ); | void drawMarker( QPainter* p, QgsSymbolV2RenderContext& context ); | |||
bool prepareShape( QString name = QString() ); | bool prepareShape( QString name = QString() ); | |||
bool preparePath( QString name = QString() ); | bool preparePath( QString name = QString() ); | |||
/**Prepares cache image | /**Prepares cache image | |||
@return true in case of success, false if cache image size too large*/ | @return true in case of success, false if cache image size too large*/ | |||
bool prepareCache( QgsSymbolV2RenderContext& context ); | bool prepareCache( QgsSymbolV2RenderContext& context ); | |||
QColor mBorderColor; | QColor mBorderColor; | |||
Qt::PenStyle mOutlineStyle; | ||||
double mOutlineWidth; | double mOutlineWidth; | |||
QgsSymbolV2::OutputUnit mOutlineWidthUnit; | QgsSymbolV2::OutputUnit mOutlineWidthUnit; | |||
QPen mPen; | QPen mPen; | |||
QBrush mBrush; | QBrush mBrush; | |||
QPolygonF mPolygon; | QPolygonF mPolygon; | |||
QPainterPath mPath; | QPainterPath mPath; | |||
QString mName; | QString mName; | |||
QImage mCache; | QImage mCache; | |||
QPen mSelPen; | QPen mSelPen; | |||
QBrush mSelBrush; | QBrush mSelBrush; | |||
QImage mSelCache; | QImage mSelCache; | |||
bool mUsingCache; | bool mUsingCache; | |||
//Maximum width/height of cache image | //Maximum width/height of cache image | |||
static const int mMaximumCacheWidth = 3000; | static const int mMaximumCacheWidth = 3000; | |||
private: | ||||
QgsExpression *mAngleExpression; | ||||
QgsExpression *mNameExpression; | ||||
}; | }; | |||
////////// | ////////// | |||
#define DEFAULT_SVGMARKER_NAME "/crosses/Star1.svg" | #define DEFAULT_SVGMARKER_NAME "/crosses/Star1.svg" | |||
#define DEFAULT_SVGMARKER_SIZE 2*DEFAULT_POINT_SIZE | #define DEFAULT_SVGMARKER_SIZE 2*DEFAULT_POINT_SIZE | |||
#define DEFAULT_SVGMARKER_ANGLE 0 | #define DEFAULT_SVGMARKER_ANGLE 0 | |||
class CORE_EXPORT QgsSvgMarkerSymbolLayerV2 : public QgsMarkerSymbolLayerV2 | class CORE_EXPORT QgsSvgMarkerSymbolLayerV2 : public QgsMarkerSymbolLayerV2 | |||
{ | { | |||
skipping to change at line 160 | skipping to change at line 184 | |||
double outlineWidth() const { return mOutlineWidth; } | double outlineWidth() const { return mOutlineWidth; } | |||
void setOutlineWidth( double w ) { mOutlineWidth = w; } | void setOutlineWidth( double w ) { mOutlineWidth = w; } | |||
void setOutlineWidthUnit( QgsSymbolV2::OutputUnit unit ) { mOutlineWidt hUnit = unit; } | void setOutlineWidthUnit( QgsSymbolV2::OutputUnit unit ) { mOutlineWidt hUnit = unit; } | |||
QgsSymbolV2::OutputUnit outlineWidthUnit() const { return mOutlineWidth Unit; } | QgsSymbolV2::OutputUnit outlineWidthUnit() const { return mOutlineWidth Unit; } | |||
void setOutputUnit( QgsSymbolV2::OutputUnit unit ); | void setOutputUnit( QgsSymbolV2::OutputUnit unit ); | |||
QgsSymbolV2::OutputUnit outputUnit() const; | QgsSymbolV2::OutputUnit outputUnit() const; | |||
bool writeDxf( QgsDxfExport& e, double mmMapUnitScaleFactor, const QStr | ||||
ing& layerName, const QgsSymbolV2RenderContext* context, const QgsFeature* | ||||
f, const QPointF& shift = QPointF( 0.0, 0.0 ) ) const; | ||||
protected: | protected: | |||
QString mPath; | QString mPath; | |||
//param(fill), param(outline), param(outline-width) are going | //param(fill), param(outline), param(outline-width) are going | |||
//to be replaced in memory | //to be replaced in memory | |||
QColor mFillColor; | QColor mFillColor; | |||
QColor mOutlineColor; | QColor mOutlineColor; | |||
double mOutlineWidth; | double mOutlineWidth; | |||
QgsSymbolV2::OutputUnit mOutlineWidthUnit; | QgsSymbolV2::OutputUnit mOutlineWidthUnit; | |||
double mOrigSize; | double mOrigSize; | |||
End of changes. 5 change blocks. | ||||
0 lines changed or deleted | 32 lines changed or added | |||
qgsmessagelogviewer.h | qgsmessagelogviewer.h | |||
---|---|---|---|---|
skipping to change at line 45 | skipping to change at line 45 | |||
class GUI_EXPORT QgsMessageLogViewer: public QDialog, private Ui::QgsMessag eLogViewer | class GUI_EXPORT QgsMessageLogViewer: public QDialog, private Ui::QgsMessag eLogViewer | |||
{ | { | |||
Q_OBJECT | Q_OBJECT | |||
public: | public: | |||
QgsMessageLogViewer( QStatusBar *statusBar = 0, QWidget *parent = 0, Qt ::WFlags fl = QgisGui::ModalDialogFlags ); | QgsMessageLogViewer( QStatusBar *statusBar = 0, QWidget *parent = 0, Qt ::WFlags fl = QgisGui::ModalDialogFlags ); | |||
~QgsMessageLogViewer(); | ~QgsMessageLogViewer(); | |||
public slots: | public slots: | |||
void logMessage( QString message, QString tag, QgsMessageLog::MessageLe vel level ); | void logMessage( QString message, QString tag, QgsMessageLog::MessageLe vel level ); | |||
private: | protected: | |||
void showEvent( QShowEvent * ); | void showEvent( QShowEvent * ); | |||
void hideEvent( QHideEvent * ); | void hideEvent( QHideEvent * ); | |||
private: | ||||
QToolButton *mButton; | QToolButton *mButton; | |||
int mCount; | int mCount; | |||
private slots: | private slots: | |||
void closeTab( int index ); | void closeTab( int index ); | |||
void buttonToggled( bool checked ); | void buttonToggled( bool checked ); | |||
void buttonDestroyed(); | void buttonDestroyed(); | |||
}; | }; | |||
#endif | #endif | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 2 lines changed or added | |||
qgsmessageoutput.h | qgsmessageoutput.h | |||
---|---|---|---|---|
skipping to change at line 60 | skipping to change at line 60 | |||
virtual void appendMessage( const QString& message ) = 0; | virtual void appendMessage( const QString& message ) = 0; | |||
//! set title for the messages | //! set title for the messages | |||
virtual void setTitle( const QString& title ) = 0; | virtual void setTitle( const QString& title ) = 0; | |||
//! display the message to the user | //! display the message to the user | |||
virtual void showMessage( bool blocking = true ) = 0; | virtual void showMessage( bool blocking = true ) = 0; | |||
//! sets function that will be used to create message output | //! sets function that will be used to create message output | |||
//! @note not available in python bindings | //! @note not available in python bindings | |||
// TODO: implementation where python class could be passed | ||||
static void setMessageOutputCreator( MESSAGE_OUTPUT_CREATOR f ); | static void setMessageOutputCreator( MESSAGE_OUTPUT_CREATOR f ); | |||
//! function that returns new class derived from QgsMessageOutput | //! function that returns new class derived from QgsMessageOutput | |||
//! (don't forget to delete it then) | //! (don't forget to delete it then) | |||
static QgsMessageOutput* createMessageOutput(); | static QgsMessageOutput* createMessageOutput(); | |||
private: | private: | |||
//! Pointer to the function which creates the class for output | //! Pointer to the function which creates the class for output | |||
static MESSAGE_OUTPUT_CREATOR mMessageOutputCreator; | static MESSAGE_OUTPUT_CREATOR mMessageOutputCreator; | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 1 lines changed or added | |||
qgsmultibandcolorrenderer.h | qgsmultibandcolorrenderer.h | |||
---|---|---|---|---|
skipping to change at line 40 | skipping to change at line 40 | |||
{ | { | |||
public: | public: | |||
QgsMultiBandColorRenderer( QgsRasterInterface* input, int redBand, int greenBand, int blueBand, | QgsMultiBandColorRenderer( QgsRasterInterface* input, int redBand, int greenBand, int blueBand, | |||
QgsContrastEnhancement* redEnhancement = 0, QgsContrastEnhancement* greenEnhancement = 0, | QgsContrastEnhancement* redEnhancement = 0, QgsContrastEnhancement* greenEnhancement = 0, | |||
QgsContrastEnhancement* blueEnhancement = 0 ); | QgsContrastEnhancement* blueEnhancement = 0 ); | |||
~QgsMultiBandColorRenderer(); | ~QgsMultiBandColorRenderer(); | |||
QgsRasterInterface * clone() const; | QgsRasterInterface * clone() const; | |||
static QgsRasterRenderer* create( const QDomElement& elem, QgsRasterInt erface* input ); | static QgsRasterRenderer* create( const QDomElement& elem, QgsRasterInt erface* input ); | |||
QgsRasterBlock* block( int bandNo, QgsRectangle const & extent, int wi dth, int height ); | QgsRasterBlock* block( int bandNo, const QgsRectangle & extent, int wid th, int height ); | |||
int redBand() const { return mRedBand; } | int redBand() const { return mRedBand; } | |||
void setRedBand( int band ) { mRedBand = band; } | void setRedBand( int band ) { mRedBand = band; } | |||
int greenBand() const { return mGreenBand; } | int greenBand() const { return mGreenBand; } | |||
void setGreenBand( int band ) { mGreenBand = band; } | void setGreenBand( int band ) { mGreenBand = band; } | |||
int blueBand() const { return mBlueBand; } | int blueBand() const { return mBlueBand; } | |||
void setBlueBand( int band ) { mBlueBand = band; } | void setBlueBand( int band ) { mBlueBand = band; } | |||
const QgsContrastEnhancement* redContrastEnhancement() const { return m RedContrastEnhancement; } | const QgsContrastEnhancement* redContrastEnhancement() const { return m RedContrastEnhancement; } | |||
/**Takes ownership*/ | /**Takes ownership*/ | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
qgsnetworkaccessmanager.h | qgsnetworkaccessmanager.h | |||
---|---|---|---|---|
skipping to change at line 27 | skipping to change at line 27 | |||
#ifndef QGSNETWORKACCESSMANAGER_H | #ifndef QGSNETWORKACCESSMANAGER_H | |||
#define QGSNETWORKACCESSMANAGER_H | #define QGSNETWORKACCESSMANAGER_H | |||
#include <QList> | #include <QList> | |||
#include <QStringList> | #include <QStringList> | |||
#include <QNetworkAccessManager> | #include <QNetworkAccessManager> | |||
#include <QNetworkProxy> | #include <QNetworkProxy> | |||
#include <QNetworkRequest> | #include <QNetworkRequest> | |||
class QTimer; | ||||
/* | /* | |||
* \class QgsNetworkAccessManager | * \class QgsNetworkAccessManager | |||
* \brief network access manager for QGIS | * \brief network access manager for QGIS | |||
* \ingroup core | * \ingroup core | |||
* \since 1.5 | * \since 1.5 | |||
* | * | |||
* This class implements the QGIS network access manager. It's a singleton | * This class implements the QGIS network access manager. It's a singleton | |||
* that can be used across QGIS. | * that can be used across QGIS. | |||
* | * | |||
* Plugins can insert proxy factories and thereby redirect requests to | * Plugins can insert proxy factories and thereby redirect requests to | |||
skipping to change at line 56 | skipping to change at line 58 | |||
Q_OBJECT | Q_OBJECT | |||
public: | public: | |||
//! returns a pointer to the single instance | //! returns a pointer to the single instance | |||
// and creates that instance on the first call. | // and creates that instance on the first call. | |||
static QgsNetworkAccessManager *instance(); | static QgsNetworkAccessManager *instance(); | |||
//! destructor | //! destructor | |||
~QgsNetworkAccessManager(); | ~QgsNetworkAccessManager(); | |||
#if QT_VERSION >= 0x40500 | ||||
//! insert a factory into the proxy factories list | //! insert a factory into the proxy factories list | |||
void insertProxyFactory( QNetworkProxyFactory *factory ); | void insertProxyFactory( QNetworkProxyFactory *factory ); | |||
//! remove a factory from the proxy factories list | //! remove a factory from the proxy factories list | |||
void removeProxyFactory( QNetworkProxyFactory *factory ); | void removeProxyFactory( QNetworkProxyFactory *factory ); | |||
//! retrieve proxy factory list | //! retrieve proxy factory list | |||
const QList<QNetworkProxyFactory *> proxyFactories() const; | const QList<QNetworkProxyFactory *> proxyFactories() const; | |||
#endif | ||||
//! retrieve fall back proxy (for urls that no factory returned proxies for) | //! retrieve fall back proxy (for urls that no factory returned proxies for) | |||
const QNetworkProxy &fallbackProxy() const; | const QNetworkProxy &fallbackProxy() const; | |||
//! retrieve exclude list (urls shouldn't use the fallback proxy) | //! retrieve exclude list (urls shouldn't use the fallback proxy) | |||
const QStringList &excludeList() const; | const QStringList &excludeList() const; | |||
//! set fallback proxy and URL that shouldn't use it. | //! set fallback proxy and URL that shouldn't use it. | |||
void setFallbackProxyAndExcludes( const QNetworkProxy &proxy, const QSt ringList &excludes ); | void setFallbackProxyAndExcludes( const QNetworkProxy &proxy, const QSt ringList &excludes ); | |||
skipping to change at line 87 | skipping to change at line 87 | |||
static QString cacheLoadControlName( QNetworkRequest::CacheLoadControl theControl ); | static QString cacheLoadControlName( QNetworkRequest::CacheLoadControl theControl ); | |||
//! Get QNetworkRequest::CacheLoadControl from name | //! Get QNetworkRequest::CacheLoadControl from name | |||
static QNetworkRequest::CacheLoadControl cacheLoadControlFromName( cons t QString &theName ); | static QNetworkRequest::CacheLoadControl cacheLoadControlFromName( cons t QString &theName ); | |||
signals: | signals: | |||
void requestAboutToBeCreated( QNetworkAccessManager::Operation, const Q NetworkRequest &, QIODevice * ); | void requestAboutToBeCreated( QNetworkAccessManager::Operation, const Q NetworkRequest &, QIODevice * ); | |||
void requestCreated( QNetworkReply * ); | void requestCreated( QNetworkReply * ); | |||
private slots: | private slots: | |||
void connectionProgress(); | ||||
void connectionDestroyed( QObject* ); | ||||
void abortRequest(); | void abortRequest(); | |||
protected: | protected: | |||
virtual QNetworkReply *createRequest( QNetworkAccessManager::Operation op, const QNetworkRequest &req, QIODevice *outgoingData = 0 ); | virtual QNetworkReply *createRequest( QNetworkAccessManager::Operation op, const QNetworkRequest &req, QIODevice *outgoingData = 0 ); | |||
private: | private: | |||
QgsNetworkAccessManager( QObject *parent = 0 ); | QgsNetworkAccessManager( QObject *parent = 0 ); | |||
#if QT_VERSION >= 0x40500 | ||||
QList<QNetworkProxyFactory*> mProxyFactories; | QList<QNetworkProxyFactory*> mProxyFactories; | |||
#endif | ||||
QNetworkProxy mFallbackProxy; | QNetworkProxy mFallbackProxy; | |||
QStringList mExcludedURLs; | QStringList mExcludedURLs; | |||
static QgsNetworkAccessManager *smNAM; | QMap<QNetworkReply*, QTimer*> mActiveRequests; | |||
}; | }; | |||
#endif // QGSNETWORKACCESSMANAGER_H | #endif // QGSNETWORKACCESSMANAGER_H | |||
End of changes. 7 change blocks. | ||||
5 lines changed or deleted | 5 lines changed or added | |||
qgsnewhttpconnection.h | qgsnewhttpconnection.h | |||
---|---|---|---|---|
skipping to change at line 41 | skipping to change at line 41 | |||
//! Constructor | //! Constructor | |||
QgsNewHttpConnection( QWidget *parent = 0, const QString& baseKey = "/Q gis/connections-wms/", const QString& connName = QString::null, Qt::WFlags fl = QgisGui::ModalDialogFlags ); | QgsNewHttpConnection( QWidget *parent = 0, const QString& baseKey = "/Q gis/connections-wms/", const QString& connName = QString::null, Qt::WFlags fl = QgisGui::ModalDialogFlags ); | |||
//! Destructor | //! Destructor | |||
~QgsNewHttpConnection(); | ~QgsNewHttpConnection(); | |||
public slots: | public slots: | |||
//! Saves the connection to ~/.qt/qgisrc | //! Saves the connection to ~/.qt/qgisrc | |||
void accept(); | void accept(); | |||
void on_txtName_textChanged( const QString & ); | void on_txtName_textChanged( const QString & ); | |||
void on_txtUrl_textChanged( const QString & ); | ||||
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()-> className() ); } | void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()-> className() ); } | |||
private: | private: | |||
QString mBaseKey; | QString mBaseKey; | |||
QString mCredentialsBaseKey; | QString mCredentialsBaseKey; | |||
QString mOriginalConnName; //store initial name to delete entry in case of rename | QString mOriginalConnName; //store initial name to delete entry in case of rename | |||
}; | }; | |||
#endif // QGSNEWHTTPCONNECTION_H | #endif // QGSNEWHTTPCONNECTION_H | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 2 lines changed or added | |||
qgsogcutils.h | qgsogcutils.h | |||
---|---|---|---|---|
#ifndef QGSOGCUTILS_H | #ifndef QGSOGCUTILS_H | |||
#define QGSOGCUTILS_H | #define QGSOGCUTILS_H | |||
class QColor; | ||||
class QDomNode; | class QDomNode; | |||
class QDomElement; | class QDomElement; | |||
class QDomDocument; | class QDomDocument; | |||
class QString; | class QString; | |||
#include <list> | #include <list> | |||
#include <QVector> | #include <QVector> | |||
class QgsExpression; | class QgsExpression; | |||
class QgsGeometry; | class QgsGeometry; | |||
skipping to change at line 51 | skipping to change at line 52 | |||
*/ | */ | |||
static QgsGeometry* geometryFromGML( const QDomNode& geometryNode ); | static QgsGeometry* geometryFromGML( const QDomNode& geometryNode ); | |||
/** read rectangle from GML2 Box */ | /** read rectangle from GML2 Box */ | |||
static QgsRectangle rectangleFromGMLBox( const QDomNode& boxNode ); | static QgsRectangle rectangleFromGMLBox( const QDomNode& boxNode ); | |||
/** read rectangle from GML3 Envelope */ | /** read rectangle from GML3 Envelope */ | |||
static QgsRectangle rectangleFromGMLEnvelope( const QDomNode& envelopeN ode ); | static QgsRectangle rectangleFromGMLEnvelope( const QDomNode& envelopeN ode ); | |||
/** Exports the geometry to GML2 or GML3 | /** Exports the geometry to GML2 or GML3 | |||
@return QDomELement | @return QDomElement | |||
*/ | */ | |||
static QDomElement geometryToGML( QgsGeometry* geometry, QDomDocument& doc, QString format ); | static QDomElement geometryToGML( QgsGeometry* geometry, QDomDocument& doc, QString format ); | |||
/** Exports the geometry to GML2 | /** Exports the geometry to GML2 | |||
@return QDomElement | @return QDomElement | |||
*/ | */ | |||
static QDomElement geometryToGML( QgsGeometry* geometry, QDomDocument& doc ); | static QDomElement geometryToGML( QgsGeometry* geometry, QDomDocument& doc ); | |||
/** Exports the rectangle to GML2 Box | /** Exports the rectangle to GML2 Box | |||
@return QDomElement | @return QDomElement | |||
*/ | */ | |||
static QDomElement rectangleToGMLBox( QgsRectangle* box, QDomDocument& doc ); | static QDomElement rectangleToGMLBox( QgsRectangle* box, QDomDocument& doc ); | |||
/** Exports the rectangle to GML2 Envelope | /** Exports the rectangle to GML2 Envelope | |||
@return QDomElement | @return QDomElement | |||
*/ | */ | |||
static QDomElement rectangleToGMLEnvelope( QgsRectangle* env, QDomDocum ent& doc ); | static QDomElement rectangleToGMLEnvelope( QgsRectangle* env, QDomDocum ent& doc ); | |||
/** Parse XML with OGC fill into QColor */ | ||||
static QColor colorFromOgcFill( const QDomElement& fillElement ); | ||||
/** Parse XML with OGC filter into QGIS expression */ | /** Parse XML with OGC filter into QGIS expression */ | |||
static QgsExpression* expressionFromOgcFilter( const QDomElement& eleme nt ); | static QgsExpression* expressionFromOgcFilter( const QDomElement& eleme nt ); | |||
/** Creates OGC filter XML element. Supports minimum standard filter | /** Creates OGC filter XML element. Supports minimum standard filter | |||
* according to the OGC filter specs (=,!=,<,>,<=,>=,AND,OR,NOT) | * according to the OGC filter specs (=,!=,<,>,<=,>=,AND,OR,NOT) | |||
* @return valid \verbatim <Filter> \endverbatim QDomElement on success , | * @return valid \verbatim <Filter> \endverbatim QDomElement on success , | |||
* otherwise null QDomElement | * otherwise null QDomElement | |||
*/ | */ | |||
static QDomElement expressionToOgcFilter( const QgsExpression& exp, QDo mDocument& doc, QString* errorMessage = 0 ); | static QDomElement expressionToOgcFilter( const QgsExpression& exp, QDo mDocument& doc, QString* errorMessage = 0 ); | |||
skipping to change at line 97 | skipping to change at line 101 | |||
/** static method that creates geometry from GML MultiPoint */ | /** static method that creates geometry from GML MultiPoint */ | |||
static QgsGeometry* geometryFromGMLMultiPoint( const QDomElement& geome tryElement ); | static QgsGeometry* geometryFromGMLMultiPoint( const QDomElement& geome tryElement ); | |||
/** static method that creates geometry from GML MultiLineString */ | /** static method that creates geometry from GML MultiLineString */ | |||
static QgsGeometry* geometryFromGMLMultiLineString( const QDomElement& geometryElement ); | static QgsGeometry* geometryFromGMLMultiLineString( const QDomElement& geometryElement ); | |||
/** static method that creates geometry from GML MultiPolygon */ | /** static method that creates geometry from GML MultiPolygon */ | |||
static QgsGeometry* geometryFromGMLMultiPolygon( const QDomElement& geo metryElement ); | static QgsGeometry* geometryFromGMLMultiPolygon( const QDomElement& geo metryElement ); | |||
/** Reads the \verbatim <gml:coordinates> \endverbatim element and extr acts the coordinates as points | /** Reads the \verbatim <gml:coordinates> \endverbatim element and extr acts the coordinates as points | |||
@param coords list where the found coordinates are appended | @param coords list where the found coordinates are appended | |||
@param elem the \verbatim <gml:coordinates> \endverbatim element | @param elem the \verbatim <gml:coordinates> \endverbatim element | |||
@return boolean for success*/ | @return boolean for success*/ | |||
static bool readGMLCoordinates( QgsPolyline &coords, const QDomElement elem ); | static bool readGMLCoordinates( QgsPolyline &coords, const QDomElement &elem ); | |||
/** Reads the \verbatim <gml:pos> \endverbatim or \verbatim <gml:posLis t> \endverbatim | /** Reads the \verbatim <gml:pos> \endverbatim or \verbatim <gml:posLis t> \endverbatim | |||
and extracts the coordinates as points | and extracts the coordinates as points | |||
@param coords list where the found coordinates are appended | @param coords list where the found coordinates are appended | |||
@param elem the \verbatim <gml:pos> \endverbatim or | @param elem the \verbatim <gml:pos> \endverbatim or | |||
\verbatim <gml:posList> \endverbatim element | \verbatim <gml:posList> \endverbatim element | |||
@return boolean for success*/ | @return boolean for success*/ | |||
static bool readGMLPositions( QgsPolyline &coords, const QDomElement el em ); | static bool readGMLPositions( QgsPolyline &coords, const QDomElement &e lem ); | |||
/**Create a GML coordinates element from a point list. | /**Create a GML coordinates element from a point list. | |||
@param points list of data points | @param points list of data points | |||
@param doc the GML document | @param doc the GML document | |||
@return QDomElement */ | @return QDomElement */ | |||
static QDomElement createGMLCoordinates( const QgsPolyline &points, QDo mDocument& doc ); | static QDomElement createGMLCoordinates( const QgsPolyline &points, QDo mDocument& doc ); | |||
/**Create a GML pos or posList element from a point list. | /**Create a GML pos or posList element from a point list. | |||
@param points list of data points | @param points list of data points | |||
@param doc the GML document | @param doc the GML document | |||
End of changes. 5 change blocks. | ||||
3 lines changed or deleted | 7 lines changed or added | |||
qgsoptionsdialogbase.h | qgsoptionsdialogbase.h | |||
---|---|---|---|---|
skipping to change at line 62 | skipping to change at line 62 | |||
/** Constructor | /** Constructor | |||
* @param settingsKey QSettings subgroup key for saving/restore ui stat es, e.g. "ProjectProperties". | * @param settingsKey QSettings subgroup key for saving/restore ui stat es, e.g. "ProjectProperties". | |||
* @param parent parent object (owner) | * @param parent parent object (owner) | |||
* @param fl widget flags | * @param fl widget flags | |||
*/ | */ | |||
QgsOptionsDialogBase( QString settingsKey, QWidget* parent = 0, Qt::WFl ags fl = 0 ); | QgsOptionsDialogBase( QString settingsKey, QWidget* parent = 0, Qt::WFl ags fl = 0 ); | |||
~QgsOptionsDialogBase(); | ~QgsOptionsDialogBase(); | |||
/** Set up the base ui connections for vertical tabs. | /** Set up the base ui connections for vertical tabs. | |||
* @param restoreUi Whether to restore the base ui at this time. | * @param restoreUi Whether to restore the base ui at this time. | |||
* @param title the window title | ||||
*/ | */ | |||
void initOptionsBase( bool restoreUi = true ); | void initOptionsBase( bool restoreUi = true, QString title = QString() ); | |||
/** Restore the base ui. | /** Restore the base ui. | |||
* Sometimes useful to do at end of subclass's constructor. | * Sometimes useful to do at end of subclass's constructor. | |||
* @param title the window title (it does not need to be defined if pre viously given to initOptionsBase(); | ||||
*/ | */ | |||
void restoreOptionsBaseUi(); | void restoreOptionsBaseUi( QString title = QString() ); | |||
/** determine if the options list is in icon only mode | ||||
*/ | ||||
bool iconOnly() {return mIconOnly;} | ||||
protected slots: | protected slots: | |||
void updateOptionsListVerticalTabs(); | void updateOptionsListVerticalTabs(); | |||
void optionsStackedWidget_CurrentChanged( int indx ); | void optionsStackedWidget_CurrentChanged( int indx ); | |||
void optionsStackedWidget_WidgetRemoved( int indx ); | void optionsStackedWidget_WidgetRemoved( int indx ); | |||
void warnAboutMissingObjects(); | void warnAboutMissingObjects(); | |||
protected: | protected: | |||
void showEvent( QShowEvent* e ); | void showEvent( QShowEvent* e ); | |||
void paintEvent( QPaintEvent* e ); | void paintEvent( QPaintEvent* e ); | |||
virtual void updateWindowTitle(); | ||||
QString mOptsKey; | QString mOptsKey; | |||
bool mInit; | bool mInit; | |||
QListWidget* mOptListWidget; | QListWidget* mOptListWidget; | |||
QStackedWidget* mOptStackedWidget; | QStackedWidget* mOptStackedWidget; | |||
QSplitter* mOptSplitter; | QSplitter* mOptSplitter; | |||
QDialogButtonBox* mOptButtonBox; | QDialogButtonBox* mOptButtonBox; | |||
QString mDialogTitle; | ||||
bool mIconOnly; | ||||
}; | }; | |||
#endif // QGSOPTIONSDIALOGBASE_H | #endif // QGSOPTIONSDIALOGBASE_H | |||
End of changes. 6 change blocks. | ||||
2 lines changed or deleted | 12 lines changed or added | |||
qgsosmbase.h | qgsosmbase.h | |||
---|---|---|---|---|
skipping to change at line 40 | skipping to change at line 40 | |||
public: | public: | |||
QgsOSMElement() { mElemID.type = QgsOSMElementID::Invalid; mElemID.id = 0; } | QgsOSMElement() { mElemID.type = QgsOSMElementID::Invalid; mElemID.id = 0; } | |||
QgsOSMElement( QgsOSMElementID::Type t, QgsOSMId id ) { mElemID.type = t; mElemID.id = id; } | QgsOSMElement( QgsOSMElementID::Type t, QgsOSMId id ) { mElemID.type = t; mElemID.id = id; } | |||
bool isValid() const { return mElemID.type != QgsOSMElementID::Invalid; } | bool isValid() const { return mElemID.type != QgsOSMElementID::Invalid; } | |||
QgsOSMDatabase* database() const; | QgsOSMDatabase* database() const; | |||
// fetched automatically from DB | // fetched automatically from DB | |||
QgsOSMElementID elemID() const { return mElemID; } | QgsOSMElementID elemID() const { return mElemID; } | |||
int id() const { return mElemID.id; } | QgsOSMId id() const { return mElemID.id; } | |||
//QString username() const; | //QString username() const; | |||
//QDateTime timestamp() const; | //QDateTime timestamp() const; | |||
//int version() const; | //int version() const; | |||
private: | private: | |||
QgsOSMElementID mElemID; | QgsOSMElementID mElemID; | |||
}; | }; | |||
/** | /** | |||
A node is one of the core elements in the OpenStreetMap data model. It cons ists of a single geospatial | A node is one of the core elements in the OpenStreetMap data model. It cons ists of a single geospatial | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
qgspalettedrasterrenderer.h | qgspalettedrasterrenderer.h | |||
---|---|---|---|---|
skipping to change at line 21 | skipping to change at line 21 | |||
* This program is free software; you can redistribute it and/or modify * | * This program is free software; you can redistribute it and/or modify * | |||
* it under the terms of the GNU General Public License as published by * | * it under the terms of the GNU General Public License as published by * | |||
* the Free Software Foundation; either version 2 of the License, or * | * the Free Software Foundation; either version 2 of the License, or * | |||
* (at your option) any later version. * | * (at your option) any later version. * | |||
* * | * * | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef QGSPALETTEDRASTERRENDERER_H | #ifndef QGSPALETTEDRASTERRENDERER_H | |||
#define QGSPALETTEDRASTERRENDERER_H | #define QGSPALETTEDRASTERRENDERER_H | |||
#include <QVector> | ||||
#include "qgsrasterrenderer.h" | #include "qgsrasterrenderer.h" | |||
class QColor; | class QColor; | |||
class QDomElement; | class QDomElement; | |||
/** \ingroup core | /** \ingroup core | |||
* Renderer for paletted raster images. | * Renderer for paletted raster images. | |||
*/ | */ | |||
class CORE_EXPORT QgsPalettedRasterRenderer: public QgsRasterRenderer | class CORE_EXPORT QgsPalettedRasterRenderer: public QgsRasterRenderer | |||
{ | { | |||
public: | public: | |||
/**Renderer owns color array*/ | /**Renderer owns color array*/ | |||
QgsPalettedRasterRenderer( QgsRasterInterface* input, int bandNumber, Q | QgsPalettedRasterRenderer( QgsRasterInterface* input, int bandNumber, Q | |||
Color* colorArray, int nColors ); | Color* colorArray, int nColors, const QVector<QString> labels = QVector<QSt | |||
QgsPalettedRasterRenderer( QgsRasterInterface* input, int bandNumber, Q | ring>() ); | |||
Rgb* colorArray, int nColors ); | QgsPalettedRasterRenderer( QgsRasterInterface* input, int bandNumber, Q | |||
Rgb* colorArray, int nColors, const QVector<QString> labels = QVector<QStri | ||||
ng>() ); | ||||
~QgsPalettedRasterRenderer(); | ~QgsPalettedRasterRenderer(); | |||
QgsRasterInterface * clone() const; | QgsRasterInterface * clone() const; | |||
static QgsRasterRenderer* create( const QDomElement& elem, QgsRasterInt erface* input ); | static QgsRasterRenderer* create( const QDomElement& elem, QgsRasterInt erface* input ); | |||
QgsRasterBlock *block( int bandNo, const QgsRectangle & extent, int wid th, int height ); | QgsRasterBlock *block( int bandNo, const QgsRectangle & extent, int wid th, int height ); | |||
/**Returns number of colors*/ | /**Returns number of colors*/ | |||
int nColors() const { return mNColors; } | int nColors() const { return mNColors; } | |||
/**Returns copy of color array (caller takes ownership)*/ | /**Returns copy of color array (caller takes ownership)*/ | |||
QColor* colors() const; | QColor* colors() const; | |||
/**Returns copy of rgb array (caller takes ownership) | /**Returns copy of rgb array (caller takes ownership) | |||
@note not available in python bindings | @note not available in python bindings | |||
*/ | */ | |||
QRgb* rgbArray() const; | QRgb* rgbArray() const; | |||
/** Return optional category label | ||||
* @note added in 2.1 */ | ||||
QString label( int idx ) const { return mLabels.value( idx ); } | ||||
/** Set category label | ||||
* @note added in 2.1 */ | ||||
void setLabel( int idx, QString label ); | ||||
void writeXML( QDomDocument& doc, QDomElement& parentElem ) const; | void writeXML( QDomDocument& doc, QDomElement& parentElem ) const; | |||
void legendSymbologyItems( QList< QPair< QString, QColor > >& symbolIte ms ) const; | void legendSymbologyItems( QList< QPair< QString, QColor > >& symbolIte ms ) const; | |||
QList<int> usesBands() const; | QList<int> usesBands() const; | |||
private: | private: | |||
int mBand; | int mBand; | |||
/**Color array*/ | /**Color array*/ | |||
QRgb* mColors; | QRgb* mColors; | |||
/**Number of colors*/ | /**Number of colors*/ | |||
int mNColors; | int mNColors; | |||
/** Optional category labels, size of vector may be < mNColors */ | ||||
QVector<QString> mLabels; | ||||
}; | }; | |||
#endif // QGSPALETTEDRASTERRENDERER_H | #endif // QGSPALETTEDRASTERRENDERER_H | |||
End of changes. 4 change blocks. | ||||
4 lines changed or deleted | 18 lines changed or added | |||
qgspallabeling.h | qgspallabeling.h | |||
---|---|---|---|---|
skipping to change at line 563 | skipping to change at line 563 | |||
double cost; | double cost; | |||
}; | }; | |||
/** \ingroup core | /** \ingroup core | |||
* Maintains current state of more grainular and temporal values when crea ting/painting | * Maintains current state of more grainular and temporal values when crea ting/painting | |||
* component parts of an individual label (e.g. buffer, background, shadow , etc.). | * component parts of an individual label (e.g. buffer, background, shadow , etc.). | |||
*/ | */ | |||
class CORE_EXPORT QgsLabelComponent | class CORE_EXPORT QgsLabelComponent | |||
{ | { | |||
public: | public: | |||
QgsLabelComponent(): mText( QString() ) | QgsLabelComponent() | |||
: mText( QString() ) | ||||
, mOrigin( QgsPoint() ) | , mOrigin( QgsPoint() ) | |||
, mUseOrigin( false ) | , mUseOrigin( false ) | |||
, mRotation( 0.0 ) | , mRotation( 0.0 ) | |||
, mRotationOffset( 0.0 ) | , mRotationOffset( 0.0 ) | |||
, mUseRotation( false ) | , mUseRotation( false ) | |||
, mCenter( QgsPoint() ) | , mCenter( QgsPoint() ) | |||
, mUseCenter( false ) | , mUseCenter( false ) | |||
, mSize( QgsPoint() ) | , mSize( QgsPoint() ) | |||
, mOffset( QgsPoint() ) | , mOffset( QgsPoint() ) | |||
, mPicture( 0 ) | , mPicture( 0 ) | |||
skipping to change at line 685 | skipping to change at line 686 | |||
bool isShowingCandidates() const { return mShowingCandidates; } | bool isShowingCandidates() const { return mShowingCandidates; } | |||
void setShowingCandidates( bool showing ) { mShowingCandidates = showin g; } | void setShowingCandidates( bool showing ) { mShowingCandidates = showin g; } | |||
const QList<QgsLabelCandidate>& candidates() { return mCandidates; } | const QList<QgsLabelCandidate>& candidates() { return mCandidates; } | |||
bool isShowingShadowRectangles() const { return mShowingShadowRects; } | bool isShowingShadowRectangles() const { return mShowingShadowRects; } | |||
void setShowingShadowRectangles( bool showing ) { mShowingShadowRects = showing; } | void setShowingShadowRectangles( bool showing ) { mShowingShadowRects = showing; } | |||
bool isShowingAllLabels() const { return mShowingAllLabels; } | bool isShowingAllLabels() const { return mShowingAllLabels; } | |||
void setShowingAllLabels( bool showing ) { mShowingAllLabels = showing; } | void setShowingAllLabels( bool showing ) { mShowingAllLabels = showing; } | |||
bool isShowingPartialsLabels() const { return mShowingPartialsLabels; } | ||||
void setShowingPartialsLabels( bool showing ) { mShowingPartialsLabels | ||||
= showing; } | ||||
// implemented methods from labeling engine interface | // implemented methods from labeling engine interface | |||
//! called when we're going to start with rendering | //! called when we're going to start with rendering | |||
virtual void init( QgsMapRenderer* mr ); | virtual void init( QgsMapRenderer* mr ); | |||
//! called to find out whether the layer is used for labeling | //! called to find out whether the layer is used for labeling | |||
virtual bool willUseLayer( QgsVectorLayer* layer ); | virtual bool willUseLayer( QgsVectorLayer* layer ); | |||
//! clears all PAL layer settings for registered layers | //! clears all PAL layer settings for registered layers | |||
//! @note: this method was added in version 1.9 | //! @note: this method was added in version 1.9 | |||
virtual void clearActiveLayers(); | virtual void clearActiveLayers(); | |||
//! clears data defined objects from PAL layer settings for a registere d layer | //! clears data defined objects from PAL layer settings for a registere d layer | |||
skipping to change at line 720 | skipping to change at line 724 | |||
//! return infos about labels within a given (map) rectangle | //! return infos about labels within a given (map) rectangle | |||
virtual QList<QgsLabelPosition> labelsWithinRect( const QgsRectangle& r ); | virtual QList<QgsLabelPosition> labelsWithinRect( const QgsRectangle& r ); | |||
//! called when passing engine among map renderers | //! called when passing engine among map renderers | |||
virtual QgsLabelingEngineInterface* clone(); | virtual QgsLabelingEngineInterface* clone(); | |||
//! @note not available in python bindings | //! @note not available in python bindings | |||
void drawLabelCandidateRect( pal::LabelPosition* lp, QPainter* painter, const QgsMapToPixel* xform ); | void drawLabelCandidateRect( pal::LabelPosition* lp, QPainter* painter, const QgsMapToPixel* xform ); | |||
//!drawLabel | //!drawLabel | |||
//! @note not available in python bindings | //! @note not available in python bindings | |||
void drawLabel( pal::LabelPosition* label, QgsRenderContext& context, Q gsPalLayerSettings& tmpLyr, DrawLabelType drawType ); | virtual void drawLabel( pal::LabelPosition* label, QgsRenderContext& co ntext, QgsPalLayerSettings& tmpLyr, DrawLabelType drawType, double dpiRatio = 1.0 ); | |||
static void drawLabelBuffer( QgsRenderContext& context, | static void drawLabelBuffer( QgsRenderContext& context, | |||
QgsLabelComponent component, | QgsLabelComponent component, | |||
const QgsPalLayerSettings& tmpLyr ); | const QgsPalLayerSettings& tmpLyr ); | |||
static void drawLabelBackground( QgsRenderContext& context, | static void drawLabelBackground( QgsRenderContext& context, | |||
QgsLabelComponent component, | QgsLabelComponent component, | |||
const QgsPalLayerSettings& tmpLyr ); | const QgsPalLayerSettings& tmpLyr ); | |||
static void drawLabelShadow( QgsRenderContext& context, | static void drawLabelShadow( QgsRenderContext& context, | |||
skipping to change at line 781 | skipping to change at line 785 | |||
Search mSearch; | Search mSearch; | |||
pal::Pal* mPal; | pal::Pal* mPal; | |||
// list of candidates from last labeling | // list of candidates from last labeling | |||
QList<QgsLabelCandidate> mCandidates; | QList<QgsLabelCandidate> mCandidates; | |||
bool mShowingCandidates; | bool mShowingCandidates; | |||
bool mShowingAllLabels; // whether to avoid collisions or not | bool mShowingAllLabels; // whether to avoid collisions or not | |||
bool mSavedWithProject; // whether engine settings have been read from project file | bool mSavedWithProject; // whether engine settings have been read from project file | |||
bool mShowingShadowRects; // whether to show debugging rectangles for d rop shadows | bool mShowingShadowRects; // whether to show debugging rectangles for d rop shadows | |||
bool mShowingPartialsLabels; // whether to avoid partials labels or not | ||||
QgsLabelSearchTree* mLabelSearchTree; | QgsLabelSearchTree* mLabelSearchTree; | |||
}; | }; | |||
#endif // QGSPALLABELING_H | #endif // QGSPALLABELING_H | |||
End of changes. 4 change blocks. | ||||
2 lines changed or deleted | 8 lines changed or added | |||
qgspaperitem.h | qgspaperitem.h | |||
---|---|---|---|---|
skipping to change at line 22 | skipping to change at line 22 | |||
* it under the terms of the GNU General Public License as published by * | * it under the terms of the GNU General Public License as published by * | |||
* the Free Software Foundation; either version 2 of the License, or * | * the Free Software Foundation; either version 2 of the License, or * | |||
* (at your option) any later version. * | * (at your option) any later version. * | |||
* * | * * | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef QGSPAPERITEM_H | #ifndef QGSPAPERITEM_H | |||
#define QGSPAPERITEM_H | #define QGSPAPERITEM_H | |||
#include "qgscomposeritem.h" | #include "qgscomposeritem.h" | |||
#include <QGraphicsRectItem> | ||||
/**Item representing the paper. May draw the snapping grid lines if composi | /**Item representing a grid. This is drawn separately to the underlying pap | |||
tion is in | er item since the grid needs to be | |||
preview mode*/ | * drawn above all other composer items, while the paper item is drawn belo | |||
class CORE_EXPORT QgsPaperItem: public QgsComposerItem | w all others.*/ | |||
class CORE_EXPORT QgsPaperGrid: public QGraphicsRectItem | ||||
{ | ||||
public: | ||||
QgsPaperGrid( double x, double y, double width, double height, QgsCompo | ||||
sition* composition ); | ||||
~QgsPaperGrid(); | ||||
/** \brief Reimplementation of QCanvasItem::paint*/ | ||||
void paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyl | ||||
e, QWidget* pWidget ); | ||||
private: | ||||
QgsComposition* mComposition; | ||||
}; | ||||
/**Item representing the paper.*/ | ||||
class CORE_EXPORT QgsPaperItem : public QgsComposerItem | ||||
{ | { | |||
public: | public: | |||
QgsPaperItem( QgsComposition* c ); | QgsPaperItem( QgsComposition* c ); | |||
QgsPaperItem( qreal x, qreal y, qreal width, qreal height, QgsCompositi on* composition ); | QgsPaperItem( qreal x, qreal y, qreal width, qreal height, QgsCompositi on* composition ); | |||
~QgsPaperItem(); | ~QgsPaperItem(); | |||
/** return correct graphics item type. Added in v1.7 */ | /** return correct graphics item type. Added in v1.7 */ | |||
virtual int type() const { return ComposerPaper; } | virtual int type() const { return ComposerPaper; } | |||
/** \brief Reimplementation of QCanvasItem::paint*/ | /** \brief Reimplementation of QCanvasItem::paint*/ | |||
skipping to change at line 50 | skipping to change at line 65 | |||
* @param doc Dom document | * @param doc Dom document | |||
*/ | */ | |||
bool writeXML( QDomElement& elem, QDomDocument & doc ) const; | bool writeXML( QDomElement& elem, QDomDocument & doc ) const; | |||
/** sets state from Dom document | /** sets state from Dom document | |||
* @param itemElem is Dom node corresponding to item tag | * @param itemElem is Dom node corresponding to item tag | |||
* @param doc is the Dom document | * @param doc is the Dom document | |||
*/ | */ | |||
bool readXML( const QDomElement& itemElem, const QDomDocument& doc ); | bool readXML( const QDomElement& itemElem, const QDomDocument& doc ); | |||
virtual void setSceneRect( const QRectF& rectangle ); | ||||
private: | private: | |||
QgsPaperItem(); | QgsPaperItem(); | |||
/**Set flags and z-value*/ | /**Set flags and z-value*/ | |||
void initialize(); | void initialize(); | |||
void calculatePageMargin(); | ||||
QgsPaperGrid* mPageGrid; | ||||
double mPageMargin; | ||||
}; | }; | |||
#endif | #endif | |||
End of changes. 4 change blocks. | ||||
4 lines changed or deleted | 29 lines changed or added | |||
qgspiediagram.h | qgspiediagram.h | |||
---|---|---|---|---|
skipping to change at line 38 | skipping to change at line 38 | |||
class QgsDiagramInterpolationSettings; | class QgsDiagramInterpolationSettings; | |||
class QgsRenderContext; | class QgsRenderContext; | |||
class CORE_EXPORT QgsPieDiagram: public QgsDiagram | class CORE_EXPORT QgsPieDiagram: public QgsDiagram | |||
{ | { | |||
public: | public: | |||
QgsPieDiagram(); | QgsPieDiagram(); | |||
~QgsPieDiagram(); | ~QgsPieDiagram(); | |||
void renderDiagram( const QgsAttributes& att, QgsRenderContext& c, cons t QgsDiagramSettings& s, const QPointF& position ); | void renderDiagram( const QgsFeature& feature, QgsRenderContext& c, con st QgsDiagramSettings& s, const QPointF& position ); | |||
QSizeF diagramSize( const QgsAttributes& attributes, const QgsRenderCon text& c, const QgsDiagramSettings& s ); | QSizeF diagramSize( const QgsAttributes& attributes, const QgsRenderCon text& c, const QgsDiagramSettings& s ); | |||
QSizeF diagramSize( const QgsAttributes& attributes, const QgsRenderCon text& c, const QgsDiagramSettings& s, const QgsDiagramInterpolationSettings & is ); | QSizeF diagramSize( const QgsFeature& feature, const QgsRenderContext& c, const QgsDiagramSettings& s, const QgsDiagramInterpolationSettings& is ) ; | |||
QString diagramName() const { return DIAGRAM_NAME_PIE; } | QString diagramName() const { return DIAGRAM_NAME_PIE; } | |||
private: | private: | |||
QBrush mCategoryBrush; | QBrush mCategoryBrush; | |||
QPen mPen; | QPen mPen; | |||
static int sCount; | static int sCount; | |||
}; | }; | |||
#endif // QGSPIEDIAGRAM_H | #endif // QGSPIEDIAGRAM_H | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
qgspluginlayer.h | qgspluginlayer.h | |||
---|---|---|---|---|
skipping to change at line 20 | skipping to change at line 20 | |||
* it under the terms of the GNU General Public License as published by * | * it under the terms of the GNU General Public License as published by * | |||
* the Free Software Foundation; either version 2 of the License, or * | * the Free Software Foundation; either version 2 of the License, or * | |||
* (at your option) any later version. * | * (at your option) any later version. * | |||
* * | * * | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef QGSPLUGINLAYER_H | #ifndef QGSPLUGINLAYER_H | |||
#define QGSPLUGINLAYER_H | #define QGSPLUGINLAYER_H | |||
#include "qgsmaplayer.h" | #include "qgsmaplayer.h" | |||
typedef QList< QPair<QString, QPixmap> > QgsLegendSymbologyList; | ||||
/** \ingroup core | /** \ingroup core | |||
Base class for plugin layers. These can be implemented by plugins | Base class for plugin layers. These can be implemented by plugins | |||
and registered in QgsPluginLayerRegistry. | and registered in QgsPluginLayerRegistry. | |||
In order to be readable from project files, they should set these attribu tes in layer DOM node: | In order to be readable from project files, they should set these attribu tes in layer DOM node: | |||
"type" = "plugin" | "type" = "plugin" | |||
"name" = "your_layer_type" | "name" = "your_layer_type" | |||
\note added in v1.5 | \note added in v1.5 | |||
*/ | */ | |||
skipping to change at line 42 | skipping to change at line 44 | |||
Q_OBJECT | Q_OBJECT | |||
public: | public: | |||
QgsPluginLayer( QString layerType, QString layerName = QString() ); | QgsPluginLayer( QString layerType, QString layerName = QString() ); | |||
/** return plugin layer type (the same as used in QgsPluginLayerRegistr y) */ | /** return plugin layer type (the same as used in QgsPluginLayerRegistr y) */ | |||
QString pluginLayerType(); | QString pluginLayerType(); | |||
void setExtent( const QgsRectangle &extent ); | void setExtent( const QgsRectangle &extent ); | |||
//! return a list of symbology items for the legend | ||||
//! (defult implementation returns nothing) | ||||
//! @note Added in v2.1 | ||||
virtual QgsLegendSymbologyList legendSymbologyItems( const QSize& iconS | ||||
ize ); | ||||
protected: | protected: | |||
QString mPluginLayerType; | QString mPluginLayerType; | |||
}; | }; | |||
#endif // QGSPLUGINLAYER_H | #endif // QGSPLUGINLAYER_H | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 8 lines changed or added | |||
qgspluginlayerregistry.h | qgspluginlayerregistry.h | |||
---|---|---|---|---|
skipping to change at line 67 | skipping to change at line 67 | |||
*/ | */ | |||
class CORE_EXPORT QgsPluginLayerRegistry | class CORE_EXPORT QgsPluginLayerRegistry | |||
{ | { | |||
public: | public: | |||
/** means of accessing canonical single instance */ | /** means of accessing canonical single instance */ | |||
static QgsPluginLayerRegistry* instance(); | static QgsPluginLayerRegistry* instance(); | |||
~QgsPluginLayerRegistry(); | ~QgsPluginLayerRegistry(); | |||
/** list all known layer types | ||||
* \note added in v2.1 */ | ||||
QStringList pluginLayerTypes(); | ||||
/** add plugin layer type (take ownership) and return true on success * / | /** add plugin layer type (take ownership) and return true on success * / | |||
bool addPluginLayerType( QgsPluginLayerType* pluginLayerType ); | bool addPluginLayerType( QgsPluginLayerType* pluginLayerType ); | |||
/** remove plugin layer type and return true on success */ | /** remove plugin layer type and return true on success */ | |||
bool removePluginLayerType( QString typeName ); | bool removePluginLayerType( QString typeName ); | |||
/** return plugin layer type metadata or NULL if doesn't exist */ | /** return plugin layer type metadata or NULL if doesn't exist */ | |||
QgsPluginLayerType* pluginLayerType( QString typeName ); | QgsPluginLayerType* pluginLayerType( QString typeName ); | |||
/** return new layer if corresponding plugin has been found, else retur n NULL */ | /** return new layer if corresponding plugin has been found, else retur n NULL */ | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 4 lines changed or added | |||
qgspoint.h | qgspoint.h | |||
---|---|---|---|---|
skipping to change at line 195 | skipping to change at line 195 | |||
QgsPoint operator-( const QgsVector &v ) const { return QgsPoint( m_x - v.x(), m_y - v.y() ); } | QgsPoint operator-( const QgsVector &v ) const { return QgsPoint( m_x - v.x(), m_y - v.y() ); } | |||
private: | private: | |||
//! x coordinate | //! x coordinate | |||
double m_x; | double m_x; | |||
//! y coordinate | //! y coordinate | |||
double m_y; | double m_y; | |||
friend uint qHash( const QgsPoint& pnt ); | ||||
}; // class QgsPoint | }; // class QgsPoint | |||
inline bool operator==( const QgsPoint &p1, const QgsPoint &p2 ) | inline bool operator==( const QgsPoint &p1, const QgsPoint &p2 ) | |||
{ | { | |||
if (( p1.x() == p2.x() ) && ( p1.y() == p2.y() ) ) | if (( p1.x() == p2.x() ) && ( p1.y() == p2.y() ) ) | |||
{ return true; } | { return true; } | |||
else | else | |||
{ return false; } | { return false; } | |||
} | } | |||
inline std::ostream& operator << ( std::ostream& os, const QgsPoint &p ) | inline std::ostream& operator << ( std::ostream& os, const QgsPoint &p ) | |||
{ | { | |||
// Use Local8Bit for printouts | // Use Local8Bit for printouts | |||
os << p.toString().toLocal8Bit().data(); | os << p.toString().toLocal8Bit().data(); | |||
return os; | return os; | |||
} | } | |||
inline uint qHash( const QgsPoint& p ) | ||||
{ | ||||
uint hash; | ||||
uint h1 = qHash(( quint64 )p.m_x ); | ||||
uint h2 = qHash(( quint64 )p.m_y ); | ||||
hash = h1 ^( h2 << 1 ); | ||||
return hash; | ||||
} | ||||
#endif //QGSPOINT_H | #endif //QGSPOINT_H | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 11 lines changed or added | |||
qgspointdisplacementrenderer.h | qgspointdisplacementrenderer.h | |||
---|---|---|---|---|
skipping to change at line 60 | skipping to change at line 60 | |||
QList<QString> usedAttributes(); | QList<QString> usedAttributes(); | |||
QgsSymbolV2List symbols(); | QgsSymbolV2List symbols(); | |||
//! create a renderer from XML element | //! create a renderer from XML element | |||
static QgsFeatureRendererV2* create( QDomElement& symbologyElem ); | static QgsFeatureRendererV2* create( QDomElement& symbologyElem ); | |||
QDomElement save( QDomDocument& doc ); | QDomElement save( QDomDocument& doc ); | |||
QgsLegendSymbologyList legendSymbologyItems( QSize iconSize ); | QgsLegendSymbologyList legendSymbologyItems( QSize iconSize ); | |||
//! @note not available in python bindings | //! @note not available in python bindings | |||
QgsLegendSymbolList legendSymbolItems(); | QgsLegendSymbolList legendSymbolItems( double scaleDenominator = -1, QS tring rule = "" ); | |||
void setLabelAttributeName( const QString& name ) { mLabelAttributeName = name; } | void setLabelAttributeName( const QString& name ) { mLabelAttributeName = name; } | |||
QString labelAttributeName() const { return mLabelAttributeName; } | QString labelAttributeName() const { return mLabelAttributeName; } | |||
/**Sets embedded renderer (takes ownership)*/ | /**Sets embedded renderer (takes ownership)*/ | |||
void setEmbeddedRenderer( QgsFeatureRendererV2* r ); | void setEmbeddedRenderer( QgsFeatureRendererV2* r ); | |||
QgsFeatureRendererV2* embeddedRenderer() { return mRenderer;} | QgsFeatureRendererV2* embeddedRenderer() { return mRenderer;} | |||
//! not available in python bindings | //! not available in python bindings | |||
void setDisplacementGroups( const QList<QMap<QgsFeatureId, QgsFeature> >& list ); | void setDisplacementGroups( const QList<QMap<QgsFeatureId, QgsFeature> >& list ); | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
qgsproject.h | qgsproject.h | |||
---|---|---|---|---|
skipping to change at line 44 | skipping to change at line 44 | |||
//#include <QDomDocument> | //#include <QDomDocument> | |||
class QFileInfo; | class QFileInfo; | |||
class QDomDocument; | class QDomDocument; | |||
class QDomElement; | class QDomElement; | |||
class QDomNode; | class QDomNode; | |||
class QgsMapLayer; | class QgsMapLayer; | |||
class QgsProjectBadLayerHandler; | class QgsProjectBadLayerHandler; | |||
class QgsRelationManager; | ||||
class QgsVectorLayer; | class QgsVectorLayer; | |||
/** \ingroup core | /** \ingroup core | |||
* Reads and writes project states. | * Reads and writes project states. | |||
@note | @note | |||
Has two general kinds of state to make persistent. (I.e., to read and | Has two general kinds of state to make persistent. (I.e., to read and | |||
write.) First, Qgis proprietary information. Second plug-in information . | write.) First, Qgis proprietary information. Second plug-in information . | |||
skipping to change at line 272 | skipping to change at line 273 | |||
/** Return error message from previous read/write | /** Return error message from previous read/write | |||
@note added in 1.4 */ | @note added in 1.4 */ | |||
QString error() const; | QString error() const; | |||
/** Change handler for missing layers. | /** Change handler for missing layers. | |||
Deletes old handler and takes ownership of the new one. | Deletes old handler and takes ownership of the new one. | |||
@note added in 1.4 */ | @note added in 1.4 */ | |||
void setBadLayerHandler( QgsProjectBadLayerHandler* handler ); | void setBadLayerHandler( QgsProjectBadLayerHandler* handler ); | |||
/**Returns project file path if layer is embedded from other project fi le. Returns empty string if layer is not embedded*/ | /** Returns project file path if layer is embedded from other project f ile. Returns empty string if layer is not embedded*/ | |||
QString layerIsEmbedded( const QString& id ) const; | QString layerIsEmbedded( const QString& id ) const; | |||
/**Creates a maplayer instance defined in an arbitrary project file. Ca ller takes ownership | /** Creates a maplayer instance defined in an arbitrary project file. C aller takes ownership | |||
@return the layer or 0 in case of error | @return the layer or 0 in case of error | |||
@note: added in version 1.8 | @note: added in version 1.8 | |||
@note not available in python bindings | @note not available in python bindings | |||
*/ | */ | |||
bool createEmbeddedLayer( const QString& layerId, const QString& projec tFilePath, QList<QDomNode>& brokenNodes, | bool createEmbeddedLayer( const QString& layerId, const QString& projec tFilePath, QList<QDomNode>& brokenNodes, | |||
QList< QPair< QgsVectorLayer*, QDomElement > >& vectorLayerList, bool saveFlag = true ); | QList< QPair< QgsVectorLayer*, QDomElement > >& vectorLayerList, bool saveFlag = true ); | |||
/**Convenience function to set snap settings per layer | /** Convenience function to set snap settings per layer | |||
@note added in version 1.9*/ | @note added in version 1.9*/ | |||
void setSnapSettingsForLayer( const QString& layerId, bool enabled, Qgs Snapper::SnappingType type, QgsTolerance::UnitType unit, double tolerance, | void setSnapSettingsForLayer( const QString& layerId, bool enabled, Qgs Snapper::SnappingType type, QgsTolerance::UnitType unit, double tolerance, | |||
bool avoidIntersection ); | bool avoidIntersection ); | |||
/**Convenience function to query snap settings of a layer | /** Convenience function to query snap settings of a layer | |||
@note added in version 1.9*/ | @note added in version 1.9*/ | |||
bool snapSettingsForLayer( const QString& layerId, bool& enabled, QgsSn apper::SnappingType& type, QgsTolerance::UnitType& units, double& tolerance , | bool snapSettingsForLayer( const QString& layerId, bool& enabled, QgsSn apper::SnappingType& type, QgsTolerance::UnitType& units, double& tolerance , | |||
bool& avoidIntersection ) const; | bool& avoidIntersection ) const; | |||
/**Convenience function to set topological editing | /** Convenience function to set topological editing | |||
@note added in version 1.9*/ | @note added in version 1.9*/ | |||
void setTopologicalEditing( bool enabled ); | void setTopologicalEditing( bool enabled ); | |||
/**Convenience function to query topological editing status | /** Convenience function to query topological editing status | |||
@note added in version 1.9*/ | @note added in version 1.9*/ | |||
bool topologicalEditing() const; | bool topologicalEditing() const; | |||
/** Return project's home path | /** Return project's home path | |||
@return home path of project (or QString::null if not set) | @return home path of project (or QString::null if not set) | |||
@note added in version 2.0 */ | @note added in version 2.0 */ | |||
QString homePath() const; | QString homePath() const; | |||
QgsRelationManager* relationManager() const; | ||||
protected: | protected: | |||
/** Set error message from read/write operation | /** Set error message from read/write operation | |||
@note added in 1.4 */ | @note added in 1.4 */ | |||
void setError( QString errorMessage ); | void setError( QString errorMessage ); | |||
/** Clear error message | /** Clear error message | |||
@note added in 1.4 */ | @note added in 1.4 */ | |||
void clearError(); | void clearError(); | |||
skipping to change at line 389 | skipping to change at line 392 | |||
QgsProjectBadLayerHandler* mBadLayerHandler; | QgsProjectBadLayerHandler* mBadLayerHandler; | |||
/**Embeded layers which are defined in other projects. Key: layer id, | /**Embeded layers which are defined in other projects. Key: layer id, | |||
value: pair< project file path, save layer yes / no (e.g. if the layer is part of an embedded group, loading/saving is done by the legend) | value: pair< project file path, save layer yes / no (e.g. if the layer is part of an embedded group, loading/saving is done by the legend) | |||
If the project file path is empty, QgsProject is going to ignore the layer for saving (e.g. because it is part and managed by an embedded group )*/ | If the project file path is empty, QgsProject is going to ignore the layer for saving (e.g. because it is part and managed by an embedded group )*/ | |||
QHash< QString, QPair< QString, bool> > mEmbeddedLayers; | QHash< QString, QPair< QString, bool> > mEmbeddedLayers; | |||
void snapSettings( QStringList& layerIdList, QStringList& enabledList, QStringList& snapTypeList, QStringList& snapUnitList, QStringList& toleranc eUnitList, | void snapSettings( QStringList& layerIdList, QStringList& enabledList, QStringList& snapTypeList, QStringList& snapUnitList, QStringList& toleranc eUnitList, | |||
QStringList& avoidIntersectionList ) const; | QStringList& avoidIntersectionList ) const; | |||
QgsRelationManager* mRelationManager; | ||||
}; // QgsProject | }; // QgsProject | |||
/** Interface for classes that handle missing layer files when reading proj ect file. | /** Interface for classes that handle missing layer files when reading proj ect file. | |||
@note added in 1.4 */ | @note added in 1.4 */ | |||
class CORE_EXPORT QgsProjectBadLayerHandler | class CORE_EXPORT QgsProjectBadLayerHandler | |||
{ | { | |||
public: | public: | |||
virtual void handleBadLayers( QList<QDomNode> layers, QDomDocument proj ectDom ) = 0; | virtual void handleBadLayers( QList<QDomNode> layers, QDomDocument proj ectDom ) = 0; | |||
virtual ~QgsProjectBadLayerHandler() {} | virtual ~QgsProjectBadLayerHandler() {} | |||
}; | }; | |||
End of changes. 9 change blocks. | ||||
6 lines changed or deleted | 11 lines changed or added | |||
qgsprojectfiletransform.h | qgsprojectfiletransform.h | |||
---|---|---|---|---|
skipping to change at line 88 | skipping to change at line 88 | |||
void transformNull() {}; // Do absolutely nothing | void transformNull() {}; // Do absolutely nothing | |||
void transform081to090(); | void transform081to090(); | |||
void transform091to0100(); | void transform091to0100(); | |||
void transform0100to0110(); | void transform0100to0110(); | |||
void transform0110to1000(); | void transform0110to1000(); | |||
void transform1100to1200(); | void transform1100to1200(); | |||
void transform1400to1500(); | void transform1400to1500(); | |||
void transform1800to1900(); | void transform1800to1900(); | |||
//helper functions | //helper functions | |||
static int rasterBandNumber( const QDomElement& rasterPropertiesElem, c | static int rasterBandNumber( const QDomElement &rasterPropertiesElem, c | |||
onst QString bandName, QgsRasterLayer* rlayer ); | onst QString &bandName, QgsRasterLayer *rlayer ); | |||
static void transformContrastEnhancement( QDomDocument& doc, const QDom | static void transformContrastEnhancement( QDomDocument &doc, const QDom | |||
Element& rasterproperties, QDomElement& rendererElem ); | Element &rasterproperties, QDomElement &rendererElem ); | |||
static void transformRasterTransparency( QDomDocument& doc, const QDomE lement& orig, QDomElement& rendererElem ); | static void transformRasterTransparency( QDomDocument& doc, const QDomE lement& orig, QDomElement& rendererElem ); | |||
}; | }; | |||
#endif //QGSPROJECTFILETRANSFORM_H | #endif //QGSPROJECTFILETRANSFORM_H | |||
End of changes. 1 change blocks. | ||||
4 lines changed or deleted | 4 lines changed or added | |||
qgsprojectproperty.h | qgsprojectproperty.h | |||
---|---|---|---|---|
skipping to change at line 60 | skipping to change at line 60 | |||
{} | {} | |||
virtual ~ QgsProperty() | virtual ~ QgsProperty() | |||
{} | {} | |||
/** dumps out the keys and values | /** dumps out the keys and values | |||
@param tabs is number of tabs to print; used for pretty-printing | @param tabs is number of tabs to print; used for pretty-printing | |||
hierarchy | hierarchy | |||
*/ | */ | |||
virtual void dump( size_t tabs = 0 ) const = 0; | virtual void dump( int tabs = 0 ) const = 0; | |||
/** returns true if is a QgsPropertyKey */ | /** returns true if is a QgsPropertyKey */ | |||
virtual bool isKey() const = 0; | virtual bool isKey() const = 0; | |||
/** returns true if is a QgsPropertyValue */ | /** returns true if is a QgsPropertyValue */ | |||
virtual bool isValue() const = 0; | virtual bool isValue() const = 0; | |||
/** returns true if a leaf node | /** returns true if a leaf node | |||
A leaf node is a key node that has either no value or a single value. | A leaf node is a key node that has either no value or a single value. | |||
skipping to change at line 117 | skipping to change at line 117 | |||
}; // class QgsProperty | }; // class QgsProperty | |||
/** QgsPropertyValue node | /** QgsPropertyValue node | |||
Contains a QgsPropertyKey's value | Contains a QgsPropertyKey's value | |||
*/ | */ | |||
class CORE_EXPORT QgsPropertyValue : public QgsProperty | class CORE_EXPORT QgsPropertyValue : public QgsProperty | |||
{ | { | |||
public: | public: | |||
QgsPropertyValue() | QgsPropertyValue() {} | |||
{} | ||||
QgsPropertyValue( const QVariant &value ) | QgsPropertyValue( const QVariant &value ) | |||
: value_( value ) | : value_( value ) | |||
{} | {} | |||
virtual ~ QgsPropertyValue() | virtual ~ QgsPropertyValue() {} | |||
{} | ||||
/** returns true if is a QgsPropertyKey */ | /** returns true if is a QgsPropertyKey */ | |||
virtual bool isKey() const | virtual bool isKey() const { return false; } | |||
{ return false; } | ||||
/** returns true if is a QgsPropertyValue */ | /** returns true if is a QgsPropertyValue */ | |||
virtual bool isValue() const | virtual bool isValue() const { return true; } | |||
{ return true; } | ||||
QVariant value() const | QVariant value() const { return value_; } | |||
{ return value_; } | ||||
/** returns true if is a leaf node | /** returns true if is a leaf node | |||
@note I suppose, in a way, value nodes can also be qualified as leaf | @note I suppose, in a way, value nodes can also be qualified as leaf | |||
nodes even though we're only counting key nodes. | nodes even though we're only counting key nodes. | |||
*/ | */ | |||
bool isLeaf() const | bool isLeaf() const { return true; } | |||
{ return true; } | ||||
void dump( size_t tabs = 0 ) const; | void dump( int tabs = 0 ) const; | |||
bool readXML( QDomNode & keyNode ); | bool readXML( QDomNode & keyNode ); | |||
bool writeXML( const QString & nodeName, | bool writeXML( const QString & nodeName, | |||
QDomElement & element, | QDomElement & element, | |||
QDomDocument & document ); | QDomDocument & document ); | |||
size_t count() const | int count() const { return 0; } | |||
{ return 0; } | ||||
/** return keys that do not contain other keys | /** return keys that do not contain other keys | |||
Since QgsPropertyValue isn't a key, don't do anything. | Since QgsPropertyValue isn't a key, don't do anything. | |||
*/ | */ | |||
void entryList( QStringList & keyName, QStringList & entries ) const | void entryList( QStringList & keyName, QStringList & entries ) const | |||
{ Q_UNUSED( keyName ); Q_UNUSED( entries ); /* NOP */ } | { Q_UNUSED( keyName ); Q_UNUSED( entries ); /* NOP */ } | |||
private: | private: | |||
skipping to change at line 192 | skipping to change at line 185 | |||
E.g., given the key sequence "/foo/bar", "foo" will have a corresponding | E.g., given the key sequence "/foo/bar", "foo" will have a corresponding | |||
QgsPropertyKey with a name "foo". It will contain an element in its | QgsPropertyKey with a name "foo". It will contain an element in its | |||
mProperties that maps to "bar", which is another QgsPropertyKey. The "b ar" | mProperties that maps to "bar", which is another QgsPropertyKey. The "b ar" | |||
QgsPropertyKey will, in turn, have an element that maps to itself, i.e. "bar", | QgsPropertyKey will, in turn, have an element that maps to itself, i.e. "bar", | |||
that will contain a QgsPropertyValue. | that will contain a QgsPropertyValue. | |||
*/ | */ | |||
class CORE_EXPORT QgsPropertyKey : public QgsProperty | class CORE_EXPORT QgsPropertyKey : public QgsProperty | |||
{ | { | |||
public: | public: | |||
QgsPropertyKey( const QString name = "" ); | QgsPropertyKey( const QString &name = "" ); | |||
virtual ~ QgsPropertyKey(); | virtual ~ QgsPropertyKey(); | |||
/// every key has a name | /// every key has a name | |||
// @{ | // @{ | |||
const QString &name() const | const QString &name() const | |||
{ return mName; } | { return mName; } | |||
QString & name() | QString & name() | |||
{ return mName; } | { return mName; } | |||
// @} | // @} | |||
skipping to change at line 247 | skipping to change at line 240 | |||
/** set the value associated with this key | /** set the value associated with this key | |||
@note that the single value node associated with each key is always | @note that the single value node associated with each key is always | |||
stored keyed by the current key name | stored keyed by the current key name | |||
*/ | */ | |||
QgsPropertyValue * setValue( const QVariant & value ) | QgsPropertyValue * setValue( const QVariant & value ) | |||
{ | { | |||
return setValue( name(), value ); | return setValue( name(), value ); | |||
} | } | |||
void dump( size_t tabs = 0 ) const; | void dump( int tabs = 0 ) const; | |||
bool readXML( QDomNode & keyNode ); | bool readXML( QDomNode & keyNode ); | |||
bool writeXML( const QString &nodeName, QDomElement & element, QDomDocu ment & document ); | bool writeXML( const QString &nodeName, QDomElement & element, QDomDocu ment & document ); | |||
/// how many elements are contained within this one? | /// how many elements are contained within this one? | |||
size_t count() const | int count() const { return mProperties.count(); } | |||
{ return mProperties.count(); } | ||||
/// Does this property not have any subkeys or values? | /// Does this property not have any subkeys or values? | |||
/* virtual */ bool isEmpty() const | /* virtual */ bool isEmpty() const { return mProperties.isEmpty(); } | |||
{ return mProperties.isEmpty(); } | ||||
/** returns true if is a QgsPropertyKey */ | /** returns true if is a QgsPropertyKey */ | |||
virtual bool isKey() const | virtual bool isKey() const { return true; } | |||
{ return true; } | ||||
/** returns true if is a QgsPropertyValue */ | /** returns true if is a QgsPropertyValue */ | |||
virtual bool isValue() const | virtual bool isValue() const { return false; } | |||
{ return false; } | ||||
/// return keys that do not contain other keys | /// return keys that do not contain other keys | |||
void entryList( QStringList & entries ) const; | void entryList( QStringList & entries ) const; | |||
/// return keys that contain other keys | /// return keys that contain other keys | |||
void subkeyList( QStringList & entries ) const; | void subkeyList( QStringList & entries ) const; | |||
/** returns true if a leaf node | /** returns true if a leaf node | |||
A leaf node is a key node that has either no value or a single value. A | A leaf node is a key node that has either no value or a single value. A | |||
End of changes. 15 change blocks. | ||||
26 lines changed or deleted | 15 lines changed or added | |||
qgsproviderregistry.h | qgsproviderregistry.h | |||
---|---|---|---|---|
skipping to change at line 155 | skipping to change at line 155 | |||
Eventually would be nice if could make QgsDataManager smart | Eventually would be nice if could make QgsDataManager smart | |||
enough to figure out whether the given name mapped to a vector, | enough to figure out whether the given name mapped to a vector, | |||
raster, or database source. | raster, or database source. | |||
*/ | */ | |||
//QgsDataProvider * openVector( QString const & dataSource, QString con st & providerKey ); | //QgsDataProvider * openVector( QString const & dataSource, QString con st & providerKey ); | |||
/** type for data provider metadata associative container */ | /** type for data provider metadata associative container */ | |||
typedef std::map<QString, QgsProviderMetadata*> Providers; | typedef std::map<QString, QgsProviderMetadata*> Providers; | |||
private: | private: | |||
/** ctor private since instance() creates it */ | /** ctor private since instance() creates it */ | |||
QgsProviderRegistry( QString pluginPath ); | QgsProviderRegistry( QString pluginPath ); | |||
/** pointer to canonical Singleton object */ | ||||
static QgsProviderRegistry* _instance; | ||||
/** associative container of provider metadata handles */ | /** associative container of provider metadata handles */ | |||
Providers mProviders; | Providers mProviders; | |||
/** directory in which provider plugins are installed */ | /** directory in which provider plugins are installed */ | |||
QDir mLibraryDirectory; | QDir mLibraryDirectory; | |||
/** file filter string for vector files | /** file filter string for vector files | |||
Built once when registry is constructed by appending strings return ed | Built once when registry is constructed by appending strings return ed | |||
from iteratively calling vectorFileFilter() for each visited data | from iteratively calling vectorFileFilter() for each visited data | |||
End of changes. 2 change blocks. | ||||
4 lines changed or deleted | 0 lines changed or added | |||
qgsraster.h | qgsraster.h | |||
---|---|---|---|---|
skipping to change at line 23 | skipping to change at line 23 | |||
* the Free Software Foundation; either version 2 of the License, or * | * the Free Software Foundation; either version 2 of the License, or * | |||
* (at your option) any later version. * | * (at your option) any later version. * | |||
* * | * * | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef QGSRASTER_H | #ifndef QGSRASTER_H | |||
#define QGSRASTER_H | #define QGSRASTER_H | |||
#include <QString> | #include <QString> | |||
#include "qgis.h" | ||||
/** \ingroup core | /** \ingroup core | |||
* Raster namespace. | * Raster namespace. | |||
*/ | */ | |||
class CORE_EXPORT QgsRaster | class CORE_EXPORT QgsRaster | |||
{ | { | |||
public: | public: | |||
// This is modified copy of GDALColorInterp | // This is modified copy of GDALColorInterp | |||
enum ColorInterpretation | enum ColorInterpretation | |||
{ | { | |||
UndefinedColorInterpretation = 0, | UndefinedColorInterpretation = 0, | |||
skipping to change at line 111 | skipping to change at line 113 | |||
PalettedMultiBandColor, // currently not supported | PalettedMultiBandColor, // currently not supported | |||
MultiBandSingleBandGray, // a layer containing 2 or more bands , but a single band drawn as a range of gray colors | MultiBandSingleBandGray, // a layer containing 2 or more bands , but a single band drawn as a range of gray colors | |||
MultiBandSingleBandPseudoColor, // a layer containing 2 or more bands , but a single band drawn using a pseudocolor algorithm | MultiBandSingleBandPseudoColor, // a layer containing 2 or more bands , but a single band drawn using a pseudocolor algorithm | |||
MultiBandColor, // a layer containing 2 or more bands , mapped to RGB color space. In the case of a multiband with only two bands , one band will be mapped to more than one color. | MultiBandColor, // a layer containing 2 or more bands , mapped to RGB color space. In the case of a multiband with only two bands , one band will be mapped to more than one color. | |||
SingleBandColorDataStyle // ARGB values rendered directly | SingleBandColorDataStyle // ARGB values rendered directly | |||
}; | }; | |||
static QString contrastEnhancementLimitsAsString( QgsRaster::ContrastEn hancementLimits theLimits ); | static QString contrastEnhancementLimitsAsString( QgsRaster::ContrastEn hancementLimits theLimits ); | |||
static ContrastEnhancementLimits contrastEnhancementLimitsFromString( Q String theLimits ); | static ContrastEnhancementLimits contrastEnhancementLimitsFromString( Q String theLimits ); | |||
/** Get value representable by given data type. | ||||
* Supported are numerical types Byte, UInt16, Int16, UInt32, Int32, Fl | ||||
oat32, Float64. | ||||
* @param value | ||||
* @param dataType | ||||
* @note added in version 2.1 */ | ||||
static double representableValue( double value, QGis::DataType dataType | ||||
); | ||||
}; | }; | |||
#endif | #endif | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 10 lines changed or added | |||
qgsrasterbandstats.h | qgsrasterbandstats.h | |||
---|---|---|---|---|
skipping to change at line 74 | skipping to change at line 74 | |||
/*! Compares region, size etc. not collected statistics */ | /*! Compares region, size etc. not collected statistics */ | |||
bool contains( const QgsRasterBandStats &s ) const | bool contains( const QgsRasterBandStats &s ) const | |||
{ | { | |||
return ( s.bandNumber == bandNumber && | return ( s.bandNumber == bandNumber && | |||
s.extent == extent && | s.extent == extent && | |||
s.width == width && | s.width == width && | |||
s.height == height && | s.height == height && | |||
s.statsGathered == ( statsGathered & s.statsGathered ) ); | s.statsGathered == ( statsGathered & s.statsGathered ) ); | |||
} | } | |||
/** \brief The name of the band that these stats belong to. */ | ||||
//QString bandName; | ||||
/** \brief The gdal band number (starts at 1)*/ | /** \brief The gdal band number (starts at 1)*/ | |||
int bandNumber; | int bandNumber; | |||
/** \brief The number of not no data cells in the band. */ | /** \brief The number of not no data cells in the band. */ | |||
// TODO: check if no data are excluded in stats calculation | // TODO: check if no data are excluded in stats calculation | |||
size_t elementCount; | qgssize elementCount; | |||
/** \brief The maximum cell value in the raster band. NO_DATA values | /** \brief The maximum cell value in the raster band. NO_DATA values | |||
* are ignored. This does not use the gdal GetMaximmum function. */ | * are ignored. This does not use the gdal GetMaximmum function. */ | |||
double maximumValue; | double maximumValue; | |||
/** \brief The minimum cell value in the raster band. NO_DATA values | /** \brief The minimum cell value in the raster band. NO_DATA values | |||
* are ignored. This does not use the gdal GetMinimum function. */ | * are ignored. This does not use the gdal GetMinimum function. */ | |||
double minimumValue; | double minimumValue; | |||
/** \brief The mean cell value for the band. NO_DATA values are exclude d. */ | /** \brief The mean cell value for the band. NO_DATA values are exclude d. */ | |||
End of changes. 2 change blocks. | ||||
4 lines changed or deleted | 1 lines changed or added | |||
qgsrasterblock.h | qgsrasterblock.h | |||
---|---|---|---|---|
skipping to change at line 127 | skipping to change at line 127 | |||
case QGis::ARGB32: | case QGis::ARGB32: | |||
case QGis::ARGB32_Premultiplied: | case QGis::ARGB32_Premultiplied: | |||
return 4; | return 4; | |||
default: | default: | |||
return 0; | return 0; | |||
} | } | |||
} | } | |||
// Data type in bytes | // Data type in bytes | |||
int dataTypeSize( ) const | int dataTypeSize() const | |||
{ | { | |||
return typeSize( mDataType ); | return typeSize( mDataType ); | |||
} | } | |||
/** Returns true if data type is numeric */ | /** Returns true if data type is numeric */ | |||
static bool typeIsNumeric( QGis::DataType type ); | static bool typeIsNumeric( QGis::DataType type ); | |||
/** Returns true if data type is color */ | /** Returns true if data type is color */ | |||
static bool typeIsColor( QGis::DataType type ); | static bool typeIsColor( QGis::DataType type ); | |||
skipping to change at line 174 | skipping to change at line 174 | |||
/** \brief Read a single value if type of block is numeric. If type is color, | /** \brief Read a single value if type of block is numeric. If type is color, | |||
* returned value is undefined. | * returned value is undefined. | |||
* @param row row index | * @param row row index | |||
* @param column column index | * @param column column index | |||
* @return value */ | * @return value */ | |||
double value( int row, int column ) const; | double value( int row, int column ) const; | |||
/** \brief Read a single value if type of block is numeric. If type is color, | /** \brief Read a single value if type of block is numeric. If type is color, | |||
* returned value is undefined. | * returned value is undefined. | |||
* @param index data matrix index | * @param index data matrix index (long type in Python) | |||
* @return value */ | * @return value */ | |||
double value( size_t index ) const; | double value( qgssize index ) const; | |||
/** \brief Read a single color | /** \brief Read a single color | |||
* @param row row index | * @param row row index | |||
* @param column column index | * @param column column index | |||
* @return color */ | * @return color */ | |||
QRgb color( int row, int column ) const; | QRgb color( int row, int column ) const; | |||
/** \brief Read a single value | /** \brief Read a single value | |||
* @param index data matrix index | * @param index data matrix index (long type in Python) | |||
* @return color */ | * @return color */ | |||
QRgb color( size_t index ) const; | QRgb color( qgssize index ) const; | |||
/** \brief Check if value at position is no data | /** \brief Check if value at position is no data | |||
* @param row row index | * @param row row index | |||
* @param column column index | * @param column column index | |||
* @return true if value is no data */ | * @return true if value is no data */ | |||
bool isNoData( int row, int column ); | bool isNoData( int row, int column ); | |||
/** \brief Check if value at position is no data | /** \brief Check if value at position is no data | |||
* @param index data matrix index | * @param index data matrix index (long type in Python) | |||
* @return true if value is no data */ | * @return true if value is no data */ | |||
bool isNoData( size_t index ); | bool isNoData( qgssize index ); | |||
/** \brief Set value on position | /** \brief Set value on position | |||
* @param row row index | * @param row row index | |||
* @param column column index | * @param column column index | |||
* @param value the value to be set | * @param value the value to be set | |||
* @return true on success */ | * @return true on success */ | |||
bool setValue( int row, int column, double value ); | bool setValue( int row, int column, double value ); | |||
/** \brief Set value on index (indexed line by line) | /** \brief Set value on index (indexed line by line) | |||
* @param index data matrix index | * @param index data matrix index (long type in Python) | |||
* @param value the value to be set | * @param value the value to be set | |||
* @return true on success */ | * @return true on success */ | |||
bool setValue( size_t index, double value ); | bool setValue( qgssize index, double value ); | |||
/** \brief Set color on position | /** \brief Set color on position | |||
* @param row row index | * @param row row index | |||
* @param column column index | * @param column column index | |||
* @param color the color to be set, QRgb value | * @param color the color to be set, QRgb value | |||
* @return true on success */ | * @return true on success */ | |||
bool setColor( int row, int column, QRgb color ); | bool setColor( int row, int column, QRgb color ); | |||
/** \brief Set color on index (indexed line by line) | /** \brief Set color on index (indexed line by line) | |||
* @param index data matrix index | * @param index data matrix index (long type in Python) | |||
* @param color the color to be set, QRgb value | * @param color the color to be set, QRgb value | |||
* @return true on success */ | * @return true on success */ | |||
bool setColor( size_t index, QRgb color ); | bool setColor( qgssize index, QRgb color ); | |||
/** \brief Set no data on pixel | /** \brief Set no data on pixel | |||
* @param row row index | * @param row row index | |||
* @param column column index | * @param column column index | |||
* @return true on success */ | * @return true on success */ | |||
bool setIsNoData( int row, int column ); | bool setIsNoData( int row, int column ); | |||
/** \brief Set no data on pixel | /** \brief Set no data on pixel | |||
* @param index data matrix index | * @param index data matrix index (long type in Python) | |||
* @return true on success */ | * @return true on success */ | |||
bool setIsNoData( size_t index ); | bool setIsNoData( qgssize index ); | |||
/** \brief Set the whole block to no data | /** \brief Set the whole block to no data | |||
* @return true on success */ | * @return true on success */ | |||
bool setIsNoData(); | bool setIsNoData(); | |||
/** \brief Set the whole block to no data except specified rectangle | /** \brief Set the whole block to no data except specified rectangle | |||
* @return true on success */ | * @return true on success */ | |||
bool setIsNoDataExcept( const QRect & theExceptRect ); | bool setIsNoDataExcept( const QRect & theExceptRect ); | |||
/** \brief Get pointer to data | /** \brief Get pointer to data | |||
* @param row row index | * @param row row index | |||
* @param column column index | * @param column column index | |||
* @return pointer to data | * @return pointer to data | |||
* @note not available in python bindings | * @note not available in python bindings | |||
*/ | */ | |||
char * bits( int row, int column ); | char * bits( int row, int column ); | |||
/** \brief Get pointer to data | /** \brief Get pointer to data | |||
* @param index data matrix index | * @param index data matrix index (long type in Python) | |||
* @return pointer to data | * @return pointer to data | |||
* @note not available in python bindings | * @note not available in python bindings | |||
*/ | */ | |||
char * bits( size_t index ); | char * bits( qgssize index ); | |||
/** \brief Get pointer to data | /** \brief Get pointer to data | |||
* @return pointer to data | * @return pointer to data | |||
* @note not available in python bindings | * @note not available in python bindings | |||
*/ | */ | |||
char * bits(); | char * bits(); | |||
/** \brief Print double value with all necessary significant digits. | /** \brief Print double value with all necessary significant digits. | |||
* It is ensured that conversion back to double gives the same number. | * It is ensured that conversion back to double gives the same number. | |||
* @param value the value to be printed | * @param value the value to be printed | |||
skipping to change at line 287 | skipping to change at line 287 | |||
/** \brief Get image if type is color. | /** \brief Get image if type is color. | |||
* @return image */ | * @return image */ | |||
QImage image() const; | QImage image() const; | |||
/** \brief set image. | /** \brief set image. | |||
* @param image image | * @param image image | |||
* @return true on success */ | * @return true on success */ | |||
bool setImage( const QImage * image ); | bool setImage( const QImage * image ); | |||
// @note not available in python bindings | // @note not available in python bindings | |||
inline static double readValue( void *data, QGis::DataType type, size_t index ); | inline static double readValue( void *data, QGis::DataType type, qgssiz e index ); | |||
// @note not available in python bindings | // @note not available in python bindings | |||
inline static void writeValue( void *data, QGis::DataType type, size_t index, double value ); | inline static void writeValue( void *data, QGis::DataType type, qgssize index, double value ); | |||
void applyNoDataValues( const QgsRasterRangeList & rangeList ); | void applyNoDataValues( const QgsRasterRangeList & rangeList ); | |||
/** \brief Get error */ | /** \brief Get error */ | |||
QgsError error() const { return mError; } | QgsError error() const { return mError; } | |||
/** \brief Set error */ | /** \brief Set error */ | |||
void setError( const QgsError & theError ) { mError = theError;} | void setError( const QgsError & theError ) { mError = theError;} | |||
/** \brief For theExtent and theWidht, theHeight find rectangle covered by subextent. | /** \brief For theExtent and theWidht, theHeight find rectangle covered by subextent. | |||
skipping to change at line 337 | skipping to change at line 337 | |||
* @return true on success */ | * @return true on success */ | |||
bool createNoDataBitmap(); | bool createNoDataBitmap(); | |||
/** \brief Convert block of data from one type to another. Original blo ck memory | /** \brief Convert block of data from one type to another. Original blo ck memory | |||
* is not release. | * is not release. | |||
* @param srcData source data | * @param srcData source data | |||
* @param srcDataType source data type | * @param srcDataType source data type | |||
* @param destDataType dest data type | * @param destDataType dest data type | |||
* @param size block size (width * height) | * @param size block size (width * height) | |||
* @return block of data in destDataType */ | * @return block of data in destDataType */ | |||
static void * convert( void *srcData, QGis::DataType srcDataType, QGis: :DataType destDataType, size_t size ); | static void * convert( void *srcData, QGis::DataType srcDataType, QGis: :DataType destDataType, qgssize size ); | |||
// Valid | // Valid | |||
bool mValid; | bool mValid; | |||
// Data type | // Data type | |||
QGis::DataType mDataType; | QGis::DataType mDataType; | |||
// Data type size in bytes, to make bits() fast | // Data type size in bytes, to make bits() fast | |||
int mTypeSize; | int mTypeSize; | |||
skipping to change at line 360 | skipping to change at line 360 | |||
// Height | // Height | |||
int mHeight; | int mHeight; | |||
// Has no data value | // Has no data value | |||
bool mHasNoDataValue; | bool mHasNoDataValue; | |||
// No data value | // No data value | |||
double mNoDataValue; | double mNoDataValue; | |||
static const QRgb mNoDataColor; | ||||
// Data block for numerical data types, not used with image data types | // Data block for numerical data types, not used with image data types | |||
// QByteArray does not seem to be intended for large data blocks, does it? | // QByteArray does not seem to be intended for large data blocks, does it? | |||
void * mData; | void * mData; | |||
// Image for image data types, not used with numerical data types | // Image for image data types, not used with numerical data types | |||
QImage *mImage; | QImage *mImage; | |||
// Bitmap of no data. One bit for each pixel. Bit is 1 if a pixels is n o data. | // Bitmap of no data. One bit for each pixel. Bit is 1 if a pixels is n o data. | |||
// Each row is represented by whole number of bytes (last bits may be u nused) | // Each row is represented by whole number of bytes (last bits may be u nused) | |||
// to make processing rows easy. | // to make processing rows easy. | |||
char *mNoDataBitmap; | char *mNoDataBitmap; | |||
// number of bytes in mNoDataBitmap row | // number of bytes in mNoDataBitmap row | |||
int mNoDataBitmapWidth; | int mNoDataBitmapWidth; | |||
// total size in bytes of mNoDataBitmap | // total size in bytes of mNoDataBitmap | |||
size_t mNoDataBitmapSize; | qgssize mNoDataBitmapSize; | |||
// Error | // Error | |||
QgsError mError; | QgsError mError; | |||
}; | }; | |||
inline double QgsRasterBlock::readValue( void *data, QGis::DataType type, s ize_t index ) | inline double QgsRasterBlock::readValue( void *data, QGis::DataType type, q gssize index ) | |||
{ | { | |||
if ( !data ) | if ( !data ) | |||
{ | { | |||
return std::numeric_limits<double>::quiet_NaN(); | return std::numeric_limits<double>::quiet_NaN(); | |||
} | } | |||
switch ( type ) | switch ( type ) | |||
{ | { | |||
case QGis::Byte: | case QGis::Byte: | |||
return ( double )(( quint8 * )data )[index]; | return ( double )(( quint8 * )data )[index]; | |||
skipping to change at line 420 | skipping to change at line 422 | |||
return ( double )(( double * )data )[index]; | return ( double )(( double * )data )[index]; | |||
break; | break; | |||
default: | default: | |||
QgsDebugMsg( QString( "Data type %1 is not supported" ).arg( type ) ) ; | QgsDebugMsg( QString( "Data type %1 is not supported" ).arg( type ) ) ; | |||
break; | break; | |||
} | } | |||
return std::numeric_limits<double>::quiet_NaN(); | return std::numeric_limits<double>::quiet_NaN(); | |||
} | } | |||
inline void QgsRasterBlock::writeValue( void *data, QGis::DataType type, si ze_t index, double value ) | inline void QgsRasterBlock::writeValue( void *data, QGis::DataType type, qg ssize index, double value ) | |||
{ | { | |||
if ( !data ) return; | if ( !data ) return; | |||
switch ( type ) | switch ( type ) | |||
{ | { | |||
case QGis::Byte: | case QGis::Byte: | |||
(( quint8 * )data )[index] = ( quint8 ) value; | (( quint8 * )data )[index] = ( quint8 ) value; | |||
break; | break; | |||
case QGis::UInt16: | case QGis::UInt16: | |||
(( quint16 * )data )[index] = ( quint16 ) value; | (( quint16 * )data )[index] = ( quint16 ) value; | |||
skipping to change at line 453 | skipping to change at line 455 | |||
break; | break; | |||
case QGis::Float64: | case QGis::Float64: | |||
(( double * )data )[index] = value; | (( double * )data )[index] = value; | |||
break; | break; | |||
default: | default: | |||
QgsDebugMsg( QString( "Data type %1 is not supported" ).arg( type ) ) ; | QgsDebugMsg( QString( "Data type %1 is not supported" ).arg( type ) ) ; | |||
break; | break; | |||
} | } | |||
} | } | |||
inline double QgsRasterBlock::value( size_t index ) const | inline double QgsRasterBlock::value( qgssize index ) const | |||
{ | { | |||
if ( !mData ) | if ( !mData ) | |||
{ | { | |||
QgsDebugMsg( "Data block not allocated" ); | QgsDebugMsg( "Data block not allocated" ); | |||
return std::numeric_limits<double>::quiet_NaN(); | return std::numeric_limits<double>::quiet_NaN(); | |||
} | } | |||
return readValue( mData, mDataType, index ); | return readValue( mData, mDataType, index ); | |||
} | } | |||
inline bool QgsRasterBlock::isNoDataValue( double value ) const | inline bool QgsRasterBlock::isNoDataValue( double value ) const | |||
End of changes. 23 change blocks. | ||||
22 lines changed or deleted | 24 lines changed or added | |||
qgsrasterchecker.h | qgsrasterchecker.h | |||
---|---|---|---|---|
skipping to change at line 36 | skipping to change at line 36 | |||
* write an image and compare it to an expected result | * write an image and compare it to an expected result | |||
* or render time. | * or render time. | |||
*/ | */ | |||
class CORE_EXPORT QgsRasterChecker | class CORE_EXPORT QgsRasterChecker | |||
{ | { | |||
public: | public: | |||
QgsRasterChecker(); | QgsRasterChecker(); | |||
//! Destructor | //! Destructor | |||
~QgsRasterChecker() {}; | ~QgsRasterChecker() {} | |||
QString report() { return mReport; }; | QString report() { return mReport; } | |||
/** | /** | |||
* Test using renderer to generate the image to be compared. | * Test using renderer to generate the image to be compared. | |||
* @param theVerifiedKey verified provider key | * @param theVerifiedKey verified provider key | |||
* @param theVerifiedUri URI of the raster to be verified | * @param theVerifiedUri URI of the raster to be verified | |||
* @param theExpectedKey expected provider key | * @param theExpectedKey expected provider key | |||
* @param theExpectedUri URI of the expected (control) raster | * @param theExpectedUri URI of the expected (control) raster | |||
*/ | */ | |||
bool runTest( QString theVerifiedKey, QString theVerifiedUri, | bool runTest( QString theVerifiedKey, QString theVerifiedUri, | |||
QString theExpectedKey, QString theExpectedUri ); | QString theExpectedKey, QString theExpectedUri ); | |||
private: | private: | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
qgsrasterdataprovider.h | qgsrasterdataprovider.h | |||
---|---|---|---|---|
skipping to change at line 27 | skipping to change at line 27 | |||
/* Thank you to Marco Hugentobler for the original vector DataProvider */ | /* Thank you to Marco Hugentobler for the original vector DataProvider */ | |||
#ifndef QGSRASTERDATAPROVIDER_H | #ifndef QGSRASTERDATAPROVIDER_H | |||
#define QGSRASTERDATAPROVIDER_H | #define QGSRASTERDATAPROVIDER_H | |||
#include <cmath> | #include <cmath> | |||
#include <QDateTime> | #include <QDateTime> | |||
#include <QVariant> | #include <QVariant> | |||
#include <QImage> | ||||
#include "qgscolorrampshader.h" | #include "qgscolorrampshader.h" | |||
#include "qgscoordinatereferencesystem.h" | #include "qgscoordinatereferencesystem.h" | |||
#include "qgsdataprovider.h" | #include "qgsdataprovider.h" | |||
#include "qgserror.h" | #include "qgserror.h" | |||
#include "qgsfeature.h" | #include "qgsfeature.h" | |||
#include "qgsfield.h" | #include "qgsfield.h" | |||
#include "qgslogger.h" | #include "qgslogger.h" | |||
#include "qgsrasterbandstats.h" | #include "qgsrasterbandstats.h" | |||
#include "qgsraster.h" | #include "qgsraster.h" | |||
skipping to change at line 68 | skipping to change at line 69 | |||
QgsRasterDataProvider( const QString & uri ); | QgsRasterDataProvider( const QString & uri ); | |||
virtual ~QgsRasterDataProvider() {}; | virtual ~QgsRasterDataProvider() {}; | |||
virtual QgsRasterInterface * clone() const = 0; | virtual QgsRasterInterface * clone() const = 0; | |||
/* It makes no sense to set input on provider */ | /* It makes no sense to set input on provider */ | |||
bool setInput( QgsRasterInterface* input ) { Q_UNUSED( input ); return false; } | bool setInput( QgsRasterInterface* input ) { Q_UNUSED( input ); return false; } | |||
/** \brief Renders the layer as an image */ | /** \brief Renders the layer as an image | |||
\note When render caching (/qgis/enable_render_caching) is on the wm | ||||
s | ||||
provider doesn't wait for the reply of the getmap request or a | ||||
ll | ||||
tiles replies and can return incomplete images. | ||||
Temporarily disable render caching if you require the complete | ||||
wms image in the first call. | ||||
*/ | ||||
virtual QImage* draw( const QgsRectangle & viewExtent, int pixelWidth, int pixelHeight ) = 0; | virtual QImage* draw( const QgsRectangle & viewExtent, int pixelWidth, int pixelHeight ) = 0; | |||
/** Get the extent of the data source. | /** Get the extent of the data source. | |||
* @return QgsRectangle containing the extent of the layer */ | * @return QgsRectangle containing the extent of the layer */ | |||
virtual QgsRectangle extent() = 0; | virtual QgsRectangle extent() = 0; | |||
/** Returns data type for the band specified by number */ | /** Returns data type for the band specified by number */ | |||
virtual QGis::DataType dataType( int bandNo ) const = 0; | virtual QGis::DataType dataType( int bandNo ) const = 0; | |||
/** Returns source data type for the band specified by number, | /** Returns source data type for the band specified by number, | |||
skipping to change at line 189 | skipping to change at line 196 | |||
virtual QList<QgsColorRampShader::ColorRampItem> colorTable( int bandNo ) const | virtual QList<QgsColorRampShader::ColorRampItem> colorTable( int bandNo ) const | |||
{ Q_UNUSED( bandNo ); return QList<QgsColorRampShader::ColorRampItem>() ; } | { Q_UNUSED( bandNo ); return QList<QgsColorRampShader::ColorRampItem>() ; } | |||
/** \brief Returns the sublayers of this layer - useful for providers t hat manage | /** \brief Returns the sublayers of this layer - useful for providers t hat manage | |||
* their own layers, such as WMS */ | * their own layers, such as WMS */ | |||
virtual QStringList subLayers() const | virtual QStringList subLayers() const | |||
{ | { | |||
return QStringList(); | return QStringList(); | |||
} | } | |||
/** \brief Returns the legend rendered as pixmap | ||||
* useful for that layer that need to get legend layer remotly as WMS | ||||
*/ | ||||
virtual QImage getLegendGraphic( double scale = 0, bool forceRefresh = | ||||
false ) | ||||
{ | ||||
Q_UNUSED( scale ); | ||||
Q_UNUSED( forceRefresh ); | ||||
return QImage(); | ||||
} | ||||
/** \brief Create pyramid overviews */ | /** \brief Create pyramid overviews */ | |||
virtual QString buildPyramids( const QList<QgsRasterPyramid> & thePyram idList, | virtual QString buildPyramids( const QList<QgsRasterPyramid> & thePyram idList, | |||
const QString & theResamplingMethod = "N EAREST", | const QString & theResamplingMethod = "N EAREST", | |||
QgsRaster::RasterPyramidsFormat theForma t = QgsRaster::PyramidsGTiff, | QgsRaster::RasterPyramidsFormat theForma t = QgsRaster::PyramidsGTiff, | |||
const QStringList & theConfigOptions = Q StringList() ) | const QStringList & theConfigOptions = Q StringList() ) | |||
{ | { | |||
Q_UNUSED( thePyramidList ); Q_UNUSED( theResamplingMethod ); | Q_UNUSED( thePyramidList ); Q_UNUSED( theResamplingMethod ); | |||
Q_UNUSED( theFormat ); Q_UNUSED( theConfigOptions ); | Q_UNUSED( theFormat ); Q_UNUSED( theConfigOptions ); | |||
return "FAILED_NOT_SUPPORTED"; | return "FAILED_NOT_SUPPORTED"; | |||
}; | }; | |||
End of changes. 3 change blocks. | ||||
1 lines changed or deleted | 21 lines changed or added | |||
qgsrasterdrawer.h | qgsrasterdrawer.h | |||
---|---|---|---|---|
skipping to change at line 36 | skipping to change at line 36 | |||
class QgsMapToPixel; | class QgsMapToPixel; | |||
struct QgsRasterViewPort; | struct QgsRasterViewPort; | |||
class QgsRasterIterator; | class QgsRasterIterator; | |||
/** \ingroup core | /** \ingroup core | |||
* The drawing pipe for raster layers. | * The drawing pipe for raster layers. | |||
*/ | */ | |||
class CORE_EXPORT QgsRasterDrawer | class CORE_EXPORT QgsRasterDrawer | |||
{ | { | |||
public: | public: | |||
QgsRasterDrawer( QgsRasterIterator* iterator ); | QgsRasterDrawer( QgsRasterIterator *iterator ); | |||
~QgsRasterDrawer(); | ~QgsRasterDrawer(); | |||
void draw( QPainter* p, QgsRasterViewPort* viewPort, const QgsMapToPixe l* theQgsMapToPixel ); | void draw( QPainter* p, QgsRasterViewPort* viewPort, const QgsMapToPixe l* theQgsMapToPixel ); | |||
protected: | protected: | |||
/**Draws raster part | /**Draws raster part | |||
@param p the painter to draw to | @param p the painter to draw to | |||
@param viewPort view port to draw to | @param viewPort view port to draw to | |||
@param img image to draw | @param img image to draw | |||
@param topLeftCol Left position relative to left border of viewport | @param topLeftCol Left position relative to left border of viewport | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
qgsrasterlayer.h | qgsrasterlayer.h | |||
---|---|---|---|---|
skipping to change at line 248 | skipping to change at line 248 | |||
/** Return time stamp for given file name */ | /** Return time stamp for given file name */ | |||
static QDateTime lastModified( const QString & name ); | static QDateTime lastModified( const QString & name ); | |||
/** [ data provider interface ] Set the data provider */ | /** [ data provider interface ] Set the data provider */ | |||
void setDataProvider( const QString & provider ); | void setDataProvider( const QString & provider ); | |||
/** \brief Accessor for raster layer type (which is a read only proper ty) */ | /** \brief Accessor for raster layer type (which is a read only proper ty) */ | |||
LayerType rasterType() { return mRasterType; } | LayerType rasterType() { return mRasterType; } | |||
/** \brief Accessor for drawing style */ | ||||
//DrawingStyle drawingStyle() { return mDrawingStyle; } | ||||
/** \brief Mutator for drawing style */ | ||||
//void setDrawingStyle( const DrawingStyle & theDrawingStyle ) { mDraw | ||||
ingStyle = theDrawingStyle; setRendererForDrawingStyle( theDrawingStyle ); | ||||
} | ||||
/**Set raster renderer. Takes ownership of the renderer object*/ | /**Set raster renderer. Takes ownership of the renderer object*/ | |||
void setRenderer( QgsRasterRenderer* theRenderer ); | void setRenderer( QgsRasterRenderer* theRenderer ); | |||
QgsRasterRenderer* renderer() const { return mPipe.renderer(); } | QgsRasterRenderer* renderer() const { return mPipe.renderer(); } | |||
/**Set raster resample filter. Takes ownership of the resample filter o bject*/ | /**Set raster resample filter. Takes ownership of the resample filter o bject*/ | |||
QgsRasterResampleFilter * resampleFilter() const { return mPipe.resampl eFilter(); } | QgsRasterResampleFilter * resampleFilter() const { return mPipe.resampl eFilter(); } | |||
QgsBrightnessContrastFilter * brightnessFilter() const { return mPipe.b rightnessFilter(); } | QgsBrightnessContrastFilter * brightnessFilter() const { return mPipe.b rightnessFilter(); } | |||
QgsHueSaturationFilter * hueSaturationFilter() const { return mPipe.hue SaturationFilter(); } | QgsHueSaturationFilter * hueSaturationFilter() const { return mPipe.hue SaturationFilter(); } | |||
skipping to change at line 390 | skipping to change at line 384 | |||
signals: | signals: | |||
/** \brief Signal for notifying listeners of long running processes */ | /** \brief Signal for notifying listeners of long running processes */ | |||
void progressUpdate( int theValue ); | void progressUpdate( int theValue ); | |||
/** | /** | |||
* This is emitted whenever data or metadata (e.g. color table, exten t) has changed | * This is emitted whenever data or metadata (e.g. color table, exten t) has changed | |||
* @note added in 1.7 | * @note added in 1.7 | |||
*/ | */ | |||
void dataChanged(); | void dataChanged(); | |||
/** Signal emitted when the symbology changes, through call to setRende | ||||
rer() */ | ||||
void rendererChanged(); | ||||
protected: | protected: | |||
/** \brief Read the symbology for the current layer from the Dom node s upplied */ | /** \brief Read the symbology for the current layer from the Dom node s upplied */ | |||
bool readSymbology( const QDomNode& node, QString& errorMessage ); | bool readSymbology( const QDomNode& node, QString& errorMessage ); | |||
/** \brief Reads layer specific state from project file Dom node */ | /** \brief Reads layer specific state from project file Dom node */ | |||
bool readXml( const QDomNode& layer_node ); | bool readXml( const QDomNode& layer_node ); | |||
/** \brief Write the symbology for the layer into the docment provided */ | /** \brief Write the symbology for the layer into the docment provided */ | |||
bool writeSymbology( QDomNode&, QDomDocument& doc, QString& errorMessag e ) const; | bool writeSymbology( QDomNode&, QDomDocument& doc, QString& errorMessag e ) const; | |||
End of changes. 2 change blocks. | ||||
8 lines changed or deleted | 4 lines changed or added | |||
qgsrasterlayersaveasdialog.h | qgsrasterlayersaveasdialog.h | |||
---|---|---|---|---|
skipping to change at line 78 | skipping to change at line 78 | |||
QString outputFileName() const; | QString outputFileName() const; | |||
QString outputFormat() const; | QString outputFormat() const; | |||
QgsCoordinateReferenceSystem outputCrs(); | QgsCoordinateReferenceSystem outputCrs(); | |||
QStringList createOptions() const; | QStringList createOptions() const; | |||
QgsRectangle outputRectangle() const; | QgsRectangle outputRectangle() const; | |||
QgsRasterRangeList noData() const; | QgsRasterRangeList noData() const; | |||
QList< int > pyramidsList() const; | QList< int > pyramidsList() const; | |||
QgsRaster::RasterBuildPyramids buildPyramidsFlag() const; | QgsRaster::RasterBuildPyramids buildPyramidsFlag() const; | |||
QString pyramidsResamplingMethod() const { return mPyramidsOptionsWidge t->resamplingMethod(); } | QString pyramidsResamplingMethod() const { return mPyramidsOptionsWidge t->resamplingMethod(); } | |||
QgsRaster::RasterPyramidsFormat pyramidsFormat() const | QgsRaster::RasterPyramidsFormat pyramidsFormat() const { return mPyrami | |||
{ return mPyramidsOptionsWidget->pyramidsFormat(); } | dsOptionsWidget->pyramidsFormat(); } | |||
QStringList pyramidsConfigOptions() const | QStringList pyramidsConfigOptions() const { return mPyramidsOptionsWidg | |||
{ return mPyramidsOptionsWidget->configOptions(); } | et->configOptions(); } | |||
void hideFormat(); | void hideFormat(); | |||
void hideOutput(); | void hideOutput(); | |||
public slots: | public slots: | |||
virtual void accept() { if ( validate() ) return QDialog::accept(); } | virtual void accept() { if ( validate() ) return QDialog::accept(); } | |||
private slots: | private slots: | |||
void on_mRawModeRadioButton_toggled( bool ); | void on_mRawModeRadioButton_toggled( bool ); | |||
void on_mBrowseButton_clicked(); | void on_mBrowseButton_clicked(); | |||
End of changes. 1 change blocks. | ||||
4 lines changed or deleted | 4 lines changed or added | |||
qgsrasternuller.h | qgsrasternuller.h | |||
---|---|---|---|---|
skipping to change at line 48 | skipping to change at line 48 | |||
double min; | double min; | |||
double max; | double max; | |||
}; | }; | |||
QgsRasterInterface * clone() const; | QgsRasterInterface * clone() const; | |||
int bandCount() const; | int bandCount() const; | |||
QGis::DataType dataType( int bandNo ) const; | QGis::DataType dataType( int bandNo ) const; | |||
QgsRasterBlock* block( int bandNo, const QgsRectangle &extent, int widt h, int height ); | QgsRasterBlock *block( int bandNo, const QgsRectangle &extent, int widt h, int height ); | |||
void setNoData( int bandNo, QgsRasterRangeList noData ); | void setNoData( int bandNo, QgsRasterRangeList noData ); | |||
QgsRasterRangeList noData( int bandNo ) const { return mNoData.value( b andNo -1 ); } | QgsRasterRangeList noData( int bandNo ) const { return mNoData.value( b andNo -1 ); } | |||
/** \brief Set output no data value. */ | /** \brief Set output no data value. */ | |||
void setOutputNoDataValue( int bandNo, double noData ); | void setOutputNoDataValue( int bandNo, double noData ); | |||
private: | private: | |||
// no data indext from 0 | // no data indext from 0 | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
qgsrasterprojector.h | qgsrasterprojector.h | |||
---|---|---|---|---|
skipping to change at line 45 | skipping to change at line 45 | |||
class QgsPoint; | class QgsPoint; | |||
class CORE_EXPORT QgsRasterProjector : public QgsRasterInterface | class CORE_EXPORT QgsRasterProjector : public QgsRasterInterface | |||
{ | { | |||
public: | public: | |||
/** \brief QgsRasterProjector implements approximate projection support for | /** \brief QgsRasterProjector implements approximate projection support for | |||
* it calculates grid of points in source CRS for target CRS + extent | * it calculates grid of points in source CRS for target CRS + extent | |||
* which are used to calculate affine transformation matrices. | * which are used to calculate affine transformation matrices. | |||
*/ | */ | |||
QgsRasterProjector( | ||||
QgsCoordinateReferenceSystem theSrcCRS, | ||||
QgsCoordinateReferenceSystem theDestCRS, | ||||
int theSrcDatumTransform, | ||||
int theDestDatumTransform, | ||||
QgsRectangle theDestExtent, | ||||
int theDestRows, int theDestCols, | ||||
double theMaxSrcXRes, double theMaxSrcYRes, | ||||
QgsRectangle theExtent | ||||
); | ||||
QgsRasterProjector( | QgsRasterProjector( | |||
QgsCoordinateReferenceSystem theSrcCRS, | QgsCoordinateReferenceSystem theSrcCRS, | |||
QgsCoordinateReferenceSystem theDestCRS, | QgsCoordinateReferenceSystem theDestCRS, | |||
QgsRectangle theDestExtent, | QgsRectangle theDestExtent, | |||
int theDestRows, int theDestCols, | int theDestRows, int theDestCols, | |||
double theMaxSrcXRes, double theMaxSrcYRes, | double theMaxSrcXRes, double theMaxSrcYRes, | |||
QgsRectangle theExtent | QgsRectangle theExtent | |||
); | ); | |||
QgsRasterProjector( | QgsRasterProjector( | |||
QgsCoordinateReferenceSystem theSrcCRS, | QgsCoordinateReferenceSystem theSrcCRS, | |||
skipping to change at line 77 | skipping to change at line 89 | |||
QgsRasterProjector & operator=( const QgsRasterProjector &projector ); | QgsRasterProjector & operator=( const QgsRasterProjector &projector ); | |||
QgsRasterInterface *clone() const; | QgsRasterInterface *clone() const; | |||
int bandCount() const; | int bandCount() const; | |||
QGis::DataType dataType( int bandNo ) const; | QGis::DataType dataType( int bandNo ) const; | |||
/** \brief set source and destination CRS */ | /** \brief set source and destination CRS */ | |||
void setCRS( const QgsCoordinateReferenceSystem & theSrcCRS, const QgsC | void setCRS( const QgsCoordinateReferenceSystem & theSrcCRS, const QgsC | |||
oordinateReferenceSystem & theDestCRS ); | oordinateReferenceSystem & theDestCRS, | |||
int srcDatumTransform = -1, int destDatumTransform = -1 ); | ||||
/** \brief Get source CRS */ | /** \brief Get source CRS */ | |||
QgsCoordinateReferenceSystem srcCrs() const { return mSrcCRS; } | QgsCoordinateReferenceSystem srcCrs() const { return mSrcCRS; } | |||
/** \brief Get destination CRS */ | /** \brief Get destination CRS */ | |||
QgsCoordinateReferenceSystem destCrs() const { return mDestCRS; } | QgsCoordinateReferenceSystem destCrs() const { return mDestCRS; } | |||
/** \brief set maximum source resolution */ | /** \brief set maximum source resolution */ | |||
void setMaxSrcRes( double theMaxSrcXRes, double theMaxSrcYRes ) | void setMaxSrcRes( double theMaxSrcXRes, double theMaxSrcYRes ) | |||
{ | { | |||
skipping to change at line 103 | skipping to change at line 116 | |||
private: | private: | |||
/** get source extent */ | /** get source extent */ | |||
QgsRectangle srcExtent() { return mSrcExtent; } | QgsRectangle srcExtent() { return mSrcExtent; } | |||
/** get/set source width/height */ | /** get/set source width/height */ | |||
int srcRows() { return mSrcRows; } | int srcRows() { return mSrcRows; } | |||
int srcCols() { return mSrcCols; } | int srcCols() { return mSrcCols; } | |||
void setSrcRows( int theRows ) { mSrcRows = theRows; mSrcXRes = mSrcExt ent.height() / mSrcRows; } | void setSrcRows( int theRows ) { mSrcRows = theRows; mSrcXRes = mSrcExt ent.height() / mSrcRows; } | |||
void setSrcCols( int theCols ) { mSrcCols = theCols; mSrcYRes = mSrcExt ent.width() / mSrcCols; } | void setSrcCols( int theCols ) { mSrcCols = theCols; mSrcYRes = mSrcExt ent.width() / mSrcCols; } | |||
/** \brief Get source row and column indexes for current source extent | /** \brief Get source row and column indexes for current source extent | |||
and resolution */ | and resolution | |||
void srcRowCol( int theDestRow, int theDestCol, int *theSrcRow, int *th | If source pixel is outside source extent theSrcRow and theSrcCol ar | |||
eSrcCol ); | e left unchanged. | |||
@return true if inside source | ||||
*/ | ||||
bool srcRowCol( int theDestRow, int theDestCol, int *theSrcRow, int *th | ||||
eSrcCol, const QgsCoordinateTransform* ct ); | ||||
int dstRows() const { return mDestRows; } | int dstRows() const { return mDestRows; } | |||
int dstCols() const { return mDestCols; } | int dstCols() const { return mDestCols; } | |||
/** \brief get destination point for _current_ destination position */ | /** \brief get destination point for _current_ destination position */ | |||
void destPointOnCPMatrix( int theRow, int theCol, double *theX, double *theY ); | void destPointOnCPMatrix( int theRow, int theCol, double *theX, double *theY ); | |||
/** \brief Get matrix upper left row/col indexes for destination row/co l */ | /** \brief Get matrix upper left row/col indexes for destination row/co l */ | |||
int matrixRow( int theDestRow ); | int matrixRow( int theDestRow ); | |||
int matrixCol( int theDestCol ); | int matrixCol( int theDestCol ); | |||
/** \brief get destination point for _current_ matrix position */ | /** \brief get destination point for _current_ matrix position */ | |||
QgsPoint srcPoint( int theRow, int theCol ); | QgsPoint srcPoint( int theRow, int theCol ); | |||
/** \brief Get precise source row and column indexes for current source extent and resolution */ | /** \brief Get precise source row and column indexes for current source extent and resolution */ | |||
inline void preciseSrcRowCol( int theDestRow, int theDestCol, int *theS rcRow, int *theSrcCol ); | inline bool preciseSrcRowCol( int theDestRow, int theDestCol, int *theS rcRow, int *theSrcCol, const QgsCoordinateTransform* ct ); | |||
/** \brief Get approximate source row and column indexes for current so urce extent and resolution */ | /** \brief Get approximate source row and column indexes for current so urce extent and resolution */ | |||
inline void approximateSrcRowCol( int theDestRow, int theDestCol, int * theSrcRow, int *theSrcCol ); | inline bool approximateSrcRowCol( int theDestRow, int theDestCol, int * theSrcRow, int *theSrcCol ); | |||
/** \brief Calculate matrix */ | /** \brief Calculate matrix */ | |||
void calc(); | void calc(); | |||
/** \brief insert rows to matrix */ | /** \brief insert rows to matrix */ | |||
void insertRows(); | void insertRows( const QgsCoordinateTransform* ct ); | |||
/** \brief insert columns to matrix */ | /** \brief insert columns to matrix */ | |||
void insertCols(); | void insertCols( const QgsCoordinateTransform* ct ); | |||
/* calculate single control point in current matrix */ | /* calculate single control point in current matrix */ | |||
void calcCP( int theRow, int theCol ); | void calcCP( int theRow, int theCol, const QgsCoordinateTransform* ct ) ; | |||
/** \brief calculate matrix row */ | /** \brief calculate matrix row */ | |||
bool calcRow( int theRow ); | bool calcRow( int theRow, const QgsCoordinateTransform* ct ); | |||
/** \brief calculate matrix column */ | /** \brief calculate matrix column */ | |||
bool calcCol( int theCol ); | bool calcCol( int theCol, const QgsCoordinateTransform* ct ); | |||
/** \brief calculate source extent */ | /** \brief calculate source extent */ | |||
void calcSrcExtent(); | void calcSrcExtent(); | |||
/** \brief calculate minimum source width and height */ | /** \brief calculate minimum source width and height */ | |||
void calcSrcRowsCols(); | void calcSrcRowsCols(); | |||
/** \brief check error along columns | /** \brief check error along columns | |||
* returns true if within threshold */ | * returns true if within threshold */ | |||
bool checkCols(); | bool checkCols( const QgsCoordinateTransform* ct ); | |||
/** \brief check error along rows | /** \brief check error along rows | |||
* returns true if within threshold */ | * returns true if within threshold */ | |||
bool checkRows(); | bool checkRows( const QgsCoordinateTransform* ct ); | |||
/** Calculate array of src helper points */ | /** Calculate array of src helper points */ | |||
void calcHelper( int theMatrixRow, QgsPoint *thePoints ); | void calcHelper( int theMatrixRow, QgsPoint *thePoints ); | |||
/** Calc / switch helper */ | /** Calc / switch helper */ | |||
void nextHelper(); | void nextHelper(); | |||
/** get mCPMatrix as string */ | /** get mCPMatrix as string */ | |||
QString cpToString(); | QString cpToString(); | |||
/** Source CRS */ | /** Source CRS */ | |||
QgsCoordinateReferenceSystem mSrcCRS; | QgsCoordinateReferenceSystem mSrcCRS; | |||
/** Destination CRS */ | /** Destination CRS */ | |||
QgsCoordinateReferenceSystem mDestCRS; | QgsCoordinateReferenceSystem mDestCRS; | |||
/** Reverse coordinate transform (from destination to source) */ | /** Source datum transformation id (or -1 if none) */ | |||
QgsCoordinateTransform mCoordinateTransform; | int mSrcDatumTransform; | |||
/** Destination datum transformation id (or -1 if none) */ | ||||
int mDestDatumTransform; | ||||
/** Destination extent */ | /** Destination extent */ | |||
QgsRectangle mDestExtent; | QgsRectangle mDestExtent; | |||
/** Source extent */ | /** Source extent */ | |||
QgsRectangle mSrcExtent; | QgsRectangle mSrcExtent; | |||
/** Source raster extent */ | /** Source raster extent */ | |||
QgsRectangle mExtent; | QgsRectangle mExtent; | |||
End of changes. 13 change blocks. | ||||
17 lines changed or deleted | 37 lines changed or added | |||
qgsrastertransparency.h | qgsrastertransparency.h | |||
---|---|---|---|---|
skipping to change at line 81 | skipping to change at line 81 | |||
/** \brief Mutator for transparentThreeValuePixelList */ | /** \brief Mutator for transparentThreeValuePixelList */ | |||
void setTransparentThreeValuePixelList( QList<QgsRasterTransparency::Tr ansparentThreeValuePixel> ); | void setTransparentThreeValuePixelList( QList<QgsRasterTransparency::Tr ansparentThreeValuePixel> ); | |||
/** \brief Returns the transparency value for a single value Pixel */ | /** \brief Returns the transparency value for a single value Pixel */ | |||
int alphaValue( double, int theGlobalTransparency = 255 ) const; | int alphaValue( double, int theGlobalTransparency = 255 ) const; | |||
/** \brief Return the transparency value for a RGB Pixel */ | /** \brief Return the transparency value for a RGB Pixel */ | |||
int alphaValue( double, double, double, int theGlobalTransparency = 255 ) const; | int alphaValue( double, double, double, int theGlobalTransparency = 255 ) const; | |||
/**True if there are no entries in the pixel lists except the nodata va lue*/ | /**True if there are no entries in the pixel lists except the nodata va lue*/ | |||
//bool isEmpty( double nodataValue ) const; | ||||
bool isEmpty( ) const; | bool isEmpty( ) const; | |||
void writeXML( QDomDocument& doc, QDomElement& parentElem ) const; | void writeXML( QDomDocument& doc, QDomElement& parentElem ) const; | |||
void readXML( const QDomElement& elem ); | void readXML( const QDomElement& elem ); | |||
private: | private: | |||
/** \brief The list to hold transparency values for RGB layers */ | /** \brief The list to hold transparency values for RGB layers */ | |||
QList<QgsRasterTransparency::TransparentThreeValuePixel> mTransparentTh reeValuePixelList; | QList<QgsRasterTransparency::TransparentThreeValuePixel> mTransparentTh reeValuePixelList; | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 0 lines changed or added | |||
qgsrasterviewport.h | qgsrasterviewport.h | |||
---|---|---|---|---|
skipping to change at line 55 | skipping to change at line 55 | |||
int mHeight; | int mHeight; | |||
/** \brief Intersection of current map extent and layer extent */ | /** \brief Intersection of current map extent and layer extent */ | |||
QgsRectangle mDrawnExtent; | QgsRectangle mDrawnExtent; | |||
/** \brief Source coordinate system */ | /** \brief Source coordinate system */ | |||
QgsCoordinateReferenceSystem mSrcCRS; | QgsCoordinateReferenceSystem mSrcCRS; | |||
/** \brief Target coordinate system */ | /** \brief Target coordinate system */ | |||
QgsCoordinateReferenceSystem mDestCRS; | QgsCoordinateReferenceSystem mDestCRS; | |||
int mSrcDatumTransform; | ||||
int mDestDatumTransform; | ||||
}; | }; | |||
#endif //QGSRASTERVIEWPORT_H | #endif //QGSRASTERVIEWPORT_H | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 3 lines changed or added | |||
qgsrectangle.h | qgsrectangle.h | |||
---|---|---|---|---|
skipping to change at line 42 | skipping to change at line 42 | |||
* Examples are storing a layer extent or the current view extent of a map | * Examples are storing a layer extent or the current view extent of a map | |||
*/ | */ | |||
class CORE_EXPORT QgsRectangle | class CORE_EXPORT QgsRectangle | |||
{ | { | |||
public: | public: | |||
//! Constructor | //! Constructor | |||
QgsRectangle( double xmin = 0, double ymin = 0, double xmax = 0, double ymax = 0 ); | QgsRectangle( double xmin = 0, double ymin = 0, double xmax = 0, double ymax = 0 ); | |||
//! Construct a rectangle from two points. The rectangle is normalized after construction. | //! Construct a rectangle from two points. The rectangle is normalized after construction. | |||
QgsRectangle( const QgsPoint & p1, const QgsPoint & p2 ); | QgsRectangle( const QgsPoint & p1, const QgsPoint & p2 ); | |||
//! Construct a rectangle from a QRectF. The rectangle is normalized af ter construction. | //! Construct a rectangle from a QRectF. The rectangle is normalized af ter construction. | |||
//@note added in 2.0 | //! @note added in 2.0 | |||
QgsRectangle( const QRectF & qRectF ); | QgsRectangle( const QRectF & qRectF ); | |||
//! Copy constructor | //! Copy constructor | |||
QgsRectangle( const QgsRectangle &other ); | QgsRectangle( const QgsRectangle &other ); | |||
//! Destructor | //! Destructor | |||
~QgsRectangle(); | ~QgsRectangle(); | |||
//! Set the rectangle from two QgsPoints. The rectangle is | //! Set the rectangle from two QgsPoints. The rectangle is | |||
//normalised after construction. | //! normalised after construction. | |||
void set( const QgsPoint& p1, const QgsPoint& p2 ); | void set( const QgsPoint& p1, const QgsPoint& p2 ); | |||
//! Set the rectangle from four points. The rectangle is | //! Set the rectangle from four points. The rectangle is | |||
// normalised after construction. | //! normalised after construction. | |||
void set( double xmin, double ymin, double xmax, double ymax ); | void set( double xmin, double ymin, double xmax, double ymax ); | |||
//! Set the minimum x value | //! Set the minimum x value | |||
void setXMinimum( double x ); | void setXMinimum( double x ); | |||
//! Set the maximum x value | //! Set the maximum x value | |||
void setXMaximum( double x ); | void setXMaximum( double x ); | |||
//! Set the minimum y value | //! Set the minimum y value | |||
void setYMinimum( double y ); | void setYMinimum( double y ); | |||
//! Set the maximum y value | //! Set the maximum y value | |||
void setYMaximum( double y ); | void setYMaximum( double y ); | |||
//! Set a rectangle so that min corner is at max | //! Set a rectangle so that min corner is at max | |||
// and max corner is at min. It is NOT normalized. | //! and max corner is at min. It is NOT normalized. | |||
void setMinimal(); | void setMinimal(); | |||
//! Get the x maximum value (right side of rectangle) | //! Get the x maximum value (right side of rectangle) | |||
double xMaximum() const; | double xMaximum() const; | |||
//! Get the x minimum value (left side of rectangle) | //! Get the x minimum value (left side of rectangle) | |||
double xMinimum() const; | double xMinimum() const; | |||
//! Get the y maximum value (top side of rectangle) | //! Get the y maximum value (top side of rectangle) | |||
double yMaximum() const; | double yMaximum() const; | |||
//! Get the y minimum value (bottom side of rectangle) | //! Get the y minimum value (bottom side of rectangle) | |||
double yMinimum() const; | double yMinimum() const; | |||
//! Normalize the rectangle so it has non-negative width/height | //! Normalize the rectangle so it has non-negative width/height | |||
void normalize(); | void normalize(); | |||
//! Width of the rectangle | //! Width of the rectangle | |||
double width() const; | double width() const; | |||
//! Height of the rectangle | //! Height of the rectangle | |||
double height() const; | double height() const; | |||
//! Center point of the rectangle | //! Center point of the rectangle | |||
QgsPoint center() const; | QgsPoint center() const; | |||
//! Scale the rectangle around its center point | //! Scale the rectangle around its center point | |||
void scale( double scaleFactor, const QgsPoint *c = 0 ); | void scale( double scaleFactor, const QgsPoint *c = 0 ); | |||
void scale( double scaleFactor, double centerX, double centerY ); | ||||
/** Get rectangle enlarged by buffer. | ||||
* @note added in 2.1 */ | ||||
QgsRectangle buffer( double width ); | ||||
//! return the intersection with the given rectangle | //! return the intersection with the given rectangle | |||
QgsRectangle intersect( const QgsRectangle *rect ) const; | QgsRectangle intersect( const QgsRectangle *rect ) const; | |||
//! returns true when rectangle intersects with other rectangle | //! returns true when rectangle intersects with other rectangle | |||
bool intersects( const QgsRectangle& rect ) const; | bool intersects( const QgsRectangle& rect ) const; | |||
//! return true when rectangle contains other rectangle | //! return true when rectangle contains other rectangle | |||
//! @note added in version 1.1 | //! @note added in version 1.1 | |||
bool contains( const QgsRectangle& rect ) const; | bool contains( const QgsRectangle& rect ) const; | |||
//! return true when rectangle contains a point | //! return true when rectangle contains a point | |||
//! @note added in version 1.3 | //! @note added in version 1.3 | |||
bool contains( const QgsPoint &p ) const; | bool contains( const QgsPoint &p ) const; | |||
//! expand the rectangle so that covers both the original rectangle and the given rectangle | //! expand the rectangle so that covers both the original rectangle and the given rectangle | |||
void combineExtentWith( QgsRectangle *rect ); | void combineExtentWith( QgsRectangle *rect ); | |||
//! expand the rectangle so that covers both the original rectangle and the given point | //! expand the rectangle so that covers both the original rectangle and the given point | |||
void combineExtentWith( double x, double y ); | void combineExtentWith( double x, double y ); | |||
//! test if rectangle is empty | //! test if rectangle is empty | |||
bool isEmpty() const; | bool isEmpty() const; | |||
//! returns string representation in Wkt form | //! returns string representation in Wkt form | |||
QString asWktCoordinates() const; | QString asWktCoordinates() const; | |||
//! returns string representation as WKT Polygon | //! returns string representation as WKT Polygon | |||
//@note added in 2.0 | //! @note added in 2.0 | |||
QString asWktPolygon() const; | QString asWktPolygon() const; | |||
//! returns a QRectF with same coordinates. | //! returns a QRectF with same coordinates. | |||
//@note added in 2.0 | //! @note added in 2.0 | |||
QRectF toRectF() const; | QRectF toRectF() const; | |||
//! returns string representation of form xmin,ymin xmax,ymax | //! returns string representation of form xmin,ymin xmax,ymax | |||
QString toString( bool automaticPrecision = false ) const; | QString toString( bool automaticPrecision = false ) const; | |||
//! overloaded toString that allows precision of numbers to be set | //! overloaded toString that allows precision of numbers to be set | |||
QString toString( int thePrecision ) const; | QString toString( int thePrecision ) const; | |||
//! returns rectangle as a polygon | //! returns rectangle as a polygon | |||
QString asPolygon() const; | QString asPolygon() const; | |||
/*! Comparison operator | /*! Comparison operator | |||
@return True if rectangles are equal | @return True if rectangles are equal | |||
*/ | */ | |||
End of changes. 7 change blocks. | ||||
6 lines changed or deleted | 10 lines changed or added | |||
qgsrenderchecker.h | qgsrenderchecker.h | |||
---|---|---|---|---|
skipping to change at line 51 | skipping to change at line 51 | |||
//! Destructor | //! Destructor | |||
~QgsRenderChecker() {}; | ~QgsRenderChecker() {}; | |||
QString controlImagePath() const; | QString controlImagePath() const; | |||
QString report() { return mReport; }; | QString report() { return mReport; }; | |||
float matchPercent() | float matchPercent() | |||
{ | { | |||
return static_cast<float>( mMismatchCount ) / | return static_cast<float>( mMismatchCount ) / | |||
static_cast<float>( mMatchTarget ) * 100; | static_cast<float>( mMatchTarget ) * 100; | |||
}; | } | |||
unsigned int mismatchCount() { return mMismatchCount; }; | unsigned int mismatchCount() { return mMismatchCount; } | |||
unsigned int matchTarget() { return mMatchTarget; }; | unsigned int matchTarget() { return mMatchTarget; } | |||
//only records time for actual render part | //only records time for actual render part | |||
int elapsedTime() { return mElapsedTime; }; | int elapsedTime() { return mElapsedTime; } | |||
void setElapsedTimeTarget( int theTarget ) { mElapsedTimeTarget = theTa rget; }; | void setElapsedTimeTarget( int theTarget ) { mElapsedTimeTarget = theTa rget; }; | |||
/** Base directory name for the control image (with control image path | /** Base directory name for the control image (with control image path | |||
* suffixed) the path to the image will be constructed like this: | * suffixed) the path to the image will be constructed like this: | |||
* controlImagePath + '/' + mControlName + '/' + mControlName + '.png' | * controlImagePath + '/' + mControlName + '/' + mControlName + '.png' | |||
*/ | */ | |||
void setControlName( const QString theName ); | void setControlName( const QString theName ); | |||
/** Prefix where the control images are kept. | /** Prefix where the control images are kept. | |||
* This will be appended to controlImagePath | * This will be appended to controlImagePath | |||
*/ | */ | |||
void setControlPathPrefix( const QString theName ) { mControlPathPrefix = theName + QDir::separator(); } | void setControlPathPrefix( const QString theName ) { mControlPathPrefix = theName + QDir::separator(); } | |||
/** Get an md5 hash that uniquely identifies an image */ | /** Get an md5 hash that uniquely identifies an image */ | |||
QString imageToHash( QString theImageFile ); | QString imageToHash( QString theImageFile ); | |||
void setRenderedImage( QString theImageFileName ) { mRenderedImageFile | void setRenderedImage( QString theImageFileName ) { mRenderedImageFile | |||
= theImageFileName; }; | = theImageFileName; } | |||
void setMapRenderer( QgsMapRenderer * thepMapRenderer ) { mpMapRendere | void setMapRenderer( QgsMapRenderer *thepMapRenderer ) { mpMapRenderer | |||
r = thepMapRenderer; }; | = thepMapRenderer; } | |||
/** Set tolerance for color components used by runTest() and compareIma | ||||
ges(). | ||||
* Default value is 0. | ||||
* @param theColorTolerance is maximum difference for each color compon | ||||
ent | ||||
* including alpha to be considered correct. | ||||
* @note added in 2.1 | ||||
*/ | ||||
void setColorTolerance( unsigned int theColorTolerance ) { mColorTolera | ||||
nce = theColorTolerance; } | ||||
/** | /** | |||
* Test using renderer to generate the image to be compared. | * Test using renderer to generate the image to be compared. | |||
* @param theTestName - to be used as the basis for writing a file to | * @param theTestName - to be used as the basis for writing a file to | |||
* e.g. /tmp/theTestName.png | * e.g. /tmp/theTestName.png | |||
* @param theMismatchCount - defaults to 0 - the number of pixels that | * @param theMismatchCount - defaults to 0 - the number of pixels that | |||
* are allowed to be different from the control image. In some cases | * are allowed to be different from the control image. In some cases | |||
* rendering may be non-deterministic. This parameter allows you to acc ount | * rendering may be non-deterministic. This parameter allows you to acc ount | |||
* for that by providing a tolerance. | * for that by providing a tolerance. | |||
* @note make sure to call setExpectedImage and setMapRenderer first | * @note make sure to call setExpectedImage and setMapRenderer first | |||
*/ | */ | |||
skipping to change at line 104 | skipping to change at line 112 | |||
bool compareImages( QString theTestName, unsigned int theMismatchCount = 0, QString theRenderedImageFile = "" ); | bool compareImages( QString theTestName, unsigned int theMismatchCount = 0, QString theRenderedImageFile = "" ); | |||
/** Get a list of all the anomalies. An anomaly is a rendered differenc e | /** Get a list of all the anomalies. An anomaly is a rendered differenc e | |||
* file where there is some red pixel content (indicating a render che ck | * file where there is some red pixel content (indicating a render che ck | |||
* mismatch), but where the output was still acceptible. If the render | * mismatch), but where the output was still acceptible. If the render | |||
* diff matches one of these anomalies we will still consider it to be | * diff matches one of these anomalies we will still consider it to be | |||
* acceptible. | * acceptible. | |||
* @return a bool indicating if the diff matched one of the anomaly fi les | * @return a bool indicating if the diff matched one of the anomaly fi les | |||
*/ | */ | |||
bool isKnownAnomaly( QString theDiffImageFile ); | bool isKnownAnomaly( QString theDiffImageFile ); | |||
private: | QString expectedImageFile() { return mExpectedImageFile; }; | |||
protected: | ||||
QString mReport; | QString mReport; | |||
unsigned int mMatchTarget; | ||||
QgsMapRenderer * mpMapRenderer; | ||||
int mElapsedTime; | ||||
QString mRenderedImageFile; | ||||
QString mExpectedImageFile; | QString mExpectedImageFile; | |||
private: | ||||
QString mControlName; | QString mControlName; | |||
QString mRenderedImageFile; | ||||
unsigned int mMismatchCount; | unsigned int mMismatchCount; | |||
unsigned int mMatchTarget; | unsigned int mColorTolerance; | |||
int mElapsedTime; | ||||
int mElapsedTimeTarget; | int mElapsedTimeTarget; | |||
QgsMapRenderer * mpMapRenderer; | ||||
QString mControlPathPrefix; | QString mControlPathPrefix; | |||
}; // class QgsRenderChecker | }; // class QgsRenderChecker | |||
/** Compare two WKT strings with some tolerance | /** Compare two WKT strings with some tolerance | |||
* @param a first WKT string | * @param a first WKT string | |||
* @param b second WKT string | * @param b second WKT string | |||
* @param tolerance tolerance to use (optional, defaults to 0.000001) | * @param tolerance tolerance to use (optional, defaults to 0.000001) | |||
* @return bool indicating if the WKT are sufficiently equal | * @return bool indicating if the WKT are sufficiently equal | |||
*/ | */ | |||
End of changes. 9 change blocks. | ||||
13 lines changed or deleted | 30 lines changed or added | |||
qgsrendercontext.h | qgsrendercontext.h | |||
---|---|---|---|---|
skipping to change at line 98 | skipping to change at line 98 | |||
void setRasterScaleFactor( double factor ) {mRasterScaleFactor = factor ;} | void setRasterScaleFactor( double factor ) {mRasterScaleFactor = factor ;} | |||
void setRendererScale( double scale ) {mRendererScale = scale;} | void setRendererScale( double scale ) {mRendererScale = scale;} | |||
void setPainter( QPainter* p ) {mPainter = p;} | void setPainter( QPainter* p ) {mPainter = p;} | |||
//! Added in QGIS v1.5 | //! Added in QGIS v1.5 | |||
void setForceVectorOutput( bool force ) {mForceVectorOutput = force;} | void setForceVectorOutput( bool force ) {mForceVectorOutput = force;} | |||
//! Added in QGIS v1.4 | //! Added in QGIS v1.4 | |||
void setLabelingEngine( QgsLabelingEngineInterface* iface ) { mLabeling Engine = iface; } | void setLabelingEngine( QgsLabelingEngineInterface* iface ) { mLabeling Engine = iface; } | |||
//! Added in QGIS v2.0 | //! Added in QGIS v2.0 | |||
void setSelectionColor( const QColor& color ) { mSelectionColor = color ; } | void setSelectionColor( const QColor& color ) { mSelectionColor = color ; } | |||
/**Returns true if the rendering optimization (geometry simplification) | ||||
can be executed*/ | ||||
bool useRenderingOptimization() const { return mUseRenderingOptimizatio | ||||
n; } | ||||
void setUseRenderingOptimization( bool enabled ) { mUseRenderingOptimiz | ||||
ation = enabled; } | ||||
private: | private: | |||
/**Painter for rendering operations*/ | /**Painter for rendering operations*/ | |||
QPainter* mPainter; | QPainter* mPainter; | |||
/**For transformation between coordinate systems. Can be 0 if on-the-fl y reprojection is not used*/ | /**For transformation between coordinate systems. Can be 0 if on-the-fl y reprojection is not used*/ | |||
const QgsCoordinateTransform* mCoordTransform; | const QgsCoordinateTransform* mCoordTransform; | |||
/**True if vertex markers for editing should be drawn*/ | /**True if vertex markers for editing should be drawn*/ | |||
bool mDrawEditingInformation; | bool mDrawEditingInformation; | |||
skipping to change at line 136 | skipping to change at line 140 | |||
double mRasterScaleFactor; | double mRasterScaleFactor; | |||
/**Map scale*/ | /**Map scale*/ | |||
double mRendererScale; | double mRendererScale; | |||
/**Labeling engine (can be NULL)*/ | /**Labeling engine (can be NULL)*/ | |||
QgsLabelingEngineInterface* mLabelingEngine; | QgsLabelingEngineInterface* mLabelingEngine; | |||
/** Color used for features that are marked as selected */ | /** Color used for features that are marked as selected */ | |||
QColor mSelectionColor; | QColor mSelectionColor; | |||
/**True if the rendering optimization (geometry simplification) can be | ||||
executed*/ | ||||
bool mUseRenderingOptimization; | ||||
}; | }; | |||
#endif | #endif | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 11 lines changed or added | |||
qgsrendererv2.h | qgsrendererv2.h | |||
---|---|---|---|---|
skipping to change at line 150 | skipping to change at line 150 | |||
//! used from subclasses to create SLD Rule elements following SLD v1.1 specs | //! used from subclasses to create SLD Rule elements following SLD v1.1 specs | |||
//! @note added in 1.9 | //! @note added in 1.9 | |||
virtual void toSld( QDomDocument& doc, QDomElement &element ) const | virtual void toSld( QDomDocument& doc, QDomElement &element ) const | |||
{ element.appendChild( doc.createComment( QString( "FeatureRendererV2 % 1 not implemented yet" ).arg( type() ) ) ); } | { element.appendChild( doc.createComment( QString( "FeatureRendererV2 % 1 not implemented yet" ).arg( type() ) ) ); } | |||
//! return a list of symbology items for the legend | //! return a list of symbology items for the legend | |||
virtual QgsLegendSymbologyList legendSymbologyItems( QSize iconSize ); | virtual QgsLegendSymbologyList legendSymbologyItems( QSize iconSize ); | |||
//! return a list of item text / symbol | //! return a list of item text / symbol | |||
//! @note: this method was added in version 1.5 | //! @note: this method was added in version 1.5 | |||
//! @note: not available in python bindings | //! @note not available in python bindings | |||
virtual QgsLegendSymbolList legendSymbolItems(); | virtual QgsLegendSymbolList legendSymbolItems( double scaleDenominator | |||
= -1, QString rule = "" ); | ||||
//! set type and size of editing vertex markers for subsequent renderin g | //! set type and size of editing vertex markers for subsequent renderin g | |||
void setVertexMarkerAppearance( int type, int size ); | void setVertexMarkerAppearance( int type, int size ); | |||
//! return rotation field name (or empty string if not set or not suppo rted by renderer) | //! return rotation field name (or empty string if not set or not suppo rted by renderer) | |||
//! @note added in 1.9 | //! @note added in 1.9 | |||
virtual QString rotationField() const { return ""; } | virtual QString rotationField() const { return ""; } | |||
//! sets rotation field of renderer (if supported by the renderer) | //! sets rotation field of renderer (if supported by the renderer) | |||
//! @note added in 1.9 | //! @note added in 1.9 | |||
virtual void setRotationField( QString fieldName ) { Q_UNUSED( fieldNam e ); } | virtual void setRotationField( QString fieldName ) { Q_UNUSED( fieldNam e ); } | |||
skipping to change at line 206 | skipping to change at line 206 | |||
void setScaleMethodToSymbol( QgsSymbolV2* symbol, int scaleMethod ); | void setScaleMethodToSymbol( QgsSymbolV2* symbol, int scaleMethod ); | |||
QString mType; | QString mType; | |||
bool mUsingSymbolLevels; | bool mUsingSymbolLevels; | |||
/** The current type of editing marker */ | /** The current type of editing marker */ | |||
int mCurrentVertexMarkerType; | int mCurrentVertexMarkerType; | |||
/** The current size of editing marker */ | /** The current size of editing marker */ | |||
int mCurrentVertexMarkerSize; | int mCurrentVertexMarkerSize; | |||
private: | ||||
Q_DISABLE_COPY( QgsFeatureRendererV2 ) | ||||
}; | }; | |||
class QgsRendererV2Widget; // why does SIP fail, when this isn't here | class QgsRendererV2Widget; // why does SIP fail, when this isn't here | |||
#endif // QGSRENDERERV2_H | #endif // QGSRENDERERV2_H | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 6 lines changed or added | |||
qgsrendererv2registry.h | qgsrendererv2registry.h | |||
---|---|---|---|---|
skipping to change at line 105 | skipping to change at line 105 | |||
QgsRendererV2CreateFunc pfCreate, | QgsRendererV2CreateFunc pfCreate, | |||
QgsRendererV2CreateFromSldFunc pfCreateFromSld, | QgsRendererV2CreateFromSldFunc pfCreateFromSld, | |||
QIcon icon = QIcon(), | QIcon icon = QIcon(), | |||
QgsRendererV2WidgetFunc pfWidget = NULL ) | QgsRendererV2WidgetFunc pfWidget = NULL ) | |||
: QgsRendererV2AbstractMetadata( name, visibleName, icon ) | : QgsRendererV2AbstractMetadata( name, visibleName, icon ) | |||
, mCreateFunc( pfCreate ) | , mCreateFunc( pfCreate ) | |||
, mWidgetFunc( pfWidget ) | , mWidgetFunc( pfWidget ) | |||
, mCreateFromSldFunc( pfCreateFromSld ) | , mCreateFromSldFunc( pfCreateFromSld ) | |||
{} | {} | |||
virtual ~QgsRendererV2Metadata(); | ||||
virtual QgsFeatureRendererV2* createRenderer( QDomElement& elem ) { ret urn mCreateFunc ? mCreateFunc( elem ) : NULL; } | virtual QgsFeatureRendererV2* createRenderer( QDomElement& elem ) { ret urn mCreateFunc ? mCreateFunc( elem ) : NULL; } | |||
virtual QgsRendererV2Widget* createRendererWidget( QgsVectorLayer* laye r, QgsStyleV2* style, QgsFeatureRendererV2* renderer ) | virtual QgsRendererV2Widget* createRendererWidget( QgsVectorLayer* laye r, QgsStyleV2* style, QgsFeatureRendererV2* renderer ) | |||
{ return mWidgetFunc ? mWidgetFunc( layer, style, renderer ) : NULL; } | { return mWidgetFunc ? mWidgetFunc( layer, style, renderer ) : NULL; } | |||
virtual QgsFeatureRendererV2* createRendererFromSld( QDomElement& elem, QGis::GeometryType geomType ) | virtual QgsFeatureRendererV2* createRendererFromSld( QDomElement& elem, QGis::GeometryType geomType ) | |||
{ return mCreateFromSldFunc ? mCreateFromSldFunc( elem, geomType ) : NU LL; } | { return mCreateFromSldFunc ? mCreateFromSldFunc( elem, geomType ) : NU LL; } | |||
//! @note not available in python bindings | //! @note not available in python bindings | |||
QgsRendererV2CreateFunc createFunction() const { return mCreateFunc; } | QgsRendererV2CreateFunc createFunction() const { return mCreateFunc; } | |||
//! @note not available in python bindings | //! @note not available in python bindings | |||
QgsRendererV2WidgetFunc widgetFunction() const { return mWidgetFunc; } | QgsRendererV2WidgetFunc widgetFunction() const { return mWidgetFunc; } | |||
skipping to change at line 158 | skipping to change at line 160 | |||
QgsRendererV2AbstractMetadata* rendererMetadata( QString rendererName ) ; | QgsRendererV2AbstractMetadata* rendererMetadata( QString rendererName ) ; | |||
//! return a list of available renderers | //! return a list of available renderers | |||
QStringList renderersList(); | QStringList renderersList(); | |||
protected: | protected: | |||
//! protected constructor | //! protected constructor | |||
QgsRendererV2Registry(); | QgsRendererV2Registry(); | |||
~QgsRendererV2Registry(); | ~QgsRendererV2Registry(); | |||
static QgsRendererV2Registry* mInstance; | ||||
QMap<QString, QgsRendererV2AbstractMetadata*> mRenderers; | QMap<QString, QgsRendererV2AbstractMetadata*> mRenderers; | |||
//! list to keep order in which renderers have been added | //! list to keep order in which renderers have been added | |||
QStringList mRenderersOrder; | QStringList mRenderersOrder; | |||
}; | }; | |||
#endif // QGSRENDERERV2REGISTRY_H | #endif // QGSRENDERERV2REGISTRY_H | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
qgsrendererv2widget.h | qgsrendererv2widget.h | |||
---|---|---|---|---|
skipping to change at line 55 | skipping to change at line 55 | |||
//! return pointer to the renderer (no transfer of ownership) | //! return pointer to the renderer (no transfer of ownership) | |||
virtual QgsFeatureRendererV2* renderer() = 0; | virtual QgsFeatureRendererV2* renderer() = 0; | |||
//! show a dialog with renderer's symbol level settings | //! show a dialog with renderer's symbol level settings | |||
void showSymbolLevelsDialog( QgsFeatureRendererV2* r ); | void showSymbolLevelsDialog( QgsFeatureRendererV2* r ); | |||
protected: | protected: | |||
QgsVectorLayer* mLayer; | QgsVectorLayer* mLayer; | |||
QgsStyleV2* mStyle; | QgsStyleV2* mStyle; | |||
QMenu* contextMenu; | QMenu* contextMenu; | |||
QAction* mCopyAction; | ||||
QAction* mPasteAction; | ||||
/**Subclasses may provide the capability of changing multiple symbols a t once by implementing the following two methods | /**Subclasses may provide the capability of changing multiple symbols a t once by implementing the following two methods | |||
and by connecting the slot contextMenuViewCategories(const QPoint&)*/ | and by connecting the slot contextMenuViewCategories(const QPoint&)*/ | |||
virtual QList<QgsSymbolV2*> selectedSymbols() { return QList<QgsSymbolV 2*>(); } | virtual QList<QgsSymbolV2*> selectedSymbols() { return QList<QgsSymbolV 2*>(); } | |||
virtual void refreshSymbolView() {} | virtual void refreshSymbolView() {} | |||
protected slots: | protected slots: | |||
void contextMenuViewCategories( const QPoint& p ); | void contextMenuViewCategories( const QPoint& p ); | |||
/**Change color of selected symbols*/ | /**Change color of selected symbols*/ | |||
void changeSymbolColor(); | void changeSymbolColor(); | |||
/**Change opacity of selected symbols*/ | /**Change opacity of selected symbols*/ | |||
void changeSymbolTransparency(); | void changeSymbolTransparency(); | |||
/**Change units mm/map units of selected symbols*/ | /**Change units mm/map units of selected symbols*/ | |||
void changeSymbolUnit(); | void changeSymbolUnit(); | |||
/**Change line widths of selected symbols*/ | /**Change line widths of selected symbols*/ | |||
void changeSymbolWidth(); | void changeSymbolWidth(); | |||
/**Change marker sizes of selected symbols*/ | /**Change marker sizes of selected symbols*/ | |||
void changeSymbolSize(); | void changeSymbolSize(); | |||
virtual void copy() {} | ||||
virtual void paste() {} | ||||
}; | }; | |||
//////////// | //////////// | |||
#include <QObject> | #include <QObject> | |||
class QMenu; | class QMenu; | |||
class QgsField; | class QgsField; | |||
class QgsFields; | class QgsFields; | |||
/** | /** | |||
Utility class for prividing GUI for data-defined rendering. | Utility class for prividing GUI for data-defined rendering. | |||
*/ | */ | |||
class QgsRendererV2DataDefinedMenus : public QObject | class QgsRendererV2DataDefinedMenus : public QObject | |||
{ | { | |||
Q_OBJECT | Q_OBJECT | |||
public: | public: | |||
QgsRendererV2DataDefinedMenus( QMenu* menu, const QgsFields& flds, QStr ing rotationField, QString sizeScaleField, QgsSymbolV2::ScaleMethod scaleMe thod ); | QgsRendererV2DataDefinedMenus( QMenu* menu, QgsVectorLayer* layer, QStr ing rotationField, QString sizeScaleField, QgsSymbolV2::ScaleMethod scaleMe thod ); | |||
~QgsRendererV2DataDefinedMenus(); | ~QgsRendererV2DataDefinedMenus(); | |||
void populateMenu( QMenu* menu, const char* slot, QString fieldName, QA ctionGroup *actionGroup ); | void populateMenu( QMenu* menu, QString fieldName, QActionGroup *action Group ); | |||
#if 0 | #if 0 | |||
void updateMenu( QActionGroup* actionGroup, QString fieldName ); | void updateMenu( QActionGroup* actionGroup, QString fieldName ); | |||
#endif | #endif | |||
public slots: | public slots: | |||
void rotationFieldSelected( QAction *a ); | void rotationFieldSelected( QAction *a ); | |||
void sizeScaleFieldSelected( QAction *a ); | void sizeScaleFieldSelected( QAction *a ); | |||
void scaleMethodSelected( QAction *a ); | void scaleMethodSelected( QAction *a ); | |||
signals: | signals: | |||
skipping to change at line 117 | skipping to change at line 123 | |||
void rotationFieldChanged( QString fldName ); | void rotationFieldChanged( QString fldName ); | |||
void sizeScaleFieldChanged( QString fldName ); | void sizeScaleFieldChanged( QString fldName ); | |||
void scaleMethodChanged( QgsSymbolV2::ScaleMethod scaleMethod ); | void scaleMethodChanged( QgsSymbolV2::ScaleMethod scaleMethod ); | |||
protected: | protected: | |||
QMenu* mRotationMenu; | QMenu* mRotationMenu; | |||
QMenu* mSizeScaleMenu; | QMenu* mSizeScaleMenu; | |||
QActionGroup *mSizeMethodActionGroup; | QActionGroup *mSizeMethodActionGroup; | |||
QActionGroup *mRotationAttributeActionGroup; | QActionGroup *mRotationAttributeActionGroup; | |||
QActionGroup *mSizeAttributeActionGroup; | QActionGroup *mSizeAttributeActionGroup; | |||
const QgsFields& mFlds; | QgsVectorLayer* mLayer; | |||
}; | }; | |||
#endif // QGSRENDERERV2WIDGET_H | #endif // QGSRENDERERV2WIDGET_H | |||
End of changes. 5 change blocks. | ||||
3 lines changed or deleted | 9 lines changed or added | |||
qgsrubberband.h | qgsrubberband.h | |||
---|---|---|---|---|
skipping to change at line 59 | skipping to change at line 59 | |||
* A cross is used to highlight points (x) | * A cross is used to highlight points (x) | |||
*/ | */ | |||
ICON_X, | ICON_X, | |||
/** | /** | |||
* A box is used to highlight points (â–¡) | * A box is used to highlight points (â–¡) | |||
*/ | */ | |||
ICON_BOX, | ICON_BOX, | |||
/** | /** | |||
* A circle is used to highlight points (â—‹) | * A circle is used to highlight points (â—‹) | |||
*/ | */ | |||
ICON_CIRCLE | ICON_CIRCLE, | |||
/** | ||||
* A full box is used to highlight points (â– ) | ||||
*/ | ||||
ICON_FULL_BOX | ||||
}; | }; | |||
/** | /** | |||
* Creates a new RubberBand. | * Creates a new RubberBand. | |||
* @param mapCanvas The map canvas to draw onto. It's CRS will be used map points onto screen coordinates. | * @param mapCanvas The map canvas to draw onto. It's CRS will be used map points onto screen coordinates. | |||
* @param geometryType Defines how the data should be drawn onto the s creen. (Use QGis::Line, QGis::Polygon or QGis::Point) | * @param geometryType Defines how the data should be drawn onto the s creen. (Use QGis::Line, QGis::Polygon or QGis::Point) | |||
* @note Added in 1.9. | * @note Added in 1.9. | |||
*/ | */ | |||
QgsRubberBand( QgsMapCanvas* mapCanvas, QGis::GeometryType geometryType = QGis::Line ); | QgsRubberBand( QgsMapCanvas* mapCanvas, QGis::GeometryType geometryType = QGis::Line ); | |||
/** | /** | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 5 lines changed or added | |||
qgsrulebasedrendererv2.h | qgsrulebasedrendererv2.h | |||
---|---|---|---|---|
skipping to change at line 88 | skipping to change at line 88 | |||
If filter is empty, it matches all features. | If filter is empty, it matches all features. | |||
If scale range has both values zero, it matches all scales. | If scale range has both values zero, it matches all scales. | |||
If one of the min/max scale denominators is zero, there is no lower/u pper bound for scales. | If one of the min/max scale denominators is zero, there is no lower/u pper bound for scales. | |||
A rule matches if both filter and scale range match. | A rule matches if both filter and scale range match. | |||
*/ | */ | |||
class CORE_EXPORT Rule | class CORE_EXPORT Rule | |||
{ | { | |||
public: | public: | |||
//! Constructor takes ownership of the symbol | //! Constructor takes ownership of the symbol | |||
Rule( QgsSymbolV2* symbol, int scaleMinDenom = 0, int scaleMaxDenom = 0, QString filterExp = QString(), | Rule( QgsSymbolV2* symbol, int scaleMinDenom = 0, int scaleMaxDenom = 0, QString filterExp = QString(), | |||
QString label = QString(), QString description = QString() ); | QString label = QString(), QString description = QString(), b ool elseRule = false ); | |||
//Rule( const Rule& other ); | //Rule( const Rule& other ); | |||
~Rule(); | ~Rule(); | |||
QString dump( int offset = 0 ) const; | QString dump( int offset = 0 ) const; | |||
QSet<QString> usedAttributes(); | QSet<QString> usedAttributes(); | |||
QgsSymbolV2List symbols(); | QgsSymbolV2List symbols(); | |||
//! @note not available in python bindings | //! @note not available in python bindings | |||
QgsLegendSymbolList legendSymbolItems(); | QgsLegendSymbolList legendSymbolItems( double scaleDenominator = -1 , QString rule = "" ); | |||
bool isFilterOK( QgsFeature& f ) const; | bool isFilterOK( QgsFeature& f ) const; | |||
bool isScaleOK( double scale ) const; | bool isScaleOK( double scale ) const; | |||
QgsSymbolV2* symbol() { return mSymbol; } | QgsSymbolV2* symbol() { return mSymbol; } | |||
QString label() const { return mLabel; } | QString label() const { return mLabel; } | |||
bool dependsOnScale() const { return mScaleMinDenom != 0 || mScaleM axDenom != 0; } | bool dependsOnScale() const { return mScaleMinDenom != 0 || mScaleM axDenom != 0; } | |||
int scaleMinDenom() const { return mScaleMinDenom; } | int scaleMinDenom() const { return mScaleMinDenom; } | |||
int scaleMaxDenom() const { return mScaleMaxDenom; } | int scaleMaxDenom() const { return mScaleMaxDenom; } | |||
QgsExpression* filter() const { return mFilter; } | QgsExpression* filter() const { return mFilter; } | |||
QString filterExpression() const { return mFilterExp; } | QString filterExpression() const { return mFilterExp; } | |||
skipping to change at line 154 | skipping to change at line 154 | |||
void stopRender( QgsRenderContext& context ); | void stopRender( QgsRenderContext& context ); | |||
static Rule* create( QDomElement& ruleElem, QgsSymbolV2Map& symbolM ap ); | static Rule* create( QDomElement& ruleElem, QgsSymbolV2Map& symbolM ap ); | |||
RuleList& children() { return mChildren; } | RuleList& children() { return mChildren; } | |||
RuleList descendants() const { RuleList l; foreach ( Rule *c, mChil dren ) { l += c; l += c->children(); } return l; } | RuleList descendants() const { RuleList l; foreach ( Rule *c, mChil dren ) { l += c; l += c->children(); } return l; } | |||
Rule* parent() { return mParent; } | Rule* parent() { return mParent; } | |||
//! add child rule, take ownership, sets this as parent | //! add child rule, take ownership, sets this as parent | |||
void appendChild( Rule* rule ) { mChildren.append( rule ); rule->mP arent = this; } | void appendChild( Rule* rule ); | |||
//! add child rule, take ownership, sets this as parent | //! add child rule, take ownership, sets this as parent | |||
void insertChild( int i, Rule* rule ) { mChildren.insert( i, rule ) ; rule->mParent = this; } | void insertChild( int i, Rule* rule ); | |||
//! delete child rule | //! delete child rule | |||
void removeChild( Rule* rule ) { mChildren.removeAll( rule ); delet e rule; } | void removeChild( Rule* rule ); | |||
//! delete child rule | //! delete child rule | |||
void removeChildAt( int i ) { Rule* rule = mChildren[i]; mChildren. removeAt( i ); delete rule; } | void removeChildAt( int i ); | |||
//! take child rule out, set parent as null | //! take child rule out, set parent as null | |||
void takeChild( Rule* rule ) { mChildren.removeAll( rule ); rule->m Parent = NULL; } | void takeChild( Rule* rule ); | |||
//! take child rule out, set parent as null | //! take child rule out, set parent as null | |||
Rule* takeChildAt( int i ) { Rule* rule = mChildren.takeAt( i ); ru | Rule* takeChildAt( int i ); | |||
le->mParent = NULL; return rule; } | ||||
void updateElseRules(); | ||||
void setIsElse( bool iselse ) { mElseRule = iselse; } | ||||
bool isElse() { return mElseRule; } | ||||
protected: | protected: | |||
void initFilter(); | void initFilter(); | |||
Rule* mParent; // parent rule (NULL only for root rule) | Rule* mParent; // parent rule (NULL only for root rule) | |||
QgsSymbolV2* mSymbol; | QgsSymbolV2* mSymbol; | |||
int mScaleMinDenom, mScaleMaxDenom; | int mScaleMinDenom, mScaleMaxDenom; | |||
QString mFilterExp, mLabel, mDescription; | QString mFilterExp, mLabel, mDescription; | |||
bool mElseRule; | bool mElseRule; | |||
RuleList mChildren; | RuleList mChildren; | |||
RuleList mElseRules; | ||||
// temporary | // temporary | |||
QgsExpression* mFilter; | QgsExpression* mFilter; | |||
// temporary while rendering | // temporary while rendering | |||
QList<int> mSymbolNormZLevels; | QList<int> mSymbolNormZLevels; | |||
RuleList mActiveChildren; | RuleList mActiveChildren; | |||
}; | }; | |||
///// | ///// | |||
skipping to change at line 222 | skipping to change at line 228 | |||
//! store renderer info to XML element | //! store renderer info to XML element | |||
virtual QDomElement save( QDomDocument& doc ); | virtual QDomElement save( QDomDocument& doc ); | |||
//! return a list of symbology items for the legend | //! return a list of symbology items for the legend | |||
virtual QgsLegendSymbologyList legendSymbologyItems( QSize iconSize ); | virtual QgsLegendSymbologyList legendSymbologyItems( QSize iconSize ); | |||
//! return a list of item text / symbol | //! return a list of item text / symbol | |||
//! @note: this method was added in version 1.5 | //! @note: this method was added in version 1.5 | |||
//! @note not available in python bindings | //! @note not available in python bindings | |||
virtual QgsLegendSymbolList legendSymbolItems(); | virtual QgsLegendSymbolList legendSymbolItems( double scaleDenominator = -1, QString rule = "" ); | |||
//! for debugging | //! for debugging | |||
virtual QString dump() const; | virtual QString dump() const; | |||
//! return whether the renderer will render a feature or not. | //! return whether the renderer will render a feature or not. | |||
//! Must be called between startRender() and stopRender() calls. | //! Must be called between startRender() and stopRender() calls. | |||
//! @note added in 1.9 | //! @note added in 1.9 | |||
virtual bool willRenderFeature( QgsFeature& feat ); | virtual bool willRenderFeature( QgsFeature& feat ); | |||
//! return list of symbols used for rendering the feature. | //! return list of symbols used for rendering the feature. | |||
End of changes. 10 change blocks. | ||||
10 lines changed or deleted | 15 lines changed or added | |||
qgsrulebasedrendererv2widget.h | qgsrulebasedrendererv2widget.h | |||
---|---|---|---|---|
skipping to change at line 84 | skipping to change at line 84 | |||
void insertRule( const QModelIndex& parent, int before, QgsRuleBasedRen dererV2::Rule* newrule ); | void insertRule( const QModelIndex& parent, int before, QgsRuleBasedRen dererV2::Rule* newrule ); | |||
void updateRule( const QModelIndex& parent, int row ); | void updateRule( const QModelIndex& parent, int row ); | |||
// update rule and all its descendants | // update rule and all its descendants | |||
void updateRule( const QModelIndex& index ); | void updateRule( const QModelIndex& index ); | |||
void removeRule( const QModelIndex& index ); | void removeRule( const QModelIndex& index ); | |||
void willAddRules( const QModelIndex& parent, int count ); // call begi nInsertRows | void willAddRules( const QModelIndex& parent, int count ); // call begi nInsertRows | |||
void finishedAddingRules(); // call endInsertRows | void finishedAddingRules(); // call endInsertRows | |||
//! @note not available in python bindungs | ||||
void setFeatureCounts( QMap<QgsRuleBasedRendererV2::Rule*, QgsRuleBased RendererV2Count> theCountMap ); | void setFeatureCounts( QMap<QgsRuleBasedRendererV2::Rule*, QgsRuleBased RendererV2Count> theCountMap ); | |||
void clearFeatureCounts(); | void clearFeatureCounts(); | |||
protected: | protected: | |||
QgsRuleBasedRendererV2* mR; | QgsRuleBasedRendererV2* mR; | |||
QMap<QgsRuleBasedRendererV2::Rule*, QgsRuleBasedRendererV2Count> mFeatu reCountMap; | QMap<QgsRuleBasedRendererV2::Rule*, QgsRuleBasedRendererV2Count> mFeatu reCountMap; | |||
}; | }; | |||
/////// | /////// | |||
skipping to change at line 130 | skipping to change at line 131 | |||
void refineRuleRanges(); | void refineRuleRanges(); | |||
void setRenderingOrder(); | void setRenderingOrder(); | |||
void currentRuleChanged( const QModelIndex& current = QModelIndex(), co nst QModelIndex& previous = QModelIndex() ); | void currentRuleChanged( const QModelIndex& current = QModelIndex(), co nst QModelIndex& previous = QModelIndex() ); | |||
void saveSectionWidth( int section, int oldSize, int newSize ); | void saveSectionWidth( int section, int oldSize, int newSize ); | |||
void restoreSectionWidths(); | void restoreSectionWidths(); | |||
protected: | protected: | |||
void refineRule( int type ); | void refineRule( int type ); | |||
void refineRuleCategoriesGui( const QModelIndexList& index ); | void refineRuleCategoriesGui( const QModelIndexList& index ); | |||
void refineRuleRangesGui( const QModelIndexList& index ); | void refineRuleRangesGui( const QModelIndexList& index ); | |||
void refineRuleScalesGui( const QModelIndexList& index ); | void refineRuleScalesGui( const QModelIndexList& index ); | |||
QgsRuleBasedRendererV2::Rule* currentRule(); | QgsRuleBasedRendererV2::Rule* currentRule(); | |||
QList<QgsSymbolV2*> selectedSymbols(); | QList<QgsSymbolV2*> selectedSymbols(); | |||
QgsRuleBasedRendererV2::RuleList selectedRules(); | ||||
void refreshSymbolView(); | void refreshSymbolView(); | |||
void keyPressEvent( QKeyEvent* event ); | ||||
QgsRuleBasedRendererV2* mRenderer; | QgsRuleBasedRendererV2* mRenderer; | |||
QgsRuleBasedRendererV2Model* mModel; | QgsRuleBasedRendererV2Model* mModel; | |||
QMenu* mRefineMenu; | QMenu* mRefineMenu; | |||
QAction* mDeleteAction; | ||||
QgsRuleBasedRendererV2::RuleList mCopyBuffer; | ||||
protected slots: | ||||
void copy(); | ||||
void paste(); | ||||
}; | }; | |||
/////// | /////// | |||
#include <QDialog> | #include <QDialog> | |||
#include "ui_qgsrendererrulepropsdialogbase.h" | #include "ui_qgsrendererrulepropsdialogbase.h" | |||
class GUI_EXPORT QgsRendererRulePropsDialog : public QDialog, private Ui::Q gsRendererRulePropsDialog | class GUI_EXPORT QgsRendererRulePropsDialog : public QDialog, private Ui::Q gsRendererRulePropsDialog | |||
{ | { | |||
End of changes. 5 change blocks. | ||||
1 lines changed or deleted | 10 lines changed or added | |||
qgsscalebarstyle.h | qgsscalebarstyle.h | |||
---|---|---|---|---|
skipping to change at line 43 | skipping to change at line 43 | |||
QgsScaleBarStyle( const QgsComposerScaleBar* bar ); | QgsScaleBarStyle( const QgsComposerScaleBar* bar ); | |||
virtual ~QgsScaleBarStyle(); | virtual ~QgsScaleBarStyle(); | |||
/**Draws the style | /**Draws the style | |||
@param p painter object | @param p painter object | |||
@param xOffset offset to account for centered labeling*/ | @param xOffset offset to account for centered labeling*/ | |||
virtual void draw( QPainter* p, double xOffset = 0 ) const = 0; //to do by every subclass | virtual void draw( QPainter* p, double xOffset = 0 ) const = 0; //to do by every subclass | |||
virtual void drawLabels( QPainter* p ) const; //default implementation provided | virtual void drawLabels( QPainter* p ) const; //default implementation provided | |||
virtual QRectF calculateBoxSize() const; //default implementation provi ded | virtual QRectF calculateBoxSize() const; //default implementation provi ded | |||
virtual QString name() const = 0; //return name of the style | virtual QString name() const = 0; //return name of the style | |||
//virtual QIcon styleIcon() const = 0; | ||||
private: | private: | |||
QgsScaleBarStyle(); //default constructor forbidden | QgsScaleBarStyle(); //default constructor forbidden | |||
protected: | protected: | |||
const QgsComposerScaleBar* mScaleBar; | const QgsComposerScaleBar* mScaleBar; | |||
}; | }; | |||
#endif | #endif | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 0 lines changed or added | |||
qgssinglebandcolordatarenderer.h | qgssinglebandcolordatarenderer.h | |||
---|---|---|---|---|
skipping to change at line 39 | skipping to change at line 39 | |||
{ | { | |||
public: | public: | |||
QgsSingleBandColorDataRenderer( QgsRasterInterface* input, int band ); | QgsSingleBandColorDataRenderer( QgsRasterInterface* input, int band ); | |||
~QgsSingleBandColorDataRenderer(); | ~QgsSingleBandColorDataRenderer(); | |||
QgsRasterInterface * clone() const; | QgsRasterInterface * clone() const; | |||
static QgsRasterRenderer* create( const QDomElement& elem, QgsRasterInt erface* input ); | static QgsRasterRenderer* create( const QDomElement& elem, QgsRasterInt erface* input ); | |||
bool setInput( QgsRasterInterface* input ); | bool setInput( QgsRasterInterface* input ); | |||
QgsRasterBlock* block( int bandNo, QgsRectangle const & extent, int wi dth, int height ); | QgsRasterBlock* block( int bandNo, const QgsRectangle & extent, int wid th, int height ); | |||
void writeXML( QDomDocument& doc, QDomElement& parentElem ) const; | void writeXML( QDomDocument& doc, QDomElement& parentElem ) const; | |||
QList<int> usesBands() const; | QList<int> usesBands() const; | |||
private: | private: | |||
int mBand; | int mBand; | |||
}; | }; | |||
#endif // QGSSINGLEBANDCOLORDATARENDERER_H | #endif // QGSSINGLEBANDCOLORDATARENDERER_H | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
qgssinglesymbolrendererv2.h | qgssinglesymbolrendererv2.h | |||
---|---|---|---|---|
skipping to change at line 21 | skipping to change at line 21 | |||
* the Free Software Foundation; either version 2 of the License, or * | * the Free Software Foundation; either version 2 of the License, or * | |||
* (at your option) any later version. * | * (at your option) any later version. * | |||
* * | * * | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef QGSSINGLESYMBOLRENDERERV2_H | #ifndef QGSSINGLESYMBOLRENDERERV2_H | |||
#define QGSSINGLESYMBOLRENDERERV2_H | #define QGSSINGLESYMBOLRENDERERV2_H | |||
#include "qgis.h" | #include "qgis.h" | |||
#include "qgsrendererv2.h" | #include "qgsrendererv2.h" | |||
#include "qgssymbolv2.h" | #include "qgssymbolv2.h" | |||
#include "qgsexpression.h" | ||||
#include <QScopedPointer> | ||||
class CORE_EXPORT QgsSingleSymbolRendererV2 : public QgsFeatureRendererV2 | class CORE_EXPORT QgsSingleSymbolRendererV2 : public QgsFeatureRendererV2 | |||
{ | { | |||
public: | public: | |||
QgsSingleSymbolRendererV2( QgsSymbolV2* symbol ); | QgsSingleSymbolRendererV2( QgsSymbolV2* symbol ); | |||
virtual ~QgsSingleSymbolRendererV2(); | virtual ~QgsSingleSymbolRendererV2(); | |||
virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature ); | virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature ); | |||
skipping to change at line 42 | skipping to change at line 44 | |||
virtual void startRender( QgsRenderContext& context, const QgsVectorLay er *vlayer ); | virtual void startRender( QgsRenderContext& context, const QgsVectorLay er *vlayer ); | |||
virtual void stopRender( QgsRenderContext& context ); | virtual void stopRender( QgsRenderContext& context ); | |||
virtual QList<QString> usedAttributes(); | virtual QList<QString> usedAttributes(); | |||
QgsSymbolV2* symbol() const; | QgsSymbolV2* symbol() const; | |||
void setSymbol( QgsSymbolV2* s ); | void setSymbol( QgsSymbolV2* s ); | |||
//! @note added in 1.5 | //! @note added in 1.5 | |||
void setRotationField( QString fieldName ) { mRotationField = fieldName ; } | void setRotationField( QString fieldOrExpression ); | |||
//! @note added in 1.5 | //! @note added in 1.5 | |||
QString rotationField() const { return mRotationField; } | QString rotationField() const; | |||
//! @note added in 1.5 | //! @note added in 1.5 | |||
void setSizeScaleField( QString fieldName ) { mSizeScaleField = fieldNa me; } | void setSizeScaleField( QString fieldOrExpression ); | |||
//! @note added in 1.5 | //! @note added in 1.5 | |||
QString sizeScaleField() const { return mSizeScaleField; } | QString sizeScaleField() const; | |||
//! @note added in 2.0 | //! @note added in 2.0 | |||
void setScaleMethod( QgsSymbolV2::ScaleMethod scaleMethod ); | void setScaleMethod( QgsSymbolV2::ScaleMethod scaleMethod ); | |||
//! @note added in 2.0 | //! @note added in 2.0 | |||
QgsSymbolV2::ScaleMethod scaleMethod() const { return mScaleMethod; } | QgsSymbolV2::ScaleMethod scaleMethod() const { return mScaleMethod; } | |||
virtual QString dump() const; | virtual QString dump() const; | |||
virtual QgsFeatureRendererV2* clone(); | virtual QgsFeatureRendererV2* clone(); | |||
skipping to change at line 81 | skipping to change at line 83 | |||
//! store renderer info to XML element | //! store renderer info to XML element | |||
virtual QDomElement save( QDomDocument& doc ); | virtual QDomElement save( QDomDocument& doc ); | |||
//! return a list of symbology items for the legend | //! return a list of symbology items for the legend | |||
virtual QgsLegendSymbologyList legendSymbologyItems( QSize iconSize ); | virtual QgsLegendSymbologyList legendSymbologyItems( QSize iconSize ); | |||
//! return a list of item text / symbol | //! return a list of item text / symbol | |||
//! @note: this method was added in version 1.5 | //! @note: this method was added in version 1.5 | |||
//! @note not available in python bindings | //! @note not available in python bindings | |||
virtual QgsLegendSymbolList legendSymbolItems(); | virtual QgsLegendSymbolList legendSymbolItems( double scaleDenominator = -1, QString rule = QString() ); | |||
protected: | protected: | |||
QgsSymbolV2* mSymbol; | QScopedPointer<QgsSymbolV2> mSymbol; | |||
QString mRotationField; | QScopedPointer<QgsExpression> mRotation; | |||
QString mSizeScaleField; | QScopedPointer<QgsExpression> mSizeScale; | |||
QgsSymbolV2::ScaleMethod mScaleMethod; | QgsSymbolV2::ScaleMethod mScaleMethod; | |||
// temporary stuff for rendering | // temporary stuff for rendering | |||
int mRotationFieldIdx, mSizeScaleFieldIdx; | QScopedPointer<QgsSymbolV2> mTempSymbol; | |||
QgsSymbolV2* mTempSymbol; | ||||
double mOrigSize; | double mOrigSize; | |||
}; | }; | |||
#endif // QGSSINGLESYMBOLRENDERERV2_H | #endif // QGSSINGLESYMBOLRENDERERV2_H | |||
End of changes. 8 change blocks. | ||||
10 lines changed or deleted | 11 lines changed or added | |||
qgssvgcache.h | qgssvgcache.h | |||
---|---|---|---|---|
skipping to change at line 35 | skipping to change at line 35 | |||
#include <QUrl> | #include <QUrl> | |||
class QDomElement; | class QDomElement; | |||
class QImage; | class QImage; | |||
class QPicture; | class QPicture; | |||
class CORE_EXPORT QgsSvgCacheEntry | class CORE_EXPORT QgsSvgCacheEntry | |||
{ | { | |||
public: | public: | |||
QgsSvgCacheEntry(); | QgsSvgCacheEntry(); | |||
QgsSvgCacheEntry( const QString& file, double size, double outlineWidth | /** Constructor. | |||
, double widthScaleFactor, double rasterScaleFctor, const QColor& fill, con | * @param file Absolute path to SVG file (relative paths are not resolv | |||
st QColor& outline ); | ed). | |||
* @param size | ||||
* @param outlineWidth width of outline | ||||
* @param widthScaleFactor width scale factor | ||||
* @param rasterScaleFactor raster scale factor | ||||
* @param fill color of fill | ||||
* @param outline color of outline | ||||
*/ | ||||
QgsSvgCacheEntry( const QString& file, double size, double outlineWidth | ||||
, double widthScaleFactor, double rasterScaleFactor, const QColor& fill, co | ||||
nst QColor& outline ); | ||||
~QgsSvgCacheEntry(); | ~QgsSvgCacheEntry(); | |||
QString file; | QString file; | |||
double size; //size in pixels (cast to int for QImage) | double size; //size in pixels (cast to int for QImage) | |||
double outlineWidth; | double outlineWidth; | |||
double widthScaleFactor; | double widthScaleFactor; | |||
double rasterScaleFactor; | double rasterScaleFactor; | |||
QColor fill; | QColor fill; | |||
QColor outline; | QColor outline; | |||
QImage* image; | QImage* image; | |||
skipping to change at line 72 | skipping to change at line 81 | |||
the parameters 'fill-color', 'pen-color', 'outline-width', 'stroke-width'. E.g. <circle fill="param(fill-color red)" stroke="param(pen-color black)" s troke-width="param(outline-width 1)"*/ | the parameters 'fill-color', 'pen-color', 'outline-width', 'stroke-width'. E.g. <circle fill="param(fill-color red)" stroke="param(pen-color black)" s troke-width="param(outline-width 1)"*/ | |||
class CORE_EXPORT QgsSvgCache : public QObject | class CORE_EXPORT QgsSvgCache : public QObject | |||
{ | { | |||
Q_OBJECT | Q_OBJECT | |||
public: | public: | |||
static QgsSvgCache* instance(); | static QgsSvgCache* instance(); | |||
~QgsSvgCache(); | ~QgsSvgCache(); | |||
/** Get SVG as QImage. | ||||
* @param file Absolute or relative path to SVG file. | ||||
* @param size size of cached image | ||||
* @param fill color of fill | ||||
* @param outline color of outline | ||||
* @param outlineWidth width of outline | ||||
* @param widthScaleFactor width scale factor | ||||
* @param rasterScaleFactor raster scale factor | ||||
* @param fitsInCache | ||||
*/ | ||||
const QImage& svgAsImage( const QString& file, double size, const QColo r& fill, const QColor& outline, double outlineWidth, | const QImage& svgAsImage( const QString& file, double size, const QColo r& fill, const QColor& outline, double outlineWidth, | |||
double widthScaleFactor, double rasterScaleFa ctor, bool& fitsInCache ); | double widthScaleFactor, double rasterScaleFa ctor, bool& fitsInCache ); | |||
/** Get SVG as QPicture&. | ||||
* @param file Absolute or relative path to SVG file. | ||||
* @param size size of cached image | ||||
* @param fill color of fill | ||||
* @param outline color of outline | ||||
* @param outlineWidth width of outline | ||||
* @param widthScaleFactor width scale factor | ||||
* @param rasterScaleFactor raster scale factor | ||||
* @param forceVectorOutput | ||||
*/ | ||||
const QPicture& svgAsPicture( const QString& file, double size, const Q Color& fill, const QColor& outline, double outlineWidth, | const QPicture& svgAsPicture( const QString& file, double size, const Q Color& fill, const QColor& outline, double outlineWidth, | |||
double widthScaleFactor, double rasterSca leFactor, bool forceVectorOutput = false ); | double widthScaleFactor, double rasterSca leFactor, bool forceVectorOutput = false ); | |||
/**Tests if an svg file contains parameters for fill, outline color, ou tline width. If yes, possible default values are returned. If there are sev eral | /**Tests if an svg file contains parameters for fill, outline color, ou tline width. If yes, possible default values are returned. If there are sev eral | |||
default values in the svg file, only the first one is considered*/ | default values in the svg file, only the first one is considered*/ | |||
void containsParams( const QString& path, bool& hasFillParam, QColor& d efaultFillColor, bool& hasOutlineParam, QColor& defaultOutlineColor, bool& hasOutlineWidthParam, | void containsParams( const QString& path, bool& hasFillParam, QColor& d efaultFillColor, bool& hasOutlineParam, QColor& defaultOutlineColor, bool& hasOutlineWidthParam, | |||
double& defaultOutlineWidth ) const; | double& defaultOutlineWidth ) const; | |||
/**Get image data*/ | /**Get image data*/ | |||
QByteArray getImageData( const QString &path ) const; | QByteArray getImageData( const QString &path ) const; | |||
signals: | signals: | |||
/** Emit a signal to be caught by qgisapp and display a msg on status b ar */ | /** Emit a signal to be caught by qgisapp and display a msg on status b ar */ | |||
void statusChanged( const QString& theStatusQString ); | void statusChanged( const QString& theStatusQString ); | |||
protected: | protected: | |||
//! protected constructor | //! protected constructor | |||
QgsSvgCache( QObject * parent = 0 ); | QgsSvgCache( QObject * parent = 0 ); | |||
/**Creates new cache entry and returns pointer to it*/ | /**Creates new cache entry and returns pointer to it | |||
* @param file Absolute or relative path to SVG file. If the path is re | ||||
lative the file is searched by QgsSymbolLayerV2Utils::symbolNameToPath() in | ||||
SVG paths. | ||||
in settings svg/searchPathsForSVG | ||||
* @param size size of cached image | ||||
* @param fill color of fill | ||||
* @param outline color of outline | ||||
* @param outlineWidth width of outline | ||||
* @param widthScaleFactor width scale factor | ||||
* @param rasterScaleFactor raster scale factor | ||||
*/ | ||||
QgsSvgCacheEntry* insertSVG( const QString& file, double size, const QC olor& fill, const QColor& outline, double outlineWidth, | QgsSvgCacheEntry* insertSVG( const QString& file, double size, const QC olor& fill, const QColor& outline, double outlineWidth, | |||
double widthScaleFactor, double rasterScal eFactor ); | double widthScaleFactor, double rasterScal eFactor ); | |||
void replaceParamsAndCacheSvg( QgsSvgCacheEntry* entry ); | void replaceParamsAndCacheSvg( QgsSvgCacheEntry* entry ); | |||
void cacheImage( QgsSvgCacheEntry* entry ); | void cacheImage( QgsSvgCacheEntry* entry ); | |||
void cachePicture( QgsSvgCacheEntry* entry, bool forceVectorOutput = fa lse ); | void cachePicture( QgsSvgCacheEntry* entry, bool forceVectorOutput = fa lse ); | |||
/**Returns entry from cache or creates a new entry if it does not exist already*/ | /**Returns entry from cache or creates a new entry if it does not exist already*/ | |||
QgsSvgCacheEntry* cacheEntry( const QString& file, double size, const Q Color& fill, const QColor& outline, double outlineWidth, | QgsSvgCacheEntry* cacheEntry( const QString& file, double size, const Q Color& fill, const QColor& outline, double outlineWidth, | |||
double widthScaleFactor, double rasterSca leFactor ); | double widthScaleFactor, double rasterSca leFactor ); | |||
/**Removes the least used items until the maximum size is under the lim it*/ | /**Removes the least used items until the maximum size is under the lim it*/ | |||
void trimToMaximumSize(); | void trimToMaximumSize(); | |||
//Removes entry from the ordered list (but does not delete the entry it self) | //Removes entry from the ordered list (but does not delete the entry it self) | |||
void takeEntryFromList( QgsSvgCacheEntry* entry ); | void takeEntryFromList( QgsSvgCacheEntry* entry ); | |||
private slots: | private slots: | |||
void downloadProgress( qint64, qint64 ); | void downloadProgress( qint64, qint64 ); | |||
private: | private: | |||
static QgsSvgCache* mInstance; | ||||
/**Entry pointers accessible by file name*/ | /**Entry pointers accessible by file name*/ | |||
QMultiHash< QString, QgsSvgCacheEntry* > mEntryLookup; | QMultiHash< QString, QgsSvgCacheEntry* > mEntryLookup; | |||
/**Estimated total size of all images, pictures and svgContent*/ | /**Estimated total size of all images, pictures and svgContent*/ | |||
long mTotalSize; | long mTotalSize; | |||
//The svg cache keeps the entries on a double connected list, moving th e current entry to the front. | //The svg cache keeps the entries on a double connected list, moving th e current entry to the front. | |||
//That way, removing entries for more space can start with the least us ed objects. | //That way, removing entries for more space can start with the least us ed objects. | |||
QgsSvgCacheEntry* mLeastRecentEntry; | QgsSvgCacheEntry* mLeastRecentEntry; | |||
QgsSvgCacheEntry* mMostRecentEntry; | QgsSvgCacheEntry* mMostRecentEntry; | |||
skipping to change at line 140 | skipping to change at line 176 | |||
void replaceElemParams( QDomElement& elem, const QColor& fill, const QC olor& outline, double outlineWidth ); | void replaceElemParams( QDomElement& elem, const QColor& fill, const QC olor& outline, double outlineWidth ); | |||
void containsElemParams( const QDomElement& elem, bool& hasFillParam, Q Color& defaultFill, bool& hasOutlineParam, QColor& defaultOutline, | void containsElemParams( const QDomElement& elem, bool& hasFillParam, Q Color& defaultFill, bool& hasOutlineParam, QColor& defaultOutline, | |||
bool& hasOutlineWidthParam, double& defaultOut lineWidth ) const; | bool& hasOutlineWidthParam, double& defaultOut lineWidth ) const; | |||
/**Release memory and remove cache entry from mEntryLookup*/ | /**Release memory and remove cache entry from mEntryLookup*/ | |||
void removeCacheEntry( QString s, QgsSvgCacheEntry* entry ); | void removeCacheEntry( QString s, QgsSvgCacheEntry* entry ); | |||
/**For debugging*/ | /**For debugging*/ | |||
void printEntryList(); | void printEntryList(); | |||
/** SVG content to be rendered if SVG file was not found. */ | ||||
QByteArray mMissingSvg; | ||||
}; | }; | |||
#endif // QGSSVGCACHE_H | #endif // QGSSVGCACHE_H | |||
End of changes. 6 change blocks. | ||||
6 lines changed or deleted | 48 lines changed or added | |||
qgssymbollayerv2.h | qgssymbollayerv2.h | |||
---|---|---|---|---|
skipping to change at line 41 | skipping to change at line 41 | |||
#include <QDomElement> | #include <QDomElement> | |||
#include "qgssymbolv2.h" | #include "qgssymbolv2.h" | |||
#include "qgssymbollayerv2utils.h" // QgsStringMap | #include "qgssymbollayerv2utils.h" // QgsStringMap | |||
class QPainter; | class QPainter; | |||
class QSize; | class QSize; | |||
class QPolygonF; | class QPolygonF; | |||
class QgsDxfExport; | ||||
class QgsExpression; | class QgsExpression; | |||
class QgsRenderContext; | class QgsRenderContext; | |||
class CORE_EXPORT QgsSymbolLayerV2 | class CORE_EXPORT QgsSymbolLayerV2 | |||
{ | { | |||
public: | public: | |||
// not necessarily supported by all symbol layers... | // not necessarily supported by all symbol layers... | |||
virtual void setColor( const QColor& color ) { mColor = color; } | ||||
virtual QColor color() const { return mColor; } | virtual QColor color() const { return mColor; } | |||
virtual void setColor( const QColor& color ) { mColor = color; } | ||||
/** Set outline color. Supported by marker and fill layers. | ||||
* @note added in 2.1 */ | ||||
virtual void setOutlineColor( const QColor& color ) { Q_UNUSED( color ) | ||||
; } | ||||
/** Get outline color. Supported by marker and fill layers. | ||||
* @note added in 2.1 */ | ||||
virtual QColor outlineColor() const { return QColor(); } | ||||
/** Set fill color. Supported by marker and fill layers. | ||||
* @note added in 2.1 */ | ||||
virtual void setFillColor( const QColor& color ) { Q_UNUSED( color ); } | ||||
/** Get fill color. Supported by marker and fill layers. | ||||
* @note added in 2.1 */ | ||||
virtual QColor fillColor() const { return QColor(); } | ||||
virtual ~QgsSymbolLayerV2() { removeDataDefinedProperties(); } | virtual ~QgsSymbolLayerV2() { removeDataDefinedProperties(); } | |||
virtual QString layerType() const = 0; | virtual QString layerType() const = 0; | |||
virtual void startRender( QgsSymbolV2RenderContext& context ) = 0; | virtual void startRender( QgsSymbolV2RenderContext& context ) = 0; | |||
virtual void stopRender( QgsSymbolV2RenderContext& context ) = 0; | virtual void stopRender( QgsSymbolV2RenderContext& context ) = 0; | |||
virtual QgsSymbolLayerV2* clone() const = 0; | virtual QgsSymbolLayerV2* clone() const = 0; | |||
skipping to change at line 79 | skipping to change at line 92 | |||
virtual QgsSymbolV2* subSymbol() { return NULL; } | virtual QgsSymbolV2* subSymbol() { return NULL; } | |||
// set layer's subsymbol. takes ownership of the passed symbol | // set layer's subsymbol. takes ownership of the passed symbol | |||
virtual bool setSubSymbol( QgsSymbolV2* symbol ) { delete symbol; retur n false; } | virtual bool setSubSymbol( QgsSymbolV2* symbol ) { delete symbol; retur n false; } | |||
QgsSymbolV2::SymbolType type() const { return mType; } | QgsSymbolV2::SymbolType type() const { return mType; } | |||
void setLocked( bool locked ) { mLocked = locked; } | void setLocked( bool locked ) { mLocked = locked; } | |||
bool isLocked() const { return mLocked; } | bool isLocked() const { return mLocked; } | |||
/**Returns the estimated maximum distance which the layer style will bl | ||||
eed outside | ||||
the drawn shape. Eg, polygons drawn with an outline will draw half th | ||||
e width | ||||
of the outline outside of the polygon. This amount is estimated, sinc | ||||
e it may | ||||
be affected by data defined symbology rules.*/ | ||||
virtual double estimateMaxBleed() const { return 0; } | ||||
virtual void setOutputUnit( QgsSymbolV2::OutputUnit unit ) { Q_UNUSED( unit ); } //= 0; | virtual void setOutputUnit( QgsSymbolV2::OutputUnit unit ) { Q_UNUSED( unit ); } //= 0; | |||
virtual QgsSymbolV2::OutputUnit outputUnit() const { return QgsSymbolV2 ::Mixed; } //= 0; | virtual QgsSymbolV2::OutputUnit outputUnit() const { return QgsSymbolV2 ::Mixed; } //= 0; | |||
// used only with rending with symbol levels is turned on (0 = first pa ss, 1 = second, ...) | // used only with rending with symbol levels is turned on (0 = first pa ss, 1 = second, ...) | |||
void setRenderingPass( int renderingPass ) { mRenderingPass = rendering Pass; } | void setRenderingPass( int renderingPass ) { mRenderingPass = rendering Pass; } | |||
int renderingPass() const { return mRenderingPass; } | int renderingPass() const { return mRenderingPass; } | |||
// symbol layers normally only use additional attributes to provide dat a defined settings | // symbol layers normally only use additional attributes to provide dat a defined settings | |||
virtual QSet<QString> usedAttributes() const; | virtual QSet<QString> usedAttributes() const; | |||
virtual const QgsExpression* dataDefinedProperty( const QString& proper ty ) const; | virtual const QgsExpression* dataDefinedProperty( const QString& proper ty ) const; | |||
virtual QString dataDefinedPropertyString( const QString& property ) co nst; | virtual QString dataDefinedPropertyString( const QString& property ) co nst; | |||
virtual void setDataDefinedProperty( const QString& property, const QSt ring& expressionString ); | virtual void setDataDefinedProperty( const QString& property, const QSt ring& expressionString ); | |||
virtual void removeDataDefinedProperty( const QString& property ); | virtual void removeDataDefinedProperty( const QString& property ); | |||
virtual void removeDataDefinedProperties(); | virtual void removeDataDefinedProperties(); | |||
bool hasDataDefinedProperties() const { return mDataDefinedProperties.s | ||||
ize() > 0; } | ||||
virtual bool writeDxf( QgsDxfExport& e, | ||||
double mmMapUnitScaleFactor, | ||||
const QString& layerName, | ||||
const QgsSymbolV2RenderContext* context, | ||||
const QgsFeature* f, | ||||
const QPointF& shift = QPointF( 0.0, 0.0 ) ) con | ||||
st; | ||||
virtual double dxfWidth( const QgsDxfExport& e, const QgsSymbolV2Render | ||||
Context& context ) const; | ||||
virtual QColor dxfColor( const QgsSymbolV2RenderContext& context ) cons | ||||
t; | ||||
virtual QVector<qreal> dxfCustomDashPattern( QgsSymbolV2::OutputUnit& u | ||||
nit ) const; | ||||
virtual Qt::PenStyle dxfPenStyle() const; | ||||
protected: | protected: | |||
QgsSymbolLayerV2( QgsSymbolV2::SymbolType type, bool locked = false ) | QgsSymbolLayerV2( QgsSymbolV2::SymbolType type, bool locked = false ) | |||
: mType( type ), mLocked( locked ), mRenderingPass( 0 ) {} | : mType( type ), mLocked( locked ), mRenderingPass( 0 ) {} | |||
QgsSymbolV2::SymbolType mType; | QgsSymbolV2::SymbolType mType; | |||
bool mLocked; | bool mLocked; | |||
QColor mColor; | QColor mColor; | |||
int mRenderingPass; | int mRenderingPass; | |||
QMap< QString, QgsExpression* > mDataDefinedProperties; | QMap< QString, QgsExpression* > mDataDefinedProperties; | |||
// Configuration of selected symbology implementation | // Configuration of selected symbology implementation | |||
static const bool selectionIsOpaque = true; // Selection ignores symbo l alpha | static const bool selectionIsOpaque = true; // Selection ignores symbo l alpha | |||
static const bool selectFillBorder = false; // Fill symbol layer also selects border symbology | static const bool selectFillBorder = false; // Fill symbol layer also selects border symbology | |||
static const bool selectFillStyle = false; // Fill symbol uses symbol layer style.. | static const bool selectFillStyle = false; // Fill symbol uses symbol layer style.. | |||
virtual void prepareExpressions( const QgsVectorLayer* vl ); | virtual void prepareExpressions( const QgsVectorLayer* vl, double scale | |||
virtual QgsExpression* expression( const QString& property ); | = -1.0 ); | |||
virtual QgsExpression* expression( const QString& property ) const; | ||||
/**Saves data defined properties to string map*/ | /**Saves data defined properties to string map*/ | |||
void saveDataDefinedProperties( QgsStringMap& stringMap ) const; | void saveDataDefinedProperties( QgsStringMap& stringMap ) const; | |||
/**Copies data defined properties of this layer to another symbol layer */ | /**Copies data defined properties of this layer to another symbol layer */ | |||
void copyDataDefinedProperties( QgsSymbolLayerV2* destLayer ) const; | void copyDataDefinedProperties( QgsSymbolLayerV2* destLayer ) const; | |||
}; | }; | |||
////////////////////// | ////////////////////// | |||
class CORE_EXPORT QgsMarkerSymbolLayerV2 : public QgsSymbolLayerV2 | class CORE_EXPORT QgsMarkerSymbolLayerV2 : public QgsSymbolLayerV2 | |||
{ | { | |||
public: | public: | |||
enum HorizontalAnchorPoint | ||||
{ | ||||
Left, | ||||
HCenter, | ||||
Right | ||||
}; | ||||
enum VerticalAnchorPoint | ||||
{ | ||||
Top, | ||||
VCenter, | ||||
Bottom | ||||
}; | ||||
void startRender( QgsSymbolV2RenderContext& context ); | ||||
virtual void renderPoint( const QPointF& point, QgsSymbolV2RenderContex t& context ) = 0; | virtual void renderPoint( const QPointF& point, QgsSymbolV2RenderContex t& context ) = 0; | |||
void drawPreviewIcon( QgsSymbolV2RenderContext& context, QSize size ); | void drawPreviewIcon( QgsSymbolV2RenderContext& context, QSize size ); | |||
void setAngle( double angle ) { mAngle = angle; } | void setAngle( double angle ) { mAngle = angle; } | |||
double angle() const { return mAngle; } | double angle() const { return mAngle; } | |||
void setSize( double size ) { mSize = size; } | void setSize( double size ) { mSize = size; } | |||
double size() const { return mSize; } | double size() const { return mSize; } | |||
skipping to change at line 154 | skipping to change at line 205 | |||
void setOffsetUnit( QgsSymbolV2::OutputUnit unit ) { mOffsetUnit = unit ; } | void setOffsetUnit( QgsSymbolV2::OutputUnit unit ) { mOffsetUnit = unit ; } | |||
QgsSymbolV2::OutputUnit offsetUnit() const { return mOffsetUnit; } | QgsSymbolV2::OutputUnit offsetUnit() const { return mOffsetUnit; } | |||
void setSizeUnit( QgsSymbolV2::OutputUnit unit ) { mSizeUnit = unit; } | void setSizeUnit( QgsSymbolV2::OutputUnit unit ) { mSizeUnit = unit; } | |||
QgsSymbolV2::OutputUnit sizeUnit() const { return mSizeUnit; } | QgsSymbolV2::OutputUnit sizeUnit() const { return mSizeUnit; } | |||
virtual void setOutputUnit( QgsSymbolV2::OutputUnit unit ); | virtual void setOutputUnit( QgsSymbolV2::OutputUnit unit ); | |||
virtual QgsSymbolV2::OutputUnit outputUnit() const; | virtual QgsSymbolV2::OutputUnit outputUnit() const; | |||
void setHorizontalAnchorPoint( HorizontalAnchorPoint h ) { mHorizontalA | ||||
nchorPoint = h; } | ||||
HorizontalAnchorPoint horizontalAnchorPoint() const { return mHorizonta | ||||
lAnchorPoint; } | ||||
void setVerticalAnchorPoint( VerticalAnchorPoint v ) { mVerticalAnchorP | ||||
oint = v; } | ||||
VerticalAnchorPoint verticalAnchorPoint() const { return mVerticalAncho | ||||
rPoint; } | ||||
protected: | protected: | |||
QgsMarkerSymbolLayerV2( bool locked = false ); | QgsMarkerSymbolLayerV2( bool locked = false ); | |||
void markerOffset( QgsSymbolV2RenderContext& context, double& offsetX, | ||||
double& offsetY ); | //handles marker offset and anchor point shift together | |||
void markerOffset( const QgsSymbolV2RenderContext& context, double& off | ||||
setX, double& offsetY ) const; | ||||
//! @note available in python bindings as markerOffset2 | ||||
void markerOffset( const QgsSymbolV2RenderContext& context, double widt | ||||
h, double height, | ||||
QgsSymbolV2::OutputUnit widthUnit, QgsSymbolV2::Outp | ||||
utUnit heightUnit, | ||||
double& offsetX, double& offsetY ) const; | ||||
static QPointF _rotatedOffset( const QPointF& offset, double angle ); | static QPointF _rotatedOffset( const QPointF& offset, double angle ); | |||
double mAngle; | double mAngle; | |||
double mSize; | double mSize; | |||
QgsSymbolV2::OutputUnit mSizeUnit; | QgsSymbolV2::OutputUnit mSizeUnit; | |||
QPointF mOffset; | QPointF mOffset; | |||
QgsSymbolV2::OutputUnit mOffsetUnit; | QgsSymbolV2::OutputUnit mOffsetUnit; | |||
QgsSymbolV2::ScaleMethod mScaleMethod; | QgsSymbolV2::ScaleMethod mScaleMethod; | |||
HorizontalAnchorPoint mHorizontalAnchorPoint; | ||||
VerticalAnchorPoint mVerticalAnchorPoint; | ||||
private: | ||||
static QgsMarkerSymbolLayerV2::HorizontalAnchorPoint decodeHorizontalAn | ||||
chorPoint( const QString& str ); | ||||
static QgsMarkerSymbolLayerV2::VerticalAnchorPoint decodeVerticalAnchor | ||||
Point( const QString& str ); | ||||
QgsExpression* mOffsetExpression; | ||||
QgsExpression* mHorizontalAnchorExpression; | ||||
QgsExpression* mVerticalAnchorExpression; | ||||
}; | }; | |||
class CORE_EXPORT QgsLineSymbolLayerV2 : public QgsSymbolLayerV2 | class CORE_EXPORT QgsLineSymbolLayerV2 : public QgsSymbolLayerV2 | |||
{ | { | |||
public: | public: | |||
virtual void renderPolyline( const QPolygonF& points, QgsSymbolV2Render Context& context ) = 0; | virtual void renderPolyline( const QPolygonF& points, QgsSymbolV2Render Context& context ) = 0; | |||
//! @note added in v1.7 | //! @note added in v1.7 | |||
virtual void renderPolygonOutline( const QPolygonF& points, QList<QPoly gonF>* rings, QgsSymbolV2RenderContext& context ); | virtual void renderPolygonOutline( const QPolygonF& points, QList<QPoly gonF>* rings, QgsSymbolV2RenderContext& context ); | |||
virtual void setWidth( double width ) { mWidth = width; } | virtual void setWidth( double width ) { mWidth = width; } | |||
virtual double width() const { return mWidth; } | virtual double width() const { return mWidth; } | |||
void setWidthUnit( QgsSymbolV2::OutputUnit unit ) { mWidthUnit = unit; } | void setWidthUnit( QgsSymbolV2::OutputUnit unit ) { mWidthUnit = unit; } | |||
QgsSymbolV2::OutputUnit widthUnit() const { return mWidthUnit; } | QgsSymbolV2::OutputUnit widthUnit() const { return mWidthUnit; } | |||
void drawPreviewIcon( QgsSymbolV2RenderContext& context, QSize size ); | void drawPreviewIcon( QgsSymbolV2RenderContext& context, QSize size ); | |||
virtual double dxfWidth( const QgsDxfExport& e, const QgsSymbolV2Render | ||||
Context& context ) const; | ||||
protected: | protected: | |||
QgsLineSymbolLayerV2( bool locked = false ); | QgsLineSymbolLayerV2( bool locked = false ); | |||
double mWidth; | double mWidth; | |||
QgsSymbolV2::OutputUnit mWidthUnit; | QgsSymbolV2::OutputUnit mWidthUnit; | |||
}; | }; | |||
class CORE_EXPORT QgsFillSymbolLayerV2 : public QgsSymbolLayerV2 | class CORE_EXPORT QgsFillSymbolLayerV2 : public QgsSymbolLayerV2 | |||
{ | { | |||
public: | public: | |||
virtual void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, QgsSymbolV2RenderContext& context ) = 0; | virtual void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, QgsSymbolV2RenderContext& context ) = 0; | |||
void drawPreviewIcon( QgsSymbolV2RenderContext& context, QSize size ); | void drawPreviewIcon( QgsSymbolV2RenderContext& context, QSize size ); | |||
void setAngle( double angle ) { mAngle = angle; } | void setAngle( double angle ) { mAngle = angle; } | |||
double angle() const { return mAngle; } | double angle() const { return mAngle; } | |||
protected: | protected: | |||
QgsFillSymbolLayerV2( bool locked = false ); | QgsFillSymbolLayerV2( bool locked = false ); | |||
/**Default method to render polygon*/ | /**Default method to render polygon*/ | |||
void _renderPolygon( QPainter* p, const QPolygonF& points, const QList< QPolygonF>* rings ); | void _renderPolygon( QPainter* p, const QPolygonF& points, const QList< QPolygonF>* rings, QgsSymbolV2RenderContext& context ); | |||
double mAngle; | double mAngle; | |||
}; | }; | |||
class QgsSymbolLayerV2Widget; // why does SIP fail, when this isn't here | class QgsSymbolLayerV2Widget; // why does SIP fail, when this isn't here | |||
#endif | #endif | |||
End of changes. 12 change blocks. | ||||
6 lines changed or deleted | 102 lines changed or added | |||
qgssymbollayerv2registry.h | qgssymbollayerv2registry.h | |||
---|---|---|---|---|
skipping to change at line 141 | skipping to change at line 141 | |||
//! return a list of available symbol layers for a specified symbol typ e | //! return a list of available symbol layers for a specified symbol typ e | |||
QStringList symbolLayersForType( QgsSymbolV2::SymbolType type ); | QStringList symbolLayersForType( QgsSymbolV2::SymbolType type ); | |||
//! create a new instance of symbol layer for specified symbol type wit h default settings | //! create a new instance of symbol layer for specified symbol type wit h default settings | |||
static QgsSymbolLayerV2* defaultSymbolLayer( QgsSymbolV2::SymbolType ty pe ); | static QgsSymbolLayerV2* defaultSymbolLayer( QgsSymbolV2::SymbolType ty pe ); | |||
protected: | protected: | |||
QgsSymbolLayerV2Registry(); | QgsSymbolLayerV2Registry(); | |||
~QgsSymbolLayerV2Registry(); | ~QgsSymbolLayerV2Registry(); | |||
static QgsSymbolLayerV2Registry* mInstance; | ||||
QMap<QString, QgsSymbolLayerV2AbstractMetadata*> mMetadata; | QMap<QString, QgsSymbolLayerV2AbstractMetadata*> mMetadata; | |||
}; | }; | |||
#endif | #endif | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 0 lines changed or added | |||
qgssymbollayerv2utils.h | qgssymbollayerv2utils.h | |||
---|---|---|---|---|
skipping to change at line 27 | skipping to change at line 27 | |||
#define QGSSYMBOLLAYERV2UTILS_H | #define QGSSYMBOLLAYERV2UTILS_H | |||
#include <QMap> | #include <QMap> | |||
#include <Qt> | #include <Qt> | |||
#include <QtCore> | #include <QtCore> | |||
#include <QFont> | #include <QFont> | |||
#include <QColor> | #include <QColor> | |||
#include "qgssymbolv2.h" | #include "qgssymbolv2.h" | |||
#include "qgis.h" | #include "qgis.h" | |||
class QgsExpression; | ||||
class QgsSymbolLayerV2; | class QgsSymbolLayerV2; | |||
class QgsVectorColorRampV2; | class QgsVectorColorRampV2; | |||
typedef QMap<QString, QString> QgsStringMap; | typedef QMap<QString, QString> QgsStringMap; | |||
typedef QMap<QString, QgsSymbolV2* > QgsSymbolV2Map; | typedef QMap<QString, QgsSymbolV2* > QgsSymbolV2Map; | |||
class QDomDocument; | class QDomDocument; | |||
class QDomElement; | class QDomElement; | |||
class QIcon; | class QIcon; | |||
class QPixmap; | class QPixmap; | |||
skipping to change at line 104 | skipping to change at line 105 | |||
static QIcon symbolPreviewIcon( QgsSymbolV2* symbol, QSize size ); | static QIcon symbolPreviewIcon( QgsSymbolV2* symbol, QSize size ); | |||
static QIcon symbolLayerPreviewIcon( QgsSymbolLayerV2* layer, QgsSymbol V2::OutputUnit u, QSize size ); | static QIcon symbolLayerPreviewIcon( QgsSymbolLayerV2* layer, QgsSymbol V2::OutputUnit u, QSize size ); | |||
static QIcon colorRampPreviewIcon( QgsVectorColorRampV2* ramp, QSize si ze ); | static QIcon colorRampPreviewIcon( QgsVectorColorRampV2* ramp, QSize si ze ); | |||
static void drawStippledBackround( QPainter* painter, QRect rect ); | static void drawStippledBackround( QPainter* painter, QRect rect ); | |||
static QPixmap symbolPreviewPixmap( QgsSymbolV2* symbol, QSize size ); | static QPixmap symbolPreviewPixmap( QgsSymbolV2* symbol, QSize size ); | |||
static QPixmap colorRampPreviewPixmap( QgsVectorColorRampV2* ramp, QSiz e size ); | static QPixmap colorRampPreviewPixmap( QgsVectorColorRampV2* ramp, QSiz e size ); | |||
/**Returns the maximum estimated bleed for the symbol */ | ||||
static double estimateMaxSymbolBleed( QgsSymbolV2* symbol ); | ||||
static QgsSymbolV2* loadSymbol( QDomElement& element ); | static QgsSymbolV2* loadSymbol( QDomElement& element ); | |||
static QgsSymbolLayerV2* loadSymbolLayer( QDomElement& element ); | static QgsSymbolLayerV2* loadSymbolLayer( QDomElement& element ); | |||
static QDomElement saveSymbol( QString symbolName, QgsSymbolV2* symbol, QDomDocument& doc ); | static QDomElement saveSymbol( QString symbolName, QgsSymbolV2* symbol, QDomDocument& doc ); | |||
static bool createSymbolLayerV2ListFromSld( QDomElement& element, QGis: :GeometryType geomType, QgsSymbolLayerV2List &layers ); | static bool createSymbolLayerV2ListFromSld( QDomElement& element, QGis: :GeometryType geomType, QgsSymbolLayerV2List &layers ); | |||
static QgsSymbolLayerV2* createFillLayerFromSld( QDomElement &element ) ; | static QgsSymbolLayerV2* createFillLayerFromSld( QDomElement &element ) ; | |||
static QgsSymbolLayerV2* createLineLayerFromSld( QDomElement &element ) ; | static QgsSymbolLayerV2* createLineLayerFromSld( QDomElement &element ) ; | |||
static QgsSymbolLayerV2* createMarkerLayerFromSld( QDomElement &element ); | static QgsSymbolLayerV2* createMarkerLayerFromSld( QDomElement &element ); | |||
skipping to change at line 148 | skipping to change at line 152 | |||
Qt::PenJoinStyle *penJoinStyle = 0, Qt::PenCap Style *penCapStyle = 0, | Qt::PenJoinStyle *penJoinStyle = 0, Qt::PenCap Style *penCapStyle = 0, | |||
QVector<qreal> *customDashPattern = 0, double *dashOffset = 0 ); | QVector<qreal> *customDashPattern = 0, double *dashOffset = 0 ); | |||
static void externalGraphicToSld( QDomDocument &doc, QDomElement &eleme nt, | static void externalGraphicToSld( QDomDocument &doc, QDomElement &eleme nt, | |||
QString path, QString mime, | QString path, QString mime, | |||
QColor color, double size = -1 ); | QColor color, double size = -1 ); | |||
static bool externalGraphicFromSld( QDomElement &element, | static bool externalGraphicFromSld( QDomElement &element, | |||
QString &path, QString &mime, | QString &path, QString &mime, | |||
QColor &color, double &size ); | QColor &color, double &size ); | |||
/** @deprecated Use wellKnownMarkerToSld( QDomDocument &doc, QDomElemen | ||||
t &element, QString name, QColor color, QColor borderColor, Qt::PenStyle bo | ||||
rderStyle, double borderWidth, double size ) instead */ | ||||
Q_DECL_DEPRECATED static void wellKnownMarkerToSld( QDomDocument &doc, | ||||
QDomElement &element, | ||||
QString name, QColor color, QColor borderColor = QColor(), | ||||
double borderWidth = -1, double size = -1 ); | ||||
static void wellKnownMarkerToSld( QDomDocument &doc, QDomElement &eleme nt, | static void wellKnownMarkerToSld( QDomDocument &doc, QDomElement &eleme nt, | |||
QString name, QColor color, QColor bo rderColor = QColor(), | QString name, QColor color, QColor bo rderColor, Qt::PenStyle borderStyle, | |||
double borderWidth = -1, double size = -1 ); | double borderWidth = -1, double size = -1 ); | |||
/** @deprecated Use wellKnownMarkerFromSld( QDomElement &element, QStri | ||||
ng &name, QColor &color, QColor &borderColor, Qt::PenStyle &borderStyle, do | ||||
uble &borderWidth, double &size ) instead */ | ||||
Q_DECL_DEPRECATED static bool wellKnownMarkerFromSld( QDomElement &elem | ||||
ent, | ||||
QString &name, QColor &color, QColor &borderColor, | ||||
double &borderWidth, double &size ); | ||||
static bool wellKnownMarkerFromSld( QDomElement &element, | static bool wellKnownMarkerFromSld( QDomElement &element, | |||
QString &name, QColor &color, QColo r &borderColor, | QString &name, QColor &color, QColo r &borderColor, Qt::PenStyle &borderStyle, | |||
double &borderWidth, double &size ) ; | double &borderWidth, double &size ) ; | |||
static void externalMarkerToSld( QDomDocument &doc, QDomElement &elemen t, | static void externalMarkerToSld( QDomDocument &doc, QDomElement &elemen t, | |||
QString path, QString format, int *mar kIndex = 0, | QString path, QString format, int *mar kIndex = 0, | |||
QColor color = QColor(), double size = -1 ); | QColor color = QColor(), double size = -1 ); | |||
static bool externalMarkerFromSld( QDomElement &element, | static bool externalMarkerFromSld( QDomElement &element, | |||
QString &path, QString &format, int &markIndex, | QString &path, QString &format, int &markIndex, | |||
QColor &color, double &size ); | QColor &color, double &size ); | |||
static void labelTextToSld( QDomDocument &doc, QDomElement &element, QS tring label, | static void labelTextToSld( QDomDocument &doc, QDomElement &element, QS tring label, | |||
skipping to change at line 239 | skipping to change at line 251 | |||
static void sortVariantList( QList<QVariant>& list, Qt::SortOrder order ); | static void sortVariantList( QList<QVariant>& list, Qt::SortOrder order ); | |||
/**Returns a point on the line from startPoint to directionPoint that i s a certain distance away from the starting point*/ | /**Returns a point on the line from startPoint to directionPoint that i s a certain distance away from the starting point*/ | |||
static QPointF pointOnLineWithDistance( const QPointF& startPoint, cons t QPointF& directionPoint, double distance ); | static QPointF pointOnLineWithDistance( const QPointF& startPoint, cons t QPointF& directionPoint, double distance ); | |||
//! Return a list of all available svg files | //! Return a list of all available svg files | |||
static QStringList listSvgFiles(); | static QStringList listSvgFiles(); | |||
//! Return a list of svg files at the specified directory | //! Return a list of svg files at the specified directory | |||
static QStringList listSvgFilesAt( QString directory ); | static QStringList listSvgFilesAt( QString directory ); | |||
//! Get symbol's path from its name | /** Get symbol's path from its name. | |||
* If the name is not absolute path the file is searched in SVG paths | ||||
specified | ||||
* in settings svg/searchPathsForSVG. | ||||
*/ | ||||
static QString symbolNameToPath( QString name ); | static QString symbolNameToPath( QString name ); | |||
//! Get symbols's name from its path | //! Get symbols's name from its path | |||
static QString symbolPathToName( QString path ); | static QString symbolPathToName( QString path ); | |||
//! Calculate the centroid point of a QPolygonF | ||||
static QPointF polygonCentroid( const QPolygonF& points ); | ||||
/** Return a new valid expression instance for given field or expressio | ||||
n string. | ||||
* If the input is not a valid expression, it is assumed that it is a f | ||||
ield name and gets properly quoted. | ||||
* If the string is empty, returns null pointer. | ||||
* This is useful when accepting input which could be either a non-quot | ||||
ed field name or expression. | ||||
* @note added in 2.2 | ||||
*/ | ||||
static QgsExpression* fieldOrExpressionToExpression( const QString& fie | ||||
ldOrExpression ); | ||||
/** Return a field name if the whole expression is just a name of the f | ||||
ield . | ||||
* Returns full expression string if the expression is more complex th | ||||
an just one field. | ||||
* Using just expression->expression() method may return quoted field | ||||
name, but that is not | ||||
* wanted for saving (due to backward compatibility) or display in GUI | ||||
. | ||||
* @note added in 2.2 | ||||
*/ | ||||
static QString fieldOrExpressionFromExpression( QgsExpression* expressi | ||||
on ); | ||||
}; | }; | |||
class QPolygonF; | class QPolygonF; | |||
//! calculate line shifted by a specified distance | //! calculate line shifted by a specified distance | |||
QPolygonF offsetLine( QPolygonF polyline, double dist ); | QPolygonF offsetLine( QPolygonF polyline, double dist ); | |||
#endif | #endif | |||
End of changes. 8 change blocks. | ||||
3 lines changed or deleted | 53 lines changed or added | |||
qgssymbollayerv2widget.h | qgssymbollayerv2widget.h | |||
---|---|---|---|---|
skipping to change at line 38 | skipping to change at line 38 | |||
public: | public: | |||
QgsSymbolLayerV2Widget( QWidget* parent, const QgsVectorLayer* vl = 0 ) : QWidget( parent ), mVectorLayer( vl ) {} | QgsSymbolLayerV2Widget( QWidget* parent, const QgsVectorLayer* vl = 0 ) : QWidget( parent ), mVectorLayer( vl ) {} | |||
virtual ~QgsSymbolLayerV2Widget() {} | virtual ~QgsSymbolLayerV2Widget() {} | |||
virtual void setSymbolLayer( QgsSymbolLayerV2* layer ) = 0; | virtual void setSymbolLayer( QgsSymbolLayerV2* layer ) = 0; | |||
virtual QgsSymbolLayerV2* symbolLayer() = 0; | virtual QgsSymbolLayerV2* symbolLayer() = 0; | |||
protected: | protected: | |||
const QgsVectorLayer* mVectorLayer; | const QgsVectorLayer* mVectorLayer; | |||
/** Get label for data defined entry. | ||||
* Implemented only for 'size' of marker symbols | ||||
* @added in 2.1 */ | ||||
virtual QString dataDefinedPropertyLabel( const QString &entryName ); | ||||
signals: | signals: | |||
void changed(); | void changed(); | |||
}; | }; | |||
/////////// | /////////// | |||
#include "ui_widget_simpleline.h" | #include "ui_widget_simpleline.h" | |||
class QgsSimpleLineSymbolLayerV2; | class QgsSimpleLineSymbolLayerV2; | |||
skipping to change at line 73 | skipping to change at line 77 | |||
void penWidthChanged(); | void penWidthChanged(); | |||
void colorChanged( const QColor& color ); | void colorChanged( const QColor& color ); | |||
void penStyleChanged(); | void penStyleChanged(); | |||
void offsetChanged(); | void offsetChanged(); | |||
void on_mCustomCheckBox_stateChanged( int state ); | void on_mCustomCheckBox_stateChanged( int state ); | |||
void on_mChangePatternButton_clicked(); | void on_mChangePatternButton_clicked(); | |||
void on_mPenWidthUnitComboBox_currentIndexChanged( int index ); | void on_mPenWidthUnitComboBox_currentIndexChanged( int index ); | |||
void on_mOffsetUnitComboBox_currentIndexChanged( int index ); | void on_mOffsetUnitComboBox_currentIndexChanged( int index ); | |||
void on_mDashPatternUnitComboBox_currentIndexChanged( int index ); | void on_mDashPatternUnitComboBox_currentIndexChanged( int index ); | |||
void on_mDataDefinedPropertiesButton_clicked(); | void on_mDataDefinedPropertiesButton_clicked(); | |||
void on_mDrawInsideCheckBox_stateChanged( int state ); | ||||
protected: | protected: | |||
QgsSimpleLineSymbolLayerV2* mLayer; | QgsSimpleLineSymbolLayerV2* mLayer; | |||
//creates a new icon for the 'change pattern' button | //creates a new icon for the 'change pattern' button | |||
void updatePatternIcon(); | void updatePatternIcon(); | |||
}; | }; | |||
/////////// | /////////// | |||
skipping to change at line 111 | skipping to change at line 116 | |||
void setName(); | void setName(); | |||
void setColorBorder( const QColor& color ); | void setColorBorder( const QColor& color ); | |||
void setColorFill( const QColor& color ); | void setColorFill( const QColor& color ); | |||
void setSize(); | void setSize(); | |||
void setAngle(); | void setAngle(); | |||
void setOffset(); | void setOffset(); | |||
void on_mSizeUnitComboBox_currentIndexChanged( int index ); | void on_mSizeUnitComboBox_currentIndexChanged( int index ); | |||
void on_mOffsetUnitComboBox_currentIndexChanged( int index ); | void on_mOffsetUnitComboBox_currentIndexChanged( int index ); | |||
void on_mOutlineWidthUnitComboBox_currentIndexChanged( int index ); | void on_mOutlineWidthUnitComboBox_currentIndexChanged( int index ); | |||
void on_mDataDefinedPropertiesButton_clicked(); | void on_mDataDefinedPropertiesButton_clicked(); | |||
void on_mOutlineStyleComboBox_currentIndexChanged( int index ); | ||||
void on_mOutlineWidthSpinBox_valueChanged( double d ); | void on_mOutlineWidthSpinBox_valueChanged( double d ); | |||
void on_mHorizontalAnchorComboBox_currentIndexChanged( int index ); | ||||
void on_mVerticalAnchorComboBox_currentIndexChanged( int index ); | ||||
protected: | protected: | |||
QgsSimpleMarkerSymbolLayerV2* mLayer; | QgsSimpleMarkerSymbolLayerV2* mLayer; | |||
}; | }; | |||
/////////// | /////////// | |||
#include "ui_widget_simplefill.h" | #include "ui_widget_simplefill.h" | |||
class QgsSimpleFillSymbolLayerV2; | class QgsSimpleFillSymbolLayerV2; | |||
skipping to change at line 153 | skipping to change at line 161 | |||
void on_mBorderWidthUnitComboBox_currentIndexChanged( int index ); | void on_mBorderWidthUnitComboBox_currentIndexChanged( int index ); | |||
void on_mOffsetUnitComboBox_currentIndexChanged( int index ); | void on_mOffsetUnitComboBox_currentIndexChanged( int index ); | |||
void on_mDataDefinedPropertiesButton_clicked(); | void on_mDataDefinedPropertiesButton_clicked(); | |||
protected: | protected: | |||
QgsSimpleFillSymbolLayerV2* mLayer; | QgsSimpleFillSymbolLayerV2* mLayer; | |||
}; | }; | |||
/////////// | /////////// | |||
#include "ui_widget_gradientfill.h" | ||||
class QgsGradientFillSymbolLayerV2; | ||||
class GUI_EXPORT QgsGradientFillSymbolLayerV2Widget : public QgsSymbolLayer | ||||
V2Widget, private Ui::WidgetGradientFill | ||||
{ | ||||
Q_OBJECT | ||||
public: | ||||
QgsGradientFillSymbolLayerV2Widget( const QgsVectorLayer* vl, QWidget* | ||||
parent = NULL ); | ||||
static QgsSymbolLayerV2Widget* create( const QgsVectorLayer* vl ) { ret | ||||
urn new QgsGradientFillSymbolLayerV2Widget( vl ); } | ||||
// from base class | ||||
virtual void setSymbolLayer( QgsSymbolLayerV2* layer ); | ||||
virtual QgsSymbolLayerV2* symbolLayer(); | ||||
public slots: | ||||
void setColor( const QColor& color ); | ||||
void setColor2( const QColor& color ); | ||||
void applyColorRamp(); | ||||
void setGradientType( int index ); | ||||
void setCoordinateMode( int index ); | ||||
void setGradientSpread( int index ); | ||||
void offsetChanged(); | ||||
void referencePointChanged(); | ||||
void on_mOffsetUnitComboBox_currentIndexChanged( int index ); | ||||
void on_mDataDefinedPropertiesButton_clicked(); | ||||
void colorModeChanged(); | ||||
void on_mSpinAngle_valueChanged( double value ); | ||||
protected: | ||||
QgsGradientFillSymbolLayerV2* mLayer; | ||||
}; | ||||
/////////// | ||||
#include "ui_widget_markerline.h" | #include "ui_widget_markerline.h" | |||
class QgsMarkerLineSymbolLayerV2; | class QgsMarkerLineSymbolLayerV2; | |||
class GUI_EXPORT QgsMarkerLineSymbolLayerV2Widget : public QgsSymbolLayerV2 Widget, private Ui::WidgetMarkerLine | class GUI_EXPORT QgsMarkerLineSymbolLayerV2Widget : public QgsSymbolLayerV2 Widget, private Ui::WidgetMarkerLine | |||
{ | { | |||
Q_OBJECT | Q_OBJECT | |||
public: | public: | |||
QgsMarkerLineSymbolLayerV2Widget( const QgsVectorLayer* vl, QWidget* pa rent = NULL ); | QgsMarkerLineSymbolLayerV2Widget( const QgsVectorLayer* vl, QWidget* pa rent = NULL ); | |||
skipping to change at line 220 | skipping to change at line 265 | |||
void on_mFileToolButton_clicked(); | void on_mFileToolButton_clicked(); | |||
void on_mFileLineEdit_textEdited( const QString& text ); | void on_mFileLineEdit_textEdited( const QString& text ); | |||
void on_mFileLineEdit_editingFinished(); | void on_mFileLineEdit_editingFinished(); | |||
void on_mChangeColorButton_colorChanged( const QColor& color ); | void on_mChangeColorButton_colorChanged( const QColor& color ); | |||
void on_mChangeBorderColorButton_colorChanged( const QColor& color ); | void on_mChangeBorderColorButton_colorChanged( const QColor& color ); | |||
void on_mBorderWidthSpinBox_valueChanged( double d ); | void on_mBorderWidthSpinBox_valueChanged( double d ); | |||
void on_mSizeUnitComboBox_currentIndexChanged( int index ); | void on_mSizeUnitComboBox_currentIndexChanged( int index ); | |||
void on_mBorderWidthUnitComboBox_currentIndexChanged( int index ); | void on_mBorderWidthUnitComboBox_currentIndexChanged( int index ); | |||
void on_mOffsetUnitComboBox_currentIndexChanged( int index ); | void on_mOffsetUnitComboBox_currentIndexChanged( int index ); | |||
void on_mDataDefinedPropertiesButton_clicked(); | void on_mDataDefinedPropertiesButton_clicked(); | |||
void on_mHorizontalAnchorComboBox_currentIndexChanged( int index ); | ||||
void on_mVerticalAnchorComboBox_currentIndexChanged( int index ); | ||||
protected: | protected: | |||
void populateList(); | void populateList(); | |||
//update gui for svg file (insert new path, update activation of gui el ements for svg params) | //update gui for svg file (insert new path, update activation of gui el ements for svg params) | |||
void setGuiForSvg( const QgsSvgMarkerSymbolLayerV2* layer ); | void setGuiForSvg( const QgsSvgMarkerSymbolLayerV2* layer ); | |||
QgsSvgMarkerSymbolLayerV2* mLayer; | QgsSvgMarkerSymbolLayerV2* mLayer; | |||
}; | }; | |||
skipping to change at line 294 | skipping to change at line 341 | |||
virtual void setSymbolLayer( QgsSymbolLayerV2* layer ); | virtual void setSymbolLayer( QgsSymbolLayerV2* layer ); | |||
virtual QgsSymbolLayerV2* symbolLayer(); | virtual QgsSymbolLayerV2* symbolLayer(); | |||
protected: | protected: | |||
QgsLinePatternFillSymbolLayer* mLayer; | QgsLinePatternFillSymbolLayer* mLayer; | |||
private slots: | private slots: | |||
void on_mAngleSpinBox_valueChanged( double d ); | void on_mAngleSpinBox_valueChanged( double d ); | |||
void on_mDistanceSpinBox_valueChanged( double d ); | void on_mDistanceSpinBox_valueChanged( double d ); | |||
void on_mLineWidthSpinBox_valueChanged( double d ); | ||||
void on_mOffsetSpinBox_valueChanged( double d ); | void on_mOffsetSpinBox_valueChanged( double d ); | |||
void on_mColorPushButton_colorChanged( const QColor& color ); | ||||
void on_mDistanceUnitComboBox_currentIndexChanged( int index ); | void on_mDistanceUnitComboBox_currentIndexChanged( int index ); | |||
void on_mLineWidthUnitComboBox_currentIndexChanged( int index ); | ||||
void on_mOffsetUnitComboBox_currentIndexChanged( int index ); | void on_mOffsetUnitComboBox_currentIndexChanged( int index ); | |||
void on_mDataDefinedPropertiesButton_clicked(); | void on_mDataDefinedPropertiesButton_clicked(); | |||
}; | }; | |||
////////// | ////////// | |||
#include "ui_widget_pointpatternfill.h" | #include "ui_widget_pointpatternfill.h" | |||
class QgsPointPatternFillSymbolLayer; | class QgsPointPatternFillSymbolLayer; | |||
skipping to change at line 364 | skipping to change at line 408 | |||
public slots: | public slots: | |||
void setFontFamily( const QFont& font ); | void setFontFamily( const QFont& font ); | |||
void setColor( const QColor& color ); | void setColor( const QColor& color ); | |||
void setSize( double size ); | void setSize( double size ); | |||
void setAngle( double angle ); | void setAngle( double angle ); | |||
void setCharacter( const QChar& chr ); | void setCharacter( const QChar& chr ); | |||
void setOffset(); | void setOffset(); | |||
void on_mSizeUnitComboBox_currentIndexChanged( int index ); | void on_mSizeUnitComboBox_currentIndexChanged( int index ); | |||
void on_mOffsetUnitComboBox_currentIndexChanged( int index ); | void on_mOffsetUnitComboBox_currentIndexChanged( int index ); | |||
void on_mHorizontalAnchorComboBox_currentIndexChanged( int index ); | ||||
void on_mVerticalAnchorComboBox_currentIndexChanged( int index ); | ||||
protected: | protected: | |||
QgsFontMarkerSymbolLayerV2* mLayer; | QgsFontMarkerSymbolLayerV2* mLayer; | |||
CharacterWidget* widgetChar; | CharacterWidget* widgetChar; | |||
}; | }; | |||
////////// | ////////// | |||
#include "ui_widget_centroidfill.h" | #include "ui_widget_centroidfill.h" | |||
End of changes. 10 change blocks. | ||||
3 lines changed or deleted | 52 lines changed or added | |||
qgssymbolv2.h | qgssymbolv2.h | |||
---|---|---|---|---|
skipping to change at line 98 | skipping to change at line 98 | |||
//! append symbol layer at the end of the list | //! append symbol layer at the end of the list | |||
bool appendSymbolLayer( QgsSymbolLayerV2* layer ); | bool appendSymbolLayer( QgsSymbolLayerV2* layer ); | |||
//! delete symbol layer at specified index | //! delete symbol layer at specified index | |||
bool deleteSymbolLayer( int index ); | bool deleteSymbolLayer( int index ); | |||
//! remove symbol layer from the list and return pointer to it | //! remove symbol layer from the list and return pointer to it | |||
QgsSymbolLayerV2* takeSymbolLayer( int index ); | QgsSymbolLayerV2* takeSymbolLayer( int index ); | |||
//! delete layer at specified index and set a new one | //! delete layer at specified index and set a new one | |||
bool changeSymbolLayer( int index, QgsSymbolLayerV2* layer ); | bool changeSymbolLayer( int index, QgsSymbolLayerV2 *layer ); | |||
void startRender( QgsRenderContext& context, const QgsVectorLayer* laye r = 0 ); | void startRender( QgsRenderContext& context, const QgsVectorLayer* laye r = 0 ); | |||
void stopRender( QgsRenderContext& context ); | void stopRender( QgsRenderContext& context ); | |||
void setColor( const QColor& color ); | void setColor( const QColor& color ); | |||
QColor color() const; | QColor color() const; | |||
void drawPreviewIcon( QPainter* painter, QSize size ); | void drawPreviewIcon( QPainter* painter, QSize size ); | |||
QImage bigSymbolPreviewImage(); | QImage bigSymbolPreviewImage(); | |||
skipping to change at line 131 | skipping to change at line 131 | |||
//! Set alpha transparency 1 for opaque, 0 for invisible | //! Set alpha transparency 1 for opaque, 0 for invisible | |||
void setAlpha( qreal alpha ) { mAlpha = alpha; } | void setAlpha( qreal alpha ) { mAlpha = alpha; } | |||
//! @note added in 1.5 | //! @note added in 1.5 | |||
void setRenderHints( int hints ) { mRenderHints = hints; } | void setRenderHints( int hints ) { mRenderHints = hints; } | |||
//! @note added in 1.5 | //! @note added in 1.5 | |||
int renderHints() const { return mRenderHints; } | int renderHints() const { return mRenderHints; } | |||
QSet<QString> usedAttributes() const; | QSet<QString> usedAttributes() const; | |||
void setLayer( const QgsVectorLayer* layer ) { mLayer = layer; } | ||||
const QgsVectorLayer* layer() const { return mLayer; } | ||||
protected: | protected: | |||
QgsSymbolV2( SymbolType type, QgsSymbolLayerV2List layers ); // can't b e instantiated | QgsSymbolV2( SymbolType type, QgsSymbolLayerV2List layers ); // can't b e instantiated | |||
QgsSymbolLayerV2List cloneLayers() const; | QgsSymbolLayerV2List cloneLayers() const; | |||
//! check whether a symbol layer type can be used within the symbol | //! check whether a symbol layer type can be used within the symbol | |||
//! (marker-marker, line-line, fill-fill/line) | //! (marker-marker, line-line, fill-fill/line) | |||
//! @note added in 1.7 | //! @note added in 1.7 | |||
bool isSymbolLayerCompatible( SymbolType t ); | bool isSymbolLayerCompatible( SymbolType t ); | |||
SymbolType mType; | SymbolType mType; | |||
QgsSymbolLayerV2List mLayers; | QgsSymbolLayerV2List mLayers; | |||
/**Symbol opacity (in the range 0 - 1)*/ | /**Symbol opacity (in the range 0 - 1)*/ | |||
qreal mAlpha; | qreal mAlpha; | |||
int mRenderHints; | int mRenderHints; | |||
const QgsVectorLayer* mLayer; //current vectorlayer | ||||
}; | }; | |||
/////////////////////// | /////////////////////// | |||
class CORE_EXPORT QgsSymbolV2RenderContext | class CORE_EXPORT QgsSymbolV2RenderContext | |||
{ | { | |||
public: | public: | |||
QgsSymbolV2RenderContext( QgsRenderContext& c, QgsSymbolV2::OutputUnit u , qreal alpha = 1.0, bool selected = false, int renderHints = 0, const Qg sFeature* f = 0 ); | QgsSymbolV2RenderContext( QgsRenderContext& c, QgsSymbolV2::OutputUnit u , qreal alpha = 1.0, bool selected = false, int renderHints = 0, const Qg sFeature* f = 0 ); | |||
~QgsSymbolV2RenderContext(); | ~QgsSymbolV2RenderContext(); | |||
End of changes. 3 change blocks. | ||||
1 lines changed or deleted | 6 lines changed or added | |||
qgstextdiagram.h | qgstextdiagram.h | |||
---|---|---|---|---|
skipping to change at line 50 | skipping to change at line 50 | |||
}; | }; | |||
enum Orientation | enum Orientation | |||
{ | { | |||
Horizontal = 0, | Horizontal = 0, | |||
Vertical | Vertical | |||
}; | }; | |||
QgsTextDiagram(); | QgsTextDiagram(); | |||
~QgsTextDiagram(); | ~QgsTextDiagram(); | |||
void renderDiagram( const QgsAttributes& att, QgsRenderContext& c, cons t QgsDiagramSettings& s, const QPointF& position ); | void renderDiagram( const QgsFeature& feature, QgsRenderContext& c, con st QgsDiagramSettings& s, const QPointF& position ); | |||
QSizeF diagramSize( const QgsAttributes& attributes, const QgsRenderCon text& c, const QgsDiagramSettings& s ); | QSizeF diagramSize( const QgsAttributes& attributes, const QgsRenderCon text& c, const QgsDiagramSettings& s ); | |||
QSizeF diagramSize( const QgsAttributes& attributes, const QgsRenderCon text& c, const QgsDiagramSettings& s, const QgsDiagramInterpolationSettings & is ); | QSizeF diagramSize( const QgsFeature& feature, const QgsRenderContext& c, const QgsDiagramSettings& s, const QgsDiagramInterpolationSettings& is ) ; | |||
QString diagramName() const { return DIAGRAM_NAME_TEXT; } | QString diagramName() const { return DIAGRAM_NAME_TEXT; } | |||
private: | private: | |||
Orientation mOrientation; | Orientation mOrientation; | |||
Shape mShape; | Shape mShape; | |||
QBrush mBrush; //transparent brush | QBrush mBrush; //transparent brush | |||
QPen mPen; | QPen mPen; | |||
/**Calculates intersection points between a line and an ellipse | /**Calculates intersection points between a line and an ellipse | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
qgsvectorcolorrampv2.h | qgsvectorcolorrampv2.h | |||
---|---|---|---|---|
skipping to change at line 20 | skipping to change at line 20 | |||
* it under the terms of the GNU General Public License as published by * | * it under the terms of the GNU General Public License as published by * | |||
* the Free Software Foundation; either version 2 of the License, or * | * the Free Software Foundation; either version 2 of the License, or * | |||
* (at your option) any later version. * | * (at your option) any later version. * | |||
* * | * * | |||
************************************************************************** */ | ************************************************************************** */ | |||
#ifndef QGSVECTORCOLORRAMPV2_H | #ifndef QGSVECTORCOLORRAMPV2_H | |||
#define QGSVECTORCOLORRAMPV2_H | #define QGSVECTORCOLORRAMPV2_H | |||
#include <QColor> | #include <QColor> | |||
#include <QGradient> | ||||
#include "qgssymbollayerv2.h" // for QgsStringMap | #include "qgssymbollayerv2.h" // for QgsStringMap | |||
#include "qgslogger.h" | #include "qgslogger.h" | |||
class CORE_EXPORT QgsVectorColorRampV2 | class CORE_EXPORT QgsVectorColorRampV2 | |||
{ | { | |||
public: | public: | |||
virtual ~QgsVectorColorRampV2() {} | virtual ~QgsVectorColorRampV2() {} | |||
// Number of defined colors | // Number of defined colors | |||
skipping to change at line 94 | skipping to change at line 95 | |||
bool isDiscrete() const { return mDiscrete; } | bool isDiscrete() const { return mDiscrete; } | |||
void setDiscrete( bool discrete ) { mDiscrete = discrete; } | void setDiscrete( bool discrete ) { mDiscrete = discrete; } | |||
void convertToDiscrete( bool discrete ); | void convertToDiscrete( bool discrete ); | |||
void setStops( const QgsGradientStopsList& stops ) { mStops = stops; } | void setStops( const QgsGradientStopsList& stops ) { mStops = stops; } | |||
const QgsGradientStopsList& stops() const { return mStops; } | const QgsGradientStopsList& stops() const { return mStops; } | |||
QgsStringMap info() const { return mInfo; } | QgsStringMap info() const { return mInfo; } | |||
void setInfo( const QgsStringMap& info ) { mInfo = info; } | void setInfo( const QgsStringMap& info ) { mInfo = info; } | |||
/**copy color ramp stops to a QGradient | ||||
* @note added in 2.1 */ | ||||
void addStopsToGradient( QGradient* gradient ); | ||||
protected: | protected: | |||
QColor mColor1, mColor2; | QColor mColor1, mColor2; | |||
bool mDiscrete; | bool mDiscrete; | |||
QgsGradientStopsList mStops; | QgsGradientStopsList mStops; | |||
QgsStringMap mInfo; | QgsStringMap mInfo; | |||
}; | }; | |||
#define DEFAULT_RANDOM_COUNT 10 | #define DEFAULT_RANDOM_COUNT 10 | |||
#define DEFAULT_RANDOM_HUE_MIN 0 | #define DEFAULT_RANDOM_HUE_MIN 0 | |||
#define DEFAULT_RANDOM_HUE_MAX 359 | #define DEFAULT_RANDOM_HUE_MAX 359 | |||
skipping to change at line 153 | skipping to change at line 158 | |||
void setSatMax( int val ) { mSatMax = val; } | void setSatMax( int val ) { mSatMax = val; } | |||
void setValMin( int val ) { mValMin = val; } | void setValMin( int val ) { mValMin = val; } | |||
void setValMax( int val ) { mValMax = val; } | void setValMax( int val ) { mValMax = val; } | |||
protected: | protected: | |||
int mCount; | int mCount; | |||
int mHueMin, mHueMax, mSatMin, mSatMax, mValMin, mValMax; | int mHueMin, mHueMax, mSatMin, mSatMax, mValMin, mValMax; | |||
QList<QColor> mColors; | QList<QColor> mColors; | |||
}; | }; | |||
class CORE_EXPORT QgsRandomColorsV2: public QgsVectorColorRampV2 | ||||
{ | ||||
public: | ||||
QgsRandomColorsV2(); | ||||
~QgsRandomColorsV2(); | ||||
int count() const; | ||||
double value( int index ) const; | ||||
QColor color( double value ) const; | ||||
QString type() const; | ||||
QgsVectorColorRampV2* clone() const; | ||||
QgsStringMap properties() const; | ||||
}; | ||||
#define DEFAULT_COLORBREWER_SCHEMENAME "Spectral" | #define DEFAULT_COLORBREWER_SCHEMENAME "Spectral" | |||
#define DEFAULT_COLORBREWER_COLORS 5 | #define DEFAULT_COLORBREWER_COLORS 5 | |||
class CORE_EXPORT QgsVectorColorBrewerColorRampV2 : public QgsVectorColorRa mpV2 | class CORE_EXPORT QgsVectorColorBrewerColorRampV2 : public QgsVectorColorRa mpV2 | |||
{ | { | |||
public: | public: | |||
QgsVectorColorBrewerColorRampV2( QString schemeName = DEFAULT_COLORBREW ER_SCHEMENAME, | QgsVectorColorBrewerColorRampV2( QString schemeName = DEFAULT_COLORBREW ER_SCHEMENAME, | |||
int colors = DEFAULT_COLORBREWER_COLOR S ); | int colors = DEFAULT_COLORBREWER_COLOR S ); | |||
static QgsVectorColorRampV2* create( const QgsStringMap& properties = Q gsStringMap() ); | static QgsVectorColorRampV2* create( const QgsStringMap& properties = Q gsStringMap() ); | |||
End of changes. 3 change blocks. | ||||
0 lines changed or deleted | 24 lines changed or added | |||
qgsvectordataprovider.h | qgsvectordataprovider.h | |||
---|---|---|---|---|
skipping to change at line 89 | skipping to change at line 89 | |||
ChangeGeometries = 1 << 8, | ChangeGeometries = 1 << 8, | |||
/** DEPRECATED - do not use */ | /** DEPRECATED - do not use */ | |||
SelectGeometryAtId = 1 << 9, | SelectGeometryAtId = 1 << 9, | |||
/** DEPRECATED - do not use */ | /** DEPRECATED - do not use */ | |||
RandomSelectGeometryAtId = 1 << 10, | RandomSelectGeometryAtId = 1 << 10, | |||
/** DEPRECATED - do not use */ | /** DEPRECATED - do not use */ | |||
SequentialSelectGeometryAtId = 1 << 11, | SequentialSelectGeometryAtId = 1 << 11, | |||
CreateAttributeIndex = 1 << 12, | CreateAttributeIndex = 1 << 12, | |||
/** allows user to select encoding */ | /** allows user to select encoding */ | |||
SelectEncoding = 1 << 13, | SelectEncoding = 1 << 13, | |||
/** supports simplification of geometries on provider side according | ||||
to a distance tolerance */ | ||||
SimplifyGeometries = 1 << 14, | ||||
/** supports topological simplification of geometries on provider sid | ||||
e according to a distance tolerance */ | ||||
SimplifyGeometriesWithTopologicalValidation = 1 << 15, | ||||
}; | }; | |||
/** bitmask of all provider's editing capabilities */ | /** bitmask of all provider's editing capabilities */ | |||
const static int EditingCapabilities = AddFeatures | DeleteFeatures | | const static int EditingCapabilities = AddFeatures | DeleteFeatures | | |||
ChangeAttributeValues | ChangeGe ometries | AddAttributes | DeleteAttributes; | ChangeAttributeValues | ChangeGe ometries | AddAttributes | DeleteAttributes; | |||
/** | /** | |||
* Constructor of the vector provider | * Constructor of the vector provider | |||
* @param uri uniform resource locator (URI) for a dataset | * @param uri uniform resource locator (URI) for a dataset | |||
*/ | */ | |||
skipping to change at line 171 | skipping to change at line 175 | |||
/** | /** | |||
* Return unique values of an attribute | * Return unique values of an attribute | |||
* @param index the index of the attribute | * @param index the index of the attribute | |||
* @param uniqueValues values reference to the list to fill | * @param uniqueValues values reference to the list to fill | |||
* @param limit maxmum number of the values to return (added in 1.4) | * @param limit maxmum number of the values to return (added in 1.4) | |||
* | * | |||
* Default implementation simply iterates the features | * Default implementation simply iterates the features | |||
*/ | */ | |||
virtual void uniqueValues( int index, QList<QVariant> &uniqueValues, in t limit = -1 ); | virtual void uniqueValues( int index, QList<QVariant> &uniqueValues, in t limit = -1 ); | |||
/**Returns the possible enum values of an attribute. Returns an empty s | /** | |||
tringlist if a provider does not support enum types | * Returns the possible enum values of an attribute. Returns an empty s | |||
or if the given attribute is not an enum type. | tringlist if a provider does not support enum types | |||
* or if the given attribute is not an enum type. | ||||
* @param index the index of the attribute | * @param index the index of the attribute | |||
* @param enumList reference to the list to fill | * @param enumList reference to the list to fill | |||
@note: added in version 1.2*/ | * @note: added in version 1.2 | |||
*/ | ||||
virtual void enumValues( int index, QStringList& enumList ) { Q_UNUSED( index ); enumList.clear(); } | virtual void enumValues( int index, QStringList& enumList ) { Q_UNUSED( index ); enumList.clear(); } | |||
/** | /** | |||
* Adds a list of features | * Adds a list of features | |||
* @return true in case of success and false in case of failure | * @return true in case of success and false in case of failure | |||
*/ | */ | |||
virtual bool addFeatures( QgsFeatureList &flist ); | virtual bool addFeatures( QgsFeatureList &flist ); | |||
/** | /** | |||
* Deletes one or more features | * Deletes one or more features | |||
skipping to change at line 263 | skipping to change at line 269 | |||
/** | /** | |||
* Get encoding which is used for accessing data | * Get encoding which is used for accessing data | |||
*/ | */ | |||
QString encoding() const; | QString encoding() const; | |||
/** | /** | |||
* Returns the index of a field name or -1 if the field does not exist | * Returns the index of a field name or -1 if the field does not exist | |||
*/ | */ | |||
int fieldNameIndex( const QString& fieldName ) const; | int fieldNameIndex( const QString& fieldName ) const; | |||
/**Return a map where the key is the name of the field and the value is | /** | |||
its index*/ | * Return a map where the key is the name of the field and the value is | |||
its index | ||||
*/ | ||||
QMap<QString, int> fieldNameMap() const; | QMap<QString, int> fieldNameMap() const; | |||
/** | /** | |||
* Return list of indexes to fetch all attributes in nextFeature() | * Return list of indexes to fetch all attributes in nextFeature() | |||
*/ | */ | |||
virtual QgsAttributeList attributeIndexes(); | virtual QgsAttributeList attributeIndexes(); | |||
/** | /** | |||
* Return list of indexes of fields that make up the primary key | * Return list of indexes of fields that make up the primary key | |||
* @note added in 2.0 | * @note added in 2.0 | |||
skipping to change at line 316 | skipping to change at line 324 | |||
const QList< NativeType > &nativeTypes() const; | const QList< NativeType > &nativeTypes() const; | |||
/** Returns true if the provider is strict about the type of inserted f eatures | /** Returns true if the provider is strict about the type of inserted f eatures | |||
(e.g. no multipolygon in a polygon layer) | (e.g. no multipolygon in a polygon layer) | |||
@note: added in version 1.4*/ | @note: added in version 1.4*/ | |||
virtual bool doesStrictFeatureTypeCheck() const { return true;} | virtual bool doesStrictFeatureTypeCheck() const { return true;} | |||
/** Returns a list of available encodings */ | /** Returns a list of available encodings */ | |||
static const QStringList &availableEncodings(); | static const QStringList &availableEncodings(); | |||
/* provider has errors to report | /** | |||
* Provider has errors to report | ||||
* @note added in 1.7 | * @note added in 1.7 | |||
*/ | */ | |||
bool hasErrors(); | bool hasErrors(); | |||
/* clear recorded errors | /** | |||
* Clear recorded errors | ||||
* @note added in 1.7 | * @note added in 1.7 | |||
*/ | */ | |||
void clearErrors(); | void clearErrors(); | |||
/* get recorded errors | /** | |||
* Get recorded errors | ||||
* @note added in 1.7 | * @note added in 1.7 | |||
*/ | */ | |||
QStringList errors(); | QStringList errors(); | |||
/** | /** | |||
* It returns false by default. | * It returns false by default. | |||
* Must be implemented by providers that support saving and loading sty les to db returning true | * Must be implemented by providers that support saving and loading sty les to db returning true | |||
*/ | */ | |||
virtual bool isSaveAndLoadStyleToDBSupported() { return false; } | virtual bool isSaveAndLoadStyleToDBSupported() { return false; } | |||
skipping to change at line 352 | skipping to change at line 363 | |||
bool mCacheMinMaxDirty; | bool mCacheMinMaxDirty; | |||
QMap<int, QVariant> mCacheMinValues, mCacheMaxValues; | QMap<int, QVariant> mCacheMinValues, mCacheMaxValues; | |||
/** Encoding */ | /** Encoding */ | |||
QTextCodec* mEncoding; | QTextCodec* mEncoding; | |||
/** should provider fetch also features that don't have geometry? */ | /** should provider fetch also features that don't have geometry? */ | |||
bool mFetchFeaturesWithoutGeom; | bool mFetchFeaturesWithoutGeom; | |||
/**True if geometry should be added to the features in nextFeature call s*/ | /** True if geometry should be added to the features in nextFeature cal ls*/ | |||
bool mFetchGeom; | bool mFetchGeom; | |||
/**List of attribute indices to fetch with nextFeature calls*/ | /** List of attribute indices to fetch with nextFeature calls*/ | |||
QgsAttributeList mAttributesToFetch; | QgsAttributeList mAttributesToFetch; | |||
/**The names of the providers native types*/ | /** The names of the providers native types*/ | |||
QList< NativeType > mNativeTypes; | QList< NativeType > mNativeTypes; | |||
void pushError( QString msg ); | void pushError( QString msg ); | |||
/** Old-style mapping of index to name for QgsPalLabeling fix */ | /** Old-style mapping of index to name for QgsPalLabeling fix */ | |||
QgsAttrPalIndexNameHash mAttrPalIndexName; | QgsAttrPalIndexNameHash mAttrPalIndexName; | |||
private: | private: | |||
/** old notation **/ | /** old notation **/ | |||
QMap<QString, QVariant::Type> mOldTypeList; | QMap<QString, QVariant::Type> mOldTypeList; | |||
// list of errors | /** list of errors */ | |||
QStringList mErrors; | QStringList mErrors; | |||
static QStringList smEncodings; | static QStringList smEncodings; | |||
}; | }; | |||
#endif | #endif | |||
End of changes. 11 change blocks. | ||||
13 lines changed or deleted | 26 lines changed or added | |||
qgsvectorfilewriter.h | qgsvectorfilewriter.h | |||
---|---|---|---|---|
skipping to change at line 44 | skipping to change at line 44 | |||
There are two possibilities how to use this class: | There are two possibilities how to use this class: | |||
1. static call to QgsVectorFileWriter::writeAsShapefile(...) which saves t he whole vector layer | 1. static call to QgsVectorFileWriter::writeAsShapefile(...) which saves t he whole vector layer | |||
2. create an instance of the class and issue calls to addFeature(...) | 2. create an instance of the class and issue calls to addFeature(...) | |||
Currently supports only writing to shapefiles, but shouldn't be a problem to add capability | Currently supports only writing to shapefiles, but shouldn't be a problem to add capability | |||
to support other OGR-writable formats. | to support other OGR-writable formats. | |||
*/ | */ | |||
class CORE_EXPORT QgsVectorFileWriter | class CORE_EXPORT QgsVectorFileWriter | |||
{ | { | |||
public: | public: | |||
enum OptionType | ||||
{ | ||||
Set, | ||||
String, | ||||
Int, | ||||
Hidden | ||||
}; | ||||
class Option | ||||
{ | ||||
public: | ||||
Option( const QString& docString, OptionType type ) | ||||
: docString( docString ) | ||||
, type( type ) {} | ||||
virtual ~Option() {} | ||||
QString docString; | ||||
OptionType type; | ||||
}; | ||||
class SetOption : public Option | ||||
{ | ||||
public: | ||||
SetOption( const QString& docString, QStringList values, const QStr | ||||
ing& defaultValue, bool allowNone = false ) | ||||
: Option( docString, Set ) | ||||
, values( values.toSet() ) | ||||
, defaultValue( defaultValue ) | ||||
, allowNone( allowNone ) | ||||
{} | ||||
QSet<QString> values; | ||||
QString defaultValue; | ||||
bool allowNone; | ||||
}; | ||||
class StringOption: public Option | ||||
{ | ||||
public: | ||||
StringOption( const QString& docString, const QString& defaultValue | ||||
= QString() ) | ||||
: Option( docString, String ) | ||||
, defaultValue( defaultValue ) | ||||
{} | ||||
QString defaultValue; | ||||
}; | ||||
class IntOption: public Option | ||||
{ | ||||
public: | ||||
IntOption( const QString& docString, int defaultValue ) | ||||
: Option( docString, Int ) | ||||
, defaultValue( defaultValue ) | ||||
{} | ||||
int defaultValue; | ||||
}; | ||||
class BoolOption : public SetOption | ||||
{ | ||||
public: | ||||
BoolOption( const QString& docString, bool defaultValue ) | ||||
: SetOption( docString, QStringList() << "YES" << "NO", default | ||||
Value ? "YES" : "NO" ) | ||||
{} | ||||
}; | ||||
class HiddenOption: public Option | ||||
{ | ||||
public: | ||||
HiddenOption( const QString& value ) | ||||
: Option( "", Hidden ) | ||||
, mValue( value ) | ||||
{} | ||||
QString mValue; | ||||
}; | ||||
struct MetaData | ||||
{ | ||||
MetaData() | ||||
{} | ||||
MetaData( QString longName, QString trLongName, QString glob, QString | ||||
ext, QMap<QString, Option*> driverOptions, QMap<QString, Option*> layerOpt | ||||
ions ) | ||||
: longName( longName ) | ||||
, trLongName( trLongName ) | ||||
, glob( glob ) | ||||
, ext( ext ) | ||||
, driverOptions( driverOptions ) | ||||
, layerOptions( layerOptions ) | ||||
{} | ||||
QString longName; | ||||
QString trLongName; | ||||
QString glob; | ||||
QString ext; | ||||
QMap<QString, Option*> driverOptions; | ||||
QMap<QString, Option*> layerOptions; | ||||
}; | ||||
enum WriterError | enum WriterError | |||
{ | { | |||
NoError = 0, | NoError = 0, | |||
ErrDriverNotFound, | ErrDriverNotFound, | |||
ErrCreateDataSource, | ErrCreateDataSource, | |||
ErrCreateLayer, | ErrCreateLayer, | |||
ErrAttributeTypeUnsupported, | ErrAttributeTypeUnsupported, | |||
ErrAttributeCreationFailed, | ErrAttributeCreationFailed, | |||
ErrProjection, // added in 1.5 | ErrProjection, // added in 1.5 | |||
skipping to change at line 97 | skipping to change at line 194 | |||
bool onlySelected = false, | bool onlySelected = false, | |||
QString *errorMessage = 0, | QString *errorMessage = 0, | |||
const QStringList &datasourceOp tions = QStringList(), // added in 1.6 | const QStringList &datasourceOp tions = QStringList(), // added in 1.6 | |||
const QStringList &layerOptions = QStringList(), // added in 1.6 | const QStringList &layerOptions = QStringList(), // added in 1.6 | |||
bool skipAttributeCreation = fa lse, // added in 1.6 | bool skipAttributeCreation = fa lse, // added in 1.6 | |||
QString *newFilename = 0, // ad ded in 1.9 | QString *newFilename = 0, // ad ded in 1.9 | |||
SymbologyExport symbologyExport = NoSymbology, //added in 2.0 | SymbologyExport symbologyExport = NoSymbology, //added in 2.0 | |||
double symbologyScale = 1.0 // added in 2.0 | double symbologyScale = 1.0 // added in 2.0 | |||
); | ); | |||
static WriterError writeAsVectorFormat( QgsVectorLayer* layer, | ||||
const QString& fileName, | ||||
const QString& fileEncoding, | ||||
const QgsCoordinateTransform* c | ||||
t, | ||||
const QString& driverName = "ES | ||||
RI Shapefile", | ||||
bool onlySelected = false, | ||||
QString *errorMessage = 0, | ||||
const QStringList &datasourceOp | ||||
tions = QStringList(), // added in 1.6 | ||||
const QStringList &layerOptions | ||||
= QStringList(), // added in 1.6 | ||||
bool skipAttributeCreation = fa | ||||
lse, // added in 1.6 | ||||
QString *newFilename = 0, // ad | ||||
ded in 1.9 | ||||
SymbologyExport symbologyExport | ||||
= NoSymbology, //added in 2.0 | ||||
double symbologyScale = 1.0 // | ||||
added in 2.0 | ||||
); | ||||
/** create shapefile and initialize it */ | /** create shapefile and initialize it */ | |||
QgsVectorFileWriter( const QString& vectorFileName, | QgsVectorFileWriter( const QString& vectorFileName, | |||
const QString& fileEncoding, | const QString& fileEncoding, | |||
const QgsFields& fields, | const QgsFields& fields, | |||
QGis::WkbType geometryType, | QGis::WkbType geometryType, | |||
const QgsCoordinateReferenceSystem* srs, | const QgsCoordinateReferenceSystem* srs, | |||
const QString& driverName = "ESRI Shapefile", | const QString& driverName = "ESRI Shapefile", | |||
const QStringList &datasourceOptions = QStringList (), // added in 1.6 | const QStringList &datasourceOptions = QStringList (), // added in 1.6 | |||
const QStringList &layerOptions = QStringList(), / / added in 1.6 | const QStringList &layerOptions = QStringList(), / / added in 1.6 | |||
QString *newFilename = 0, // added in 1.9 | QString *newFilename = 0, // added in 1.9 | |||
skipping to change at line 157 | skipping to change at line 269 | |||
* @return bool true if the file was deleted successfully | * @return bool true if the file was deleted successfully | |||
*/ | */ | |||
static bool deleteShapeFile( QString theFileName ); | static bool deleteShapeFile( QString theFileName ); | |||
SymbologyExport symbologyExport() const { return mSymbologyExport; } | SymbologyExport symbologyExport() const { return mSymbologyExport; } | |||
void setSymbologyExport( SymbologyExport symExport ) { mSymbologyExport = symExport; } | void setSymbologyExport( SymbologyExport symExport ) { mSymbologyExport = symExport; } | |||
double symbologyScaleDenominator() const { return mSymbologyScaleDenomi nator; } | double symbologyScaleDenominator() const { return mSymbologyScaleDenomi nator; } | |||
void setSymbologyScaleDenominator( double d ) { mSymbologyScaleDenomina tor = d; } | void setSymbologyScaleDenominator( double d ) { mSymbologyScaleDenomina tor = d; } | |||
static bool driverMetadata( const QString& driverName, MetaData& driver | ||||
Metadata ); | ||||
protected: | protected: | |||
//! @note not available in python bindings | //! @note not available in python bindings | |||
OGRGeometryH createEmptyGeometry( QGis::WkbType wkbType ); | OGRGeometryH createEmptyGeometry( QGis::WkbType wkbType ); | |||
OGRDataSourceH mDS; | OGRDataSourceH mDS; | |||
OGRLayerH mLayer; | OGRLayerH mLayer; | |||
OGRGeometryH mGeom; | OGRGeometryH mGeom; | |||
QgsFields mFields; | QgsFields mFields; | |||
skipping to change at line 189 | skipping to change at line 303 | |||
SymbologyExport mSymbologyExport; | SymbologyExport mSymbologyExport; | |||
#if defined(GDAL_VERSION_NUM) && GDAL_VERSION_NUM >= 1700 | #if defined(GDAL_VERSION_NUM) && GDAL_VERSION_NUM >= 1700 | |||
QMap< QgsSymbolLayerV2*, QString > mSymbolLayerTable; | QMap< QgsSymbolLayerV2*, QString > mSymbolLayerTable; | |||
#endif | #endif | |||
/**Scale for symbology export (e.g. for symbols units in map units)*/ | /**Scale for symbology export (e.g. for symbols units in map units)*/ | |||
double mSymbologyScaleDenominator; | double mSymbologyScaleDenominator; | |||
private: | private: | |||
static QMap<QString, MetaData> initMetaData(); | ||||
/** | ||||
* @deprecated | ||||
*/ | ||||
static bool driverMetadata( QString driverName, QString &longName, QStr ing &trLongName, QString &glob, QString &ext ); | static bool driverMetadata( QString driverName, QString &longName, QStr ing &trLongName, QString &glob, QString &ext ); | |||
void createSymbolLayerTable( QgsVectorLayer* vl, const QgsCoordinateTr ansform* ct, OGRDataSourceH ds ); | void createSymbolLayerTable( QgsVectorLayer* vl, const QgsCoordinateTr ansform* ct, OGRDataSourceH ds ); | |||
OGRFeatureH createFeature( QgsFeature& feature ); | OGRFeatureH createFeature( QgsFeature& feature ); | |||
bool writeFeature( OGRLayerH layer, OGRFeatureH feature ); | bool writeFeature( OGRLayerH layer, OGRFeatureH feature ); | |||
/**Writes features considering symbol level order*/ | /**Writes features considering symbol level order*/ | |||
WriterError exportFeaturesSymbolLevels( QgsVectorLayer* layer, QgsFeatu reIterator& fit, const QgsCoordinateTransform* ct, QString* errorMessage = 0 ); | WriterError exportFeaturesSymbolLevels( QgsVectorLayer* layer, QgsFeatu reIterator& fit, const QgsCoordinateTransform* ct, QString* errorMessage = 0 ); | |||
double mmScaleFactor( double scaleDenominator, QgsSymbolV2::OutputUnit symbolUnits, QGis::UnitType mapUnits ); | double mmScaleFactor( double scaleDenominator, QgsSymbolV2::OutputUnit symbolUnits, QGis::UnitType mapUnits ); | |||
double mapUnitScaleFactor( double scaleDenominator, QgsSymbolV2::Output Unit symbolUnits, QGis::UnitType mapUnits ); | double mapUnitScaleFactor( double scaleDenominator, QgsSymbolV2::Output Unit symbolUnits, QGis::UnitType mapUnits ); | |||
QgsRenderContext renderContext() const; | QgsRenderContext renderContext() const; | |||
void startRender( QgsVectorLayer* vl ) const; | void startRender( QgsVectorLayer* vl ) const; | |||
void stopRender( QgsVectorLayer* vl ) const; | void stopRender( QgsVectorLayer* vl ) const; | |||
QgsFeatureRendererV2* symbologyRenderer( QgsVectorLayer* vl ) const; | QgsFeatureRendererV2* symbologyRenderer( QgsVectorLayer* vl ) const; | |||
/**Adds attributes needed for classification*/ | /**Adds attributes needed for classification*/ | |||
void addRendererAttributes( QgsVectorLayer* vl, QgsAttributeList& attLi st ); | void addRendererAttributes( QgsVectorLayer* vl, QgsAttributeList& attLi st ); | |||
static QMap<QString, MetaData> sDriverMetadata; | ||||
}; | }; | |||
#endif | #endif | |||
End of changes. 5 change blocks. | ||||
1 lines changed or deleted | 133 lines changed or added | |||
qgsvectorlayer.h | qgsvectorlayer.h | |||
---|---|---|---|---|
skipping to change at line 30 | skipping to change at line 30 | |||
#include <QMap> | #include <QMap> | |||
#include <QSet> | #include <QSet> | |||
#include <QList> | #include <QList> | |||
#include <QStringList> | #include <QStringList> | |||
#include "qgis.h" | #include "qgis.h" | |||
#include "qgsmaplayer.h" | #include "qgsmaplayer.h" | |||
#include "qgsfeature.h" | #include "qgsfeature.h" | |||
#include "qgsfeatureiterator.h" | #include "qgsfeatureiterator.h" | |||
#include "qgseditorwidgetconfig.h" | ||||
#include "qgsfield.h" | #include "qgsfield.h" | |||
#include "qgssnapper.h" | #include "qgssnapper.h" | |||
#include "qgsfield.h" | #include "qgsfield.h" | |||
#include "qgsrelation.h" | ||||
#include "qgsvectorsimplifymethod.h" | ||||
class QPainter; | class QPainter; | |||
class QImage; | class QImage; | |||
class QgsAttributeAction; | class QgsAttributeAction; | |||
class QgsCoordinateTransform; | class QgsCoordinateTransform; | |||
class QgsEditorWidgetWrapper; | ||||
class QgsFeatureRequest; | class QgsFeatureRequest; | |||
class QgsGeometry; | class QgsGeometry; | |||
class QgsGeometryVertexIndex; | class QgsGeometryVertexIndex; | |||
class QgsMapToPixel; | ||||
class QgsLabel; | class QgsLabel; | |||
class QgsMapToPixel; | ||||
class QgsRectangle; | class QgsRectangle; | |||
class QgsRelation; | ||||
class QgsRelationManager; | ||||
class QgsVectorDataProvider; | class QgsVectorDataProvider; | |||
class QgsSingleSymbolRendererV2; | class QgsSingleSymbolRendererV2; | |||
class QgsRectangle; | class QgsRectangle; | |||
class QgsVectorLayerJoinBuffer; | class QgsVectorLayerJoinBuffer; | |||
class QgsFeatureRendererV2; | class QgsFeatureRendererV2; | |||
class QgsDiagramRendererV2; | class QgsDiagramRendererV2; | |||
class QgsDiagramLayerSettings; | class QgsDiagramLayerSettings; | |||
class QgsGeometryCache; | class QgsGeometryCache; | |||
class QgsVectorLayerEditBuffer; | class QgsVectorLayerEditBuffer; | |||
class QgsSymbolV2; | class QgsSymbolV2; | |||
class QgsAbstractGeometrySimplifier; | ||||
typedef QList<int> QgsAttributeList; | typedef QList<int> QgsAttributeList; | |||
typedef QSet<int> QgsAttributeIds; | typedef QSet<int> QgsAttributeIds; | |||
/** @note Added in 1.9 */ | /** @note Added in 1.9 */ | |||
class CORE_EXPORT QgsAttributeEditorElement : public QObject | class CORE_EXPORT QgsAttributeEditorElement : public QObject | |||
{ | { | |||
Q_OBJECT | Q_OBJECT | |||
public: | public: | |||
enum AttributeEditorType | enum AttributeEditorType | |||
{ | { | |||
AeTypeContainer, | AeTypeContainer, | |||
AeTypeField, | AeTypeField, | |||
AeTypeRelation, | ||||
AeTypeInvalid | AeTypeInvalid | |||
}; | }; | |||
QgsAttributeEditorElement( AttributeEditorType type, QString name, QObj ect *parent = NULL ) | QgsAttributeEditorElement( AttributeEditorType type, QString name, QObj ect *parent = NULL ) | |||
: QObject( parent ), mType( type ), mName( name ) {} | : QObject( parent ), mType( type ), mName( name ) {} | |||
virtual ~QgsAttributeEditorElement() {} | virtual ~QgsAttributeEditorElement() {} | |||
QString name() const { return mName; } | QString name() const { return mName; } | |||
AttributeEditorType type() const { return mType; } | AttributeEditorType type() const { return mType; } | |||
skipping to change at line 98 | skipping to change at line 106 | |||
class CORE_EXPORT QgsAttributeEditorContainer : public QgsAttributeEditorEl ement | class CORE_EXPORT QgsAttributeEditorContainer : public QgsAttributeEditorEl ement | |||
{ | { | |||
public: | public: | |||
QgsAttributeEditorContainer( QString name, QObject *parent ) | QgsAttributeEditorContainer( QString name, QObject *parent ) | |||
: QgsAttributeEditorElement( AeTypeContainer, name, parent ) {} | : QgsAttributeEditorElement( AeTypeContainer, name, parent ) {} | |||
~QgsAttributeEditorContainer() {} | ~QgsAttributeEditorContainer() {} | |||
virtual QDomElement toDomElement( QDomDocument& doc ) const; | virtual QDomElement toDomElement( QDomDocument& doc ) const; | |||
virtual void addChildElement( QgsAttributeEditorElement *widget ); | virtual void addChildElement( QgsAttributeEditorElement *widget ); | |||
virtual bool isGroupBox() const { return true; } | ||||
QList<QgsAttributeEditorElement*> children() const { return mChildren; } | QList<QgsAttributeEditorElement*> children() const { return mChildren; } | |||
virtual QList<QgsAttributeEditorElement*> findElements( AttributeEditor Type type ) const; | ||||
private: | private: | |||
QList<QgsAttributeEditorElement*> mChildren; | QList<QgsAttributeEditorElement*> mChildren; | |||
}; | }; | |||
/** @note Added in 1.9 */ | /** @note Added in 1.9 */ | |||
class CORE_EXPORT QgsAttributeEditorField : public QgsAttributeEditorElemen t | class CORE_EXPORT QgsAttributeEditorField : public QgsAttributeEditorElemen t | |||
{ | { | |||
public: | public: | |||
QgsAttributeEditorField( QString name , int idx, QObject *parent ) | QgsAttributeEditorField( QString name , int idx, QObject *parent ) | |||
skipping to change at line 120 | skipping to change at line 130 | |||
~QgsAttributeEditorField() {} | ~QgsAttributeEditorField() {} | |||
virtual QDomElement toDomElement( QDomDocument& doc ) const; | virtual QDomElement toDomElement( QDomDocument& doc ) const; | |||
int idx() const { return mIdx; } | int idx() const { return mIdx; } | |||
private: | private: | |||
int mIdx; | int mIdx; | |||
}; | }; | |||
/** @note Added in 2.1 */ | ||||
class CORE_EXPORT QgsAttributeEditorRelation : public QgsAttributeEditorEle | ||||
ment | ||||
{ | ||||
public: | ||||
QgsAttributeEditorRelation( QString name, const QString &relationId, QO | ||||
bject *parent ) | ||||
: QgsAttributeEditorElement( AeTypeRelation, name, parent ) | ||||
, mRelationId( relationId ) {} | ||||
QgsAttributeEditorRelation( QString name, const QgsRelation& relation, | ||||
QObject *parent ) | ||||
: QgsAttributeEditorElement( AeTypeRelation, name, parent ) | ||||
, mRelationId( relation.id() ) | ||||
, mRelation( relation ) {} | ||||
~QgsAttributeEditorRelation() {} | ||||
virtual QDomElement toDomElement( QDomDocument& doc ) const; | ||||
const QgsRelation& relation() const { return mRelation; } | ||||
/** | ||||
* Initializes the relation from the id | ||||
* | ||||
* @param relManager The relation manager to use for the initialization | ||||
* @return true if the relation was found in the relationmanager | ||||
*/ | ||||
bool init( QgsRelationManager *relManager ); | ||||
private: | ||||
QString mRelationId; | ||||
QgsRelation mRelation; | ||||
}; | ||||
/** @note added in 1.7 */ | /** @note added in 1.7 */ | |||
struct CORE_EXPORT QgsVectorJoinInfo | struct CORE_EXPORT QgsVectorJoinInfo | |||
{ | { | |||
/**Join field in the target layer*/ | /**Join field in the target layer*/ | |||
QString targetFieldName; | QString targetFieldName; | |||
/**Source layer*/ | /**Source layer*/ | |||
QString joinLayerId; | QString joinLayerId; | |||
/**Join field in the source layer*/ | /**Join field in the source layer*/ | |||
QString joinFieldName; | QString joinFieldName; | |||
/**True if the join is cached in virtual memory*/ | /**True if the join is cached in virtual memory*/ | |||
skipping to change at line 431 | skipping to change at line 472 | |||
enum EditType | enum EditType | |||
{ | { | |||
LineEdit, | LineEdit, | |||
UniqueValues, | UniqueValues, | |||
UniqueValuesEditable, | UniqueValuesEditable, | |||
ValueMap, | ValueMap, | |||
Classification, | Classification, | |||
EditRange, | EditRange, | |||
SliderRange, | SliderRange, | |||
CheckBox, /**< @note added in 1.4 */ | CheckBox, /**< @note added in 1.4 */ | |||
FileName, | FileName, | |||
Enumeration, | Enumeration, | |||
Immutable, /**< The attribute value should not be changed in the | Immutable, /**< The attribute value should not be changed in the | |||
attribute form */ | attribute form */ | |||
Hidden, /**< The attribute value should not be shown in the at | Hidden, /**< The attribute value should not be shown in the a | |||
tribute form @note added in 1.4 */ | ttribute form @note added in 1.4 */ | |||
TextEdit, /**< multiline edit @note added in 1.4*/ | TextEdit, /**< multiline edit @note added in 1.4*/ | |||
Calendar, /**< calendar widget @note added in 1.5 */ | Calendar, /**< calendar widget @note added in 1.5 */ | |||
DialRange, /**< dial range @note added in 1.5 */ | DialRange, /**< dial range @note added in 1.5 */ | |||
ValueRelation, /**< value map from an table @note added in 1.8 */ | ValueRelation, /**< value map from an table @note added in 1.8 */ | |||
UuidGenerator, /**< uuid generator - readonly and automatically intia | UuidGenerator, /**< uuid generator - readonly and automatically inti | |||
lized @note added in 1.9 */ | alized @note added in 1.9 */ | |||
Photo, /**< phote widget @note added in 1.9 */ | Photo, /**< phote widget @note added in 1.9 */ | |||
WebView, /**< webview widget @note added in 1.9 */ | WebView, /**< webview widget @note added in 1.9 */ | |||
Color, /**< color @note added in 1.9 */ | Color, /**< color @note added in 1.9 */ | |||
EditorWidgetV2, /**< modularized edit widgets @note added in 2.1 */ | ||||
}; | ||||
/** Types of feature form suppression after feature creation | ||||
* @note added in 2.1 */ | ||||
enum FeatureFormSuppress | ||||
{ | ||||
SuppressDefault = 0, // use the application-wide setting | ||||
SuppressOn = 1, | ||||
SuppressOff = 2 | ||||
}; | }; | |||
struct RangeData | struct RangeData | |||
{ | { | |||
RangeData() {} | RangeData() {} | |||
RangeData( QVariant theMin, QVariant theMax, QVariant theStep ) | RangeData( QVariant theMin, QVariant theMax, QVariant theStep ) | |||
: mMin( theMin ), mMax( theMax ), mStep( theStep ) {} | : mMin( theMin ), mMax( theMax ), mStep( theStep ) {} | |||
QVariant mMin; | QVariant mMin; | |||
QVariant mMax; | QVariant mMax; | |||
skipping to change at line 541 | skipping to change at line 592 | |||
/** Returns the primary display field name used in the identify results dialog */ | /** Returns the primary display field name used in the identify results dialog */ | |||
const QString displayField() const; | const QString displayField() const; | |||
/** Set the preview expression, used to create a human readable preview string. | /** Set the preview expression, used to create a human readable preview string. | |||
* Used e.g. in the attribute table feature list. Uses { @link QgsExpr ession }. | * Used e.g. in the attribute table feature list. Uses { @link QgsExpr ession }. | |||
* | * | |||
* @param displayExpression The expression which will be used to previ ew features | * @param displayExpression The expression which will be used to previ ew features | |||
* for this layer | * for this layer | |||
* @note added in 2.0 | * @note added in 2.0 | |||
*/ | */ | |||
void setDisplayExpression( const QString displayExpression ); | void setDisplayExpression( const QString &displayExpression ); | |||
/** | /** | |||
* Get the preview expression, used to create a human readable preview string. | * Get the preview expression, used to create a human readable preview string. | |||
* Uses { @link QgsExpression } | * Uses { @link QgsExpression } | |||
* | * | |||
* @return The expression which will be used to preview features for t his layer | * @return The expression which will be used to preview features for t his layer | |||
* | * | |||
* @note added in 2.0 | * @note added in 2.0 | |||
*/ | */ | |||
const QString displayExpression(); | const QString displayExpression(); | |||
skipping to change at line 622 | skipping to change at line 673 | |||
* @see deselect(QgsFeatureId) | * @see deselect(QgsFeatureId) | |||
*/ | */ | |||
void modifySelection( QgsFeatureIds selectIds, QgsFeatureIds deselectId s ); | void modifySelection( QgsFeatureIds selectIds, QgsFeatureIds deselectId s ); | |||
/** Select not selected features and deselect selected ones */ | /** Select not selected features and deselect selected ones */ | |||
void invertSelection(); | void invertSelection(); | |||
/** Select all the features */ | /** Select all the features */ | |||
void selectAll(); | void selectAll(); | |||
/** Get all feature Ids */ | ||||
QgsFeatureIds allFeatureIds(); | ||||
/** | /** | |||
* Invert selection of features found within the search rectangle (in l ayer's coordinates) | * Invert selection of features found within the search rectangle (in l ayer's coordinates) | |||
* | * | |||
* @param rect The rectangle in which the selection of features will b e inverted | * @param rect The rectangle in which the selection of features will b e inverted | |||
* | * | |||
* @see invertSelection() | * @see invertSelection() | |||
*/ | */ | |||
void invertSelectionInRectangle( QgsRectangle & rect ); | void invertSelectionInRectangle( QgsRectangle & rect ); | |||
/** | /** | |||
skipping to change at line 743 | skipping to change at line 797 | |||
* Will return the named style corresponding to style id provided | * Will return the named style corresponding to style id provided | |||
*/ | */ | |||
virtual QString getStyleFromDatabase( QString styleId, QString &msgErro r ); | virtual QString getStyleFromDatabase( QString styleId, QString &msgErro r ); | |||
/** | /** | |||
* Load a named style from file/local db/datasource db | * Load a named style from file/local db/datasource db | |||
* @param theURI the URI of the style or the URI of the layer | * @param theURI the URI of the style or the URI of the layer | |||
* @param theResultFlag will be set to true if a named style is correct ly loaded | * @param theResultFlag will be set to true if a named style is correct ly loaded | |||
* @param loadFromLocalDb if true forces to load from local db instead of datasource one | * @param loadFromLocalDb if true forces to load from local db instead of datasource one | |||
*/ | */ | |||
virtual QString loadNamedStyle( const QString theURI, bool &theResultFl ag, bool loadFromLocalDb ); | virtual QString loadNamedStyle( const QString &theURI, bool &theResultF lag, bool loadFromLocalDb ); | |||
/** | /** | |||
* Calls loadNamedStyle( theURI, theResultFlag, false ); | * Calls loadNamedStyle( theURI, theResultFlag, false ); | |||
* Retained for backward compatibility | * Retained for backward compatibility | |||
*/ | */ | |||
virtual QString loadNamedStyle( const QString theURI, bool &theResultFl ag ); | virtual QString loadNamedStyle( const QString &theURI, bool &theResultF lag ); | |||
virtual bool applyNamedStyle( QString namedStyle , QString errorMsg ); | virtual bool applyNamedStyle( QString namedStyle , QString errorMsg ); | |||
/** convert a saved attribute editor element into a AttributeEditor str ucture as it's used internally. | /** convert a saved attribute editor element into a AttributeEditor str ucture as it's used internally. | |||
* @param elem the DOM element | * @param elem the DOM element | |||
* @param parent the QObject which will own this object | * @param parent the QObject which will own this object | |||
*/ | */ | |||
QgsAttributeEditorElement* attributeEditorElementFromDomElement( QDomEl ement &elem, QObject* parent ); | QgsAttributeEditorElement* attributeEditorElementFromDomElement( QDomEl ement &elem, QObject* parent ); | |||
/** Read the symbology for the current layer from the Dom node supplied . | /** Read the symbology for the current layer from the Dom node supplied . | |||
skipping to change at line 828 | skipping to change at line 882 | |||
*/ | */ | |||
QgsFeatureIterator getFeatures( const QgsFeatureRequest& request = QgsF eatureRequest() ); | QgsFeatureIterator getFeatures( const QgsFeatureRequest& request = QgsF eatureRequest() ); | |||
/** Adds a feature | /** Adds a feature | |||
@param f feature to add | @param f feature to add | |||
@param alsoUpdateExtent If True, will also go to the effort of e.g. updating the extents. | @param alsoUpdateExtent If True, will also go to the effort of e.g. updating the extents. | |||
@return True in case of success and False in cas e of error | @return True in case of success and False in cas e of error | |||
*/ | */ | |||
bool addFeature( QgsFeature& f, bool alsoUpdateExtent = true ); | bool addFeature( QgsFeature& f, bool alsoUpdateExtent = true ); | |||
/** Updates an existing feature | /** Updates an existing feature. This method needs to query the datasou | |||
@param f feature to update | rce | |||
@return True in case of success and False in cas | on every call. Consider using {@link changeAttributeValue()} or | |||
e of error | {@link changeGeometry()} instead. | |||
@note added in 1.8 | @param f Feature to update | |||
@return True in case of success and False in case of error | ||||
@note Added in 1.8 | ||||
*/ | */ | |||
bool updateFeature( QgsFeature &f ); | bool updateFeature( QgsFeature &f ); | |||
/** Insert a new vertex before the given vertex number, | /** Insert a new vertex before the given vertex number, | |||
* in the given ring, item (first number is index 0), and feature | * in the given ring, item (first number is index 0), and feature | |||
* Not meaningful for Point geometries | * Not meaningful for Point geometries | |||
*/ | */ | |||
bool insertVertex( double x, double y, QgsFeatureId atFeatureId, int be foreVertex ); | bool insertVertex( double x, double y, QgsFeatureId atFeatureId, int be foreVertex ); | |||
/** Moves the vertex at the given position number, | /** Moves the vertex at the given position number, | |||
skipping to change at line 886 | skipping to change at line 942 | |||
7 layer not editable */ | 7 layer not editable */ | |||
int addPart( const QList<QgsPoint>& ring ); | int addPart( const QList<QgsPoint>& ring ); | |||
/**Translates feature by dx, dy | /**Translates feature by dx, dy | |||
@param featureId id of the feature to translate | @param featureId id of the feature to translate | |||
@param dx translation of x-coordinate | @param dx translation of x-coordinate | |||
@param dy translation of y-coordinate | @param dy translation of y-coordinate | |||
@return 0 in case of success*/ | @return 0 in case of success*/ | |||
int translateFeature( QgsFeatureId featureId, double dx, double dy ); | int translateFeature( QgsFeatureId featureId, double dx, double dy ); | |||
/**Splits parts cut by the given line | ||||
* @param splitLine line that splits the layer features | ||||
* @param topologicalEditing true if topological editing is enabled | ||||
* @return | ||||
* 0 in case of success, | ||||
* 4 if there is a selection but no feature split | ||||
*/ | ||||
int splitParts( const QList<QgsPoint>& splitLine, bool topologicalEditi | ||||
ng = false ); | ||||
/**Splits features cut by the given line | /**Splits features cut by the given line | |||
* @param splitLine line that splits the layer features | * @param splitLine line that splits the layer features | |||
* @param topologicalEditing true if topological editing is enabled | * @param topologicalEditing true if topological editing is enabled | |||
* @return | * @return | |||
* 0 in case of success, | * 0 in case of success, | |||
* 4 if there is a selection but no feature split | * 4 if there is a selection but no feature split | |||
*/ | */ | |||
int splitFeatures( const QList<QgsPoint>& splitLine, bool topologicalEd iting = false ); | int splitFeatures( const QList<QgsPoint>& splitLine, bool topologicalEd iting = false ); | |||
/**Changes the specified geometry such that it has no intersections wit h other | /**Changes the specified geometry such that it has no intersections wit h other | |||
* polygon (or multipolygon) geometries in this vector layer | * polygon (or multipolygon) geometries in this vector layer | |||
* @param geom geometry to modify | * @param geom geometry to modify | |||
* @param ignoreFeatures list of feature ids where intersections shoul d be ignored | * @param ignoreFeatures list of feature ids where intersections shoul d be ignored | |||
* @return 0 in case of success | * @return 0 in case of success | |||
* | ||||
* @deprecated since 2.2 - not being used for "avoid intersections" fu | ||||
nctionality anymore | ||||
*/ | */ | |||
int removePolygonIntersections( QgsGeometry* geom, QgsFeatureIds ignore Features = QgsFeatureIds() ); | Q_DECL_DEPRECATED int removePolygonIntersections( QgsGeometry* geom, Qg sFeatureIds ignoreFeatures = QgsFeatureIds() ); | |||
/** Adds topological points for every vertex of the geometry. | /** Adds topological points for every vertex of the geometry. | |||
* @param geom the geometry where each vertex is added to segments of o ther features | * @param geom the geometry where each vertex is added to segments of o ther features | |||
* @note geom is not going to be modified by the function | * @note geom is not going to be modified by the function | |||
* @return 0 in case of success | * @return 0 in case of success | |||
*/ | */ | |||
int addTopologicalPoints( QgsGeometry* geom ); | int addTopologicalPoints( QgsGeometry* geom ); | |||
/** Adds a vertex to segments which intersect point p but don't | /** Adds a vertex to segments which intersect point p but don't | |||
* already have a vertex there. If a feature already has a vertex at po sition p, | * already have a vertex there. If a feature already has a vertex at po sition p, | |||
skipping to change at line 1005 | skipping to change at line 1072 | |||
*/ | */ | |||
bool setReadOnly( bool readonly = true ); | bool setReadOnly( bool readonly = true ); | |||
/** Make layer editable */ | /** Make layer editable */ | |||
bool startEditing(); | bool startEditing(); | |||
/** change feature's geometry | /** change feature's geometry | |||
@note added in version 1.2 */ | @note added in version 1.2 */ | |||
bool changeGeometry( QgsFeatureId fid, QgsGeometry* geom ); | bool changeGeometry( QgsFeatureId fid, QgsGeometry* geom ); | |||
/** changed an attribute value (but does not commit it) */ | /** | |||
bool changeAttributeValue( QgsFeatureId fid, int field, QVariant value, | * Changes an attribute value (but does not commit it) | |||
bool emitSignal = true ); | * | |||
* @deprecated The emitSignal parameter is obsolete and not considered | ||||
at the moment. It will | ||||
* be removed in future releases. Remove it to be prepared | ||||
for the future. (Since 2.1) | ||||
*/ | ||||
Q_DECL_DEPRECATED bool changeAttributeValue( QgsFeatureId fid, int fiel | ||||
d, QVariant value, bool emitSignal ); | ||||
/** | ||||
* Changes an attribute value (but does not commit it) | ||||
* | ||||
* @param fid The feature id of the feature to be changed | ||||
* @param field The index of the field to be updated | ||||
* @param newValue The value which will be assigned to the field | ||||
* @param oldValue The previous value to restore on undo (will otherwis | ||||
e be retrieved) | ||||
* | ||||
* @return true in case of success | ||||
*/ | ||||
bool changeAttributeValue( QgsFeatureId fid, int field, const QVariant | ||||
&newValue, const QVariant &oldValue = QVariant() ); | ||||
/** add an attribute field (but does not commit it) | /** add an attribute field (but does not commit it) | |||
returns true if the field was added | returns true if the field was added | |||
@note added in version 1.2 */ | @note added in version 1.2 */ | |||
bool addAttribute( const QgsField &field ); | bool addAttribute( const QgsField &field ); | |||
/**Sets an alias (a display name) for attributes to display in dialogs | /** | |||
@note added in version 1.2*/ | * Sets an alias (a display name) for attributes to display in dialogs | |||
* @note added in version 1.2 | ||||
*/ | ||||
void addAttributeAlias( int attIndex, QString aliasString ); | void addAttributeAlias( int attIndex, QString aliasString ); | |||
/**Adds a tab (for the attribute editor form) holding groups and fields | /** | |||
@note added in version 1.9*/ | * Adds a tab (for the attribute editor form) holding groups and fields | |||
* @note added in version 2.0 | ||||
*/ | ||||
void addAttributeEditorWidget( QgsAttributeEditorElement* data ); | void addAttributeEditorWidget( QgsAttributeEditorElement* data ); | |||
/**Returns a list of tabs holding groups and fields | /** | |||
@note added in version 1.9*/ | * Get the id for the editor widget used to represent the field at the | |||
given index | ||||
* | ||||
* @param fieldIdx The index of the field | ||||
* | ||||
* @return The id for the editor widget or a NULL string if not applica | ||||
ble | ||||
*/ | ||||
const QString editorWidgetV2( int fieldIdx ); | ||||
/** | ||||
* Get the configuration for the editor widget used to represent the fi | ||||
eld at the given index | ||||
* | ||||
* @param fieldIdx The index of the field | ||||
* | ||||
* @return The id for the editor widget or a NULL string if not configu | ||||
red | ||||
*/ | ||||
const QgsEditorWidgetConfig editorWidgetV2Config( int fieldIdx ); | ||||
/** | ||||
* Returns a list of tabs holding groups and fields | ||||
* @note added in version 2.0 | ||||
*/ | ||||
QList< QgsAttributeEditorElement* > &attributeEditorElements(); | QList< QgsAttributeEditorElement* > &attributeEditorElements(); | |||
/**Clears all the tabs for the attribute editor form | /** | |||
@note added in version 1.9*/ | * Clears all the tabs for the attribute editor form | |||
* @note added in version 2.0 | ||||
*/ | ||||
void clearAttributeEditorWidgets(); | void clearAttributeEditorWidgets(); | |||
/**Returns the alias of an attribute name or an empty string if there i | /** | |||
s no alias | * Returns the alias of an attribute name or an empty string if there i | |||
@note added in version 1.2*/ | s no alias | |||
* @note added in version 1.2 | ||||
*/ | ||||
QString attributeAlias( int attributeIndex ) const; | QString attributeAlias( int attributeIndex ) const; | |||
/**Convenience function that returns the attribute alias if defined or | /** | |||
the field name else | * Convenience function that returns the attribute alias if defined or | |||
@note added in version 1.2*/ | the field name else | |||
* @note added in version 1.2 | ||||
*/ | ||||
QString attributeDisplayName( int attributeIndex ) const; | QString attributeDisplayName( int attributeIndex ) const; | |||
const QMap< QString, QString >& attributeAliases() const { return mAttr ibuteAliasMap; } | const QMap< QString, QString >& attributeAliases() const { return mAttr ibuteAliasMap; } | |||
const QSet<QString>& excludeAttributesWMS() const { return mExcludeAttr ibutesWMS; } | const QSet<QString>& excludeAttributesWMS() const { return mExcludeAttr ibutesWMS; } | |||
void setExcludeAttributesWMS( const QSet<QString>& att ) { mExcludeAttr ibutesWMS = att; } | void setExcludeAttributesWMS( const QSet<QString>& att ) { mExcludeAttr ibutesWMS = att; } | |||
const QSet<QString>& excludeAttributesWFS() const { return mExcludeAttr ibutesWFS; } | const QSet<QString>& excludeAttributesWFS() const { return mExcludeAttr ibutesWFS; } | |||
void setExcludeAttributesWFS( const QSet<QString>& att ) { mExcludeAttr ibutesWFS = att; } | void setExcludeAttributesWFS( const QSet<QString>& att ) { mExcludeAttr ibutesWFS = att; } | |||
skipping to change at line 1097 | skipping to change at line 1211 | |||
/**set edit type*/ | /**set edit type*/ | |||
void setEditType( int idx, EditType edit ); | void setEditType( int idx, EditType edit ); | |||
/** get the active layout for the attribute editor for this layer (adde d in 1.9) */ | /** get the active layout for the attribute editor for this layer (adde d in 1.9) */ | |||
EditorLayout editorLayout(); | EditorLayout editorLayout(); | |||
/** set the active layout for the attribute editor for this layer (adde d in 1.9) */ | /** set the active layout for the attribute editor for this layer (adde d in 1.9) */ | |||
void setEditorLayout( EditorLayout editorLayout ); | void setEditorLayout( EditorLayout editorLayout ); | |||
void setEditorWidgetV2( int attrIdx, const QString& widgetType ); | ||||
void setEditorWidgetV2Config( int attrIdx, const QMap<QString, QVariant | ||||
>& config ); | ||||
/** set string representing 'true' for a checkbox (added in 1.4) */ | /** set string representing 'true' for a checkbox (added in 1.4) */ | |||
void setCheckedState( int idx, QString checked, QString notChecked ); | void setCheckedState( int idx, QString checked, QString notChecked ); | |||
/** return string representing 'true' for a checkbox (added in 1.4) | /** return string representing 'true' for a checkbox (added in 1.4) | |||
* @note not available in python bindings | * @note not available in python bindings | |||
* FIXME: need SIP binding for QPair<QString, QString> | * FIXME: need SIP binding for QPair<QString, QString> | |||
*/ | */ | |||
QPair<QString, QString> checkedState( int idx ); | QPair<QString, QString> checkedState( int idx ); | |||
/** get edit form (added in 1.4) */ | /** get edit form (added in 1.4) */ | |||
QString editForm(); | QString editForm(); | |||
/** set edit form (added in 1.4) */ | /** set edit form (added in 1.4) */ | |||
void setEditForm( QString ui ); | void setEditForm( QString ui ); | |||
/** Type of feature form pop-up suppression after feature creation (ove | ||||
rrides app setting) | ||||
* @note added in 2.1 */ | ||||
QgsVectorLayer::FeatureFormSuppress featureFormSuppress() const { retur | ||||
n mFeatureFormSuppress; } | ||||
/** Set type of feature form pop-up suppression after feature creation | ||||
(overrides app setting) | ||||
* @note added in 2.1 */ | ||||
void setFeatureFormSuppress( QgsVectorLayer::FeatureFormSuppress s ) { | ||||
mFeatureFormSuppress = s; } | ||||
/** get annotation form (added in 1.5)*/ | /** get annotation form (added in 1.5)*/ | |||
QString annotationForm() const { return mAnnotationForm; } | QString annotationForm() const { return mAnnotationForm; } | |||
/** set annotation form for layer (added in 1.5)*/ | /** set annotation form for layer (added in 1.5)*/ | |||
void setAnnotationForm( const QString& ui ); | void setAnnotationForm( const QString& ui ); | |||
/** get python function for edit form initialization (added in 1.4) */ | /** get python function for edit form initialization (added in 1.4) */ | |||
QString editFormInit(); | QString editFormInit(); | |||
/** set python function for edit form initialization (added in 1.4) */ | /** set python function for edit form initialization (added in 1.4) */ | |||
skipping to change at line 1135 | skipping to change at line 1261 | |||
QMap<QString, QVariant> &valueMap( int idx ); | QMap<QString, QVariant> &valueMap( int idx ); | |||
/**access range */ | /**access range */ | |||
RangeData &range( int idx ); | RangeData &range( int idx ); | |||
/**access relations | /**access relations | |||
* @note added in 1.8 | * @note added in 1.8 | |||
**/ | **/ | |||
ValueRelationData &valueRelation( int idx ); | ValueRelationData &valueRelation( int idx ); | |||
/** | ||||
* Get relations, where the foreign key is on this layer | ||||
* | ||||
* @param idx Only get relations, where idx forms part of the foreign k | ||||
ey | ||||
* @return A list of relations | ||||
*/ | ||||
QList<QgsRelation> referencingRelations( int idx ); | ||||
/**access date format | /**access date format | |||
* @note added in 1.9 | * @note added in 1.9 | |||
*/ | */ | |||
QString &dateFormat( int idx ); | QString &dateFormat( int idx ); | |||
/**access widget size for photo and webview widget | /**access widget size for photo and webview widget | |||
* @note added in 1.9 | * @note added in 1.9 | |||
*/ | */ | |||
QSize &widgetSize( int idx ); | QSize &widgetSize( int idx ); | |||
skipping to change at line 1224 | skipping to change at line 1358 | |||
@note added in 1.7*/ | @note added in 1.7*/ | |||
QVariant minimumValue( int index ); | QVariant minimumValue( int index ); | |||
/**Returns maximum value for an attribute column or invalid variant in case of error | /**Returns maximum value for an attribute column or invalid variant in case of error | |||
@note added in 1.7*/ | @note added in 1.7*/ | |||
QVariant maximumValue( int index ); | QVariant maximumValue( int index ); | |||
/* Set the blending mode used for rendering each feature | /* Set the blending mode used for rendering each feature | |||
* @note added in 2.0 | * @note added in 2.0 | |||
*/ | */ | |||
void setFeatureBlendMode( const QPainter::CompositionMode blendMode ); | void setFeatureBlendMode( const QPainter::CompositionMode &blendMode ); | |||
/* Returns the current blending mode for features | /* Returns the current blending mode for features | |||
* @note added in 2.0 | * @note added in 2.0 | |||
*/ | */ | |||
QPainter::CompositionMode featureBlendMode() const; | QPainter::CompositionMode featureBlendMode() const; | |||
/* Set the transparency for the vector layer | /* Set the transparency for the vector layer | |||
* @note added in 2.0 | * @note added in 2.0 | |||
*/ | */ | |||
void setLayerTransparency( int layerTransparency ); | void setLayerTransparency( int layerTransparency ); | |||
/* Returns the current transparency for the vector layer | /* Returns the current transparency for the vector layer | |||
* @note added in 2.0 | * @note added in 2.0 | |||
*/ | */ | |||
int layerTransparency() const; | int layerTransparency() const; | |||
QString metadata(); | ||||
/** @note not available in python bindings */ | ||||
inline QgsGeometryCache* cache() { return mCache; } | ||||
/** Set the simplification settings for fast rendering of features | ||||
* @note added in 2.2 | ||||
*/ | ||||
void setSimplifyMethod( const QgsVectorSimplifyMethod& simplifyMethod ) | ||||
{ mSimplifyMethod = simplifyMethod; } | ||||
/** Returns the simplification settings for fast rendering of features | ||||
* @note added in 2.2 | ||||
*/ | ||||
inline const QgsVectorSimplifyMethod& simplifyMethod() const { return m | ||||
SimplifyMethod; } | ||||
/** Returns whether the VectorLayer can apply the specified simplificat | ||||
ion hint | ||||
* @note Do not use in 3rd party code - may be removed in future versi | ||||
on! | ||||
* @note added in 2.2 | ||||
*/ | ||||
bool simplifyDrawingCanbeApplied( const QgsRenderContext& renderContext | ||||
, QgsVectorSimplifyMethod::SimplifyHint simplifyHint ) const; | ||||
public slots: | public slots: | |||
/** | /** | |||
* Select feature by its ID | * Select feature by its ID | |||
* | * | |||
* @param featureId The id of the feature to select | * @param featureId The id of the feature to select | |||
* | * | |||
* @see select(QgsFeatureIds) | * @see select(QgsFeatureIds) | |||
*/ | */ | |||
void select( const QgsFeatureId &featureId ); | void select( const QgsFeatureId &featureId ); | |||
skipping to change at line 1294 | skipping to change at line 1448 | |||
/** Update the extents for the layer. This is necessary if features are | /** Update the extents for the layer. This is necessary if features are | |||
* added/deleted or the layer has been subsetted. | * added/deleted or the layer has been subsetted. | |||
*/ | */ | |||
virtual void updateExtents(); | virtual void updateExtents(); | |||
/** Check if there is a join with a layer that will be removed | /** Check if there is a join with a layer that will be removed | |||
@note added in 1.7 */ | @note added in 1.7 */ | |||
void checkJoinLayerRemove( QString theLayerId ); | void checkJoinLayerRemove( QString theLayerId ); | |||
QString metadata(); | ||||
/** @note not available in python bindings */ | ||||
inline QgsGeometryCache* cache() { return mCache; } | ||||
/** | /** | |||
* @brief Is called when the cache image is being deleted. Overwrite an d use to clean up. | * @brief Is called when the cache image is being deleted. Overwrite an d use to clean up. | |||
* @note added in 2.0 | * @note added in 2.0 | |||
*/ | */ | |||
virtual void onCacheImageDelete(); | virtual void onCacheImageDelete(); | |||
protected slots: | protected slots: | |||
void invalidateSymbolCountedFlag(); | void invalidateSymbolCountedFlag(); | |||
signals: | signals: | |||
skipping to change at line 1378 | skipping to change at line 1527 | |||
/** Signals emitted after committing changes | /** Signals emitted after committing changes | |||
\note added in v1.6 */ | \note added in v1.6 */ | |||
void committedAttributesDeleted( const QString& layerId, const QgsAttri buteList& deletedAttributes ); | void committedAttributesDeleted( const QString& layerId, const QgsAttri buteList& deletedAttributes ); | |||
void committedAttributesAdded( const QString& layerId, const QList<QgsF ield>& addedAttributes ); | void committedAttributesAdded( const QString& layerId, const QList<QgsF ield>& addedAttributes ); | |||
void committedFeaturesAdded( const QString& layerId, const QgsFeatureLi st& addedFeatures ); | void committedFeaturesAdded( const QString& layerId, const QgsFeatureLi st& addedFeatures ); | |||
void committedFeaturesRemoved( const QString& layerId, const QgsFeature Ids& deletedFeatureIds ); | void committedFeaturesRemoved( const QString& layerId, const QgsFeature Ids& deletedFeatureIds ); | |||
void committedAttributeValuesChanges( const QString& layerId, const Qgs ChangedAttributesMap& changedAttributesValues ); | void committedAttributeValuesChanges( const QString& layerId, const Qgs ChangedAttributesMap& changedAttributesValues ); | |||
void committedGeometriesChanges( const QString& layerId, const QgsGeome tryMap& changedGeometries ); | void committedGeometriesChanges( const QString& layerId, const QgsGeome tryMap& changedGeometries ); | |||
void saveLayerToProject(); | ||||
/** Emitted when the font family defined for labeling layer is not foun d on system | /** Emitted when the font family defined for labeling layer is not foun d on system | |||
* @note added in 1.9 | * @note added in 1.9 | |||
*/ | */ | |||
void labelingFontNotFound( QgsVectorLayer* layer, const QString& fontfa mily ); | void labelingFontNotFound( QgsVectorLayer* layer, const QString& fontfa mily ); | |||
/** Signal emitted on symbology changes, when setRendererV2() is called | ||||
*/ | ||||
void rendererChanged(); | ||||
/** Signal emitted when setFeatureBlendMode() is called */ | ||||
void featureBlendModeChanged( const QPainter::CompositionMode &blendMod | ||||
e ); | ||||
/** Signal emitted when setLayerTransparency() is called */ | ||||
void layerTransparencyChanged( int layerTransparency ); | ||||
/** | ||||
* Signal emitted when a new edit command has been started | ||||
* | ||||
* @param text Description for this edit command | ||||
*/ | ||||
void editCommandStarted( const QString& text ); | ||||
/** | ||||
* Signal emitted, when an edit command successfully ended | ||||
* @note This does not mean it is also committed, only that it is writt | ||||
en | ||||
* to the edit buffer. See {@link beforeCommitChanges()} | ||||
*/ | ||||
void editCommandEnded(); | ||||
/** | ||||
* Signal emitted, whan an edit command is destroyed | ||||
* @note This is not a rollback, it is only related to the current edit | ||||
command. | ||||
* See {@link beforeRollBack()} | ||||
*/ | ||||
void editCommandDestroyed(); | ||||
private slots: | ||||
void onRelationsLoaded(); | ||||
protected: | protected: | |||
/** Set the extent */ | /** Set the extent */ | |||
void setExtent( const QgsRectangle &rect ); | void setExtent( const QgsRectangle &rect ); | |||
private: // Private methods | private: // Private methods | |||
/** vector layers are not copyable */ | /** vector layers are not copyable */ | |||
QgsVectorLayer( const QgsVectorLayer & rhs ); | QgsVectorLayer( const QgsVectorLayer & rhs ); | |||
/** vector layers are not copyable */ | /** vector layers are not copyable */ | |||
skipping to change at line 1437 | skipping to change at line 1621 | |||
/** Stop version 2 renderer and selected renderer (if required) */ | /** Stop version 2 renderer and selected renderer (if required) */ | |||
void stopRendererV2( QgsRenderContext& rendererContext, QgsSingleSymbol RendererV2* selRenderer ); | void stopRendererV2( QgsRenderContext& rendererContext, QgsSingleSymbol RendererV2* selRenderer ); | |||
/**Registers label and diagram layer | /**Registers label and diagram layer | |||
@param rendererContext render context | @param rendererContext render context | |||
@param attributes attributes needed for labeling and diagrams will be added to the list | @param attributes attributes needed for labeling and diagrams will be added to the list | |||
@param labeling out: true if there will be labeling (ng) for this lay er*/ | @param labeling out: true if there will be labeling (ng) for this lay er*/ | |||
void prepareLabelingAndDiagrams( QgsRenderContext& rendererContext, Qgs AttributeList& attributes, bool& labeling ); | void prepareLabelingAndDiagrams( QgsRenderContext& rendererContext, Qgs AttributeList& attributes, bool& labeling ); | |||
/** Read labeling from SLD */ | ||||
void readSldLabeling( const QDomNode& node ); | ||||
private: // Private attributes | private: // Private attributes | |||
/** Update threshold for drawing features as they are read. A value of zero indicates | /** Update threshold for drawing features as they are read. A value of zero indicates | |||
* that no features will be drawn until all have been read | * that no features will be drawn until all have been read | |||
*/ | */ | |||
int mUpdateThreshold; | int mUpdateThreshold; | |||
/** Enables backbuffering for the map window. This improves graphics pe rformance, | /** Enables backbuffering for the map window. This improves graphics pe rformance, | |||
* but the possibility to cancel rendering and incremental feature dra wing will be lost. | * but the possibility to cancel rendering and incremental feature dra wing will be lost. | |||
* | * | |||
skipping to change at line 1499 | skipping to change at line 1686 | |||
/**Map that stores the tab for attributes in the edit form. Key is the tab order and value the tab name*/ | /**Map that stores the tab for attributes in the edit form. Key is the tab order and value the tab name*/ | |||
QList< TabData > mTabs; | QList< TabData > mTabs; | |||
/** Geometry type as defined in enum WkbType (qgis.h) */ | /** Geometry type as defined in enum WkbType (qgis.h) */ | |||
int mWkbType; | int mWkbType; | |||
/** Renderer object which holds the information about how to display th e features */ | /** Renderer object which holds the information about how to display th e features */ | |||
QgsFeatureRendererV2 *mRendererV2; | QgsFeatureRendererV2 *mRendererV2; | |||
/** Simplification object which holds the information about how to simp | ||||
lify the features for fast rendering */ | ||||
QgsVectorSimplifyMethod mSimplifyMethod; | ||||
/** Label */ | /** Label */ | |||
QgsLabel *mLabel; | QgsLabel *mLabel; | |||
/** Display labels */ | /** Display labels */ | |||
bool mLabelOn; | bool mLabelOn; | |||
/** Whether 'labeling font not found' has be shown for this layer (only show once in QgsMessageBar, on first rendering) */ | /** Whether 'labeling font not found' has be shown for this layer (only show once in QgsMessageBar, on first rendering) */ | |||
bool mLabelFontNotFoundNotified; | bool mLabelFontNotFoundNotified; | |||
/** Blend mode for features */ | /** Blend mode for features */ | |||
skipping to change at line 1535 | skipping to change at line 1725 | |||
QMap< QString, EditType > mEditTypes; | QMap< QString, EditType > mEditTypes; | |||
QMap< QString, bool> mFieldEditables; | QMap< QString, bool> mFieldEditables; | |||
QMap< QString, bool> mLabelOnTop; | QMap< QString, bool> mLabelOnTop; | |||
QMap< QString, QMap<QString, QVariant> > mValueMaps; | QMap< QString, QMap<QString, QVariant> > mValueMaps; | |||
QMap< QString, RangeData > mRanges; | QMap< QString, RangeData > mRanges; | |||
QMap< QString, QPair<QString, QString> > mCheckedStates; | QMap< QString, QPair<QString, QString> > mCheckedStates; | |||
QMap< QString, ValueRelationData > mValueRelations; | QMap< QString, ValueRelationData > mValueRelations; | |||
QMap< QString, QString> mDateFormats; | QMap< QString, QString> mDateFormats; | |||
QMap< QString, QSize> mWidgetSize; | QMap< QString, QSize> mWidgetSize; | |||
QMap<int, QString> mEditorWidgetV2Types; | ||||
QMap<int, QMap<QString, QVariant> > mEditorWidgetV2Configs; | ||||
/** Defines the default layout to use for the attribute editor (Drag an d drop, UI File, Generated) */ | /** Defines the default layout to use for the attribute editor (Drag an d drop, UI File, Generated) */ | |||
EditorLayout mEditorLayout; | EditorLayout mEditorLayout; | |||
QString mEditForm, mEditFormInit; | QString mEditForm, mEditFormInit; | |||
/** Type of feature form suppression after feature creation | ||||
* @note added in 2.1 */ | ||||
QgsVectorLayer::FeatureFormSuppress mFeatureFormSuppress; | ||||
//annotation form for this layer | //annotation form for this layer | |||
QString mAnnotationForm; | QString mAnnotationForm; | |||
//! cache for some vector layer data - currently only geometries for fa ster editing | //! cache for some vector layer data - currently only geometries for fa ster editing | |||
QgsGeometryCache* mCache; | QgsGeometryCache* mCache; | |||
//! stores information about uncommitted changes to layer | //! stores information about uncommitted changes to layer | |||
QgsVectorLayerEditBuffer* mEditBuffer; | QgsVectorLayerEditBuffer* mEditBuffer; | |||
friend class QgsVectorLayerEditBuffer; | friend class QgsVectorLayerEditBuffer; | |||
//stores information about joined layers | //stores information about joined layers | |||
QgsVectorLayerJoinBuffer* mJoinBuffer; | QgsVectorLayerJoinBuffer* mJoinBuffer; | |||
//diagram rendering object. 0 if diagram drawing is disabled | //diagram rendering object. 0 if diagram drawing is disabled | |||
QgsDiagramRendererV2* mDiagramRenderer; | QgsDiagramRendererV2* mDiagramRenderer; | |||
//stores infos about diagram placement (placement type, priority, posit ion distance) | //stores infos about diagram placement (placement type, priority, posit ion distance) | |||
QgsDiagramLayerSettings *mDiagramLayerSettings; | QgsDiagramLayerSettings *mDiagramLayerSettings; | |||
bool mValidExtent; | bool mValidExtent; | |||
bool mLazyExtent; | ||||
// Features in renderer classes counted | // Features in renderer classes counted | |||
bool mSymbolFeatureCounted; | bool mSymbolFeatureCounted; | |||
// Feature counts for each renderer symbol | // Feature counts for each renderer symbol | |||
QMap<QgsSymbolV2*, long> mSymbolFeatureCountMap; | QMap<QgsSymbolV2*, long> mSymbolFeatureCountMap; | |||
QgsRenderContext* mCurrentRendererContext; | QgsRenderContext *mCurrentRendererContext; | |||
friend class QgsVectorLayerFeatureIterator; | friend class QgsVectorLayerFeatureIterator; | |||
}; | }; | |||
#endif | #endif | |||
End of changes. 42 change blocks. | ||||
48 lines changed or deleted | 276 lines changed or added | |||
qgsvectorlayercache.h | qgsvectorlayercache.h | |||
---|---|---|---|---|
skipping to change at line 151 | skipping to change at line 151 | |||
/** | /** | |||
* Query this VectorLayerCache for features. | * Query this VectorLayerCache for features. | |||
* If the VectorLayerCache (and moreover any of its indices) is able to satisfy | * If the VectorLayerCache (and moreover any of its indices) is able to satisfy | |||
* the request, the returned {@link QgsFeatureIterator} will iterate ov er cached features. | * the request, the returned {@link QgsFeatureIterator} will iterate ov er cached features. | |||
* If it's not possible to fully satisfy the request from the cache, pa rt or all of the features | * If it's not possible to fully satisfy the request from the cache, pa rt or all of the features | |||
* will be requested from the data provider. | * will be requested from the data provider. | |||
* @param featureRequest The request specifying filter and required da ta. | * @param featureRequest The request specifying filter and required da ta. | |||
* @return An iterator over the requested data. | * @return An iterator over the requested data. | |||
*/ | */ | |||
QgsFeatureIterator getFeatures( const QgsFeatureRequest& featureRequest ); | QgsFeatureIterator getFeatures( const QgsFeatureRequest& featureRequest = QgsFeatureRequest() ); | |||
/** | /** | |||
* Check if a certain feature id is cached. | * Check if a certain feature id is cached. | |||
* @param fid The feature id to look for | * @param fid The feature id to look for | |||
* @return True if this id is in the cache | * @return True if this id is in the cache | |||
*/ | */ | |||
bool isFidCached( const QgsFeatureId fid ); | bool isFidCached( const QgsFeatureId fid ); | |||
/** | /** | |||
* Gets the feature at the given feature id. Considers the changed, add ed, deleted and permanent features | * Gets the feature at the given feature id. Considers the changed, add ed, deleted and permanent features | |||
skipping to change at line 221 | skipping to change at line 221 | |||
bool checkInformationCovered( const QgsFeatureRequest& featureRequest ) ; | bool checkInformationCovered( const QgsFeatureRequest& featureRequest ) ; | |||
signals: | signals: | |||
/** | /** | |||
* When filling the cache, this signal gets emitted periodically to not ify about the progress | * When filling the cache, this signal gets emitted periodically to not ify about the progress | |||
* and to be able to cancel an operation. | * and to be able to cancel an operation. | |||
* | * | |||
* @param i The number of already fetched features | * @param i The number of already fetched features | |||
* @param cancel A reference to a boolean variable. Set to true and th e operation will be canceled. | * @param cancel A reference to a boolean variable. Set to true and th e operation will be canceled. | |||
* | ||||
* @note not available in python bindings | ||||
*/ | */ | |||
void progress( int i, bool& cancel ); | void progress( int i, bool& cancel ); | |||
/** | /** | |||
* When filling the cache, this signal gets emitted once the cache is f ully initialized. | * When filling the cache, this signal gets emitted once the cache is f ully initialized. | |||
*/ | */ | |||
void finished(); | void finished(); | |||
/** | /** | |||
* @brief Is emitted when the cached layer is deleted. Is emitted when the cached layers layerDelete() | * @brief Is emitted when the cached layer is deleted. Is emitted when the cached layers layerDelete() | |||
skipping to change at line 242 | skipping to change at line 244 | |||
* @link layer() @endlink will still return a valid pointer for cleanup purpose. | * @link layer() @endlink will still return a valid pointer for cleanup purpose. | |||
*/ | */ | |||
void cachedLayerDeleted(); | void cachedLayerDeleted(); | |||
/** | /** | |||
* @brief Is emitted when an attribute is changed. Is re-emitted after the layer itself emits this signal. | * @brief Is emitted when an attribute is changed. Is re-emitted after the layer itself emits this signal. | |||
* You should connect to this signal, to be sure, to not get a c ached value if querying the cache. | * You should connect to this signal, to be sure, to not get a c ached value if querying the cache. | |||
*/ | */ | |||
void attributeValueChanged( const QgsFeatureId& fid, const int& field, const QVariant &value ); | void attributeValueChanged( const QgsFeatureId& fid, const int& field, const QVariant &value ); | |||
/** | ||||
* Is emitted, when a new feature has been added to the layer and this | ||||
cache. | ||||
* You should connect to this signal instead of the layers', if you wan | ||||
t to be sure | ||||
* that this cache has updated information for the new feature | ||||
* | ||||
* @param fid The featureid of the changed feature | ||||
*/ | ||||
void featureAdded( QgsFeatureId fid ); | ||||
private slots: | private slots: | |||
void onAttributeValueChanged( QgsFeatureId fid, int field, const QVaria nt& value ); | void onAttributeValueChanged( QgsFeatureId fid, int field, const QVaria nt& value ); | |||
void featureDeleted( QgsFeatureId fid ); | void featureDeleted( QgsFeatureId fid ); | |||
void featureAdded( QgsFeatureId fid ); | void onFeatureAdded( QgsFeatureId fid ); | |||
void attributeAdded( int field ); | void attributeAdded( int field ); | |||
void attributeDeleted( int field ); | void attributeDeleted( int field ); | |||
void geometryChanged( QgsFeatureId fid, QgsGeometry& geom ); | void geometryChanged( QgsFeatureId fid, QgsGeometry& geom ); | |||
void layerDeleted(); | void layerDeleted(); | |||
void updatedFields(); | void updatedFields(); | |||
private: | private: | |||
inline void cacheFeature( QgsFeature& feat ) | inline void cacheFeature( QgsFeature& feat ) | |||
{ | { | |||
End of changes. 4 change blocks. | ||||
2 lines changed or deleted | 15 lines changed or added | |||
qgsvectorlayereditbuffer.h | qgsvectorlayereditbuffer.h | |||
---|---|---|---|---|
skipping to change at line 60 | skipping to change at line 60 | |||
bool addFeatures( QgsFeatureList& features ); | bool addFeatures( QgsFeatureList& features ); | |||
/** delete a feature from the layer (but does not commit it) */ | /** delete a feature from the layer (but does not commit it) */ | |||
bool deleteFeature( QgsFeatureId fid ); | bool deleteFeature( QgsFeatureId fid ); | |||
/** change feature's geometry | /** change feature's geometry | |||
@note added in version 1.2 */ | @note added in version 1.2 */ | |||
bool changeGeometry( QgsFeatureId fid, QgsGeometry* geom ); | bool changeGeometry( QgsFeatureId fid, QgsGeometry* geom ); | |||
/** changed an attribute value (but does not commit it) */ | /** changed an attribute value (but does not commit it) */ | |||
bool changeAttributeValue( QgsFeatureId fid, int field, QVariant value ); | bool changeAttributeValue( QgsFeatureId fid, int field, const QVariant &newValue, const QVariant &oldValue = QVariant() ); | |||
/** add an attribute field (but does not commit it) | /** add an attribute field (but does not commit it) | |||
returns true if the field was added | returns true if the field was added | |||
@note added in version 1.2 */ | @note added in version 1.2 */ | |||
bool addAttribute( const QgsField &field ); | bool addAttribute( const QgsField &field ); | |||
/** delete an attribute field (but does not commit it) */ | /** delete an attribute field (but does not commit it) */ | |||
bool deleteAttribute( int attr ); | bool deleteAttribute( int attr ); | |||
/** | /** | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
qgsvectorlayereditutils.h | qgsvectorlayereditutils.h | |||
---|---|---|---|---|
skipping to change at line 75 | skipping to change at line 75 | |||
6 if selected geometry not found*/ | 6 if selected geometry not found*/ | |||
int addPart( const QList<QgsPoint>& ring, QgsFeatureId featureId ); | int addPart( const QList<QgsPoint>& ring, QgsFeatureId featureId ); | |||
/** Translates feature by dx, dy | /** Translates feature by dx, dy | |||
@param featureId id of the feature to translate | @param featureId id of the feature to translate | |||
@param dx translation of x-coordinate | @param dx translation of x-coordinate | |||
@param dy translation of y-coordinate | @param dy translation of y-coordinate | |||
@return 0 in case of success*/ | @return 0 in case of success*/ | |||
int translateFeature( QgsFeatureId featureId, double dx, double dy ); | int translateFeature( QgsFeatureId featureId, double dx, double dy ); | |||
/** Splits parts cut by the given line | ||||
* @param splitLine line that splits the layer feature parts | ||||
* @param topologicalEditing true if topological editing is enabled | ||||
* @return | ||||
* 0 in case of success, | ||||
* 4 if there is a selection but no feature split | ||||
*/ | ||||
int splitParts( const QList<QgsPoint>& splitLine, bool topologicalEditi | ||||
ng = false ); | ||||
/** Splits features cut by the given line | /** Splits features cut by the given line | |||
* @param splitLine line that splits the layer features | * @param splitLine line that splits the layer features | |||
* @param topologicalEditing true if topological editing is enabled | * @param topologicalEditing true if topological editing is enabled | |||
* @return | * @return | |||
* 0 in case of success, | * 0 in case of success, | |||
* 4 if there is a selection but no feature split | * 4 if there is a selection but no feature split | |||
*/ | */ | |||
int splitFeatures( const QList<QgsPoint>& splitLine, bool topologicalEd iting = false ); | int splitFeatures( const QList<QgsPoint>& splitLine, bool topologicalEd iting = false ); | |||
/** Adds topological points for every vertex of the geometry. | /** Adds topological points for every vertex of the geometry. | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 10 lines changed or added | |||
qgsvectorlayerfeatureiterator.h | qgsvectorlayerfeatureiterator.h | |||
---|---|---|---|---|
skipping to change at line 35 | skipping to change at line 35 | |||
class QgsVectorLayerEditBuffer; | class QgsVectorLayerEditBuffer; | |||
struct QgsVectorJoinInfo; | struct QgsVectorJoinInfo; | |||
class CORE_EXPORT QgsVectorLayerFeatureIterator : public QgsAbstractFeature Iterator | class CORE_EXPORT QgsVectorLayerFeatureIterator : public QgsAbstractFeature Iterator | |||
{ | { | |||
public: | public: | |||
QgsVectorLayerFeatureIterator( QgsVectorLayer* layer, const QgsFeatureR equest& request ); | QgsVectorLayerFeatureIterator( QgsVectorLayer* layer, const QgsFeatureR equest& request ); | |||
~QgsVectorLayerFeatureIterator(); | ~QgsVectorLayerFeatureIterator(); | |||
//! fetch next feature, return true on success | ||||
virtual bool nextFeature( QgsFeature& feature ); | ||||
//! reset the iterator to the starting position | //! reset the iterator to the starting position | |||
virtual bool rewind(); | virtual bool rewind(); | |||
//! end of iterating: free the resources / lock | //! end of iterating: free the resources / lock | |||
virtual bool close(); | virtual bool close(); | |||
protected: | protected: | |||
//! fetch next feature, return true on success | ||||
virtual bool fetchFeature( QgsFeature& feature ); | ||||
//! Overrides default method as we only need to filter features in the | ||||
edit buffer | ||||
//! while for others filtering is left to the provider implementation. | ||||
inline virtual bool nextFeatureFilterExpression( QgsFeature &f ) { retu | ||||
rn fetchFeature( f ); } | ||||
//! Setup the simplification of geometries to fetch using the specified | ||||
simplify method | ||||
virtual bool prepareSimplification( const QgsSimplifyMethod& simplifyMe | ||||
thod ); | ||||
QgsVectorLayer* L; | QgsVectorLayer* L; | |||
QgsFeatureRequest mProviderRequest; | QgsFeatureRequest mProviderRequest; | |||
QgsFeatureIterator mProviderIterator; | QgsFeatureIterator mProviderIterator; | |||
QgsFeatureRequest mChangedFeaturesRequest; | ||||
QgsFeatureIterator mChangedFeaturesIterator; | ||||
#if 0 | #if 0 | |||
// general stuff | // general stuff | |||
bool mFetching; | bool mFetching; | |||
QgsRectangle mFetchRect; | QgsRectangle mFetchRect; | |||
QgsAttributeList mFetchAttributes; | QgsAttributeList mFetchAttributes; | |||
QgsAttributeList mFetchProvAttributes; | QgsAttributeList mFetchProvAttributes; | |||
bool mFetchGeometry; | bool mFetchGeometry; | |||
#endif | #endif | |||
skipping to change at line 70 | skipping to change at line 79 | |||
QSet<QgsFeatureId> mFetchConsidered; | QSet<QgsFeatureId> mFetchConsidered; | |||
QgsGeometryMap::ConstIterator mFetchChangedGeomIt; | QgsGeometryMap::ConstIterator mFetchChangedGeomIt; | |||
QgsFeatureMap::ConstIterator mFetchAddedFeaturesIt; | QgsFeatureMap::ConstIterator mFetchAddedFeaturesIt; | |||
bool mFetchedFid; // when iterating by FID: indicator whether it has be en fetched yet or not | bool mFetchedFid; // when iterating by FID: indicator whether it has be en fetched yet or not | |||
void rewindEditBuffer(); | void rewindEditBuffer(); | |||
void prepareJoins(); | void prepareJoins(); | |||
bool fetchNextAddedFeature( QgsFeature& f ); | bool fetchNextAddedFeature( QgsFeature& f ); | |||
bool fetchNextChangedGeomFeature( QgsFeature& f ); | bool fetchNextChangedGeomFeature( QgsFeature& f ); | |||
bool fetchNextChangedAttributeFeature( QgsFeature& f ); | ||||
void useAddedFeature( const QgsFeature& src, QgsFeature& f ); | void useAddedFeature( const QgsFeature& src, QgsFeature& f ); | |||
void useChangedAttributeFeature( QgsFeatureId fid, const QgsGeometry& g eom, QgsFeature& f ); | void useChangedAttributeFeature( QgsFeatureId fid, const QgsGeometry& g eom, QgsFeature& f ); | |||
bool nextFeatureFid( QgsFeature& f ); | bool nextFeatureFid( QgsFeature& f ); | |||
void addJoinedAttributes( QgsFeature &f ); | void addJoinedAttributes( QgsFeature &f ); | |||
/** Update feature with uncommited attribute updates */ | /** Update feature with uncommited attribute updates */ | |||
void updateChangedAttributes( QgsFeature& f ); | void updateChangedAttributes( QgsFeature& f ); | |||
/** Update feature with uncommited geometry updates */ | /** Update feature with uncommited geometry updates */ | |||
void updateFeatureGeometry( QgsFeature& f ); | void updateFeatureGeometry( QgsFeature& f ); | |||
skipping to change at line 110 | skipping to change at line 120 | |||
QgsFeatureMap mAddedFeatures; | QgsFeatureMap mAddedFeatures; | |||
QgsGeometryMap mChangedGeometries; | QgsGeometryMap mChangedGeometries; | |||
QgsFeatureIds mDeletedFeatureIds; | QgsFeatureIds mDeletedFeatureIds; | |||
QList<QgsField> mAddedAttributes; | QList<QgsField> mAddedAttributes; | |||
QgsChangedAttributesMap mChangedAttributeValues; | QgsChangedAttributesMap mChangedAttributeValues; | |||
QgsAttributeList mDeletedAttributeIds; | QgsAttributeList mDeletedAttributeIds; | |||
/** Informations about joins used in the current select() statement. | /** Informations about joins used in the current select() statement. | |||
Allows faster mapping of attribute ids compared to mVectorJoins */ | Allows faster mapping of attribute ids compared to mVectorJoins */ | |||
QMap<QgsVectorLayer*, FetchJoinInfo> mFetchJoinInfo; | QMap<QgsVectorLayer*, FetchJoinInfo> mFetchJoinInfo; | |||
private: | ||||
//! optional object to locally simplify edited (changed or added) geome | ||||
tries fetched by this feature iterator | ||||
QgsAbstractGeometrySimplifier* mEditGeometrySimplifier; | ||||
//! returns whether the iterator supports simplify geometries on provid | ||||
er side | ||||
virtual bool providerCanSimplify( QgsSimplifyMethod::MethodType methodT | ||||
ype ) const; | ||||
}; | }; | |||
#endif // QGSVECTORLAYERFEATUREITERATOR_H | #endif // QGSVECTORLAYERFEATUREITERATOR_H | |||
End of changes. 5 change blocks. | ||||
3 lines changed or deleted | 27 lines changed or added | |||
qgsvectorlayerundocommand.h | qgsvectorlayerundocommand.h | |||
---|---|---|---|---|
skipping to change at line 34 | skipping to change at line 34 | |||
#include "qgsfield.h" | #include "qgsfield.h" | |||
#include "qgsfeature.h" | #include "qgsfeature.h" | |||
class QgsGeometry; | class QgsGeometry; | |||
class QgsGeometryCache; | class QgsGeometryCache; | |||
#include "qgsvectorlayer.h" | #include "qgsvectorlayer.h" | |||
#include "qgsvectorlayereditbuffer.h" | #include "qgsvectorlayereditbuffer.h" | |||
class QgsVectorLayerUndoCommand : public QUndoCommand | class CORE_EXPORT QgsVectorLayerUndoCommand : public QUndoCommand | |||
{ | { | |||
public: | public: | |||
QgsVectorLayerUndoCommand( QgsVectorLayerEditBuffer *buffer ) | QgsVectorLayerUndoCommand( QgsVectorLayerEditBuffer *buffer ) | |||
: QUndoCommand() | : QUndoCommand() | |||
, mBuffer( buffer ) | , mBuffer( buffer ) | |||
{} | {} | |||
inline QgsVectorLayer *layer() { return mBuffer->L; } | inline QgsVectorLayer *layer() { return mBuffer->L; } | |||
inline QgsGeometryCache *cache() { return mBuffer->L->cache(); } | inline QgsGeometryCache *cache() { return mBuffer->L->cache(); } | |||
virtual int id() const { return -1; } | virtual int id() const { return -1; } | |||
virtual bool mergeWith( QUndoCommand * ) { return false; } | virtual bool mergeWith( QUndoCommand * ) { return false; } | |||
protected: | protected: | |||
QgsVectorLayerEditBuffer* mBuffer; | QgsVectorLayerEditBuffer* mBuffer; | |||
}; | }; | |||
class QgsVectorLayerUndoCommandAddFeature : public QgsVectorLayerUndoComman d | class CORE_EXPORT QgsVectorLayerUndoCommandAddFeature : public QgsVectorLay erUndoCommand | |||
{ | { | |||
public: | public: | |||
QgsVectorLayerUndoCommandAddFeature( QgsVectorLayerEditBuffer* buffer, QgsFeature& f ); | QgsVectorLayerUndoCommandAddFeature( QgsVectorLayerEditBuffer* buffer, QgsFeature& f ); | |||
virtual void undo(); | virtual void undo(); | |||
virtual void redo(); | virtual void redo(); | |||
private: | private: | |||
QgsFeature mFeature; | QgsFeature mFeature; | |||
}; | }; | |||
class QgsVectorLayerUndoCommandDeleteFeature : public QgsVectorLayerUndoCom mand | class CORE_EXPORT QgsVectorLayerUndoCommandDeleteFeature : public QgsVector LayerUndoCommand | |||
{ | { | |||
public: | public: | |||
QgsVectorLayerUndoCommandDeleteFeature( QgsVectorLayerEditBuffer* buffe r, QgsFeatureId fid ); | QgsVectorLayerUndoCommandDeleteFeature( QgsVectorLayerEditBuffer* buffe r, QgsFeatureId fid ); | |||
virtual void undo(); | virtual void undo(); | |||
virtual void redo(); | virtual void redo(); | |||
private: | private: | |||
QgsFeatureId mFid; | QgsFeatureId mFid; | |||
QgsFeature mOldAddedFeature; | QgsFeature mOldAddedFeature; | |||
}; | }; | |||
class QgsVectorLayerUndoCommandChangeGeometry : public QgsVectorLayerUndoCo mmand | class CORE_EXPORT QgsVectorLayerUndoCommandChangeGeometry : public QgsVecto rLayerUndoCommand | |||
{ | { | |||
public: | public: | |||
QgsVectorLayerUndoCommandChangeGeometry( QgsVectorLayerEditBuffer* buff er, QgsFeatureId fid, QgsGeometry* newGeom ); | QgsVectorLayerUndoCommandChangeGeometry( QgsVectorLayerEditBuffer* buff er, QgsFeatureId fid, QgsGeometry* newGeom ); | |||
~QgsVectorLayerUndoCommandChangeGeometry(); | ~QgsVectorLayerUndoCommandChangeGeometry(); | |||
virtual void undo(); | virtual void undo(); | |||
virtual void redo(); | virtual void redo(); | |||
virtual int id() const; | virtual int id() const; | |||
virtual bool mergeWith( const QUndoCommand * ); | virtual bool mergeWith( const QUndoCommand * ); | |||
private: | private: | |||
QgsFeatureId mFid; | QgsFeatureId mFid; | |||
QgsGeometry* mOldGeom; | QgsGeometry* mOldGeom; | |||
mutable QgsGeometry* mNewGeom; | mutable QgsGeometry* mNewGeom; | |||
}; | }; | |||
class QgsVectorLayerUndoCommandChangeAttribute : public QgsVectorLayerUndoC ommand | class CORE_EXPORT QgsVectorLayerUndoCommandChangeAttribute : public QgsVect orLayerUndoCommand | |||
{ | { | |||
public: | public: | |||
QgsVectorLayerUndoCommandChangeAttribute( QgsVectorLayerEditBuffer* buf fer, QgsFeatureId fid, int fieldIndex, const QVariant& newValue ); | QgsVectorLayerUndoCommandChangeAttribute( QgsVectorLayerEditBuffer* buf fer, QgsFeatureId fid, int fieldIndex, const QVariant &newValue, const QVar iant &oldValue ); | |||
virtual void undo(); | virtual void undo(); | |||
virtual void redo(); | virtual void redo(); | |||
private: | private: | |||
QgsFeatureId mFid; | QgsFeatureId mFid; | |||
int mFieldIndex; | int mFieldIndex; | |||
QVariant mOldValue; | QVariant mOldValue; | |||
QVariant mNewValue; | QVariant mNewValue; | |||
bool mFirstChange; | bool mFirstChange; | |||
}; | }; | |||
class QgsVectorLayerUndoCommandAddAttribute : public QgsVectorLayerUndoComm and | class CORE_EXPORT QgsVectorLayerUndoCommandAddAttribute : public QgsVectorL ayerUndoCommand | |||
{ | { | |||
public: | public: | |||
QgsVectorLayerUndoCommandAddAttribute( QgsVectorLayerEditBuffer* buffer , const QgsField& field ); | QgsVectorLayerUndoCommandAddAttribute( QgsVectorLayerEditBuffer* buffer , const QgsField& field ); | |||
virtual void undo(); | virtual void undo(); | |||
virtual void redo(); | virtual void redo(); | |||
private: | private: | |||
QgsField mField; | QgsField mField; | |||
int mFieldIndex; | int mFieldIndex; | |||
}; | }; | |||
class QgsVectorLayerUndoCommandDeleteAttribute : public QgsVectorLayerUndoC ommand | class CORE_EXPORT QgsVectorLayerUndoCommandDeleteAttribute : public QgsVect orLayerUndoCommand | |||
{ | { | |||
public: | public: | |||
QgsVectorLayerUndoCommandDeleteAttribute( QgsVectorLayerEditBuffer* buf fer, int fieldIndex ); | QgsVectorLayerUndoCommandDeleteAttribute( QgsVectorLayerEditBuffer* buf fer, int fieldIndex ); | |||
virtual void undo(); | virtual void undo(); | |||
virtual void redo(); | virtual void redo(); | |||
private: | private: | |||
int mFieldIndex; | int mFieldIndex; | |||
bool mProviderField; | bool mProviderField; | |||
End of changes. 8 change blocks. | ||||
8 lines changed or deleted | 8 lines changed or added | |||
ui_qgsexpressionbuilder.h | ui_qgsexpressionbuilder.h | |||
---|---|---|---|---|
skipping to change at line 23 | skipping to change at line 23 | |||
#include <QtGui/QAction> | #include <QtGui/QAction> | |||
#include <QtGui/QApplication> | #include <QtGui/QApplication> | |||
#include <QtGui/QButtonGroup> | #include <QtGui/QButtonGroup> | |||
#include <QtGui/QGridLayout> | #include <QtGui/QGridLayout> | |||
#include <QtGui/QGroupBox> | #include <QtGui/QGroupBox> | |||
#include <QtGui/QHBoxLayout> | #include <QtGui/QHBoxLayout> | |||
#include <QtGui/QHeaderView> | #include <QtGui/QHeaderView> | |||
#include <QtGui/QLabel> | #include <QtGui/QLabel> | |||
#include <QtGui/QListWidget> | #include <QtGui/QListWidget> | |||
#include <QtGui/QPushButton> | #include <QtGui/QPushButton> | |||
#include <QtGui/QSpacerItem> | ||||
#include <QtGui/QSplitter> | ||||
#include <QtGui/QTextEdit> | #include <QtGui/QTextEdit> | |||
#include <QtGui/QTreeView> | #include <QtGui/QTreeView> | |||
#include <QtGui/QVBoxLayout> | #include <QtGui/QVBoxLayout> | |||
#include <QtGui/QWidget> | #include <QtGui/QWidget> | |||
#include "qgscollapsiblegroupbox.h" | ||||
#include "qgsfilterlineedit.h" | #include "qgsfilterlineedit.h" | |||
QT_BEGIN_NAMESPACE | QT_BEGIN_NAMESPACE | |||
class Ui_QgsExpressionBuilderWidgetBase | class Ui_QgsExpressionBuilderWidgetBase | |||
{ | { | |||
public: | public: | |||
QGridLayout *gridLayout; | QGridLayout *gridLayout_2; | |||
QGridLayout *gridLayout_3; | QSplitter *splitter_2; | |||
QSplitter *splitter; | ||||
QGroupBox *moperationListGroup; | QGroupBox *moperationListGroup; | |||
QGridLayout *gridLayout_6; | QGridLayout *gridLayout_6; | |||
QTreeView *expressionTree; | QTreeView *expressionTree; | |||
QgsFilterLineEdit *txtSearchEdit; | QgsFilterLineEdit *txtSearchEdit; | |||
QWidget *layoutWidget; | ||||
QVBoxLayout *verticalLayout_2; | QVBoxLayout *verticalLayout_2; | |||
QGroupBox *mFunctionHelGroup; | QGroupBox *mFunctionHelGroup; | |||
QGridLayout *gridLayout_4; | QGridLayout *gridLayout_4; | |||
QTextEdit *txtHelpText; | QTextEdit *txtHelpText; | |||
QGroupBox *mValueGroupBox; | QGroupBox *mValueGroupBox; | |||
QGridLayout *gridLayout_7; | QGridLayout *gridLayout_7; | |||
QListWidget *mValueListWidget; | QListWidget *mValueListWidget; | |||
QHBoxLayout *horizontalLayout_5; | QWidget *mLoadGroupBox; | |||
QHBoxLayout *horizontalLayout; | ||||
QSpacerItem *horizontalSpacer; | ||||
QLabel *lblLoad; | ||||
QPushButton *btnLoadAll; | QPushButton *btnLoadAll; | |||
QPushButton *btnLoadSample; | QPushButton *btnLoadSample; | |||
QGroupBox *mOperatorsGroupBox; | QWidget *layoutWidget_1; | |||
QVBoxLayout *verticalLayout; | ||||
QgsCollapsibleGroupBox *mOperatorsGroupBox; | ||||
QHBoxLayout *horizontalLayout_2; | QHBoxLayout *horizontalLayout_2; | |||
QPushButton *btnEqualPushButton; | QPushButton *btnEqualPushButton; | |||
QPushButton *btnPlusPushButton; | QPushButton *btnPlusPushButton; | |||
QPushButton *btnMinusPushButton; | QPushButton *btnMinusPushButton; | |||
QPushButton *btnDividePushButton; | QPushButton *btnDividePushButton; | |||
QPushButton *btnMultiplyPushButton; | QPushButton *btnMultiplyPushButton; | |||
QPushButton *btnExpButton; | QPushButton *btnExpButton; | |||
QPushButton *btnConcatButton; | QPushButton *btnConcatButton; | |||
QPushButton *btnOpenBracketPushButton; | QPushButton *btnOpenBracketPushButton; | |||
QPushButton *btnCloseBracketPushButton; | QPushButton *btnCloseBracketPushButton; | |||
QHBoxLayout *horizontalLayout_3; | ||||
QLabel *label_2; | ||||
QLabel *lblPreview; | ||||
QGroupBox *groupBox; | QGroupBox *groupBox; | |||
QGridLayout *gridLayout_2; | QGridLayout *gridLayout; | |||
QTextEdit *txtExpressionString; | QTextEdit *txtExpressionString; | |||
QLabel *label_2; | ||||
QLabel *lblPreview; | ||||
void setupUi(QWidget *QgsExpressionBuilderWidgetBase) | void setupUi(QWidget *QgsExpressionBuilderWidgetBase) | |||
{ | { | |||
if (QgsExpressionBuilderWidgetBase->objectName().isEmpty()) | if (QgsExpressionBuilderWidgetBase->objectName().isEmpty()) | |||
QgsExpressionBuilderWidgetBase->setObjectName(QString::fromUtf8 ("QgsExpressionBuilderWidgetBase")); | QgsExpressionBuilderWidgetBase->setObjectName(QString::fromUtf8 ("QgsExpressionBuilderWidgetBase")); | |||
QgsExpressionBuilderWidgetBase->resize(561, 587); | QgsExpressionBuilderWidgetBase->resize(418, 447); | |||
QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferr ed); | QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferr ed); | |||
sizePolicy.setHorizontalStretch(0); | sizePolicy.setHorizontalStretch(0); | |||
sizePolicy.setVerticalStretch(0); | sizePolicy.setVerticalStretch(0); | |||
sizePolicy.setHeightForWidth(QgsExpressionBuilderWidgetBase->sizePo licy().hasHeightForWidth()); | sizePolicy.setHeightForWidth(QgsExpressionBuilderWidgetBase->sizePo licy().hasHeightForWidth()); | |||
QgsExpressionBuilderWidgetBase->setSizePolicy(sizePolicy); | QgsExpressionBuilderWidgetBase->setSizePolicy(sizePolicy); | |||
gridLayout = new QGridLayout(QgsExpressionBuilderWidgetBase); | gridLayout_2 = new QGridLayout(QgsExpressionBuilderWidgetBase); | |||
gridLayout->setContentsMargins(0, 0, 0, 0); | gridLayout_2->setContentsMargins(0, 0, 0, 0); | |||
gridLayout->setObjectName(QString::fromUtf8("gridLayout")); | gridLayout_2->setObjectName(QString::fromUtf8("gridLayout_2")); | |||
gridLayout->setHorizontalSpacing(0); | splitter_2 = new QSplitter(QgsExpressionBuilderWidgetBase); | |||
gridLayout->setVerticalSpacing(3); | splitter_2->setObjectName(QString::fromUtf8("splitter_2")); | |||
gridLayout_3 = new QGridLayout(); | splitter_2->setOrientation(Qt::Vertical); | |||
gridLayout_3->setSpacing(10); | splitter = new QSplitter(splitter_2); | |||
gridLayout_3->setObjectName(QString::fromUtf8("gridLayout_3")); | splitter->setObjectName(QString::fromUtf8("splitter")); | |||
moperationListGroup = new QGroupBox(QgsExpressionBuilderWidgetBase) | splitter->setOrientation(Qt::Horizontal); | |||
; | moperationListGroup = new QGroupBox(splitter); | |||
moperationListGroup->setObjectName(QString::fromUtf8("moperationLis tGroup")); | moperationListGroup->setObjectName(QString::fromUtf8("moperationLis tGroup")); | |||
moperationListGroup->setFlat(true); | moperationListGroup->setFlat(true); | |||
gridLayout_6 = new QGridLayout(moperationListGroup); | gridLayout_6 = new QGridLayout(moperationListGroup); | |||
gridLayout_6->setSpacing(0); | gridLayout_6->setSpacing(0); | |||
gridLayout_6->setObjectName(QString::fromUtf8("gridLayout_6")); | gridLayout_6->setObjectName(QString::fromUtf8("gridLayout_6")); | |||
gridLayout_6->setContentsMargins(0, -1, 0, 0); | gridLayout_6->setContentsMargins(0, -1, 0, 0); | |||
expressionTree = new QTreeView(moperationListGroup); | expressionTree = new QTreeView(moperationListGroup); | |||
expressionTree->setObjectName(QString::fromUtf8("expressionTree")); | expressionTree->setObjectName(QString::fromUtf8("expressionTree")); | |||
expressionTree->setFrameShape(QFrame::StyledPanel); | expressionTree->setFrameShape(QFrame::StyledPanel); | |||
expressionTree->setFrameShadow(QFrame::Sunken); | expressionTree->setFrameShadow(QFrame::Sunken); | |||
skipping to change at line 111 | skipping to change at line 121 | |||
expressionTree->header()->setVisible(false); | expressionTree->header()->setVisible(false); | |||
gridLayout_6->addWidget(expressionTree, 4, 0, 1, 1); | gridLayout_6->addWidget(expressionTree, 4, 0, 1, 1); | |||
txtSearchEdit = new QgsFilterLineEdit(moperationListGroup); | txtSearchEdit = new QgsFilterLineEdit(moperationListGroup); | |||
txtSearchEdit->setObjectName(QString::fromUtf8("txtSearchEdit")); | txtSearchEdit->setObjectName(QString::fromUtf8("txtSearchEdit")); | |||
txtSearchEdit->setEnabled(true); | txtSearchEdit->setEnabled(true); | |||
gridLayout_6->addWidget(txtSearchEdit, 2, 0, 1, 1); | gridLayout_6->addWidget(txtSearchEdit, 2, 0, 1, 1); | |||
gridLayout_3->addWidget(moperationListGroup, 0, 0, 1, 1); | splitter->addWidget(moperationListGroup); | |||
layoutWidget = new QWidget(splitter); | ||||
verticalLayout_2 = new QVBoxLayout(); | layoutWidget->setObjectName(QString::fromUtf8("layoutWidget")); | |||
verticalLayout_2 = new QVBoxLayout(layoutWidget); | ||||
verticalLayout_2->setSpacing(0); | verticalLayout_2->setSpacing(0); | |||
verticalLayout_2->setObjectName(QString::fromUtf8("verticalLayout_2 ")); | verticalLayout_2->setObjectName(QString::fromUtf8("verticalLayout_2 ")); | |||
verticalLayout_2->setSizeConstraint(QLayout::SetDefaultConstraint); | verticalLayout_2->setSizeConstraint(QLayout::SetDefaultConstraint); | |||
verticalLayout_2->setContentsMargins(-1, 0, 0, 0); | verticalLayout_2->setContentsMargins(0, 0, 0, 0); | |||
mFunctionHelGroup = new QGroupBox(QgsExpressionBuilderWidgetBase); | mFunctionHelGroup = new QGroupBox(layoutWidget); | |||
mFunctionHelGroup->setObjectName(QString::fromUtf8("mFunctionHelGro up")); | mFunctionHelGroup->setObjectName(QString::fromUtf8("mFunctionHelGro up")); | |||
mFunctionHelGroup->setFlat(true); | mFunctionHelGroup->setFlat(true); | |||
gridLayout_4 = new QGridLayout(mFunctionHelGroup); | gridLayout_4 = new QGridLayout(mFunctionHelGroup); | |||
gridLayout_4->setSpacing(0); | gridLayout_4->setSpacing(0); | |||
gridLayout_4->setObjectName(QString::fromUtf8("gridLayout_4")); | gridLayout_4->setObjectName(QString::fromUtf8("gridLayout_4")); | |||
gridLayout_4->setContentsMargins(0, -1, 0, 0); | gridLayout_4->setContentsMargins(0, -1, 0, 0); | |||
txtHelpText = new QTextEdit(mFunctionHelGroup); | txtHelpText = new QTextEdit(mFunctionHelGroup); | |||
txtHelpText->setObjectName(QString::fromUtf8("txtHelpText")); | txtHelpText->setObjectName(QString::fromUtf8("txtHelpText")); | |||
txtHelpText->setReadOnly(true); | txtHelpText->setReadOnly(true); | |||
gridLayout_4->addWidget(txtHelpText, 0, 0, 1, 1); | gridLayout_4->addWidget(txtHelpText, 0, 0, 1, 1); | |||
verticalLayout_2->addWidget(mFunctionHelGroup); | verticalLayout_2->addWidget(mFunctionHelGroup); | |||
mValueGroupBox = new QGroupBox(QgsExpressionBuilderWidgetBase); | mValueGroupBox = new QGroupBox(layoutWidget); | |||
mValueGroupBox->setObjectName(QString::fromUtf8("mValueGroupBox")); | mValueGroupBox->setObjectName(QString::fromUtf8("mValueGroupBox")); | |||
mValueGroupBox->setFlat(true); | mValueGroupBox->setFlat(true); | |||
gridLayout_7 = new QGridLayout(mValueGroupBox); | gridLayout_7 = new QGridLayout(mValueGroupBox); | |||
gridLayout_7->setSpacing(0); | gridLayout_7->setSpacing(0); | |||
gridLayout_7->setObjectName(QString::fromUtf8("gridLayout_7")); | gridLayout_7->setObjectName(QString::fromUtf8("gridLayout_7")); | |||
gridLayout_7->setContentsMargins(0, -1, 0, 0); | gridLayout_7->setContentsMargins(0, -1, 0, 0); | |||
mValueListWidget = new QListWidget(mValueGroupBox); | mValueListWidget = new QListWidget(mValueGroupBox); | |||
mValueListWidget->setObjectName(QString::fromUtf8("mValueListWidget ")); | mValueListWidget->setObjectName(QString::fromUtf8("mValueListWidget ")); | |||
QSizePolicy sizePolicy1(QSizePolicy::Expanding, QSizePolicy::Expand ing); | QSizePolicy sizePolicy1(QSizePolicy::Expanding, QSizePolicy::Expand ing); | |||
sizePolicy1.setHorizontalStretch(0); | sizePolicy1.setHorizontalStretch(0); | |||
skipping to change at line 158 | skipping to change at line 169 | |||
mValueListWidget->setAutoFillBackground(false); | mValueListWidget->setAutoFillBackground(false); | |||
mValueListWidget->setEditTriggers(QAbstractItemView::NoEditTriggers ); | mValueListWidget->setEditTriggers(QAbstractItemView::NoEditTriggers ); | |||
mValueListWidget->setProperty("showDropIndicator", QVariant(false)) ; | mValueListWidget->setProperty("showDropIndicator", QVariant(false)) ; | |||
mValueListWidget->setAlternatingRowColors(true); | mValueListWidget->setAlternatingRowColors(true); | |||
mValueListWidget->setViewMode(QListView::ListMode); | mValueListWidget->setViewMode(QListView::ListMode); | |||
gridLayout_7->addWidget(mValueListWidget, 0, 0, 1, 2); | gridLayout_7->addWidget(mValueListWidget, 0, 0, 1, 2); | |||
verticalLayout_2->addWidget(mValueGroupBox); | verticalLayout_2->addWidget(mValueGroupBox); | |||
horizontalLayout_5 = new QHBoxLayout(); | mLoadGroupBox = new QWidget(layoutWidget); | |||
horizontalLayout_5->setObjectName(QString::fromUtf8("horizontalLayo | mLoadGroupBox->setObjectName(QString::fromUtf8("mLoadGroupBox")); | |||
ut_5")); | horizontalLayout = new QHBoxLayout(mLoadGroupBox); | |||
horizontalLayout_5->setContentsMargins(6, -1, -1, -1); | horizontalLayout->setContentsMargins(0, 0, 0, 0); | |||
btnLoadAll = new QPushButton(QgsExpressionBuilderWidgetBase); | horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout | |||
btnLoadAll->setObjectName(QString::fromUtf8("btnLoadAll")); | ")); | |||
horizontalSpacer = new QSpacerItem(5, 20, QSizePolicy::Expanding, Q | ||||
SizePolicy::Minimum); | ||||
horizontalLayout_5->addWidget(btnLoadAll); | horizontalLayout->addItem(horizontalSpacer); | |||
btnLoadSample = new QPushButton(QgsExpressionBuilderWidgetBase); | lblLoad = new QLabel(mLoadGroupBox); | |||
btnLoadSample->setObjectName(QString::fromUtf8("btnLoadSample")); | lblLoad->setObjectName(QString::fromUtf8("lblLoad")); | |||
horizontalLayout->addWidget(lblLoad); | ||||
horizontalLayout_5->addWidget(btnLoadSample); | btnLoadAll = new QPushButton(mLoadGroupBox); | |||
btnLoadAll->setObjectName(QString::fromUtf8("btnLoadAll")); | ||||
horizontalLayout->addWidget(btnLoadAll); | ||||
verticalLayout_2->addLayout(horizontalLayout_5); | btnLoadSample = new QPushButton(mLoadGroupBox); | |||
btnLoadSample->setObjectName(QString::fromUtf8("btnLoadSample")); | ||||
gridLayout_3->addLayout(verticalLayout_2, 0, 1, 1, 1); | horizontalLayout->addWidget(btnLoadSample); | |||
gridLayout->addLayout(gridLayout_3, 0, 0, 1, 1); | verticalLayout_2->addWidget(mLoadGroupBox); | |||
mOperatorsGroupBox = new QGroupBox(QgsExpressionBuilderWidgetBase); | splitter->addWidget(layoutWidget); | |||
splitter_2->addWidget(splitter); | ||||
layoutWidget_1 = new QWidget(splitter_2); | ||||
layoutWidget_1->setObjectName(QString::fromUtf8("layoutWidget_1")); | ||||
verticalLayout = new QVBoxLayout(layoutWidget_1); | ||||
verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); | ||||
verticalLayout->setContentsMargins(0, 0, 0, 0); | ||||
mOperatorsGroupBox = new QgsCollapsibleGroupBox(layoutWidget_1); | ||||
mOperatorsGroupBox->setObjectName(QString::fromUtf8("mOperatorsGrou pBox")); | mOperatorsGroupBox->setObjectName(QString::fromUtf8("mOperatorsGrou pBox")); | |||
QSizePolicy sizePolicy2(QSizePolicy::Fixed, QSizePolicy::Fixed); | QSizePolicy sizePolicy2(QSizePolicy::Fixed, QSizePolicy::Preferred) ; | |||
sizePolicy2.setHorizontalStretch(0); | sizePolicy2.setHorizontalStretch(0); | |||
sizePolicy2.setVerticalStretch(0); | sizePolicy2.setVerticalStretch(0); | |||
sizePolicy2.setHeightForWidth(mOperatorsGroupBox->sizePolicy().hasH eightForWidth()); | sizePolicy2.setHeightForWidth(mOperatorsGroupBox->sizePolicy().hasH eightForWidth()); | |||
mOperatorsGroupBox->setSizePolicy(sizePolicy2); | mOperatorsGroupBox->setSizePolicy(sizePolicy2); | |||
mOperatorsGroupBox->setMinimumSize(QSize(27, 0)); | mOperatorsGroupBox->setMinimumSize(QSize(27, 0)); | |||
mOperatorsGroupBox->setMaximumSize(QSize(300, 16777215)); | mOperatorsGroupBox->setMaximumSize(QSize(300, 16777215)); | |||
mOperatorsGroupBox->setSizeIncrement(QSize(20, 0)); | mOperatorsGroupBox->setSizeIncrement(QSize(20, 0)); | |||
mOperatorsGroupBox->setBaseSize(QSize(7, 0)); | mOperatorsGroupBox->setBaseSize(QSize(7, 0)); | |||
mOperatorsGroupBox->setLayoutDirection(Qt::LeftToRight); | mOperatorsGroupBox->setLayoutDirection(Qt::LeftToRight); | |||
mOperatorsGroupBox->setAutoFillBackground(false); | mOperatorsGroupBox->setAutoFillBackground(false); | |||
skipping to change at line 252 | skipping to change at line 277 | |||
btnOpenBracketPushButton->setSizePolicy(sizePolicy4); | btnOpenBracketPushButton->setSizePolicy(sizePolicy4); | |||
btnOpenBracketPushButton->setMinimumSize(QSize(0, 10)); | btnOpenBracketPushButton->setMinimumSize(QSize(0, 10)); | |||
horizontalLayout_2->addWidget(btnOpenBracketPushButton); | horizontalLayout_2->addWidget(btnOpenBracketPushButton); | |||
btnCloseBracketPushButton = new QPushButton(mOperatorsGroupBox); | btnCloseBracketPushButton = new QPushButton(mOperatorsGroupBox); | |||
btnCloseBracketPushButton->setObjectName(QString::fromUtf8("btnClos eBracketPushButton")); | btnCloseBracketPushButton->setObjectName(QString::fromUtf8("btnClos eBracketPushButton")); | |||
horizontalLayout_2->addWidget(btnCloseBracketPushButton); | horizontalLayout_2->addWidget(btnCloseBracketPushButton); | |||
gridLayout->addWidget(mOperatorsGroupBox, 1, 0, 1, 1); | verticalLayout->addWidget(mOperatorsGroupBox); | |||
groupBox = new QGroupBox(layoutWidget_1); | ||||
groupBox->setObjectName(QString::fromUtf8("groupBox")); | ||||
sizePolicy1.setHeightForWidth(groupBox->sizePolicy().hasHeightForWi | ||||
dth()); | ||||
groupBox->setSizePolicy(sizePolicy1); | ||||
groupBox->setMinimumSize(QSize(0, 0)); | ||||
groupBox->setMaximumSize(QSize(16777215, 16777215)); | ||||
groupBox->setBaseSize(QSize(0, 0)); | ||||
groupBox->setFlat(true); | ||||
gridLayout = new QGridLayout(groupBox); | ||||
gridLayout->setObjectName(QString::fromUtf8("gridLayout")); | ||||
gridLayout->setContentsMargins(0, 9, 0, 0); | ||||
txtExpressionString = new QTextEdit(groupBox); | ||||
txtExpressionString->setObjectName(QString::fromUtf8("txtExpression | ||||
String")); | ||||
sizePolicy1.setHeightForWidth(txtExpressionString->sizePolicy().has | ||||
HeightForWidth()); | ||||
txtExpressionString->setSizePolicy(sizePolicy1); | ||||
txtExpressionString->setMinimumSize(QSize(0, 32)); | ||||
txtExpressionString->viewport()->setProperty("cursor", QVariant(QCu | ||||
rsor(Qt::IBeamCursor))); | ||||
gridLayout->addWidget(txtExpressionString, 0, 0, 1, 2); | ||||
horizontalLayout_3 = new QHBoxLayout(); | label_2 = new QLabel(groupBox); | |||
horizontalLayout_3->setSpacing(3); | ||||
horizontalLayout_3->setObjectName(QString::fromUtf8("horizontalLayo | ||||
ut_3")); | ||||
horizontalLayout_3->setContentsMargins(-1, 0, -1, -1); | ||||
label_2 = new QLabel(QgsExpressionBuilderWidgetBase); | ||||
label_2->setObjectName(QString::fromUtf8("label_2")); | label_2->setObjectName(QString::fromUtf8("label_2")); | |||
sizePolicy2.setHeightForWidth(label_2->sizePolicy().hasHeightForWid | QSizePolicy sizePolicy5(QSizePolicy::Fixed, QSizePolicy::Fixed); | |||
th()); | sizePolicy5.setHorizontalStretch(0); | |||
label_2->setSizePolicy(sizePolicy2); | sizePolicy5.setVerticalStretch(0); | |||
sizePolicy5.setHeightForWidth(label_2->sizePolicy().hasHeightForWid | ||||
th()); | ||||
label_2->setSizePolicy(sizePolicy5); | ||||
horizontalLayout_3->addWidget(label_2); | gridLayout->addWidget(label_2, 1, 0, 1, 1); | |||
lblPreview = new QLabel(QgsExpressionBuilderWidgetBase); | lblPreview = new QLabel(groupBox); | |||
lblPreview->setObjectName(QString::fromUtf8("lblPreview")); | lblPreview->setObjectName(QString::fromUtf8("lblPreview")); | |||
sizePolicy.setHeightForWidth(lblPreview->sizePolicy().hasHeightForW idth()); | sizePolicy.setHeightForWidth(lblPreview->sizePolicy().hasHeightForW idth()); | |||
lblPreview->setSizePolicy(sizePolicy); | lblPreview->setSizePolicy(sizePolicy); | |||
QFont font; | QFont font; | |||
font.setBold(false); | font.setBold(false); | |||
font.setItalic(true); | font.setItalic(true); | |||
font.setUnderline(false); | font.setUnderline(false); | |||
font.setWeight(50); | font.setWeight(50); | |||
lblPreview->setFont(font); | lblPreview->setFont(font); | |||
lblPreview->setFrameShape(QFrame::NoFrame); | lblPreview->setFrameShape(QFrame::NoFrame); | |||
lblPreview->setFrameShadow(QFrame::Sunken); | lblPreview->setFrameShadow(QFrame::Sunken); | |||
lblPreview->setLineWidth(0); | lblPreview->setLineWidth(0); | |||
lblPreview->setMidLineWidth(0); | lblPreview->setMidLineWidth(0); | |||
lblPreview->setScaledContents(false); | lblPreview->setScaledContents(false); | |||
lblPreview->setWordWrap(false); | lblPreview->setWordWrap(false); | |||
lblPreview->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt:: TextSelectableByMouse); | lblPreview->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt:: TextSelectableByMouse); | |||
horizontalLayout_3->addWidget(lblPreview); | gridLayout->addWidget(lblPreview, 1, 1, 1, 1); | |||
gridLayout->addLayout(horizontalLayout_3, 3, 0, 1, 1); | ||||
groupBox = new QGroupBox(QgsExpressionBuilderWidgetBase); | verticalLayout->addWidget(groupBox); | |||
groupBox->setObjectName(QString::fromUtf8("groupBox")); | ||||
QSizePolicy sizePolicy5(QSizePolicy::Preferred, QSizePolicy::Fixed) | ||||
; | ||||
sizePolicy5.setHorizontalStretch(0); | ||||
sizePolicy5.setVerticalStretch(0); | ||||
sizePolicy5.setHeightForWidth(groupBox->sizePolicy().hasHeightForWi | ||||
dth()); | ||||
groupBox->setSizePolicy(sizePolicy5); | ||||
groupBox->setMinimumSize(QSize(0, 0)); | ||||
groupBox->setMaximumSize(QSize(16777215, 120)); | ||||
groupBox->setBaseSize(QSize(0, 0)); | ||||
groupBox->setFlat(true); | ||||
gridLayout_2 = new QGridLayout(groupBox); | ||||
gridLayout_2->setSpacing(3); | ||||
gridLayout_2->setObjectName(QString::fromUtf8("gridLayout_2")); | ||||
gridLayout_2->setContentsMargins(0, -1, 0, 0); | ||||
txtExpressionString = new QTextEdit(groupBox); | ||||
txtExpressionString->setObjectName(QString::fromUtf8("txtExpression | ||||
String")); | ||||
txtExpressionString->setMinimumSize(QSize(0, 32)); | ||||
txtExpressionString->viewport()->setProperty("cursor", QVariant(QCu | ||||
rsor(Qt::IBeamCursor))); | ||||
gridLayout_2->addWidget(txtExpressionString, 2, 0, 1, 1); | splitter_2->addWidget(layoutWidget_1); | |||
gridLayout->addWidget(groupBox, 2, 0, 1, 1); | gridLayout_2->addWidget(splitter_2, 0, 0, 1, 1); | |||
retranslateUi(QgsExpressionBuilderWidgetBase); | retranslateUi(QgsExpressionBuilderWidgetBase); | |||
QMetaObject::connectSlotsByName(QgsExpressionBuilderWidgetBase); | QMetaObject::connectSlotsByName(QgsExpressionBuilderWidgetBase); | |||
} // setupUi | } // setupUi | |||
void retranslateUi(QWidget *QgsExpressionBuilderWidgetBase) | void retranslateUi(QWidget *QgsExpressionBuilderWidgetBase) | |||
{ | { | |||
QgsExpressionBuilderWidgetBase->setWindowTitle(QApplication::transl ate("QgsExpressionBuilderWidgetBase", "Form", 0, QApplication::UnicodeUTF8) ); | QgsExpressionBuilderWidgetBase->setWindowTitle(QApplication::transl ate("QgsExpressionBuilderWidgetBase", "Form", 0, QApplication::UnicodeUTF8) ); | |||
moperationListGroup->setTitle(QApplication::translate("QgsExpressio | moperationListGroup->setTitle(QApplication::translate("QgsExpressio | |||
nBuilderWidgetBase", "Function List", 0, QApplication::UnicodeUTF8)); | nBuilderWidgetBase", "Function list", 0, QApplication::UnicodeUTF8)); | |||
mFunctionHelGroup->setTitle(QApplication::translate("QgsExpressionB | mFunctionHelGroup->setTitle(QApplication::translate("QgsExpressionB | |||
uilderWidgetBase", "Selected Function Help", 0, QApplication::UnicodeUTF8)) | uilderWidgetBase", "Selected function help", 0, QApplication::UnicodeUTF8)) | |||
; | ; | |||
mValueGroupBox->setTitle(QApplication::translate("QgsExpressionBuil | mValueGroupBox->setTitle(QApplication::translate("QgsExpressionBuil | |||
derWidgetBase", "Field Values", 0, QApplication::UnicodeUTF8)); | derWidgetBase", "Field values", 0, QApplication::UnicodeUTF8)); | |||
btnLoadAll->setText(QApplication::translate("QgsExpressionBuilderWi | lblLoad->setText(QApplication::translate("QgsExpressionBuilderWidge | |||
dgetBase", "Load all unique values", 0, QApplication::UnicodeUTF8)); | tBase", "Load values", 0, QApplication::UnicodeUTF8)); | |||
btnLoadSample->setText(QApplication::translate("QgsExpressionBuilde | btnLoadAll->setText(QApplication::translate("QgsExpressionBuilderWi | |||
rWidgetBase", "Load 10 sample values", 0, QApplication::UnicodeUTF8)); | dgetBase", "all unique", 0, QApplication::UnicodeUTF8)); | |||
btnLoadSample->setText(QApplication::translate("QgsExpressionBuilde | ||||
rWidgetBase", "10 samples", 0, QApplication::UnicodeUTF8)); | ||||
mOperatorsGroupBox->setTitle(QApplication::translate("QgsExpression BuilderWidgetBase", "Operators", 0, QApplication::UnicodeUTF8)); | mOperatorsGroupBox->setTitle(QApplication::translate("QgsExpression BuilderWidgetBase", "Operators", 0, QApplication::UnicodeUTF8)); | |||
#ifndef QT_NO_TOOLTIP | #ifndef QT_NO_TOOLTIP | |||
btnEqualPushButton->setToolTip(QApplication::translate("QgsExpressi onBuilderWidgetBase", "Equal operator", 0, QApplication::UnicodeUTF8)); | btnEqualPushButton->setToolTip(QApplication::translate("QgsExpressi onBuilderWidgetBase", "Equal operator", 0, QApplication::UnicodeUTF8)); | |||
#endif // QT_NO_TOOLTIP | #endif // QT_NO_TOOLTIP | |||
btnEqualPushButton->setText(QApplication::translate("QgsExpressionB uilderWidgetBase", "=", 0, QApplication::UnicodeUTF8)); | btnEqualPushButton->setText(QApplication::translate("QgsExpressionB uilderWidgetBase", "=", 0, QApplication::UnicodeUTF8)); | |||
#ifndef QT_NO_TOOLTIP | #ifndef QT_NO_TOOLTIP | |||
btnPlusPushButton->setToolTip(QApplication::translate("QgsExpressio nBuilderWidgetBase", "Addition operator", 0, QApplication::UnicodeUTF8)); | btnPlusPushButton->setToolTip(QApplication::translate("QgsExpressio nBuilderWidgetBase", "Addition operator", 0, QApplication::UnicodeUTF8)); | |||
#endif // QT_NO_TOOLTIP | #endif // QT_NO_TOOLTIP | |||
btnPlusPushButton->setText(QApplication::translate("QgsExpressionBu ilderWidgetBase", "+", 0, QApplication::UnicodeUTF8)); | btnPlusPushButton->setText(QApplication::translate("QgsExpressionBu ilderWidgetBase", "+", 0, QApplication::UnicodeUTF8)); | |||
#ifndef QT_NO_TOOLTIP | #ifndef QT_NO_TOOLTIP | |||
skipping to change at line 361 | skipping to change at line 386 | |||
#endif // QT_NO_TOOLTIP | #endif // QT_NO_TOOLTIP | |||
btnConcatButton->setText(QApplication::translate("QgsExpressionBuil derWidgetBase", "||", 0, QApplication::UnicodeUTF8)); | btnConcatButton->setText(QApplication::translate("QgsExpressionBuil derWidgetBase", "||", 0, QApplication::UnicodeUTF8)); | |||
#ifndef QT_NO_TOOLTIP | #ifndef QT_NO_TOOLTIP | |||
btnOpenBracketPushButton->setToolTip(QApplication::translate("QgsEx pressionBuilderWidgetBase", "Open Bracket ", 0, QApplication::UnicodeUTF8)) ; | btnOpenBracketPushButton->setToolTip(QApplication::translate("QgsEx pressionBuilderWidgetBase", "Open Bracket ", 0, QApplication::UnicodeUTF8)) ; | |||
#endif // QT_NO_TOOLTIP | #endif // QT_NO_TOOLTIP | |||
btnOpenBracketPushButton->setText(QApplication::translate("QgsExpre ssionBuilderWidgetBase", "(", 0, QApplication::UnicodeUTF8)); | btnOpenBracketPushButton->setText(QApplication::translate("QgsExpre ssionBuilderWidgetBase", "(", 0, QApplication::UnicodeUTF8)); | |||
#ifndef QT_NO_TOOLTIP | #ifndef QT_NO_TOOLTIP | |||
btnCloseBracketPushButton->setToolTip(QApplication::translate("QgsE xpressionBuilderWidgetBase", "Close Bracket ", 0, QApplication::UnicodeUTF8 )); | btnCloseBracketPushButton->setToolTip(QApplication::translate("QgsE xpressionBuilderWidgetBase", "Close Bracket ", 0, QApplication::UnicodeUTF8 )); | |||
#endif // QT_NO_TOOLTIP | #endif // QT_NO_TOOLTIP | |||
btnCloseBracketPushButton->setText(QApplication::translate("QgsExpr essionBuilderWidgetBase", ")", 0, QApplication::UnicodeUTF8)); | btnCloseBracketPushButton->setText(QApplication::translate("QgsExpr essionBuilderWidgetBase", ")", 0, QApplication::UnicodeUTF8)); | |||
groupBox->setTitle(QApplication::translate("QgsExpressionBuilderWid getBase", "Expression", 0, QApplication::UnicodeUTF8)); | ||||
#ifndef QT_NO_TOOLTIP | #ifndef QT_NO_TOOLTIP | |||
label_2->setToolTip(QApplication::translate("QgsExpressionBuilderWi dgetBase", "Output preview is generated <br> using the first feature from t he layer.", 0, QApplication::UnicodeUTF8)); | label_2->setToolTip(QApplication::translate("QgsExpressionBuilderWi dgetBase", "Output preview is generated <br> using the first feature from t he layer.", 0, QApplication::UnicodeUTF8)); | |||
#endif // QT_NO_TOOLTIP | #endif // QT_NO_TOOLTIP | |||
label_2->setText(QApplication::translate("QgsExpressionBuilderWidge tBase", "Output preview: ", 0, QApplication::UnicodeUTF8)); | label_2->setText(QApplication::translate("QgsExpressionBuilderWidge tBase", "Output preview: ", 0, QApplication::UnicodeUTF8)); | |||
#ifndef QT_NO_TOOLTIP | #ifndef QT_NO_TOOLTIP | |||
lblPreview->setToolTip(QApplication::translate("QgsExpressionBuilde rWidgetBase", "Output preview is generated <br> using the first feature fro m the layer.", 0, QApplication::UnicodeUTF8)); | lblPreview->setToolTip(QApplication::translate("QgsExpressionBuilde rWidgetBase", "Output preview is generated <br> using the first feature fro m the layer.", 0, QApplication::UnicodeUTF8)); | |||
#endif // QT_NO_TOOLTIP | #endif // QT_NO_TOOLTIP | |||
lblPreview->setText(QString()); | lblPreview->setText(QString()); | |||
groupBox->setTitle(QApplication::translate("QgsExpressionBuilderWid getBase", "Expression", 0, QApplication::UnicodeUTF8)); | ||||
} // retranslateUi | } // retranslateUi | |||
}; | }; | |||
namespace Ui { | namespace Ui { | |||
class QgsExpressionBuilderWidgetBase: public Ui_QgsExpressionBuilderWid getBase {}; | class QgsExpressionBuilderWidgetBase: public Ui_QgsExpressionBuilderWid getBase {}; | |||
} // namespace Ui | } // namespace Ui | |||
QT_END_NAMESPACE | QT_END_NAMESPACE | |||
End of changes. 35 change blocks. | ||||
92 lines changed or deleted | 117 lines changed or added | |||
ui_qgsexpressionbuilderdialogbase.h | ui_qgsexpressionbuilderdialogbase.h | |||
---|---|---|---|---|
skipping to change at line 35 | skipping to change at line 35 | |||
{ | { | |||
public: | public: | |||
QGridLayout *gridLayout; | QGridLayout *gridLayout; | |||
QgsExpressionBuilderWidget *builder; | QgsExpressionBuilderWidget *builder; | |||
QDialogButtonBox *buttonBox; | QDialogButtonBox *buttonBox; | |||
void setupUi(QDialog *QgsExpressionBuilderDialogBase) | void setupUi(QDialog *QgsExpressionBuilderDialogBase) | |||
{ | { | |||
if (QgsExpressionBuilderDialogBase->objectName().isEmpty()) | if (QgsExpressionBuilderDialogBase->objectName().isEmpty()) | |||
QgsExpressionBuilderDialogBase->setObjectName(QString::fromUtf8 ("QgsExpressionBuilderDialogBase")); | QgsExpressionBuilderDialogBase->setObjectName(QString::fromUtf8 ("QgsExpressionBuilderDialogBase")); | |||
QgsExpressionBuilderDialogBase->resize(625, 554); | QgsExpressionBuilderDialogBase->resize(507, 539); | |||
gridLayout = new QGridLayout(QgsExpressionBuilderDialogBase); | gridLayout = new QGridLayout(QgsExpressionBuilderDialogBase); | |||
gridLayout->setContentsMargins(3, 3, 3, 3); | ||||
gridLayout->setObjectName(QString::fromUtf8("gridLayout")); | gridLayout->setObjectName(QString::fromUtf8("gridLayout")); | |||
builder = new QgsExpressionBuilderWidget(QgsExpressionBuilderDialog Base); | builder = new QgsExpressionBuilderWidget(QgsExpressionBuilderDialog Base); | |||
builder->setObjectName(QString::fromUtf8("builder")); | builder->setObjectName(QString::fromUtf8("builder")); | |||
builder->setAutoFillBackground(false); | builder->setAutoFillBackground(false); | |||
builder->setStyleSheet(QString::fromUtf8("")); | builder->setStyleSheet(QString::fromUtf8("")); | |||
gridLayout->addWidget(builder, 0, 0, 1, 1); | gridLayout->addWidget(builder, 0, 0, 1, 1); | |||
buttonBox = new QDialogButtonBox(QgsExpressionBuilderDialogBase); | buttonBox = new QDialogButtonBox(QgsExpressionBuilderDialogBase); | |||
buttonBox->setObjectName(QString::fromUtf8("buttonBox")); | buttonBox->setObjectName(QString::fromUtf8("buttonBox")); | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 2 lines changed or added | |||
ui_qgsexpressionselectiondialogbase.h | ui_qgsexpressionselectiondialogbase.h | |||
---|---|---|---|---|
skipping to change at line 53 | skipping to change at line 53 | |||
QgsExpressionSelectionDialogBase->resize(536, 401); | QgsExpressionSelectionDialogBase->resize(536, 401); | |||
mActionSelect = new QAction(QgsExpressionSelectionDialogBase); | mActionSelect = new QAction(QgsExpressionSelectionDialogBase); | |||
mActionSelect->setObjectName(QString::fromUtf8("mActionSelect")); | mActionSelect->setObjectName(QString::fromUtf8("mActionSelect")); | |||
mActionAddToSelection = new QAction(QgsExpressionSelectionDialogBas e); | mActionAddToSelection = new QAction(QgsExpressionSelectionDialogBas e); | |||
mActionAddToSelection->setObjectName(QString::fromUtf8("mActionAddT oSelection")); | mActionAddToSelection->setObjectName(QString::fromUtf8("mActionAddT oSelection")); | |||
mActionRemoveFromSelection = new QAction(QgsExpressionSelectionDial ogBase); | mActionRemoveFromSelection = new QAction(QgsExpressionSelectionDial ogBase); | |||
mActionRemoveFromSelection->setObjectName(QString::fromUtf8("mActio nRemoveFromSelection")); | mActionRemoveFromSelection->setObjectName(QString::fromUtf8("mActio nRemoveFromSelection")); | |||
mActionSelectInstersect = new QAction(QgsExpressionSelectionDialogB ase); | mActionSelectInstersect = new QAction(QgsExpressionSelectionDialogB ase); | |||
mActionSelectInstersect->setObjectName(QString::fromUtf8("mActionSe lectInstersect")); | mActionSelectInstersect->setObjectName(QString::fromUtf8("mActionSe lectInstersect")); | |||
gridLayout = new QGridLayout(QgsExpressionSelectionDialogBase); | gridLayout = new QGridLayout(QgsExpressionSelectionDialogBase); | |||
gridLayout->setContentsMargins(3, 3, 3, 3); | ||||
gridLayout->setObjectName(QString::fromUtf8("gridLayout")); | gridLayout->setObjectName(QString::fromUtf8("gridLayout")); | |||
horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); | horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); | |||
gridLayout->addItem(horizontalSpacer, 1, 0, 1, 1); | gridLayout->addItem(horizontalSpacer, 1, 0, 1, 1); | |||
mPbnClose = new QPushButton(QgsExpressionSelectionDialogBase); | mPbnClose = new QPushButton(QgsExpressionSelectionDialogBase); | |||
mPbnClose->setObjectName(QString::fromUtf8("mPbnClose")); | mPbnClose->setObjectName(QString::fromUtf8("mPbnClose")); | |||
gridLayout->addWidget(mPbnClose, 1, 2, 1, 1); | gridLayout->addWidget(mPbnClose, 1, 2, 1, 1); | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 1 lines changed or added | |||
ui_qgsquerybuilderbase.h | ui_qgsquerybuilderbase.h | |||
---|---|---|---|---|
skipping to change at line 29 | skipping to change at line 29 | |||
#include <QtGui/QButtonGroup> | #include <QtGui/QButtonGroup> | |||
#include <QtGui/QCheckBox> | #include <QtGui/QCheckBox> | |||
#include <QtGui/QDialog> | #include <QtGui/QDialog> | |||
#include <QtGui/QDialogButtonBox> | #include <QtGui/QDialogButtonBox> | |||
#include <QtGui/QGridLayout> | #include <QtGui/QGridLayout> | |||
#include <QtGui/QGroupBox> | #include <QtGui/QGroupBox> | |||
#include <QtGui/QHeaderView> | #include <QtGui/QHeaderView> | |||
#include <QtGui/QLabel> | #include <QtGui/QLabel> | |||
#include <QtGui/QListView> | #include <QtGui/QListView> | |||
#include <QtGui/QPushButton> | #include <QtGui/QPushButton> | |||
#include <QtGui/QSpacerItem> | ||||
#include <QtGui/QSplitter> | ||||
#include <QtGui/QTextEdit> | #include <QtGui/QTextEdit> | |||
#include <QtGui/QVBoxLayout> | ||||
#include <QtGui/QWidget> | ||||
#include "qgscollapsiblegroupbox.h" | ||||
QT_BEGIN_NAMESPACE | QT_BEGIN_NAMESPACE | |||
class Ui_QgsQueryBuilderBase | class Ui_QgsQueryBuilderBase | |||
{ | { | |||
public: | public: | |||
QGridLayout *gridLayout; | QGridLayout *gridLayout; | |||
QLabel *lblDataUri; | QLabel *lblDataUri; | |||
QSplitter *splitter_2; | ||||
QSplitter *splitter; | ||||
QGroupBox *groupBox1; | QGroupBox *groupBox1; | |||
QGridLayout *gridLayout1; | QGridLayout *gridLayout1; | |||
QListView *lstFields; | QListView *lstFields; | |||
QGroupBox *groupBox2; | QGroupBox *groupBox2; | |||
QGridLayout *gridLayout2; | QGridLayout *gridLayout2; | |||
QListView *lstValues; | QListView *lstValues; | |||
QPushButton *btnSampleValues; | QPushButton *btnSampleValues; | |||
QPushButton *btnGetAllValues; | QPushButton *btnGetAllValues; | |||
QCheckBox *mUseUnfilteredLayer; | QCheckBox *mUseUnfilteredLayer; | |||
QGroupBox *groupBox4; | QWidget *verticalLayoutWidget; | |||
QVBoxLayout *verticalLayout; | ||||
QgsCollapsibleGroupBox *groupBox4; | ||||
QGridLayout *gridLayout3; | QGridLayout *gridLayout3; | |||
QPushButton *btnEqual; | QPushButton *btnLike; | |||
QPushButton *btnLessThan; | ||||
QPushButton *btnNot; | ||||
QPushButton *btnOr; | ||||
QPushButton *btnAnd; | ||||
QPushButton *btnPct; | ||||
QPushButton *btnIn; | QPushButton *btnIn; | |||
QPushButton *btnLessEqual; | ||||
QPushButton *btnLessThan; | ||||
QPushButton *btnNotIn; | QPushButton *btnNotIn; | |||
QPushButton *btnNotEqual; | ||||
QPushButton *btnGreaterThan; | QPushButton *btnGreaterThan; | |||
QPushButton *btnLike; | QPushButton *btnEqual; | |||
QPushButton *btnILike; | QPushButton *btnILike; | |||
QPushButton *btnOr; | ||||
QPushButton *btnPct; | ||||
QPushButton *btnNotEqual; | ||||
QPushButton *btnGreaterEqual; | QPushButton *btnGreaterEqual; | |||
QPushButton *btnLessEqual; | QPushButton *btnAnd; | |||
QPushButton *btnNot; | ||||
QSpacerItem *horizontalSpacer; | ||||
QGroupBox *groupBox3; | QGroupBox *groupBox3; | |||
QGridLayout *gridLayout4; | QGridLayout *gridLayout4; | |||
QTextEdit *txtSQL; | QTextEdit *txtSQL; | |||
QDialogButtonBox *buttonBox; | QDialogButtonBox *buttonBox; | |||
void setupUi(QDialog *QgsQueryBuilderBase) | void setupUi(QDialog *QgsQueryBuilderBase) | |||
{ | { | |||
if (QgsQueryBuilderBase->objectName().isEmpty()) | if (QgsQueryBuilderBase->objectName().isEmpty()) | |||
QgsQueryBuilderBase->setObjectName(QString::fromUtf8("QgsQueryB uilderBase")); | QgsQueryBuilderBase->setObjectName(QString::fromUtf8("QgsQueryB uilderBase")); | |||
QgsQueryBuilderBase->resize(679, 572); | QgsQueryBuilderBase->resize(727, 707); | |||
QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); | QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); | |||
sizePolicy.setHorizontalStretch(0); | sizePolicy.setHorizontalStretch(0); | |||
sizePolicy.setVerticalStretch(0); | sizePolicy.setVerticalStretch(0); | |||
sizePolicy.setHeightForWidth(QgsQueryBuilderBase->sizePolicy().hasH eightForWidth()); | sizePolicy.setHeightForWidth(QgsQueryBuilderBase->sizePolicy().hasH eightForWidth()); | |||
QgsQueryBuilderBase->setSizePolicy(sizePolicy); | QgsQueryBuilderBase->setSizePolicy(sizePolicy); | |||
QIcon icon; | QIcon icon; | |||
icon.addFile(QString::fromUtf8(""), QSize(), QIcon::Normal, QIcon:: Off); | icon.addFile(QString::fromUtf8(""), QSize(), QIcon::Normal, QIcon:: Off); | |||
QgsQueryBuilderBase->setWindowIcon(icon); | QgsQueryBuilderBase->setWindowIcon(icon); | |||
QgsQueryBuilderBase->setModal(true); | QgsQueryBuilderBase->setModal(true); | |||
gridLayout = new QGridLayout(QgsQueryBuilderBase); | gridLayout = new QGridLayout(QgsQueryBuilderBase); | |||
gridLayout->setSpacing(6); | gridLayout->setSpacing(6); | |||
gridLayout->setContentsMargins(11, 11, 11, 11); | gridLayout->setContentsMargins(11, 11, 11, 11); | |||
gridLayout->setObjectName(QString::fromUtf8("gridLayout")); | gridLayout->setObjectName(QString::fromUtf8("gridLayout")); | |||
lblDataUri = new QLabel(QgsQueryBuilderBase); | lblDataUri = new QLabel(QgsQueryBuilderBase); | |||
lblDataUri->setObjectName(QString::fromUtf8("lblDataUri")); | lblDataUri->setObjectName(QString::fromUtf8("lblDataUri")); | |||
gridLayout->addWidget(lblDataUri, 0, 0, 1, 2); | gridLayout->addWidget(lblDataUri, 0, 0, 1, 1); | |||
groupBox1 = new QGroupBox(QgsQueryBuilderBase); | splitter_2 = new QSplitter(QgsQueryBuilderBase); | |||
splitter_2->setObjectName(QString::fromUtf8("splitter_2")); | ||||
splitter_2->setOrientation(Qt::Vertical); | ||||
splitter = new QSplitter(splitter_2); | ||||
splitter->setObjectName(QString::fromUtf8("splitter")); | ||||
splitter->setOrientation(Qt::Horizontal); | ||||
groupBox1 = new QGroupBox(splitter); | ||||
groupBox1->setObjectName(QString::fromUtf8("groupBox1")); | groupBox1->setObjectName(QString::fromUtf8("groupBox1")); | |||
QSizePolicy sizePolicy1(QSizePolicy::Fixed, QSizePolicy::Expanding) ; | QSizePolicy sizePolicy1(QSizePolicy::Fixed, QSizePolicy::Expanding) ; | |||
sizePolicy1.setHorizontalStretch(0); | sizePolicy1.setHorizontalStretch(0); | |||
sizePolicy1.setVerticalStretch(0); | sizePolicy1.setVerticalStretch(0); | |||
sizePolicy1.setHeightForWidth(groupBox1->sizePolicy().hasHeightForW idth()); | sizePolicy1.setHeightForWidth(groupBox1->sizePolicy().hasHeightForW idth()); | |||
groupBox1->setSizePolicy(sizePolicy1); | groupBox1->setSizePolicy(sizePolicy1); | |||
gridLayout1 = new QGridLayout(groupBox1); | gridLayout1 = new QGridLayout(groupBox1); | |||
gridLayout1->setSpacing(6); | gridLayout1->setSpacing(6); | |||
gridLayout1->setContentsMargins(11, 11, 11, 11); | gridLayout1->setContentsMargins(11, 11, 11, 11); | |||
gridLayout1->setObjectName(QString::fromUtf8("gridLayout1")); | gridLayout1->setObjectName(QString::fromUtf8("gridLayout1")); | |||
lstFields = new QListView(groupBox1); | lstFields = new QListView(groupBox1); | |||
lstFields->setObjectName(QString::fromUtf8("lstFields")); | lstFields->setObjectName(QString::fromUtf8("lstFields")); | |||
gridLayout1->addWidget(lstFields, 0, 0, 1, 1); | gridLayout1->addWidget(lstFields, 0, 0, 1, 1); | |||
gridLayout->addWidget(groupBox1, 1, 0, 1, 1); | splitter->addWidget(groupBox1); | |||
groupBox2 = new QGroupBox(splitter); | ||||
groupBox2 = new QGroupBox(QgsQueryBuilderBase); | ||||
groupBox2->setObjectName(QString::fromUtf8("groupBox2")); | groupBox2->setObjectName(QString::fromUtf8("groupBox2")); | |||
sizePolicy1.setHeightForWidth(groupBox2->sizePolicy().hasHeightForW idth()); | sizePolicy1.setHeightForWidth(groupBox2->sizePolicy().hasHeightForW idth()); | |||
groupBox2->setSizePolicy(sizePolicy1); | groupBox2->setSizePolicy(sizePolicy1); | |||
gridLayout2 = new QGridLayout(groupBox2); | gridLayout2 = new QGridLayout(groupBox2); | |||
gridLayout2->setSpacing(6); | gridLayout2->setSpacing(6); | |||
gridLayout2->setContentsMargins(11, 11, 11, 11); | gridLayout2->setContentsMargins(11, 11, 11, 11); | |||
gridLayout2->setObjectName(QString::fromUtf8("gridLayout2")); | gridLayout2->setObjectName(QString::fromUtf8("gridLayout2")); | |||
lstValues = new QListView(groupBox2); | lstValues = new QListView(groupBox2); | |||
lstValues->setObjectName(QString::fromUtf8("lstValues")); | lstValues->setObjectName(QString::fromUtf8("lstValues")); | |||
lstValues->setAutoFillBackground(true); | lstValues->setAutoFillBackground(true); | |||
skipping to change at line 141 | skipping to change at line 156 | |||
btnGetAllValues->setObjectName(QString::fromUtf8("btnGetAllValues") ); | btnGetAllValues->setObjectName(QString::fromUtf8("btnGetAllValues") ); | |||
gridLayout2->addWidget(btnGetAllValues, 1, 1, 1, 1); | gridLayout2->addWidget(btnGetAllValues, 1, 1, 1, 1); | |||
mUseUnfilteredLayer = new QCheckBox(groupBox2); | mUseUnfilteredLayer = new QCheckBox(groupBox2); | |||
mUseUnfilteredLayer->setObjectName(QString::fromUtf8("mUseUnfiltere dLayer")); | mUseUnfilteredLayer->setObjectName(QString::fromUtf8("mUseUnfiltere dLayer")); | |||
mUseUnfilteredLayer->setEnabled(false); | mUseUnfilteredLayer->setEnabled(false); | |||
gridLayout2->addWidget(mUseUnfilteredLayer, 2, 0, 1, 2); | gridLayout2->addWidget(mUseUnfilteredLayer, 2, 0, 1, 2); | |||
gridLayout->addWidget(groupBox2, 1, 1, 1, 1); | splitter->addWidget(groupBox2); | |||
splitter_2->addWidget(splitter); | ||||
groupBox4 = new QGroupBox(QgsQueryBuilderBase); | verticalLayoutWidget = new QWidget(splitter_2); | |||
verticalLayoutWidget->setObjectName(QString::fromUtf8("verticalLayo | ||||
utWidget")); | ||||
verticalLayout = new QVBoxLayout(verticalLayoutWidget); | ||||
verticalLayout->setSpacing(6); | ||||
verticalLayout->setContentsMargins(11, 11, 11, 11); | ||||
verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); | ||||
verticalLayout->setContentsMargins(0, 0, 0, 0); | ||||
groupBox4 = new QgsCollapsibleGroupBox(verticalLayoutWidget); | ||||
groupBox4->setObjectName(QString::fromUtf8("groupBox4")); | groupBox4->setObjectName(QString::fromUtf8("groupBox4")); | |||
gridLayout3 = new QGridLayout(groupBox4); | gridLayout3 = new QGridLayout(groupBox4); | |||
gridLayout3->setSpacing(6); | gridLayout3->setSpacing(6); | |||
gridLayout3->setContentsMargins(11, 11, 11, 11); | gridLayout3->setContentsMargins(11, 11, 11, 11); | |||
gridLayout3->setObjectName(QString::fromUtf8("gridLayout3")); | gridLayout3->setObjectName(QString::fromUtf8("gridLayout3")); | |||
btnEqual = new QPushButton(groupBox4); | btnLike = new QPushButton(groupBox4); | |||
btnEqual->setObjectName(QString::fromUtf8("btnEqual")); | btnLike->setObjectName(QString::fromUtf8("btnLike")); | |||
gridLayout3->addWidget(btnEqual, 0, 0, 1, 1); | ||||
btnLessThan = new QPushButton(groupBox4); | ||||
btnLessThan->setObjectName(QString::fromUtf8("btnLessThan")); | ||||
gridLayout3->addWidget(btnLessThan, 0, 1, 1, 1); | ||||
btnNot = new QPushButton(groupBox4); | ||||
btnNot->setObjectName(QString::fromUtf8("btnNot")); | ||||
gridLayout3->addWidget(btnNot, 1, 6, 1, 1); | ||||
btnOr = new QPushButton(groupBox4); | ||||
btnOr->setObjectName(QString::fromUtf8("btnOr")); | ||||
gridLayout3->addWidget(btnOr, 1, 5, 1, 1); | gridLayout3->addWidget(btnLike, 0, 3, 1, 1); | |||
btnAnd = new QPushButton(groupBox4); | btnIn = new QPushButton(groupBox4); | |||
btnAnd->setObjectName(QString::fromUtf8("btnAnd")); | btnIn->setObjectName(QString::fromUtf8("btnIn")); | |||
gridLayout3->addWidget(btnAnd, 1, 4, 1, 1); | gridLayout3->addWidget(btnIn, 0, 5, 1, 1); | |||
btnPct = new QPushButton(groupBox4); | btnLessEqual = new QPushButton(groupBox4); | |||
btnPct->setObjectName(QString::fromUtf8("btnPct")); | btnLessEqual->setObjectName(QString::fromUtf8("btnLessEqual")); | |||
gridLayout3->addWidget(btnPct, 0, 4, 1, 1); | gridLayout3->addWidget(btnLessEqual, 1, 0, 1, 1); | |||
btnIn = new QPushButton(groupBox4); | btnLessThan = new QPushButton(groupBox4); | |||
btnIn->setObjectName(QString::fromUtf8("btnIn")); | btnLessThan->setObjectName(QString::fromUtf8("btnLessThan")); | |||
gridLayout3->addWidget(btnIn, 0, 5, 1, 1); | gridLayout3->addWidget(btnLessThan, 0, 1, 1, 1); | |||
btnNotIn = new QPushButton(groupBox4); | btnNotIn = new QPushButton(groupBox4); | |||
btnNotIn->setObjectName(QString::fromUtf8("btnNotIn")); | btnNotIn->setObjectName(QString::fromUtf8("btnNotIn")); | |||
gridLayout3->addWidget(btnNotIn, 0, 6, 1, 1); | gridLayout3->addWidget(btnNotIn, 0, 6, 1, 1); | |||
btnNotEqual = new QPushButton(groupBox4); | ||||
btnNotEqual->setObjectName(QString::fromUtf8("btnNotEqual")); | ||||
gridLayout3->addWidget(btnNotEqual, 1, 2, 1, 1); | ||||
btnGreaterThan = new QPushButton(groupBox4); | btnGreaterThan = new QPushButton(groupBox4); | |||
btnGreaterThan->setObjectName(QString::fromUtf8("btnGreaterThan")); | btnGreaterThan->setObjectName(QString::fromUtf8("btnGreaterThan")); | |||
gridLayout3->addWidget(btnGreaterThan, 0, 2, 1, 1); | gridLayout3->addWidget(btnGreaterThan, 0, 2, 1, 1); | |||
btnLike = new QPushButton(groupBox4); | btnEqual = new QPushButton(groupBox4); | |||
btnLike->setObjectName(QString::fromUtf8("btnLike")); | btnEqual->setObjectName(QString::fromUtf8("btnEqual")); | |||
gridLayout3->addWidget(btnLike, 0, 3, 1, 1); | gridLayout3->addWidget(btnEqual, 0, 0, 1, 1); | |||
btnILike = new QPushButton(groupBox4); | btnILike = new QPushButton(groupBox4); | |||
btnILike->setObjectName(QString::fromUtf8("btnILike")); | btnILike->setObjectName(QString::fromUtf8("btnILike")); | |||
gridLayout3->addWidget(btnILike, 1, 3, 1, 1); | gridLayout3->addWidget(btnILike, 1, 3, 1, 1); | |||
btnOr = new QPushButton(groupBox4); | ||||
btnOr->setObjectName(QString::fromUtf8("btnOr")); | ||||
gridLayout3->addWidget(btnOr, 1, 5, 1, 1); | ||||
btnPct = new QPushButton(groupBox4); | ||||
btnPct->setObjectName(QString::fromUtf8("btnPct")); | ||||
gridLayout3->addWidget(btnPct, 0, 4, 1, 1); | ||||
btnNotEqual = new QPushButton(groupBox4); | ||||
btnNotEqual->setObjectName(QString::fromUtf8("btnNotEqual")); | ||||
gridLayout3->addWidget(btnNotEqual, 1, 2, 1, 1); | ||||
btnGreaterEqual = new QPushButton(groupBox4); | btnGreaterEqual = new QPushButton(groupBox4); | |||
btnGreaterEqual->setObjectName(QString::fromUtf8("btnGreaterEqual") ); | btnGreaterEqual->setObjectName(QString::fromUtf8("btnGreaterEqual") ); | |||
gridLayout3->addWidget(btnGreaterEqual, 1, 1, 1, 1); | gridLayout3->addWidget(btnGreaterEqual, 1, 1, 1, 1); | |||
btnLessEqual = new QPushButton(groupBox4); | btnAnd = new QPushButton(groupBox4); | |||
btnLessEqual->setObjectName(QString::fromUtf8("btnLessEqual")); | btnAnd->setObjectName(QString::fromUtf8("btnAnd")); | |||
gridLayout3->addWidget(btnLessEqual, 1, 0, 1, 1); | gridLayout3->addWidget(btnAnd, 1, 4, 1, 1); | |||
btnNot = new QPushButton(groupBox4); | ||||
btnNot->setObjectName(QString::fromUtf8("btnNot")); | ||||
gridLayout3->addWidget(btnNot, 1, 6, 1, 1); | ||||
horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, | ||||
QSizePolicy::Minimum); | ||||
gridLayout->addWidget(groupBox4, 2, 0, 1, 2); | gridLayout3->addItem(horizontalSpacer, 0, 7, 1, 1); | |||
groupBox3 = new QGroupBox(QgsQueryBuilderBase); | verticalLayout->addWidget(groupBox4); | |||
groupBox3 = new QGroupBox(verticalLayoutWidget); | ||||
groupBox3->setObjectName(QString::fromUtf8("groupBox3")); | groupBox3->setObjectName(QString::fromUtf8("groupBox3")); | |||
groupBox3->setMaximumSize(QSize(32767, 116)); | QSizePolicy sizePolicy2(QSizePolicy::Preferred, QSizePolicy::Expand | |||
ing); | ||||
sizePolicy2.setHorizontalStretch(0); | ||||
sizePolicy2.setVerticalStretch(0); | ||||
sizePolicy2.setHeightForWidth(groupBox3->sizePolicy().hasHeightForW | ||||
idth()); | ||||
groupBox3->setSizePolicy(sizePolicy2); | ||||
gridLayout4 = new QGridLayout(groupBox3); | gridLayout4 = new QGridLayout(groupBox3); | |||
gridLayout4->setSpacing(6); | gridLayout4->setSpacing(6); | |||
gridLayout4->setContentsMargins(11, 11, 11, 11); | gridLayout4->setContentsMargins(11, 11, 11, 11); | |||
gridLayout4->setObjectName(QString::fromUtf8("gridLayout4")); | gridLayout4->setObjectName(QString::fromUtf8("gridLayout4")); | |||
txtSQL = new QTextEdit(groupBox3); | txtSQL = new QTextEdit(groupBox3); | |||
txtSQL->setObjectName(QString::fromUtf8("txtSQL")); | txtSQL->setObjectName(QString::fromUtf8("txtSQL")); | |||
gridLayout4->addWidget(txtSQL, 0, 0, 1, 1); | gridLayout4->addWidget(txtSQL, 0, 0, 1, 1); | |||
gridLayout->addWidget(groupBox3, 3, 0, 1, 2); | verticalLayout->addWidget(groupBox3); | |||
splitter_2->addWidget(verticalLayoutWidget); | ||||
gridLayout->addWidget(splitter_2, 1, 0, 1, 1); | ||||
buttonBox = new QDialogButtonBox(QgsQueryBuilderBase); | buttonBox = new QDialogButtonBox(QgsQueryBuilderBase); | |||
buttonBox->setObjectName(QString::fromUtf8("buttonBox")); | buttonBox->setObjectName(QString::fromUtf8("buttonBox")); | |||
buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButto nBox::Help|QDialogButtonBox::Ok); | buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButto nBox::Help|QDialogButtonBox::Ok); | |||
gridLayout->addWidget(buttonBox, 4, 0, 1, 2); | gridLayout->addWidget(buttonBox, 2, 0, 1, 1); | |||
splitter_2->raise(); | ||||
lblDataUri->raise(); | ||||
buttonBox->raise(); | ||||
QWidget::setTabOrder(lstFields, lstValues); | QWidget::setTabOrder(lstFields, lstValues); | |||
QWidget::setTabOrder(lstValues, btnSampleValues); | QWidget::setTabOrder(lstValues, btnSampleValues); | |||
QWidget::setTabOrder(btnSampleValues, btnGetAllValues); | QWidget::setTabOrder(btnSampleValues, btnGetAllValues); | |||
QWidget::setTabOrder(btnGetAllValues, btnEqual); | QWidget::setTabOrder(btnGetAllValues, btnEqual); | |||
QWidget::setTabOrder(btnEqual, btnLessThan); | QWidget::setTabOrder(btnEqual, btnLessThan); | |||
QWidget::setTabOrder(btnLessThan, btnGreaterThan); | QWidget::setTabOrder(btnLessThan, btnGreaterThan); | |||
QWidget::setTabOrder(btnGreaterThan, btnLike); | QWidget::setTabOrder(btnGreaterThan, btnLike); | |||
QWidget::setTabOrder(btnLike, btnPct); | QWidget::setTabOrder(btnLike, btnPct); | |||
QWidget::setTabOrder(btnPct, btnIn); | QWidget::setTabOrder(btnPct, btnIn); | |||
QWidget::setTabOrder(btnIn, btnNotIn); | QWidget::setTabOrder(btnIn, btnNotIn); | |||
skipping to change at line 302 | skipping to change at line 339 | |||
btnSampleValues->setText(QApplication::translate("QgsQueryBuilderBa se", "Sample", 0, QApplication::UnicodeUTF8)); | btnSampleValues->setText(QApplication::translate("QgsQueryBuilderBa se", "Sample", 0, QApplication::UnicodeUTF8)); | |||
#ifndef QT_NO_TOOLTIP | #ifndef QT_NO_TOOLTIP | |||
btnGetAllValues->setToolTip(QApplication::translate("QgsQueryBuilde rBase", "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\ "text/css\">\n" | btnGetAllValues->setToolTip(QApplication::translate("QgsQueryBuilde rBase", "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\ "text/css\">\n" | |||
"p, li { white-space: pre-wrap; }\n" | "p, li { white-space: pre-wrap; }\n" | |||
"</style></head><body style=\" font-family:'Sans Serif'; font-size:9pt; fon t-weight:400; font-style:normal;\">\n" | "</style></head><body style=\" font-family:'Sans Serif'; font-size:9pt; fon t-weight:400; font-style:normal;\">\n" | |||
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-rig ht:0px; -qt-block-indent:0; text-indent:0px;\">Retrieve <span style=\" font -weight:600;\">all</span> the record in the vector file (<span style=\" fon t-style:italic;\">if the table is big, the operation can consume some time< /span>)</p></body></html>", 0, QApplication::UnicodeUTF8)); | "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-rig ht:0px; -qt-block-indent:0; text-indent:0px;\">Retrieve <span style=\" font -weight:600;\">all</span> the record in the vector file (<span style=\" fon t-style:italic;\">if the table is big, the operation can consume some time< /span>)</p></body></html>", 0, QApplication::UnicodeUTF8)); | |||
#endif // QT_NO_TOOLTIP | #endif // QT_NO_TOOLTIP | |||
btnGetAllValues->setText(QApplication::translate("QgsQueryBuilderBa se", "All", 0, QApplication::UnicodeUTF8)); | btnGetAllValues->setText(QApplication::translate("QgsQueryBuilderBa se", "All", 0, QApplication::UnicodeUTF8)); | |||
mUseUnfilteredLayer->setText(QApplication::translate("QgsQueryBuild erBase", "Use unfiltered layer", 0, QApplication::UnicodeUTF8)); | mUseUnfilteredLayer->setText(QApplication::translate("QgsQueryBuild erBase", "Use unfiltered layer", 0, QApplication::UnicodeUTF8)); | |||
groupBox4->setTitle(QApplication::translate("QgsQueryBuilderBase", "Operators", 0, QApplication::UnicodeUTF8)); | groupBox4->setTitle(QApplication::translate("QgsQueryBuilderBase", "Operators", 0, QApplication::UnicodeUTF8)); | |||
btnEqual->setText(QApplication::translate("QgsQueryBuilderBase", "= | btnLike->setText(QApplication::translate("QgsQueryBuilderBase", "LI | |||
", 0, QApplication::UnicodeUTF8)); | KE", 0, QApplication::UnicodeUTF8)); | |||
btnLessThan->setText(QApplication::translate("QgsQueryBuilderBase", | ||||
"<", 0, QApplication::UnicodeUTF8)); | ||||
btnNot->setText(QApplication::translate("QgsQueryBuilderBase", "NOT | ||||
", 0, QApplication::UnicodeUTF8)); | ||||
btnOr->setText(QApplication::translate("QgsQueryBuilderBase", "OR", | ||||
0, QApplication::UnicodeUTF8)); | ||||
btnAnd->setText(QApplication::translate("QgsQueryBuilderBase", "AND | ||||
", 0, QApplication::UnicodeUTF8)); | ||||
btnPct->setText(QApplication::translate("QgsQueryBuilderBase", "%", | ||||
0, QApplication::UnicodeUTF8)); | ||||
btnIn->setText(QApplication::translate("QgsQueryBuilderBase", "IN", 0, QApplication::UnicodeUTF8)); | btnIn->setText(QApplication::translate("QgsQueryBuilderBase", "IN", 0, QApplication::UnicodeUTF8)); | |||
btnLessEqual->setText(QApplication::translate("QgsQueryBuilderBase" | ||||
, "<=", 0, QApplication::UnicodeUTF8)); | ||||
btnLessThan->setText(QApplication::translate("QgsQueryBuilderBase", | ||||
"<", 0, QApplication::UnicodeUTF8)); | ||||
btnNotIn->setText(QApplication::translate("QgsQueryBuilderBase", "N OT IN", 0, QApplication::UnicodeUTF8)); | btnNotIn->setText(QApplication::translate("QgsQueryBuilderBase", "N OT IN", 0, QApplication::UnicodeUTF8)); | |||
btnNotEqual->setText(QApplication::translate("QgsQueryBuilderBase", "!=", 0, QApplication::UnicodeUTF8)); | ||||
btnGreaterThan->setText(QApplication::translate("QgsQueryBuilderBas e", ">", 0, QApplication::UnicodeUTF8)); | btnGreaterThan->setText(QApplication::translate("QgsQueryBuilderBas e", ">", 0, QApplication::UnicodeUTF8)); | |||
btnLike->setText(QApplication::translate("QgsQueryBuilderBase", "LI KE", 0, QApplication::UnicodeUTF8)); | btnEqual->setText(QApplication::translate("QgsQueryBuilderBase", "= ", 0, QApplication::UnicodeUTF8)); | |||
btnILike->setText(QApplication::translate("QgsQueryBuilderBase", "I LIKE", 0, QApplication::UnicodeUTF8)); | btnILike->setText(QApplication::translate("QgsQueryBuilderBase", "I LIKE", 0, QApplication::UnicodeUTF8)); | |||
btnOr->setText(QApplication::translate("QgsQueryBuilderBase", "OR", | ||||
0, QApplication::UnicodeUTF8)); | ||||
btnPct->setText(QApplication::translate("QgsQueryBuilderBase", "%", | ||||
0, QApplication::UnicodeUTF8)); | ||||
btnNotEqual->setText(QApplication::translate("QgsQueryBuilderBase", | ||||
"!=", 0, QApplication::UnicodeUTF8)); | ||||
btnGreaterEqual->setText(QApplication::translate("QgsQueryBuilderBa se", ">=", 0, QApplication::UnicodeUTF8)); | btnGreaterEqual->setText(QApplication::translate("QgsQueryBuilderBa se", ">=", 0, QApplication::UnicodeUTF8)); | |||
btnLessEqual->setText(QApplication::translate("QgsQueryBuilderBase" | btnAnd->setText(QApplication::translate("QgsQueryBuilderBase", "AND | |||
, "<=", 0, QApplication::UnicodeUTF8)); | ", 0, QApplication::UnicodeUTF8)); | |||
btnNot->setText(QApplication::translate("QgsQueryBuilderBase", "NOT | ||||
", 0, QApplication::UnicodeUTF8)); | ||||
groupBox3->setTitle(QApplication::translate("QgsQueryBuilderBase", "Provider specific filter expression", 0, QApplication::UnicodeUTF8)); | groupBox3->setTitle(QApplication::translate("QgsQueryBuilderBase", "Provider specific filter expression", 0, QApplication::UnicodeUTF8)); | |||
} // retranslateUi | } // retranslateUi | |||
}; | }; | |||
namespace Ui { | namespace Ui { | |||
class QgsQueryBuilderBase: public Ui_QgsQueryBuilderBase {}; | class QgsQueryBuilderBase: public Ui_QgsQueryBuilderBase {}; | |||
} // namespace Ui | } // namespace Ui | |||
QT_END_NAMESPACE | QT_END_NAMESPACE | |||
End of changes. 41 change blocks. | ||||
78 lines changed or deleted | 120 lines changed or added | |||