2007-04-02 17:41:47 +00:00
|
|
|
|
|
|
|
class QgsSymbol
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgssymbol.h>
|
|
|
|
%End
|
|
|
|
|
|
|
|
public:
|
|
|
|
/**Constructor*/
|
2008-10-10 20:02:22 +00:00
|
|
|
QgsSymbol(QGis::GeometryType t, QString lvalue="", QString uvalue="", QString label="");
|
2007-04-02 17:41:47 +00:00
|
|
|
/**Constructor*/
|
2008-10-10 20:02:22 +00:00
|
|
|
QgsSymbol(QGis::GeometryType t, QString lvalue, QString uvalue, QString label, QColor c);
|
2007-04-02 17:41:47 +00:00
|
|
|
QgsSymbol(const QgsSymbol&);
|
|
|
|
/**old constructors*/
|
|
|
|
QgsSymbol();
|
|
|
|
QgsSymbol(QColor c);
|
|
|
|
/**Sets the brush*/
|
|
|
|
virtual void setBrush(QBrush b);
|
|
|
|
/**Gets a reference to m_brush, Don't use the brush to change color/style */
|
|
|
|
virtual const QBrush& brush() const;
|
|
|
|
/**Set the color*/
|
|
|
|
virtual void setColor(QColor c);
|
|
|
|
/**Get the current color*/
|
|
|
|
virtual QColor color() const;
|
|
|
|
/**Get the fill color*/
|
|
|
|
virtual QColor fillColor() const;
|
|
|
|
/**Sets the fill color*/
|
|
|
|
virtual void setFillColor(QColor c);
|
|
|
|
/**Get the line width*/
|
2008-05-15 08:13:05 +00:00
|
|
|
virtual double lineWidth() const;
|
2007-04-02 17:41:47 +00:00
|
|
|
/**Sets the line width*/
|
2008-05-15 08:13:05 +00:00
|
|
|
virtual void setLineWidth(double w);
|
2007-04-02 17:41:47 +00:00
|
|
|
/**Sets the pen*/
|
|
|
|
virtual void setPen(QPen p);
|
|
|
|
/**Gets a reference to m_pen. Don't use the pen to change color/style */
|
|
|
|
virtual const QPen& pen() const;
|
|
|
|
|
2009-04-12 22:01:13 +00:00
|
|
|
/**Gets the path to the customs texture image*/
|
|
|
|
virtual QString customTexture() const;
|
|
|
|
/**Sets the path to the custom texture, and sets the brush to use TexturePattern */
|
|
|
|
virtual void setCustomTexture( QString path );
|
|
|
|
|
2007-04-02 17:41:47 +00:00
|
|
|
/**Set the line (pen) style*/
|
|
|
|
virtual void setLineStyle(Qt::PenStyle s);
|
|
|
|
/**Set the fill (brush) style*/
|
|
|
|
virtual void setFillStyle(Qt::BrushStyle s);
|
2009-04-12 22:01:13 +00:00
|
|
|
|
2007-04-02 17:41:47 +00:00
|
|
|
virtual void setLowerValue(QString value);
|
|
|
|
virtual QString lowerValue() const;
|
|
|
|
virtual void setUpperValue(QString value);
|
|
|
|
virtual QString upperValue() const;
|
|
|
|
virtual void setLabel(QString label);
|
|
|
|
virtual QString label() const;
|
|
|
|
|
|
|
|
/**Set point symbol from name*/
|
|
|
|
virtual void setNamedPointSymbol(QString name);
|
|
|
|
/**Get point symbol*/
|
|
|
|
virtual QString pointSymbolName() const;
|
|
|
|
/**Set size*/
|
2008-08-02 07:54:31 +00:00
|
|
|
virtual void setPointSize(double s);
|
2007-04-02 17:41:47 +00:00
|
|
|
/**Get size*/
|
2008-08-02 07:54:31 +00:00
|
|
|
virtual double pointSize() const;
|
2007-04-02 17:41:47 +00:00
|
|
|
//! Destructor
|
|
|
|
virtual ~QgsSymbol();
|
|
|
|
|
|
|
|
//! Get a little icon for the legend
|
|
|
|
virtual QImage getLineSymbolAsImage();
|
|
|
|
|
|
|
|
//! Get a little icon for the legend
|
|
|
|
virtual QImage getPolygonSymbolAsImage();
|
|
|
|
|
|
|
|
/** Get QImage representation of point symbol with current settings
|
2009-04-12 22:01:13 +00:00
|
|
|
* and scaled (can be slow when scale != 1.0)
|
|
|
|
*/
|
2009-06-09 06:57:55 +00:00
|
|
|
virtual QImage getPointSymbolAsImage( double widthScale = 1.0,
|
2009-04-12 22:01:13 +00:00
|
|
|
bool selected = false,
|
|
|
|
QColor selectionColor = Qt::yellow,
|
|
|
|
double scale = 1.0,
|
|
|
|
double rotation = 0.0,
|
2009-08-05 19:55:30 +00:00
|
|
|
double rasterScaleFactor = 1.0,
|
2009-08-05 16:43:33 +00:00
|
|
|
double opacity = 1.0 );
|
2007-04-02 17:41:47 +00:00
|
|
|
|
|
|
|
/**Writes the contents of the symbol to a configuration file
|
|
|
|
@ return true in case of success*/
|
2008-12-07 03:10:00 +00:00
|
|
|
virtual bool writeXML( QDomNode & item, QDomDocument & document, const QgsVectorLayer *vl ) const;
|
2007-04-02 17:41:47 +00:00
|
|
|
/**Reads the contents of the symbol from a configuration file
|
|
|
|
@ return true in case of success*/
|
2008-12-07 03:10:00 +00:00
|
|
|
virtual bool readXML( QDomNode & symbol, const QgsVectorLayer *vl );
|
2007-04-02 17:41:47 +00:00
|
|
|
/**Returns if this symbol is point/ line or polygon*/
|
2008-10-10 20:02:22 +00:00
|
|
|
QGis::GeometryType type() const;
|
2007-04-02 17:41:47 +00:00
|
|
|
|
2009-04-12 22:01:13 +00:00
|
|
|
/**Returns the number of the rotation classification field*/
|
|
|
|
int rotationClassificationField() const;
|
|
|
|
/**Sets the number of the rotation classicifation field
|
|
|
|
\param field the number of the field to classify for rotation*/
|
|
|
|
void setRotationClassificationField( int field );
|
|
|
|
|
|
|
|
/**Returns the number of the scale classification field*/
|
|
|
|
int scaleClassificationField() const;
|
|
|
|
/**Sets the number of the scale classicifation field
|
|
|
|
\param field the number of the field to classify for scale*/
|
|
|
|
void setScaleClassificationField( int field );
|
|
|
|
|
2007-04-02 17:41:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|