347 changes: 55 additions & 292 deletions qgis/src/qgscontinuouscolrenderer.cpp

Large diffs are not rendered by default.

47 changes: 17 additions & 30 deletions qgis/src/qgscontinuouscolrenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,45 +19,39 @@
#define QGSCONTINUOUSCOLRENDERER_H

#include "qgsrenderer.h"
#include "qgsrenderitem.h"
#include <qpainter.h>
#include "qgsmaptopixel.h"
#include "qgspoint.h"
#include "qgsfeature.h"
#include <iostream>
#include "qgsdlgvectorlayerproperties.h"

class QgsSymbol;

/**Renderer class which interpolates rgb values linear between the minimum and maximum value of the classification field*/
class QgsContinuousColRenderer: public QgsRenderer
{
public:
QgsContinuousColRenderer();
QgsContinuousColRenderer(QGis::VectorType type);
virtual ~QgsContinuousColRenderer();
/**Sets the initial symbology configuration for a layer. Besides of applying default symbology settings, an instance of the corresponding renderer dialog is created and associated with the layer (or with the property dialog, if pr is not 0). Finally, a pixmap for the legend is drawn (or, if pr is not 0, it is stored in the property dialog, until the settings are applied).
@param layer the vector layer associated with the renderer
@param pr the property dialog. This is only needed if the renderer is created from the property dialog and not yet associated with the vector layer, otherwise 0*/
void initializeSymbology(QgsVectorLayer* layer, QgsDlgVectorLayerProperties* pr=0);
/**Renders the feature using the minimum and maximum value of the classification field*/
void renderFeature(QPainter* p, QgsFeature* f, QPicture* pic, double* scalefactor, bool selected, int oversampling = 1, double widthScale = 1.);
/**Returns the number of the classification field*/
int classificationField() const;
/**Sets the id of the classification field*/
void setClassificationField(int id);
/**Sets the item for the minimum value. The item has to be created using the new operator and is automatically deleted when inserting a new item or when the instance is destroyed*/
void setMinimumItem(QgsRenderItem* it);
/**Sets the item for the maximum value. The item has to be created using the new operator and is automatically deleted when inserting a new item or when the instance is destroyed*/
void setMaximumItem(QgsRenderItem* it);
/**Returns the item for the minimum value*/
QgsRenderItem* minimumItem();
/**Returns the item for the maximum value*/
QgsRenderItem* maximumItem();
/**Sets the symbol for the minimum value. The symbol has to be created using the new operator and is automatically deleted when inserting a new symbol or when the instance is destroyed*/
void setMinimumSymbol(QgsSymbol* sy);
/**Sets the symbol for the maximum value. The symbol has to be created using the new operator and is automatically deleted when inserting a new symbol or when the instance is destroyed*/
void setMaximumSymbol(QgsSymbol* sy);
/**Returns the symbol for the minimum value*/
QgsSymbol* minimumSymbol();
/**Returns the symbol for the maximum value*/
QgsSymbol* maximumSymbol();
/**Reads the renderer configuration from an XML file
@param rnode the DOM node to read
@param vl the vector layer which will be associated with the renderer*/
virtual void readXML(const QDomNode& rnode, QgsVectorLayer& vl);
/**Writes the contents of the renderer to a configuration file*/
virtual void writeXML(std::ostream& xml);
/**Writes the contents of the renderer to a configuration file
@ return true in case of success*/
virtual bool writeXML( QDomNode & layer_node, QDomDocument & document );
Expand All @@ -68,23 +62,16 @@ class QgsContinuousColRenderer: public QgsRenderer
/**Returns the renderers name*/
QString name();
/**Return symbology items*/
const std::list<QgsRenderItem*> items() const;
const std::list<QgsSymbol*> symbols() const;
protected:
/**Number of the classification field (it must be a numerical field)*/
int mClassificationField;
/**Item for the minimum value*/
QgsRenderItem* mMinimumItem;
QgsSymbol* mMinimumSymbol;
/**Item for the maximum value*/
QgsRenderItem* mMaximumItem;
QgsSymbol* mMaximumSymbol;
};

inline QgsContinuousColRenderer::QgsContinuousColRenderer(): mMinimumItem(0), mMaximumItem(0)
{
//call superclass method to set up selection colour
initialiseSelectionColor();

}

inline int QgsContinuousColRenderer::classificationField() const
{
return mClassificationField;
Expand All @@ -95,14 +82,14 @@ inline void QgsContinuousColRenderer::setClassificationField(int id)
mClassificationField=id;
}

inline QgsRenderItem* QgsContinuousColRenderer::minimumItem()
inline QgsSymbol* QgsContinuousColRenderer::minimumSymbol()
{
return mMinimumItem;
return mMinimumSymbol;
}

inline QgsRenderItem* QgsContinuousColRenderer::maximumItem()
inline QgsSymbol* QgsContinuousColRenderer::maximumSymbol()
{
return mMaximumItem;
return mMaximumSymbol;
}

inline bool QgsContinuousColRenderer::needsAttributes()
Expand Down
133 changes: 72 additions & 61 deletions qgis/src/qgsdlgvectorlayerproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@
#include <qapplication.h>


