/usr/include/qgis/qgstransformeffect.h is in libqgis-dev 2.18.17+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 | /***************************************************************************
qgstransformeffect.h
--------------------
begin : March 2015
copyright : (C) 2015 Nyall Dawson
email : nyall dot dawson at gmail dot com
***************************************************************************/
/***************************************************************************
* *
* 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 *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSTRANSFORMEFFECT_H
#define QGSTRANSFORMEFFECT_H
#include "qgspainteffect.h"
#include "qgis.h"
#include "qgsmapunitscale.h"
#include "qgssymbolv2.h"
#include <QPainter>
/** \ingroup core
* \class QgsTransformEffect
* \brief A paint effect which applies transformations (such as move,
* scale and rotate) to a picture.
*
* \note Added in version 2.9
*/
class CORE_EXPORT QgsTransformEffect : public QgsPaintEffect
{
public:
/** Creates a new QgsTransformEffect effect from a properties string map.
* @param map encoded properties string map
* @returns new QgsTransformEffect
*/
static QgsPaintEffect* create( const QgsStringMap& map );
QgsTransformEffect();
virtual ~QgsTransformEffect();
virtual QString type() const override { return QString( "transform" ); }
virtual QgsStringMap properties() const override;
virtual void readProperties( const QgsStringMap& props ) override;
virtual QgsTransformEffect* clone() const override;
/** Sets the transform x translation.
* @param translateX distance to translate along the x axis
* @see translateX
* @see setTranslateY
* @see setTranslateUnit
* @see setTranslateMapUnitScale
*/
void setTranslateX( const double translateX ) { mTranslateX = translateX; }
/** Returns the transform x translation.
* @returns X distance translated along the x axis
* @see setTranslateX
* @see translateY
* @see translateUnit
* @see translateMapUnitScale
*/
double translateX() const { return mTranslateX; }
/** Sets the transform y translation.
* @param translateY distance to translate along the y axis
* @see translateY
* @see setTranslateX
* @see setTranslateUnit
* @see setTranslateMapUnitScale
*/
void setTranslateY( const double translateY ) { mTranslateY = translateY; }
/** Returns the transform y translation.
* @returns Y distance translated along the y axis
* @see setTranslateY
* @see translateX
* @see translateUnit
* @see translateMapUnitScale
*/
double translateY() const { return mTranslateY; }
/** Sets the units used for the transform translation.
* @param unit units for translation
* @see translateUnit
* @see setTranslateX
* @see setTranslateY
* @see setTranslateMapUnitScale
*/
void setTranslateUnit( const QgsSymbolV2::OutputUnit unit ) { mTranslateUnit = unit; }
/** Returns the units used for the transform translation.
* @returns units for translation
* @see setTranslateUnit
* @see translateX
* @see translateY
* @see translateMapUnitScale
*/
QgsSymbolV2::OutputUnit translateUnit() const { return mTranslateUnit; }
/** Sets the map unit scale used for the transform translation.
* @param scale map unit scale for translation
* @see translateMapUnitScale
* @see setTranslateX
* @see setTranslateY
* @see setTranslateUnit
*/
void setTranslateMapUnitScale( const QgsMapUnitScale& scale ) { mTranslateMapUnitScale = scale; }
/** Returns the map unit scale used for the transform translation.
* @returns map unit scale for translation
* @see setTranslateMapUnitScale
* @see translateX
* @see translateY
* @see translateUnit
*/
const QgsMapUnitScale& translateMapUnitScale() const { return mTranslateMapUnitScale; }
/** Sets the x axis scaling factor.
* @param scaleX factor to scale x axis by, where 1.0 = no scaling
* @see scaleX
* @see setScaleY
*/
void setScaleX( const double scaleX ) { mScaleX = scaleX; }
/** Returns the x axis scaling factor.
* @returns x axis scaling factor, where 1.0 = no scaling
* @see setScaleX
* @see scaleY
*/
double scaleX() const { return mScaleX; }
/** Sets the y axis scaling factor.
* @param scaleY factor to scale y axis by, where 1.0 = no scaling
* @see scaleX
*/
void setScaleY( const double scaleY ) { mScaleY = scaleY; }
/** Returns the y axis scaling factor.
* @returns y axis scaling factor, where 1.0 = no scaling
* @see setScaleY
* @see scaleX
*/
double scaleY() const { return mScaleY; }
/** Sets the transform rotation.
* @param rotation degrees to rotate, clockwise
* @see rotation
*/
void setRotation( const double rotation ) { mRotation = rotation; }
/** Returns the transform rotation.
* @returns rotation in degrees clockwise
* @see setRotation
*/
double rotation() const { return mRotation; }
/** Sets the x axis shearing factor.
* @param shearX x axis shearing
* @see shearX
* @see setShearY
*/
void setShearX( const double shearX ) { mShearX = shearX; }
/** Returns the x axis shearing factor.
* @returns x axis shearing
* @see setShearX
* @see shearY
*/
double shearX() const { return mShearX; }
/** Sets the y axis shearing factor.
* @param shearY y axis shearing
* @see shearY
* @see setShearX
*/
void setShearY( const double shearY ) { mShearY = shearY; }
/** Returns the y axis shearing factor.
* @returns y axis shearing
* @see setShearY
* @see shearX
*/
double shearY() const { return mShearY; }
/** Sets whether to reflect along the x-axis
* @param reflectX true to reflect horizontally
* @see reflectX
* @see setReflectY
*/
void setReflectX( const bool reflectX ) { mReflectX = reflectX; }
/** Returns whether transform will be reflected along the x-axis
* @returns true if transform will reflect horizontally
* @see setReflectX
* @see reflectY
*/
bool reflectX() const { return mReflectX; }
/** Sets whether to reflect along the y-axis
* @param reflectY true to reflect horizontally
* @see reflectY
* @see setReflectX
*/
void setReflectY( const bool reflectY ) { mReflectY = reflectY; }
/** Returns whether transform will be reflected along the y-axis
* @returns true if transform will reflect horizontally
* @see setReflectY
* @see reflectX
*/
bool reflectY() const { return mReflectY; }
protected:
virtual void draw( QgsRenderContext& context ) override;
virtual QRectF boundingRect( const QRectF& rect, const QgsRenderContext& context ) const override;
private:
double mTranslateX;
double mTranslateY;
QgsSymbolV2::OutputUnit mTranslateUnit;
QgsMapUnitScale mTranslateMapUnitScale;
double mScaleX;
double mScaleY;
double mRotation;
double mShearX;
double mShearY;
bool mReflectX;
bool mReflectY;
QTransform createTransform( const QgsRenderContext& context ) const;
};
#endif // QGSTRANSFORMEFFECT_H
|