/usr/include/qgis/qgsvectorfieldsymbollayer.h is in libqgis-dev 2.8.6+dfsg-1build1.
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 | /***************************************************************************
qgsvectorfieldsymbollayer.h
-------------------------
begin : Octorer 25, 2011
copyright : (C) 2011 by Marco Hugentobler
email : marco dot hugentobler at sourcepole dot ch
***************************************************************************/
/***************************************************************************
* *
* 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 QGSVECTORFIELDSYMBOLLAYER_H
#define QGSVECTORFIELDSYMBOLLAYER_H
#include "qgssymbollayerv2.h"
/**A symbol layer class for displaying displacement arrows based on point layer attributes*/
class CORE_EXPORT QgsVectorFieldSymbolLayer: public QgsMarkerSymbolLayerV2
{
public:
enum VectorFieldType
{
Cartesian = 0,
Polar,
Height
};
enum AngleOrientation
{
ClockwiseFromNorth = 0,
CounterclockwiseFromEast
};
enum AngleUnits
{
Degrees = 0,
Radians
};
QgsVectorFieldSymbolLayer();
~QgsVectorFieldSymbolLayer();
static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsStringMap() );
static QgsSymbolLayerV2* createFromSld( QDomElement &element );
QString layerType() const override { return "VectorField"; }
bool setSubSymbol( QgsSymbolV2* symbol ) override;
QgsSymbolV2* subSymbol() override { return mLineSymbol; }
void renderPoint( const QPointF& point, QgsSymbolV2RenderContext& context ) override;
void startRender( QgsSymbolV2RenderContext& context ) override;
void stopRender( QgsSymbolV2RenderContext& context ) override;
QgsSymbolLayerV2* clone() const override;
QgsStringMap properties() const override;
void toSld( QDomDocument& doc, QDomElement &element, QgsStringMap props ) const override;
void drawPreviewIcon( QgsSymbolV2RenderContext& context, QSize size ) override;
QSet<QString> usedAttributes() const override;
//setters and getters
void setXAttribute( const QString& attribute ) { mXAttribute = attribute; }
QString xAttribute() const { return mXAttribute; }
void setYAttribute( const QString& attribute ) { mYAttribute = attribute; }
QString yAttribute() const { return mYAttribute; }
void setScale( double s ) { mScale = s; }
double scale() const { return mScale; }
void setVectorFieldType( VectorFieldType type ) { mVectorFieldType = type; }
VectorFieldType vectorFieldType() const { return mVectorFieldType; }
void setAngleOrientation( AngleOrientation orientation ) { mAngleOrientation = orientation; }
AngleOrientation angleOrientation() const { return mAngleOrientation; }
void setAngleUnits( AngleUnits units ) { mAngleUnits = units; }
AngleUnits angleUnits() const { return mAngleUnits; }
void setOutputUnit( QgsSymbolV2::OutputUnit unit ) override;
QgsSymbolV2::OutputUnit outputUnit() const override;
void setMapUnitScale( const QgsMapUnitScale& scale ) override;
QgsMapUnitScale mapUnitScale() const override;
void setDistanceUnit( QgsSymbolV2::OutputUnit unit ) { mDistanceUnit = unit; }
QgsSymbolV2::OutputUnit distanceUnit() const { return mDistanceUnit; }
void setDistanceMapUnitScale( const QgsMapUnitScale& scale ) { mDistanceMapUnitScale = scale; }
const QgsMapUnitScale& distanceMapUnitScale() const { return mDistanceMapUnitScale; }
private:
QString mXAttribute;
QString mYAttribute;
QgsSymbolV2::OutputUnit mDistanceUnit;
QgsMapUnitScale mDistanceMapUnitScale;
double mScale;
VectorFieldType mVectorFieldType;
AngleOrientation mAngleOrientation;
AngleUnits mAngleUnits;
QgsLineSymbolV2* mLineSymbol;
//Attribute indices are resolved in startRender method
int mXIndex;
int mYIndex;
//Converts length/angle to cartesian x/y
void convertPolarToCartesian( double length, double angle, double& x, double& y ) const;
};
#endif // QGSVECTORFIELDSYMBOLLAYER_H
|