QgsDlgVectorLayerProperties::QgsDlgVectorLayerProperties(QgsVectorLayer * lyr, QWidget * parent, const char *name, bool modal):QgsDlgVectorLayerPropertiesBase(parent, name, modal), layer(lyr), rendererDirty(false), bufferDialog(layer->rendererDialog()),
bufferRenderer(layer->
renderer())
QgsDlgVectorLayerProperties::QgsDlgVectorLayerProperties(QgsVectorLayer * lyr, QWidget * parent, const char *name, bool modal):QgsDlgVectorLayerPropertiesBase(parent, name, modal), layer(lyr), mRendererDialog(0)
{
// Create the Label dialog tab
QVBoxLayout *layout = new QVBoxLayout( labelOptionsFrame );
Expand Down Expand Up @@ -105,16 +103,33 @@ bufferRenderer(layer->

QgsDlgVectorLayerProperties::~QgsDlgVectorLayerProperties()
{
widgetStackRenderers->removeWidget(bufferDialog);
if (rendererDirty)
{
delete bufferDialog;
delete bufferRenderer;
}

}

void QgsDlgVectorLayerProperties::alterLayerDialog(const QString & dialogString)
{

widgetStackRenderers->removeWidget(mRendererDialog);
delete mRendererDialog;
mRendererDialog=0;
if(dialogString == tr("Single Symbol"))
{
mRendererDialog = new QgsSiSyDialog(layer);
}
else if(dialogString == tr("Graduated Symbol"))
{
mRendererDialog = new QgsGraSyDialog(layer);
}
else if(dialogString == tr("Continuous Color"))
{
mRendererDialog = new QgsContColDialog(layer);
}
widgetStackRenderers->addWidget(mRendererDialog);
widgetStackRenderers->raiseWidget(mRendererDialog);


#if 0 //disabled during symbology reorganisation

/*#ifdef QGISDEBUG
qDebug( "%s:%d QgsDlgVectorLayerProperties::alterLayerDialog(%s)",
__FILE__, __LINE__, dialogString );
Expand All @@ -128,7 +143,7 @@ void QgsDlgVectorLayerProperties::alterLayerDialog(const QString & dialogString)
//create a new Dialog
if (dialogString == tr("Single Symbol"))
{
bufferRenderer = new QgsSingleSymRenderer();
bufferRenderer = new QgsSingleSymRenderer(layer->vectorType());
} else if (dialogString == tr("Graduated Symbol"))
{
bufferRenderer = new QgsGraduatedSymRenderer();
Expand Down Expand Up @@ -184,22 +199,18 @@ void QgsDlgVectorLayerProperties::alterLayerDialog(const QString & dialogString)
widgetStackRenderers->addWidget(bufferDialog);
widgetStackRenderers->raiseWidget(bufferDialog);
rendererDirty = true;
}

void QgsDlgVectorLayerProperties::setRendererDirty(bool enabled)
{
rendererDirty = enabled;
#endif //0
}


QDialog *QgsDlgVectorLayerProperties::getBufferDialog()
{
return bufferDialog;
//return bufferDialog;
}

QgsRenderer *QgsDlgVectorLayerProperties::getBufferRenderer()
{
return bufferRenderer;
//return bufferRenderer;
}

void QgsDlgVectorLayerProperties::setLegendType(QString type)
Expand Down Expand Up @@ -264,21 +275,42 @@ void QgsDlgVectorLayerProperties::reset( void )
legendtypecombobox->insertItem(tr("Single Symbol"));
legendtypecombobox->insertItem(tr("Graduated Symbol"));
legendtypecombobox->insertItem(tr("Continuous Color"));
legendtypecombobox->insertItem(tr("Unique Value"));
/*legendtypecombobox->insertItem(tr("Unique Value"));
if( layer->vectorType()==QGis::Point )
{
legendtypecombobox->insertItem(tr("Single Marker"));
legendtypecombobox->insertItem(tr("Graduated Marker"));
legendtypecombobox->insertItem(tr("Unique Value Marker"));
}
}*/
}

QObject::connect(legendtypecombobox, SIGNAL(activated(const QString &)), this, SLOT(alterLayerDialog(const QString &)));
//todo: find out the type of renderer in the vectorlayer, create a dialog with these settings and add it to the form
delete mRendererDialog;
mRendererDialog=0;
QString rtype=layer->renderer()->name();
if(rtype=="Single Symbol")
{
mRendererDialog=new QgsSiSyDialog(layer);
}
else if(rtype=="Graduated Symbol")
{
mRendererDialog=new QgsGraSyDialog(layer);
}
else if(rtype=="Continuous Color")
{
mRendererDialog=new QgsContColDialog(layer);
}

if(mRendererDialog)
{
widgetStackRenderers->addWidget(mRendererDialog);
widgetStackRenderers->raiseWidget(mRendererDialog);
}


//insert the renderer dialog of the vector layer into the widget stack
widgetStackRenderers->addWidget(bufferDialog);
widgetStackRenderers->raiseWidget(bufferDialog);
QObject::connect(legendtypecombobox, SIGNAL(activated(const QString &)), this, SLOT(alterLayerDialog(const QString &)));


//set the metadata contents
teMetadata->setText(getMetadata());
actionDialog->init();
Expand All @@ -299,27 +331,9 @@ void QgsDlgVectorLayerProperties::btnHelp_clicked()
}
void QgsDlgVectorLayerProperties::pbnOK_clicked()
{
//make sure changes are applied
pbnApply_clicked();
//
if (rendererDirty)
{
widgetStackRenderers->removeWidget(bufferDialog);
delete bufferDialog;
delete bufferRenderer;
bufferDialog = layer->rendererDialog();
bufferRenderer = layer->renderer();
widgetStackRenderers->addWidget(bufferDialog);
widgetStackRenderers->raiseWidget(bufferDialog);
rendererDirty = false;
//restore the right name in the combobox
if(bufferRenderer)
{
legendtypecombobox->setCurrentText(tr(bufferRenderer->name()));
}
}
//reject();
close();
layer->setLayerProperties(0);
close(true);
}
void QgsDlgVectorLayerProperties::pbnApply_clicked()
{
Expand All @@ -346,38 +360,34 @@ void QgsDlgVectorLayerProperties::pbnApply_clicked()
// update the display field
layer->setDisplayField(displayFieldComboBox->currentText());

if (rendererDirty)
{
layer->setRenderer(bufferRenderer);
layer->setRendererDialog(bufferDialog);
}

actionDialog->apply();

labelDialog->apply();
layer->setLabelOn(labelCheckBox->isChecked());
layer->setLayerName(displayName());


QgsSiSyDialog *sdialog = dynamic_cast < QgsSiSyDialog * >(layer->rendererDialog());
QgsGraSyDialog *gdialog = dynamic_cast < QgsGraSyDialog * >(layer->rendererDialog());
QgsContColDialog *cdialog = dynamic_cast < QgsContColDialog * >(layer->rendererDialog());
QgsSiMaDialog* smdialog = dynamic_cast < QgsSiMaDialog * >(layer->rendererDialog());
QgsSiSyDialog *sdialog = dynamic_cast < QgsSiSyDialog * >(widgetStackRenderers->visibleWidget());
QgsGraSyDialog *gdialog = dynamic_cast < QgsGraSyDialog * >(widgetStackRenderers->visibleWidget());
QgsContColDialog *cdialog = dynamic_cast < QgsContColDialog * >(widgetStackRenderers->visibleWidget());
/*QgsSiMaDialog* smdialog = dynamic_cast < QgsSiMaDialog * >(layer->rendererDialog());
QgsGraMaDialog* gmdialog = dynamic_cast< QgsGraMaDialog * >(layer->rendererDialog());
QgsUValDialog* udialog = dynamic_cast< QgsUValDialog * > (layer->rendererDialog());
QgsUValMaDialog* umdialog = dynamic_cast< QgsUValMaDialog * > (layer->rendererDialog());
QgsUValMaDialog* umdialog = dynamic_cast< QgsUValMaDialog * > (layer->rendererDialog());*/

if (sdialog)
{
sdialog->apply();
} else if (gdialog)
{
}
else if (gdialog)
{
gdialog->apply();
} else if (cdialog)
}
else if (cdialog)
{
cdialog->apply();
}
else if(smdialog)
/*else if(smdialog)
{
smdialog->apply();
}
Expand All @@ -392,9 +402,10 @@ void QgsDlgVectorLayerProperties::pbnApply_clicked()
else if(umdialog)
{
umdialog->apply();
}
}*/

layer->triggerRepaint();

rendererDirty = false;
}

