/usr/include/qgis/qgsfillsymbollayerv2.h is in libqgis-dev 1.7.4+1.7.5~20120320-1.1+b1.
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 | #ifndef QGSFILLSYMBOLLAYERV2_H
#define QGSFILLSYMBOLLAYERV2_H
#include "qgssymbollayerv2.h"
#define DEFAULT_SIMPLEFILL_COLOR QColor(0,0,255)
#define DEFAULT_SIMPLEFILL_STYLE Qt::SolidPattern
#define DEFAULT_SIMPLEFILL_BORDERCOLOR QColor(0,0,0)
#define DEFAULT_SIMPLEFILL_BORDERSTYLE Qt::SolidLine
#define DEFAULT_SIMPLEFILL_BORDERWIDTH DEFAULT_LINE_WIDTH
#include <QPen>
#include <QBrush>
class CORE_EXPORT QgsSimpleFillSymbolLayerV2 : public QgsFillSymbolLayerV2
{
public:
QgsSimpleFillSymbolLayerV2( QColor color = DEFAULT_SIMPLEFILL_COLOR,
Qt::BrushStyle style = DEFAULT_SIMPLEFILL_STYLE,
QColor borderColor = DEFAULT_SIMPLEFILL_BORDERCOLOR,
Qt::PenStyle borderStyle = DEFAULT_SIMPLEFILL_BORDERSTYLE,
double borderWidth = DEFAULT_SIMPLEFILL_BORDERWIDTH );
// static stuff
static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsStringMap() );
// implemented from base classes
QString layerType() const;
void startRender( QgsSymbolV2RenderContext& context );
void stopRender( QgsSymbolV2RenderContext& context );
void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, QgsSymbolV2RenderContext& context );
QgsStringMap properties() const;
QgsSymbolLayerV2* clone() const;
Qt::BrushStyle brushStyle() const { return mBrushStyle; }
void setBrushStyle( Qt::BrushStyle style ) { mBrushStyle = style; }
QColor borderColor() const { return mBorderColor; }
void setBorderColor( QColor borderColor ) { mBorderColor = borderColor; }
Qt::PenStyle borderStyle() const { return mBorderStyle; }
void setBorderStyle( Qt::PenStyle borderStyle ) { mBorderStyle = borderStyle; }
double borderWidth() const { return mBorderWidth; }
void setBorderWidth( double borderWidth ) { mBorderWidth = borderWidth; }
void setOffset( QPointF offset ) { mOffset = offset; }
QPointF offset() { return mOffset; }
protected:
QBrush mBrush;
QBrush mSelBrush;
Qt::BrushStyle mBrushStyle;
QColor mBorderColor;
Qt::PenStyle mBorderStyle;
double mBorderWidth;
QPen mPen;
QPointF mOffset;
};
/**A class for svg fill patterns. The class automatically scales the pattern to
the appropriate pixel dimensions of the output device*/
class CORE_EXPORT QgsSVGFillSymbolLayer: public QgsFillSymbolLayerV2
{
public:
QgsSVGFillSymbolLayer( const QString& svgFilePath = "", double width = 20, double rotation = 0.0 );
QgsSVGFillSymbolLayer( const QByteArray& svgData, double width = 20, double rotation = 0.0 );
~QgsSVGFillSymbolLayer();
static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsStringMap() );
// implemented from base classes
QString layerType() const;
void startRender( QgsSymbolV2RenderContext& context );
void stopRender( QgsSymbolV2RenderContext& context );
void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, QgsSymbolV2RenderContext& context );
QgsStringMap properties() const;
QgsSymbolLayerV2* clone() const;
//getters and setters
void setSvgFilePath( const QString& svgPath );
QString svgFilePath() const { return mSvgFilePath; }
void setPatternWidth( double width ) { mPatternWidth = width;}
double patternWidth() const { return mPatternWidth; }
QgsSymbolV2* subSymbol() { return mOutline; }
bool setSubSymbol( QgsSymbolV2* symbol );
protected:
/**Width of the pattern (in QgsSymbolV2 output units)*/
double mPatternWidth;
/**SVG data*/
QByteArray mSvgData;
/**Path to the svg file (or empty if constructed directly from data)*/
QString mSvgFilePath;
/**SVG view box (to keep the aspect ratio */
QRectF mSvgViewBox;
/**Brush that receives rendered pixel image in startRender() method*/
QBrush mBrush;
/**Outline width*/
double mOutlineWidth;
/**Custom outline*/
QgsLineSymbolV2* mOutline;
private:
/**Helper function that gets the view box from the byte array*/
void storeViewBox();
};
class CORE_EXPORT QgsCentroidFillSymbolLayerV2 : public QgsFillSymbolLayerV2
{
public:
QgsCentroidFillSymbolLayerV2();
~QgsCentroidFillSymbolLayerV2();
// static stuff
static QgsSymbolLayerV2* create( const QgsStringMap& properties = QgsStringMap() );
// implemented from base classes
QString layerType() const;
void startRender( QgsSymbolV2RenderContext& context );
void stopRender( QgsSymbolV2RenderContext& context );
void renderPolygon( const QPolygonF& points, QList<QPolygonF>* rings, QgsSymbolV2RenderContext& context );
QgsStringMap properties() const;
QgsSymbolLayerV2* clone() const;
void setColor( const QColor& color );
QgsSymbolV2* subSymbol();
bool setSubSymbol( QgsSymbolV2* symbol );
protected:
QgsMarkerSymbolV2* mMarker;
};
#endif
|