void QgsDlgVectorLayerProperties::pbnQueryBuilder_clicked()
Expand Down Expand Up @@ -600,4 +611,4 @@ void QgsDlgVectorLayerProperties::pbnChangeSpatialRefSys_clicked()
}
delete mySelector;
leSpatialRefSys->setText(layer->coordinateTransform()->sourceSRS().proj4String());
}
}
19 changes: 9 additions & 10 deletions qgis/src/qgsdlgvectorlayerproperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@ class QgsDlgVectorLayerProperties : public QgsDlgVectorLayerPropertiesBase{
void setLegendType(QString type);
/**Returns the display name entered in the dialog*/
QString displayName();
void setRendererDirty(bool){}
/**Sets the attribute that is used in the Identify Results dialog box*/
void setDisplayField(QString name);
/**Sets the rendererDirty flag*/
void setRendererDirty(bool enabled=true);
/**Returns a pointer to the bufferDialog*/
QDialog* getBufferDialog();
/**Sets the buffer dialog*/
Expand Down Expand Up @@ -77,28 +76,28 @@ class QgsDlgVectorLayerProperties : public QgsDlgVectorLayerPropertiesBase{

protected:
QgsVectorLayer *layer;
/**Flag indicating that the render type has changed compared to the vector layer (true)*/
bool rendererDirty;
/**Renderer dialog which is shown. If apply is pressed, it assigned to the vector layer*/
QDialog* bufferDialog;
/**Renderer dialog which is shown*/
QDialog* mRendererDialog;
/**Buffer renderer, which is assigned to the vector layer when apply is pressed*/
QgsRenderer* bufferRenderer;
//QgsRenderer* bufferRenderer;
/**Label dialog. If apply is pressed, options are applied to vector's QgsLabel */
QgsLabelDialog* labelDialog;
/**Actions dialog. If apply is pressed, the actions are stored for later use */
QgsAttributeActionDialog* actionDialog;
/**Buffer pixmap which takes the picture of renderers before they are assigned to the vector layer*/
QPixmap bufferPixmap;
//QPixmap bufferPixmap;
};


inline void QgsDlgVectorLayerProperties::setBufferDialog(QDialog* dialog)
{
bufferDialog=dialog;
//bufferDialog=dialog;
}

inline QPixmap* QgsDlgVectorLayerProperties::getBufferPixmap()
{
return &bufferPixmap;
//return &bufferPixmap;
return 0;
}

inline QString QgsDlgVectorLayerProperties::displayName()
Expand Down
6 changes: 6 additions & 0 deletions qgis/src/qgsgraduatedmarenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ void QgsGraduatedMaRenderer::removeItems()

void QgsGraduatedMaRenderer::initializeSymbology(QgsVectorLayer* layer, QgsDlgVectorLayerProperties* pr)
{
#if 0
bool toproperties = false; //if false: rendererDialog is associated with the vector layer and image is rendered, true: rendererDialog is associated with buffer dialog of vector layer properties and no image is rendered
if (pr)
{
Expand Down Expand Up @@ -80,6 +81,7 @@ void QgsGraduatedMaRenderer::initializeSymbology(QgsVectorLayer* layer, QgsDlgVe
{
qWarning("Warning, layer is null in QgsGraduatedMaRenderer::initializeSymbology(..)");
}
#endif //0
}

void QgsGraduatedMaRenderer::renderFeature(QPainter* p, QgsFeature* f,QPicture* pic,
Expand Down Expand Up @@ -142,6 +144,7 @@ void QgsGraduatedMaRenderer::renderFeature(QPainter* p, QgsFeature* f,QPicture*

void QgsGraduatedMaRenderer::readXML(const QDomNode& rnode, QgsVectorLayer& vl)
{
#if 0
QDomNode classnode = rnode.namedItem("classificationfield");
int classificationfield = classnode.toElement().text().toInt();
this->setClassificationField(classificationfield);
Expand Down Expand Up @@ -236,10 +239,12 @@ void QgsGraduatedMaRenderer::readXML(const QDomNode& rnode, QgsVectorLayer& vl)
properties->setLegendType("Graduated Marker");

gdialog->apply();
#endif //0
}

void QgsGraduatedMaRenderer::writeXML(std::ostream& xml)
{
#if 0
xml << "\t\t<graduatedmarker>\n";
xml << "\t\t\t<classificationfield>" + QString::number(this->classificationField()) +
"</classificationfield>\n";
Expand Down Expand Up @@ -268,6 +273,7 @@ void QgsGraduatedMaRenderer::writeXML(std::ostream& xml)
xml << "\t\t\t</rangerenderitem>\n";
}
xml << "\t\t</graduatedmarker>\n";
#endif //0
}

std::list<int> QgsGraduatedMaRenderer::classificationAttributes()
Expand Down
2 changes: 2 additions & 0 deletions qgis/src/qgsgraduatedmarenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ class QgsGraduatedMaRenderer: public QgsRenderer
QString name();
/**Return symbology items*/
const std::list<QgsRenderItem*> items() const;
/**Return symbology items*/
const std::list<QgsSymbol*> symbols() const {}
protected:
/**Name of the classification field (it must be a numerical field)*/
int mClassificationField;
Expand Down
138 changes: 35 additions & 103 deletions qgis/src/qgsgraduatedsymrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,86 +26,87 @@
#include <qdom.h>
#include <qpixmap.h>
#include <qpicture.h>
//XXX Inlining this destructor kills build on WIN32 - sorry


QgsGraduatedSymRenderer::QgsGraduatedSymRenderer(QGis::VectorType type)
{
mVectorType=type;
//call superclass method to set up selection colour
initialiseSelectionColor();
}

QgsGraduatedSymRenderer::~QgsGraduatedSymRenderer()
{
//free the memory first
/*for (std::list < QgsRangeRenderItem * >::iterator it = mItems.begin(); it != mItems.end(); ++it)
{
delete *it;
}

}

//and remove the pointers then
mItems.clear();*/
removeItems();
const std::list<QgsSymbol*> QgsGraduatedSymRenderer::symbols() const
{
return mSymbols;
}

void QgsGraduatedSymRenderer::removeItems()
void QgsGraduatedSymRenderer::removeSymbols()
{
//free the memory first
for (std::list < QgsRangeRenderItem * >::iterator it = mItems.begin(); it != mItems.end(); ++it)
for (std::list < QgsSymbol * >::iterator it = mSymbols.begin(); it != mSymbols.end(); ++it)
{
delete *it;
}

//and remove the pointers then
mItems.clear();
mSymbols.clear();
}

void QgsGraduatedSymRenderer::renderFeature(QPainter * p, QgsFeature * f, QPicture* pic,
double* scalefactor, bool selected, int oversampling, double widthScale)
{
//first find out the value for the classification attribute
std::vector < QgsFeatureAttribute > vec = f->attributeMap();
//double value = vec[mClassificationField].fieldValue().toDouble();
double value = vec[0].fieldValue().toDouble();

std::list < QgsRangeRenderItem * >::iterator it;
//first find the first render item which contains the feature
for (it = mItems.begin(); it != mItems.end(); ++it)
std::list < QgsSymbol* >::iterator it;
//find the first render item which contains the feature
for (it = mSymbols.begin(); it != mSymbols.end(); ++it)
{
if (value >= (*it)->value().toDouble() && value <= (*it)->upper_value().toDouble())
if (value >= (*it)->lowerValue().toDouble() && value <= (*it)->upperValue().toDouble())
{
break;
}
}

if (it == mItems.end()) //value is contained in no item
if (it == mSymbols.end()) //value is contained in no item
{
std::cout << "Warning, value is contained in no class" << std::endl << std::flush;
return;
}
else
{
//set the qpen and qpainter to the right values

QgsRenderItem *item = *it;

// Point
if ( pic && mVectorType == QGis::Point ) {
*pic = item->getSymbol()->getPointSymbolAsPicture( oversampling, widthScale,
if ( pic && mVectorType == QGis::Point )
{
*pic = (*it)->getPointSymbolAsPicture( oversampling, widthScale,
selected, mSelectionColor );

if ( scalefactor ) *scalefactor = 1;

}

// Line, polygon
if ( mVectorType != QGis::Point )
{
if( !selected )
{
QPen pen=item->getSymbol()->pen();
QPen pen=(*it)->pen();
pen.setWidth ( (int) (widthScale * pen.width()) );
p->setPen(pen);
p->setBrush(item->getSymbol()->brush());
p->setBrush((*it)->brush());
}
else
{
QPen pen=item->getSymbol()->pen();
QPen pen=(*it)->pen();
pen.setColor(mSelectionColor);
pen.setWidth ( (int) (widthScale * pen.width()) );
QBrush brush=item->getSymbol()->brush();
QBrush brush=(*it)->brush();
brush.setColor(mSelectionColor);
p->setPen(pen);
p->setBrush(brush);
Expand All @@ -114,39 +115,6 @@ void QgsGraduatedSymRenderer::renderFeature(QPainter * p, QgsFeature * f, QPictu
}
}

void QgsGraduatedSymRenderer::initializeSymbology(QgsVectorLayer * layer, QgsDlgVectorLayerProperties * pr)
{
bool toproperties = false; //if false: rendererDialog is associated with the vector layer and image is rendered, true: rendererDialog is associated with buffer dialog of vector layer properties and no image is rendered
if (pr)
{
toproperties = true;
}

setClassificationField(0); //the classification field does not matter

if (layer)
{
mVectorType = layer->vectorType();

QgsGraSyDialog *dialog = new QgsGraSyDialog(layer);

if (toproperties)
{
pr->setBufferDialog(dialog);
}
else
{
layer->setRendererDialog(dialog);
QgsLegendItem *item;
layer->updateItemPixmap();
}
}
else
{
qWarning("Warning, layer is null in QgsGraduatedSymRenderer::initializeSymbology(..)");
}
}

void QgsGraduatedSymRenderer::readXML(const QDomNode& rnode, QgsVectorLayer& vl)
{
mVectorType = vl.vectorType();
Expand All @@ -155,43 +123,17 @@ void QgsGraduatedSymRenderer::readXML(const QDomNode& rnode, QgsVectorLayer& vl)

this->setClassificationField(classificationfield);

QDomNode rangerendernode = rnode.namedItem("rangerenderitem");
while (!rangerendernode.isNull())
QDomNode symbolnode = rnode.namedItem("symbol");
while (!symbolnode.isNull())
{
QgsSymbol* sy = new QgsSymbol();
QPen pen;
QBrush brush;

QDomNode lvnode = rangerendernode.namedItem("lowervalue");
QString lowervalue = lvnode.toElement().text();

QDomNode uvnode = rangerendernode.namedItem("uppervalue");
QString uppervalue = uvnode.toElement().text();

QDomNode synode = rangerendernode.namedItem("symbol");

sy->readXML ( synode );
sy->readXML ( symbolnode );
this->addSymbol(sy);

QDomElement labelelement = rangerendernode.namedItem("label").toElement();
QString label = labelelement.text();

//create a renderitem and add it to the renderer

QgsRangeRenderItem *ri = new QgsRangeRenderItem(sy, lowervalue, uppervalue, label);
this->addItem(ri);

rangerendernode = rangerendernode.nextSibling();
symbolnode = symbolnode.nextSibling();
}

vl.setRenderer(this);
QgsGraSyDialog *gdialog = new QgsGraSyDialog(&vl);
vl.setRendererDialog(gdialog);

QgsDlgVectorLayerProperties *properties = new QgsDlgVectorLayerProperties(&vl);
vl.setLayerProperties(properties);
properties->setLegendType("Graduated Symbol");

gdialog->apply();
}

std::list<int> QgsGraduatedSymRenderer::classificationAttributes()
Expand All @@ -215,7 +157,7 @@ bool QgsGraduatedSymRenderer::writeXML( QDomNode & layer_node, QDomDocument & do
QDomText classificationfieldtxt=document.createTextNode(QString::number(mClassificationField));
classificationfield.appendChild(classificationfieldtxt);
graduatedsymbol.appendChild(classificationfield);
for(std::list<QgsRangeRenderItem*>::iterator it=mItems.begin();it!=mItems.end();++it)
for(std::list<QgsSymbol*>::iterator it=mSymbols.begin();it!=mSymbols.end();++it)
{
if(!(*it)->writeXML(graduatedsymbol,document))
{
Expand All @@ -224,13 +166,3 @@ bool QgsGraduatedSymRenderer::writeXML( QDomNode & layer_node, QDomDocument & do
}
return returnval;
}

const std::list<QgsRenderItem*> QgsGraduatedSymRenderer::items() const
{
std::list<QgsRenderItem*> list;
for(std::list<QgsRangeRenderItem*>::const_iterator iter=mItems.begin();iter!=mItems.end();++iter)
{
list.push_back(*iter);
}
return list;
}
37 changes: 11 additions & 26 deletions qgis/src/qgsgraduatedsymrenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,17 @@
class QgsGraduatedSymRenderer: public QgsRenderer
{
public:
QgsGraduatedSymRenderer();
QgsGraduatedSymRenderer(QGis::VectorType type);
virtual ~QgsGraduatedSymRenderer();
/**Adds a new item
\param ri a pointer to the QgsRangeRenderItem to be inserted. It has to be created using the new operator and is automatically destroyed when 'removeItems' is called or when the instance is destroyed*/
void addItem(QgsRangeRenderItem* ri);
\param sy a pointer to the QgsSymbol to be inserted. It has to be created using the new operator and is automatically destroyed when 'removeItems' is called or when this object is destroyed*/
void addSymbol(QgsSymbol* sy);
/**Returns the number of the classification field*/
int classificationField() const;
/**Removes all items*/
void removeItems();
/**Removes all symbols*/
void removeSymbols();
/**Renders an OGRFeature
\param p a painter (usually the one from the current map canvas)
\param f a pointer to a feature to render
Expand All @@ -51,12 +53,6 @@ class QgsGraduatedSymRenderer: public QgsRenderer
/**Sets the number of the classicifation field
\param field the number of the field to classify*/
void setClassificationField(int field);
/**Sets the initial symbology configuration for a layer. Besides of applying default symbology settings, an instance of the corresponding renderer dialog is created and associated with the layer (or with the property dialog, if pr is not 0). Finally, a pixmap for the legend is drawn (or, if pr is not 0, it is stored in the property dialog, until the settings are applied).
@param layer the vector layer associated with the renderer
@param pr the property dialog. This is only needed if the renderer is created from the property dialog and not yet associated with the vector layer, otherwise 0*/
void initializeSymbology(QgsVectorLayer* layer, QgsDlgVectorLayerProperties* pr=0);
/**Returns the list with the render items*/
std::list<QgsRangeRenderItem*>& items();
/**Reads the renderer configuration from an XML file
@param rnode the DOM node to read
@param vl the vector layer which will be associated with the renderer*/
Expand All @@ -70,25 +66,19 @@ class QgsGraduatedSymRenderer: public QgsRenderer
virtual std::list<int> classificationAttributes();
/**Returns the renderers name*/
QString name();
/**Return symbology items*/
const std::list<QgsRenderItem*> items() const;
/**Returns the symbols of the items*/
const std::list<QgsSymbol*> symbols() const;
protected:
/**Name of the classification field (it must be a numerical field)*/
int mClassificationField;
/**List holding the render items for the individual classes*/
std::list<QgsRangeRenderItem*> mItems;
/**List holding the symbols for the individual classes*/
std::list<QgsSymbol*> mSymbols;

};

inline QgsGraduatedSymRenderer::QgsGraduatedSymRenderer()
inline void QgsGraduatedSymRenderer::addSymbol(QgsSymbol* sy)
{
//call superclass method to set up selection colour
initialiseSelectionColor();
}

inline void QgsGraduatedSymRenderer::addItem(QgsRangeRenderItem* ri)
{
mItems.push_back(ri);
mSymbols.push_back(sy);
}

inline int QgsGraduatedSymRenderer::classificationField() const
Expand All @@ -101,11 +91,6 @@ inline void QgsGraduatedSymRenderer::setClassificationField(int field)
mClassificationField=field;
}

inline std::list<QgsRangeRenderItem*>& QgsGraduatedSymRenderer::items()
{
return mItems;
}

inline bool QgsGraduatedSymRenderer::needsAttributes()
{
return true;
Expand Down
272 changes: 131 additions & 141 deletions qgis/src/qgsgrasydialog.cpp

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion qgis/src/qgsgrasydialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class QgsGraSyDialog: public QgsGraSyDialogBase
/**Stores the names and numbers of the fields with numeric values*/
std::map<QString,int> mFieldMap;
/**Stores the classes*/
std::map<QString,QgsRangeRenderItem*> mEntries;
std::map<QString,QgsSymbol*> mEntries;
/**Dialog which shows the settings of the activated class*/
QgsSiSyDialog sydialog;
int mClassificationField;
Expand Down
8 changes: 3 additions & 5 deletions qgis/src/qgsrenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,14 @@ class QColor;
#include <qcolor.h>

class QgsRenderItem;
class QgsSymbol;

/**Abstract base class for renderers. A renderer holds all the information necessary to draw the contents of a vector layer to a map canvas. The vector layer then passes each feature to paint to the renderer*/
class QgsRenderer
{
public:
/** Default ctor sets up selection colour from project properties */
QgsRenderer();
/**Sets the initial symbology configuration for a layer. Besides of applying default symbology settings, an instance of the corresponding renderer dialog is created and associated with the layer (or with the property dialog, if pr is not 0). Finally, a pixmap for the legend is drawn (or, if pr is not 0, it is stored in the property dialog, until the settings are applied).
@param layer the vector layer associated with the renderer
@param pr the property dialog. This is only needed if the renderer is created from the property dialog and not yet associated with the vector layer, otherwise 0*/
virtual void initializeSymbology(QgsVectorLayer* layer, QgsDlgVectorLayerProperties* pr=0)=0;
/**A vector layer passes features to a renderer object to change the brush and pen of the qpainter
@param p the painter storing brush and pen
@param f a pointer to the feature to be rendered
Expand All @@ -72,11 +69,12 @@ class QgsRenderer
/** Set up the selection color by reading approriate values from project props */
void initialiseSelectionColor();
/**Return symbology items*/
virtual const std::list<QgsRenderItem*> items() const=0;
virtual const std::list<QgsSymbol*> symbols() const=0;
/**Color to draw selected features - static so we can change it in proj props and automatically
all renderers are updated*/
static QColor mSelectionColor;
/**Layer type*/
protected:
QGis::VectorType mVectorType;

};
Expand Down
4 changes: 4 additions & 0 deletions qgis/src/qgssimarenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

void QgsSiMaRenderer::initializeSymbology(QgsVectorLayer* layer, QgsDlgVectorLayerProperties* pr)
{
#if 0
bool toproperties = false; //if false: rendererDialog is associated with the vector layer and image is rendered, true: rendererDialog is associated with buffer dialog of vector layer properties and no image is rendered
if (pr)
{
Expand Down Expand Up @@ -59,6 +60,7 @@ void QgsSiMaRenderer::initializeSymbology(QgsVectorLayer* layer, QgsDlgVectorLay
layer->setRendererDialog(dialog);
}
}
#endif //0
}

void QgsSiMaRenderer::renderFeature(QPainter* p, QgsFeature* f, QPicture* pic,
Expand Down Expand Up @@ -86,6 +88,7 @@ void QgsSiMaRenderer::renderFeature(QPainter* p, QgsFeature* f, QPicture* pic,

void QgsSiMaRenderer::readXML(const QDomNode& rnode, QgsVectorLayer& vl)
{
#if 0
QgsMarkerSymbol* msy = new QgsMarkerSymbol();
QPen pen;
QBrush brush;
Expand Down Expand Up @@ -164,6 +167,7 @@ void QgsSiMaRenderer::readXML(const QDomNode& rnode, QgsVectorLayer& vl)
properties->setLegendType("Single Marker");

smdialog->apply();
#endif //0
}

void QgsSiMaRenderer::writeXML(std::ostream& xml)
Expand Down
2 changes: 2 additions & 0 deletions qgis/src/qgssimarenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ class QgsSiMaRenderer: public QgsRenderer
QString name();
/**Return symbology items*/
const std::list<QgsRenderItem*> items() const;
/**Return symbology items*/
const std::list<QgsSymbol*> symbols() const {}
protected:
QgsRenderItem* mItem;
};
Expand Down
258 changes: 41 additions & 217 deletions qgis/src/qgssinglesymrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,30 +30,51 @@
#include <qpicture.h>
#include <qpixmap.h>

QgsSingleSymRenderer::QgsSingleSymRenderer(): mItem(new QgsRenderItem())
QgsSingleSymRenderer::QgsSingleSymRenderer(QGis::VectorType type)
{
//call superclass method to set up selection colour
initialiseSelectionColor();
mVectorType=type;
//call superclass method to set up selection colour
initialiseSelectionColor();

//initial setting based on random color
QgsSymbol* sy = new QgsSymbol(mVectorType);

//random fill colors for points and polygons and pen colors for lines
int red = 1 + (int) (255.0 * rand() / (RAND_MAX + 1.0));
int green = 1 + (int) (255.0 * rand() / (RAND_MAX + 1.0));
int blue = 1 + (int) (255.0 * rand() / (RAND_MAX + 1.0));

if (type == QGis::Line)
{
sy->pen().setColor(QColor(red, green, blue));
}
else
{
sy->setFillColor(QColor(red, green, blue));
sy->setFillStyle(Qt::SolidPattern);
sy->pen().setColor(QColor(0, 0, 0));
}
sy->setLineWidth(1);
mSymbol=sy;
}

QgsSingleSymRenderer::~QgsSingleSymRenderer()
{
delete mItem;
delete mSymbol;
}

void QgsSingleSymRenderer::addItem(QgsRenderItem* ri)
void QgsSingleSymRenderer::addSymbol(QgsSymbol* sy)
{
delete mItem;
mItem = ri;
delete mSymbol;
mSymbol=sy;
}

void QgsSingleSymRenderer::renderFeature(QPainter * p, QgsFeature * f, QPicture* pic,
double* scalefactor, bool selected, int oversampling, double widthScale)
{
// Point
if ( pic && mVectorType == QGis::Point) {
*pic = mItem->getSymbol()->getPointSymbolAsPicture( oversampling, widthScale,
*pic = mSymbol->getPointSymbolAsPicture( oversampling, widthScale,
selected, mSelectionColor );

if ( scalefactor ) *scalefactor = 1;
Expand All @@ -64,211 +85,30 @@ void QgsSingleSymRenderer::renderFeature(QPainter * p, QgsFeature * f, QPicture*
{
if( !selected )
{
QPen pen=mItem->getSymbol()->pen();
QPen pen=mSymbol->pen();
pen.setWidth ( (int) (widthScale * pen.width()) );
p->setPen(pen);
p->setBrush(mItem->getSymbol()->brush());
p->setBrush(mSymbol->brush());
}
else
{
QPen pen=mItem->getSymbol()->pen();
QPen pen=mSymbol->pen();
pen.setWidth ( (int) (widthScale * pen.width()) );
pen.setColor(mSelectionColor);
QBrush brush=mItem->getSymbol()->brush();
QBrush brush=mSymbol->brush();
brush.setColor(mSelectionColor);
p->setPen(pen);
p->setBrush(brush);
}
}
}

void QgsSingleSymRenderer::initializeSymbology(QgsVectorLayer * layer, QgsDlgVectorLayerProperties * pr)
{
bool toproperties = false; //if false: rendererDialog is associated with the vector layer and image is rendered, true: rendererDialog is associated with buffer dialog of vector layer properties and no image is rendered
if (pr)
{
toproperties = true;
}

if (layer)
{
mVectorType = layer->vectorType();
QgsSymbol* sy = new QgsSymbol();
sy->brush().setStyle(Qt::SolidPattern);
sy->pen().setStyle(Qt::SolidLine);
sy->pen().setWidth(1);//set width 1 as default instead of width 0

//random fill colors for points and polygons and pen colors for lines
int red = 1 + (int) (255.0 * rand() / (RAND_MAX + 1.0));
int green = 1 + (int) (255.0 * rand() / (RAND_MAX + 1.0));
int blue = 1 + (int) (255.0 * rand() / (RAND_MAX + 1.0));

//font tor the legend text
QFont f("arial", 10, QFont::Normal);
QFontMetrics fm(f);

QPixmap *pixmap;
if (toproperties)
{
pixmap = pr->getBufferPixmap();
}
else
{
pixmap = layer->legendPixmap();
}

QString name = layer->name();
int width = 40 + fm.width(layer->name());
int height = (fm.height() + 10 > 35) ? fm.height() + 10 : 35;

pixmap->resize(width, height);
pixmap->fill();
QPainter p(pixmap);
p.setPen(sy->pen());

if (layer->vectorType() == QGis::Line)
{
sy->pen().setColor(QColor(red, green, blue));
//paint the pixmap for the legend
p.setPen(sy->pen());
p.drawLine(10, pixmap->height() - 25, 25, pixmap->height() - 10);
}
else
{
sy->brush().setColor(QColor(red, green, blue));
sy->pen().setColor(QColor(0, 0, 0));
//paint the pixmap for the legend
p.setPen(sy->pen());
p.setBrush(sy->brush());
if (layer->vectorType() == QGis::Point)
{
//p.drawRect(20, pixmap->height() - 17, 5, 5);
QPixmap pm = sy->getPointSymbolAsPixmap();
p.drawPixmap ( (int) (17-pm.width()/2), (int) ((pixmap->height()-pm.height())/2), pm );
}
else //polygon
{
p.drawRect(10, pixmap->height() - 25, 20, 15);
}
}

p.setPen(Qt::black);
p.setFont(f);
p.drawText(35, pixmap->height() - 10, name);
QgsRenderItem* ri = new QgsRenderItem(sy, "", "");
addItem(ri);

QgsSiSyDialog *dialog = new QgsSiSyDialog(layer);
if (toproperties)
{
mVectorType = layer->vectorType();
QgsSymbol* sy = new QgsSymbol();
sy->brush().setStyle(Qt::SolidPattern);
sy->pen().setStyle(Qt::SolidLine);
sy->pen().setWidth(1);//set width 1 as default instead of width 0

//random fill colors for points and polygons and pen colors for lines
int red = 1 + (int) (255.0 * rand() / (RAND_MAX + 1.0));
int green = 1 + (int) (255.0 * rand() / (RAND_MAX + 1.0));
int blue = 1 + (int) (255.0 * rand() / (RAND_MAX + 1.0));

//font tor the legend text
QFont f("arial", 10, QFont::Normal);
QFontMetrics fm(f);

QPixmap *pixmap;
if (toproperties)
{
pixmap = pr->getBufferPixmap();
}
else
{
pixmap = layer->legendPixmap();
}

QString name = layer->name();
int width = 40 + fm.width(layer->name());
int height = (fm.height() + 10 > 35) ? fm.height() + 10 : 35;

pixmap->resize(width, height);
pixmap->fill();
QPainter p(pixmap);
p.setPen(sy->pen());

if (layer->vectorType() == QGis::Line)
{
sy->pen().setColor(QColor(red, green, blue));
//paint the pixmap for the legend
p.setPen(sy->pen());
p.drawLine(10, pixmap->height() - 25, 25, pixmap->height() - 10);
}
else
{
sy->brush().setColor(QColor(red, green, blue));
sy->pen().setColor(QColor(0, 0, 0));
//paint the pixmap for the legend
p.setPen(sy->pen());
p.setBrush(sy->brush());
if (layer->vectorType() == QGis::Point)
{
//p.drawRect(20, pixmap->height() - 17, 5, 5);
QPixmap pm = sy->getPointSymbolAsPixmap();
p.drawPixmap ( (int) (17-pm.width()/2), (int) ((pixmap->height()-pm.height())/2), pm );
}
else //polygon
{
p.drawRect(10, pixmap->height() - 25, 20, 15);
}
}

p.setPen(Qt::black);
p.setFont(f);
p.drawText(35, pixmap->height() - 10, name);
QgsRenderItem* ri = new QgsRenderItem(sy, "", "");
addItem(ri);

QgsSiSyDialog *dialog = new QgsSiSyDialog(layer);
if (toproperties)
{
pr->setBufferDialog(dialog);
}
else
{
layer->setRendererDialog(dialog);
QgsLegendItem *item;
layer->updateItemPixmap();
}
}
else
{
layer->setRendererDialog(dialog);
QgsLegendItem *item;
layer->updateItemPixmap();
}
}
else
{
qWarning("Warning, null pointer in QgsSingleSymRenderer::initializeSymbology()");
}
}

void QgsSingleSymRenderer::readXML(const QDomNode& rnode, QgsVectorLayer& vl)
{
mVectorType = vl.vectorType();
QgsSymbol* sy = new QgsSymbol();

QDomNode rinode = rnode.namedItem("renderitem");

Q_ASSERT( ! rinode.isNull() );

QDomNode vnode = rinode.namedItem("value");

Q_ASSERT( ! rinode.isNull() );

QDomElement velement = vnode.toElement();
QString value = velement.text();

QDomNode synode = rinode.namedItem("symbol");
QDomNode synode = rnode.namedItem("symbol");

if ( synode.isNull() )
{
Expand All @@ -280,35 +120,19 @@ void QgsSingleSymRenderer::readXML(const QDomNode& rnode, QgsVectorLayer& vl)
sy->readXML ( synode );
}

QDomNode lnode = rinode.namedItem("label");

Q_ASSERT( ! rinode.isNull() );

QDomElement lnodee = lnode.toElement();
QString label = lnodee.text();

//create a renderer and add it to the vector layer
QgsRenderItem* ri = new QgsRenderItem(sy, value, label);
this->addItem(ri);
this->addSymbol(sy);
vl.setRenderer(this);
QgsSiSyDialog *sdialog = new QgsSiSyDialog(&vl);
vl.setRendererDialog(sdialog);

QgsDlgVectorLayerProperties *properties = new QgsDlgVectorLayerProperties(&vl);
vl.setLayerProperties(properties);
properties->setLegendType("Single Symbol");

sdialog->apply();
}

bool QgsSingleSymRenderer::writeXML( QDomNode & layer_node, QDomDocument & document )
{
bool returnval=false;
QDomElement singlesymbol=document.createElement("singlesymbol");
layer_node.appendChild(singlesymbol);
if(mItem)
if(mSymbol)
{
returnval=mItem->writeXML(singlesymbol,document);
returnval=mSymbol->writeXML(singlesymbol,document);
}
return returnval;
}
Expand All @@ -325,10 +149,10 @@ QString QgsSingleSymRenderer::name()
return "Single Symbol";
}

const std::list<QgsRenderItem*> QgsSingleSymRenderer::items() const
const std::list<QgsSymbol*> QgsSingleSymRenderer::symbols() const
{
std::list<QgsRenderItem*> list;
list.push_back(mItem);
return list;
std::list<QgsSymbol*> list;
list.push_back(mSymbol);
return list;
}

30 changes: 15 additions & 15 deletions qgis/src/qgssinglesymrenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@

#include "qgsrenderer.h"
#include "qgsrenderitem.h"
#include "qgssymbol.h"
#include "qgspoint.h"
#include "qpainter.h"
#include <qpainter.h>
#include "qgsmaptopixel.h"
#include "qgsdlgvectorlayerproperties.h"
class QgsFeature;
Expand All @@ -31,18 +32,14 @@ class QgsFeature;
class QgsSingleSymRenderer: public QgsRenderer
{
public:
QgsSingleSymRenderer();
QgsSingleSymRenderer(QGis::VectorType type);
virtual ~QgsSingleSymRenderer();
/**Replaces the current mItem by ri*/
void addItem(QgsRenderItem* ri);
/**Returns a pointer to mItem*/
QgsRenderItem* item();
/**Replaces the current mSymbol by sy*/
void addSymbol(QgsSymbol* sy);
/*Returns a pointer to mSymbol*/
QgsSymbol* symbol();
/**Renders an OGRFeature*/
void renderFeature(QPainter* p, QgsFeature* f, QPicture* pic, double* scalefactor, bool selected, int oversampling = 1, double widthScale = 1.);
/**Sets the initial symbology configuration for a layer. Besides of applying default symbology settings, an instance of the corresponding renderer dialog is created and associated with the layer (or with the property dialog, if pr is not 0). Finally, a pixmap for the legend is drawn (or, if pr is not 0, it is stored in the property dialog, until the settings are applied).
@param layer the vector layer associated with the renderer
@param pr the property dialog. This is only needed if the renderer is created from the property dialog and not yet associated with the vector layer, otherwise 0*/
virtual void initializeSymbology(QgsVectorLayer* layer, QgsDlgVectorLayerProperties* pr=0);
/**Reads the renderer configuration from an XML file
@param rnode the DOM node to read
@param vl the vector layer which will be associated with the renderer*/
Expand All @@ -58,17 +55,20 @@ class QgsSingleSymRenderer: public QgsRenderer
virtual std::list<int> classificationAttributes();
/**Returns the renderers name*/
virtual QString name();
/**Return symbology items*/
const std::list<QgsRenderItem*> items() const;
/**Returns a list containing mSymbol*/
const std::list<QgsSymbol*> symbols() const;
protected:
QgsRenderItem* mItem;
/**Object containing symbology information*/
QgsSymbol* mSymbol;
};

inline QgsRenderItem* QgsSingleSymRenderer::item()
inline QgsSymbol* QgsSingleSymRenderer::symbol()
{
return mItem;
return mSymbol;
}

inline bool QgsSingleSymRenderer::needsAttributes(){
return false;
}

#endif
118 changes: 47 additions & 71 deletions qgis/src/qgssisydialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ QgsSiSyDialog::QgsSiSyDialog():QgsSiSyDialogBase(), mVectorLayer(0)
#endif
}

QgsSiSyDialog::QgsSiSyDialog(QgsVectorLayer * layer):QgsSiSyDialogBase(), mVectorLayer(layer)
QgsSiSyDialog::QgsSiSyDialog(QgsVectorLayer * layer): QgsSiSyDialogBase(), mVectorLayer(layer)
{
#ifdef QGISDEBUG
qWarning("constructor QgsSiSyDialog called WITH a layer");
Expand Down Expand Up @@ -135,37 +135,15 @@ QgsSiSyDialog::QgsSiSyDialog(QgsVectorLayer * layer):QgsSiSyDialogBase(), mVecto
nopen->setPixmap(QgsSymbologyUtils::char2PatternPixmap("NoBrush"));


if (layer)
if (mVectorLayer)
{
QgsSingleSymRenderer *renderer;

//initial settings, use the buffer of the propertiesDialog if possible. If this is not possible, use the renderer of the vectorlayer directly
if (mVectorLayer->propertiesDialog())
{
renderer = dynamic_cast < QgsSingleSymRenderer * >(layer->propertiesDialog()->getBufferRenderer());
}
else
{
renderer = dynamic_cast < QgsSingleSymRenderer * >(layer->renderer());
}
QgsSingleSymRenderer *renderer=dynamic_cast<QgsSingleSymRenderer*>(mVectorLayer->renderer());

if (renderer)
{
#ifdef QGISDEBUG
qWarning("Setting up renderer");
#endif
// get the renderer item first
QgsRenderItem *ri = renderer->item();
//if(ri)

// Set
set ( renderer->item()->getSymbol() );

}
else
{
qWarning("%s:%d Warning, typecast failed", __FILE__, __LINE__);
}
set ( renderer->symbol());
}

if (mVectorLayer && mVectorLayer->vectorType() == QGis::Line)
{
Expand All @@ -179,42 +157,45 @@ QgsSiSyDialog::QgsSiSyDialog(QgsVectorLayer * layer):QgsSiSyDialogBase(), mVecto
mGroupPoint->setEnabled(false);

}
//do the signal/slot connections
QObject::connect(btnOutlineColor, SIGNAL(clicked()), this, SLOT(selectOutlineColor()));
//QObject::connect(stylebutton, SIGNAL(clicked()), this, SLOT(selectOutlineStyle()));
QObject::connect(btnFillColor, SIGNAL(clicked()), this, SLOT(selectFillColor()));
QObject::connect(outlinewidthspinbox, SIGNAL(valueChanged(int)), this, SLOT(resendSettingsChanged()));
QObject::connect(mLabelEdit, SIGNAL(textChanged(const QString&)), this, SLOT(resendSettingsChanged()));
QObject::connect(mPointSymbolComboBox, SIGNAL(activated(int)), this, SLOT(resendSettingsChanged()));
QObject::connect(mPointSizeSpinBox, SIGNAL(valueChanged(int)), this, SLOT(resendSettingsChanged()));

//connect fill style and line style buttons
QObject::connect(pbnLineSolid, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(pbnLineDot, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(pbnLineDashDot, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(pbnLineDash, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(pbnLineDashDotDot, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(pbnLineNoPen, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(solid, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(fdiag, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(dense4, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(horizontal, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(bdiag, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(diagcross, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(dense5, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(vertical, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(dense1, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(dense3, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(dense6, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(cross, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(dense2, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(dense7, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(nopen, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));

}
else
{
qWarning("Warning, layer is a null pointer in QgsSiSyDialog::QgsSiSyDialog(QgsVectorLayer)");
}

//do the signal/slot connections
QObject::connect(btnOutlineColor, SIGNAL(clicked()), this, SLOT(selectOutlineColor()));
//QObject::connect(stylebutton, SIGNAL(clicked()), this, SLOT(selectOutlineStyle()));
QObject::connect(btnFillColor, SIGNAL(clicked()), this, SLOT(selectFillColor()));
QObject::connect(outlinewidthspinbox, SIGNAL(valueChanged(int)), this, SLOT(resendSettingsChanged()));
QObject::connect(mLabelEdit, SIGNAL(textChanged(const QString&)), this, SLOT(resendSettingsChanged()));
QObject::connect(mPointSymbolComboBox, SIGNAL(activated(int)), this, SLOT(resendSettingsChanged()));
QObject::connect(mPointSizeSpinBox, SIGNAL(valueChanged(int)), this, SLOT(resendSettingsChanged()));

//connect fill style and line style buttons
QObject::connect(pbnLineSolid, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(pbnLineDot, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(pbnLineDashDot, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(pbnLineDash, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(pbnLineDashDotDot, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(pbnLineNoPen, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(solid, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(fdiag, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(dense4, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(horizontal, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(bdiag, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(diagcross, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(dense5, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(vertical, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(dense1, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(dense3, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(dense6, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(cross, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(dense2, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(dense7, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));
QObject::connect(nopen, SIGNAL(clicked()), this, SLOT(resendSettingsChanged()));

}

QgsSiSyDialog::~QgsSiSyDialog()
Expand Down Expand Up @@ -346,27 +327,23 @@ void QgsSiSyDialog::apply( QgsSymbol *sy )

void QgsSiSyDialog::apply()
{
QgsSymbol* sy = new QgsSymbol();
QgsSymbol* sy = new QgsSymbol(mVectorLayer->vectorType());
apply(sy);

QgsRenderItem* ri = new QgsRenderItem(sy, "blabla", "blabla");

QgsSingleSymRenderer *renderer = dynamic_cast < QgsSingleSymRenderer * >(mVectorLayer->renderer());

if (renderer)
if (!renderer)
{
renderer->addItem(ri);
}
else
{
qWarning("typecast failed in QgsSiSyDialog::apply()");
return;
renderer=new QgsSingleSymRenderer(mVectorLayer->vectorType());
mVectorLayer->setRenderer(renderer);
}

renderer->addSymbol(sy);

//add a pixmap to the legend item

//font tor the legend text
QFont f("arial", 10, QFont::Normal);
/*QFont f("arial", 10, QFont::Normal);
QFontMetrics fm(f);
QPixmap *pix = mVectorLayer->legendPixmap();
Expand Down Expand Up @@ -413,9 +390,8 @@ void QgsSiSyDialog::apply()
if (mVectorLayer->propertiesDialog())
{
mVectorLayer->propertiesDialog()->setRendererDirty(false);
}
}*/
//repaint the map canvas
mVectorLayer->triggerRepaint();
}

void QgsSiSyDialog::set ( QgsSymbol *sy )
Expand Down
2 changes: 1 addition & 1 deletion qgis/src/qgssisydialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#endif

class QString;

class QgsSingleSymRenderer;
class QgsSymbol;
class QgsVectorLayer;

Expand Down
68 changes: 68 additions & 0 deletions qgis/src/qgssymbol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,37 @@
#include <qrect.h>
#include <qpointarray.h>

QgsSymbol::QgsSymbol(QGis::VectorType t, QString lvalue, QString uvalue, QString label)
: mType(t),
mLowerValue(lvalue),
mUpperValue(uvalue),
mLabel(label),
mPointSymbolName( "hard:circle" ),
mPointSize( 6 ),
mCacheUpToDate( false ),
mCacheUpToDate2( false ),
mPointSymbolPixmap(1,1),
mOversampling(1),
mWidthScale(1.0)
{}


QgsSymbol::QgsSymbol(QGis::VectorType t, QString lvalue, QString uvalue, QString label, QColor c)
: mType(t),
mLowerValue(lvalue),
mUpperValue(uvalue),
mLabel(label),
mPen( c ),
mBrush( c ),
mPointSymbolName( "hard:circle" ),
mPointSize( 6 ),
mCacheUpToDate( false ),
mCacheUpToDate2( false ),
mPointSymbolPixmap(1,1),
mOversampling(1),
mWidthScale(1.0)
{}

QgsSymbol::QgsSymbol()
: mPointSymbolName( "hard:circle" ),
mPointSize( 6 ),
Expand Down Expand Up @@ -251,6 +282,21 @@ bool QgsSymbol::writeXML( QDomNode & item, QDomDocument & document )
QDomElement symbol=document.createElement("symbol");
item.appendChild(symbol);

QDomElement lowervalue=document.createElement("lowervalue");
QDomText lowervaluetxt=document.createTextNode(mLowerValue);
symbol.appendChild(lowervalue);
lowervalue.appendChild(lowervaluetxt);

QDomElement uppervalue=document.createElement("uppervalue");
QDomText uppervaluetxt=document.createTextNode(mUpperValue);
symbol.appendChild(uppervalue);
uppervalue.appendChild(uppervaluetxt);

QDomElement label=document.createElement("label");
QDomText labeltxt=document.createTextNode(mLabel);
symbol.appendChild(label);
label.appendChild(labeltxt);

QDomElement pointsymbol=document.createElement("pointsymbol");
QDomText pointsymboltxt=document.createTextNode(pointSymbolName());
symbol.appendChild(pointsymbol);
Expand Down Expand Up @@ -291,6 +337,28 @@ bool QgsSymbol::readXML( QDomNode & synode )
// Legacy project file formats didn't have support for pointsymbol nor
// pointsize DOM elements. Therefore we should check whether these
// actually exist.

QDomNode lvalnode = synode.namedItem("lowervalue");
if( ! lvalnode.isNull() )
{
QDomElement lvalelement = lvalnode.toElement();
mLowerValue=lvalelement.text();
}

QDomNode uvalnode = synode.namedItem("uppervalue");
if( ! uvalnode.isNull() )
{
QDomElement uvalelement = uvalnode.toElement();
mUpperValue=uvalelement.text();
}

QDomNode labelnode = synode.namedItem("label");
if( ! labelnode.isNull() )
{
QDomElement labelelement = labelnode.toElement();
mLabel=labelelement.text();
}

QDomNode psymbnode = synode.namedItem("pointsymbol");

if ( ! psymbnode.isNull() )
Expand Down
53 changes: 51 additions & 2 deletions qgis/src/qgssymbol.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include <iostream>

#include "qgis.h"
#include <qbrush.h>
#include <qpen.h>
#include <qpixmap.h>
Expand All @@ -29,13 +30,17 @@

class QString;

/**Encapsulates settings for drawing*/
/**Encapsulates settings for drawing (QPen, QBrush, Point symbol) and classification
(lower value, upper value)*/
class QgsSymbol{

public:
/**Constructor*/
QgsSymbol();
QgsSymbol(QGis::VectorType t, QString lvalue="", QString uvalue="", QString label="");
/**Constructor*/
QgsSymbol(QGis::VectorType t, QString lvalue, QString uvalue, QString label, QColor c);
/**old constructors*/
QgsSymbol();
QgsSymbol(QColor c);
/**Sets the brush*/
virtual void setBrush(QBrush b);
Expand All @@ -62,6 +67,12 @@ class QgsSymbol{
virtual void setLineStyle(Qt::PenStyle s);
/**Set the fill (brush) style*/
virtual void setFillStyle(Qt::BrushStyle s);
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);
Expand Down Expand Up @@ -94,6 +105,14 @@ class QgsSymbol{
@ return true in case of success*/
virtual bool readXML( QDomNode & symbol );
protected:
/**Lower value for classification*/
QString mLowerValue;
/**Upper value for classification*/
QString mUpperValue;
QString mLabel;
/**Vector type (point, line, polygon)*/
QGis::VectorType mType;

QPen mPen;
QBrush mBrush;
/* Point symbol name */
Expand Down Expand Up @@ -158,6 +177,36 @@ inline QPen& QgsSymbol::pen()
return mPen;
}

inline void QgsSymbol::setLowerValue(QString value)
{
mLowerValue=value;
}

inline QString QgsSymbol::lowerValue() const
{
return mLowerValue;
}

inline void QgsSymbol::setUpperValue(QString value)
{
mUpperValue=value;
}

inline QString QgsSymbol::upperValue() const
{
return mUpperValue;
}

inline void QgsSymbol::setLabel(QString label)
{
mLabel=label;
}

inline QString QgsSymbol::label() const
{
return mLabel;
}

#endif // QGSSYMBOL_H


4 changes: 4 additions & 0 deletions qgis/src/qgsuniquevalrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ QgsUniqueValRenderer::~QgsUniqueValRenderer()

void QgsUniqueValRenderer::initializeSymbology(QgsVectorLayer* layer, QgsDlgVectorLayerProperties* pr)
{
#if 0
mVectorType = layer->vectorType();
QgsUValDialog *dialog = new QgsUValDialog(layer);

Expand All @@ -59,6 +60,7 @@ void QgsUniqueValRenderer::initializeSymbology(QgsVectorLayer* layer, QgsDlgVect
{
layer->setRendererDialog(dialog);
}
#endif //0
}

void QgsUniqueValRenderer::renderFeature(QPainter* p, QgsFeature* f,QPicture* pic,
Expand Down Expand Up @@ -112,6 +114,7 @@ void QgsUniqueValRenderer::renderFeature(QPainter* p, QgsFeature* f,QPicture* pi

void QgsUniqueValRenderer::readXML(const QDomNode& rnode, QgsVectorLayer& vl)
{
#if 0
mVectorType = vl.vectorType();
QDomNode classnode = rnode.namedItem("classificationfield");
int classificationfield = classnode.toElement().text().toInt();
Expand Down Expand Up @@ -153,6 +156,7 @@ void QgsUniqueValRenderer::readXML(const QDomNode& rnode, QgsVectorLayer& vl)
properties->setLegendType("Unique Value");

uvaldialog->apply();
#endif
}

void QgsUniqueValRenderer::clearValues()
Expand Down
2 changes: 2 additions & 0 deletions qgis/src/qgsuniquevalrenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ class QgsUniqueValRenderer: public QgsRenderer
std::map<QString,QgsRenderItem*>& items();
/**Return symbology items*/
const std::list<QgsRenderItem*> items() const;
/**Return symbology items*/
const std::list<QgsSymbol*> symbols() const {}
protected:
/**Field index used for classification*/
int mClassificationField;
Expand Down
4 changes: 4 additions & 0 deletions qgis/src/qgsuvalmarenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ QgsUValMaRenderer::~QgsUValMaRenderer()

void QgsUValMaRenderer::initializeSymbology(QgsVectorLayer* layer, QgsDlgVectorLayerProperties* pr)
{
#if 0
QgsUValMaDialog *dialog = new QgsUValMaDialog(layer);

if (pr)
Expand All @@ -57,6 +58,7 @@ void QgsUValMaRenderer::initializeSymbology(QgsVectorLayer* layer, QgsDlgVectorL
{
layer->setRendererDialog(dialog);
}
#endif //0
}

void QgsUValMaRenderer::renderFeature(QPainter* p, QgsFeature* f,QPicture* pic,
Expand Down Expand Up @@ -102,6 +104,7 @@ void QgsUValMaRenderer::renderFeature(QPainter* p, QgsFeature* f,QPicture* pic,

void QgsUValMaRenderer::readXML(const QDomNode& rnode, QgsVectorLayer& vl)
{
#if 0
QDomNode classnode = rnode.namedItem("classificationfield");
int classificationfield = classnode.toElement().text().toInt();
this->setClassificationField(classificationfield);
Expand Down Expand Up @@ -146,6 +149,7 @@ void QgsUValMaRenderer::readXML(const QDomNode& rnode, QgsVectorLayer& vl)
properties->setLegendType("Unique Value Marker");

uvalmadialog->apply();
#endif //0
}

void QgsUValMaRenderer::writeXML(std::ostream& xml)
Expand Down
2 changes: 2 additions & 0 deletions qgis/src/qgsuvalmarenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ class QgsUValMaRenderer: public QgsRenderer
std::map<QString,QgsRenderItem*>& items();
/**Return symbology items*/
const std::list<QgsRenderItem*> items() const;
/**Return symbology items*/
const std::list<QgsSymbol*> symbols() const {}
protected:
/**Field index used for classification*/
int mClassificationField;
Expand Down
73 changes: 23 additions & 50 deletions qgis/src/qgsvectorlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ QgsVectorLayer::QgsVectorLayer(QString vectorLayerPath,
m_renderer(0),
mLabel(0),
m_propertiesDialog(0),
m_rendererDialog(0),
myLib(0),
ir(0), // initialize the identify results pointer
updateThreshold(0), // XXX better default value?
Expand Down Expand Up @@ -171,10 +170,6 @@ QgsVectorLayer::~QgsVectorLayer()
{
delete m_renderer;
}
if (m_rendererDialog)
{
delete m_rendererDialog;
}
if (m_propertiesDialog)
{
delete m_propertiesDialog;
Expand Down Expand Up @@ -1334,8 +1329,8 @@ void QgsVectorLayer::showLayerProperties()
// Set wait cursor while the property dialog is created
// and initialized
qApp->setOverrideCursor(QCursor(Qt::WaitCursor));
if (! m_propertiesDialog)
{


#ifdef QGISDEBUG
std::cerr << "Creating new QgsDlgVectorLayerProperties object\n";
#endif
Expand All @@ -1346,34 +1341,29 @@ void QgsVectorLayer::showLayerProperties()
std::cerr << "Setting display field in prop dialog\n";
#endif
m_propertiesDialog->setDisplayField(displayField());
}

#ifdef QGISDEBUG
std::cerr << "Resetting prop dialog\n";
std::cerr << "Resetting prop dialog\n";
#endif
m_propertiesDialog->reset();
m_propertiesDialog->reset();
#ifdef QGISDEBUG
std::cerr << "Raising prop dialog\n";
std::cerr << "Raising prop dialog\n";
#endif
m_propertiesDialog->raise();
m_propertiesDialog->raise();
#ifdef QGISDEBUG
std::cerr << "Showing prop dialog\n";
std::cerr << "Showing prop dialog\n";
#endif
m_propertiesDialog->show();
// restore normal cursor
qApp->restoreOverrideCursor();
} // QgsVectorLayer::showLayerProperties()
m_propertiesDialog->show();
// restore normal cursor
qApp->restoreOverrideCursor();
}


QgsRenderer *QgsVectorLayer::renderer()
{
return m_renderer;
}

QDialog *QgsVectorLayer::rendererDialog()
{
return m_rendererDialog;
}

void QgsVectorLayer::setRenderer(QgsRenderer * r)
{
if (r != m_renderer)
Expand All @@ -1387,18 +1377,6 @@ void QgsVectorLayer::setRenderer(QgsRenderer * r)
}
}

void QgsVectorLayer::setRendererDialog(QDialog * dialog)
{
if (dialog != m_rendererDialog)
{
if (m_rendererDialog)
{
delete m_rendererDialog;
}
m_rendererDialog = dialog;
}
}

QGis::VectorType QgsVectorLayer::vectorType()
{
if (dataProvider)
Expand Down Expand Up @@ -1539,15 +1517,14 @@ QgsRect QgsVectorLayer::bBoxOfSelected()

void QgsVectorLayer::setLayerProperties(QgsDlgVectorLayerProperties * properties)
{
if (m_propertiesDialog)
{
delete m_propertiesDialog;
}

m_propertiesDialog = properties;
m_propertiesDialog = properties;
// Make sure that the UI gets the correct display
// field value
m_propertiesDialog->setDisplayField(displayField());

if(m_propertiesDialog)
{
m_propertiesDialog->setDisplayField(displayField());
}
}


Expand Down Expand Up @@ -2098,6 +2075,7 @@ bool QgsVectorLayer::readXML_( QDomNode & layer_node )

// XXX Kludge!


// if we don't have a coordinate transform, get one
if ( ! coordinateTransform() )
{
Expand All @@ -2107,37 +2085,31 @@ bool QgsVectorLayer::readXML_( QDomNode & layer_node )

if (!singlenode.isNull())
{
// renderer.reset( new QgsSingleSymRenderer );
renderer = new QgsSingleSymRenderer;
renderer = new QgsSingleSymRenderer(vectorType());
renderer->readXML(singlenode, *this);
}
else if (!graduatednode.isNull())
{
//renderer.reset( new QgsGraduatedSymRenderer );
renderer = new QgsGraduatedSymRenderer;
renderer = new QgsGraduatedSymRenderer(vectorType());
renderer->readXML(graduatednode, *this);
}
else if (!continuousnode.isNull())
{
//renderer.reset( new QgsContinuousColRenderer );
renderer = new QgsContinuousColRenderer;
renderer = new QgsContinuousColRenderer(vectorType());
renderer->readXML(continuousnode, *this);
}
else if (!singlemarkernode.isNull())
{
//renderer.reset( new QgsSiMaRenderer );
renderer = new QgsSiMaRenderer;
renderer->readXML(singlemarkernode, *this);
}
else if (!graduatedmarkernode.isNull())
{
//renderer.reset( new QgsGraduatedMaRenderer );
renderer = new QgsGraduatedMaRenderer;
renderer->readXML(graduatedmarkernode, *this);
}
else if (!uniquevaluenode.isNull())
{
//renderer.reset( new QgsUniqueValRenderer );
renderer = new QgsUniqueValRenderer;
renderer->readXML(uniquevaluenode, *this);
}
Expand All @@ -2147,6 +2119,7 @@ bool QgsVectorLayer::readXML_( QDomNode & layer_node )
renderer->readXML(uniquemarkernode, *this);
}


// Test if labeling is on or off
QDomElement element = labelnode.toElement();
int labelOn = element.text().toInt();
Expand Down
6 changes: 0 additions & 6 deletions qgis/src/qgsvectorlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,8 @@ public slots:
virtual void showLayerProperties();
/**Returns a pointer to the renderer*/
QgsRenderer *renderer();
/**Returns a pointer to the renderer dialog*/
QDialog *rendererDialog();
/**Sets the renderer. If a renderer is already present, it is deleted*/
void setRenderer(QgsRenderer * r);
/**Sets the renderer dialog. If a renderer dialog is already present, it is deleted*/
void setRendererDialog(QDialog * dialog);
/**Sets m_propertiesDialog*/
void setLayerProperties(QgsDlgVectorLayerProperties * properties);
/**Returns point, line or polygon*/
Expand Down Expand Up @@ -388,8 +384,6 @@ public slots:
bool mLabelOn;
/**Dialog to set the properties*/
QgsDlgVectorLayerProperties *m_propertiesDialog;
/**Widget to set the symbology properties*/
QDialog *m_rendererDialog;
/**Goes through all features and finds a free id (e.g. to give it temporarily to a not-commited feature)*/
int findFreeId();
/**Writes the changes to disk*/
Expand Down