Skip to content

Commit

Permalink
renamed QgsUniqueValRenderer to QgsUniqueValueRenderer
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@4876 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Feb 18, 2006
1 parent 877895a commit e6a6a91
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 35 deletions.
4 changes: 2 additions & 2 deletions src/gui/Makefile.am
Expand Up @@ -121,7 +121,7 @@ libqgis_guiHEADERS = \
qgssinglesymboldialog.h \
qgssinglesymbolrenderer.h \
qgsspatialrefsys.h \
qgsuniquevalrenderer.h \
qgsuniquevaluerenderer.h \
qgsuvaldialog.h \
qgsvectorfilewriter.h \
qgsvectorlayerproperties.h
Expand Down Expand Up @@ -232,7 +232,7 @@ libqgis_gui_la_SOURCES = \
qgssinglesymboldialog.cpp \
qgssinglesymbolrenderer.cpp \
qgsspatialrefsys.cpp \
qgsuniquevalrenderer.cpp \
qgsuniquevaluerenderer.cpp \
qgsuvaldialog.cpp \
qgsvectorfilewriter.cpp \
qgsvectorlayer.cpp \
Expand Down
@@ -1,5 +1,5 @@
/***************************************************************************
qgsuniquevalrenderer.cpp - description
qgsuniquevaluerenderer.cpp - description
-------------------
begin : July 2004
copyright : (C) 2004 by Marco Hugentobler
Expand All @@ -15,7 +15,7 @@
* *
***************************************************************************/
/* $Id$ */
#include "qgsuniquevalrenderer.h"
#include "qgsuniquevaluerenderer.h"
#include "qgsuvaldialog.h"
#include "qgsfeatureattribute.h"
#include "qgsfeature.h"
Expand All @@ -29,7 +29,7 @@
#include <QPixmap>
#include <vector>

QgsUniqueValRenderer::QgsUniqueValRenderer(QGis::VectorType type): mClassificationField(0)
QgsUniqueValueRenderer::QgsUniqueValueRenderer(QGis::VectorType type): mClassificationField(0)
{
mVectorType = type;

Expand All @@ -38,7 +38,7 @@ QgsUniqueValRenderer::QgsUniqueValRenderer(QGis::VectorType type): mClassificati

}

QgsUniqueValRenderer::QgsUniqueValRenderer(const QgsUniqueValRenderer& other)
QgsUniqueValueRenderer::QgsUniqueValueRenderer(const QgsUniqueValueRenderer& other)
{
mVectorType = other.mVectorType;
mClassificationField = other.mClassificationField;
Expand All @@ -49,7 +49,7 @@ QgsUniqueValRenderer::QgsUniqueValRenderer(const QgsUniqueValRenderer& other)
}
}

QgsUniqueValRenderer& QgsUniqueValRenderer::operator=(const QgsUniqueValRenderer& other)
QgsUniqueValueRenderer& QgsUniqueValueRenderer::operator=(const QgsUniqueValueRenderer& other)
{
if(this != &other)
{
Expand All @@ -64,15 +64,15 @@ QgsUniqueValRenderer& QgsUniqueValRenderer::operator=(const QgsUniqueValRenderer
}
}

QgsUniqueValRenderer::~QgsUniqueValRenderer()
QgsUniqueValueRenderer::~QgsUniqueValueRenderer()
{
for(std::map<QString,QgsSymbol*>::iterator it=mSymbols.begin();it!=mSymbols.end();++it)
{
delete it->second;
}
}

const std::list<QgsSymbol*> QgsUniqueValRenderer::symbols() const
const std::list<QgsSymbol*> QgsUniqueValueRenderer::symbols() const
{
std::list <QgsSymbol*> symbollist;
for(std::map<QString, QgsSymbol*>::const_iterator it = mSymbols.begin(); it!=mSymbols.end(); ++it)
Expand All @@ -82,22 +82,22 @@ const std::list<QgsSymbol*> QgsUniqueValRenderer::symbols() const
return symbollist;
}

void QgsUniqueValRenderer::insertValue(QString name, QgsSymbol* symbol)
void QgsUniqueValueRenderer::insertValue(QString name, QgsSymbol* symbol)
{
mSymbols.insert(std::make_pair(name, symbol));
}

void QgsUniqueValRenderer::setClassificationField(int field)
void QgsUniqueValueRenderer::setClassificationField(int field)
{
mClassificationField=field;
}

int QgsUniqueValRenderer::classificationField()
int QgsUniqueValueRenderer::classificationField()
{
return mClassificationField;
}

void QgsUniqueValRenderer::renderFeature(QPainter* p, QgsFeature* f,QPixmap* pic,
void QgsUniqueValueRenderer::renderFeature(QPainter* p, QgsFeature* f,QPixmap* pic,
double* scalefactor, bool selected, double widthScale)
{
std::vector < QgsFeatureAttribute > vec = f->attributeMap();
Expand Down Expand Up @@ -140,13 +140,13 @@ void QgsUniqueValRenderer::renderFeature(QPainter* p, QgsFeature* f,QPixmap* pic
else
{
#ifdef QGISDEBUG
qWarning("Warning, no render item found in QgsUniqueValRenderer::renderFeature");
qWarning("Warning, no render item found in QgsUniqueValueRenderer::renderFeature");
#endif
}

}

void QgsUniqueValRenderer::readXML(const QDomNode& rnode, QgsVectorLayer& vl)
void QgsUniqueValueRenderer::readXML(const QDomNode& rnode, QgsVectorLayer& vl)
{
mVectorType = vl.vectorType();
QDomNode classnode = rnode.namedItem("classificationfield");
Expand All @@ -164,7 +164,7 @@ void QgsUniqueValRenderer::readXML(const QDomNode& rnode, QgsVectorLayer& vl)
}
}

void QgsUniqueValRenderer::clearValues()
void QgsUniqueValueRenderer::clearValues()
{
for(std::map<QString,QgsSymbol*>::iterator it=mSymbols.begin();it!=mSymbols.end();++it)
{
Expand All @@ -173,19 +173,19 @@ void QgsUniqueValRenderer::clearValues()
mSymbols.clear();
}

QString QgsUniqueValRenderer::name() const
QString QgsUniqueValueRenderer::name() const
{
return "Unique Value";
}

std::list<int> QgsUniqueValRenderer::classificationAttributes() const
std::list<int> QgsUniqueValueRenderer::classificationAttributes() const
{
std::list<int> list;
list.push_back(mClassificationField);
return list;
}

bool QgsUniqueValRenderer::writeXML( QDomNode & layer_node, QDomDocument & document ) const
bool QgsUniqueValueRenderer::writeXML( QDomNode & layer_node, QDomDocument & document ) const
{
bool returnval=true;
QDomElement uniquevalue=document.createElement("uniquevalue");
Expand All @@ -204,8 +204,8 @@ bool QgsUniqueValRenderer::writeXML( QDomNode & layer_node, QDomDocument & docum
return returnval;
}

QgsRenderer* QgsUniqueValRenderer::clone() const
QgsRenderer* QgsUniqueValueRenderer::clone() const
{
QgsUniqueValRenderer* r = new QgsUniqueValRenderer(*this);
QgsUniqueValueRenderer* r = new QgsUniqueValueRenderer(*this);
return r;
}
@@ -1,5 +1,5 @@
/***************************************************************************
qgsuniquevalrenderer.h - description
qgsuniquevaluerenderer.h - description
-------------------
begin : July 2004
copyright : (C) 2004 by Marco Hugentobler
Expand All @@ -15,8 +15,8 @@
* *
***************************************************************************/
/* $Id$ */
#ifndef QGSUNIQUEVALRENDERER_H
#define QGSUNIQUEVALRENDERER_H
#ifndef QGSUNIQUEVALUERENDERER_H
#define QGSUNIQUEVALUERENDERER_H

#include "qgsrenderer.h"
#include <map>
Expand All @@ -25,13 +25,13 @@ class QgsSymbol;
class QPixmap;
class QPainter;

class QgsUniqueValRenderer: public QgsRenderer
class QgsUniqueValueRenderer: public QgsRenderer
{
public:
QgsUniqueValRenderer(QGis::VectorType type);
QgsUniqueValRenderer(const QgsUniqueValRenderer& other);
QgsUniqueValRenderer& operator=(const QgsUniqueValRenderer& other);
virtual ~QgsUniqueValRenderer();
QgsUniqueValueRenderer(QGis::VectorType type);
QgsUniqueValueRenderer(const QgsUniqueValueRenderer& other);
QgsUniqueValueRenderer& operator=(const QgsUniqueValueRenderer& other);
virtual ~QgsUniqueValueRenderer();
void renderFeature(QPainter* p, QgsFeature* f,QPixmap* pic, double* scalefactor, bool selected, double widthScale = 1.);
/**Reads the renderer configuration from an XML file
@param rnode the DOM node to read
Expand Down Expand Up @@ -64,7 +64,7 @@ class QgsUniqueValRenderer: public QgsRenderer
std::map<QString, QgsSymbol*> mSymbols;
};

inline bool QgsUniqueValRenderer::needsAttributes() const
inline bool QgsUniqueValueRenderer::needsAttributes() const
{
return true;
}
Expand Down
6 changes: 3 additions & 3 deletions src/gui/qgsuvaldialog.cpp
Expand Up @@ -20,7 +20,7 @@
#include "qgsfeature.h"
#include "qgsfeatureattribute.h"
#include "qgssymbol.h"
#include "qgsuniquevalrenderer.h"
#include "qgsuniquevaluerenderer.h"
#include "qgsvectordataprovider.h"
#include "qgsvectorlayer.h"

Expand Down Expand Up @@ -58,7 +58,7 @@ QgsUValDialog::QgsUValDialog(QgsVectorLayer* vl): QDialog(), mVectorLayer(vl), s
mSymbolWidgetStack->addWidget(&sydialog);
mSymbolWidgetStack->raiseWidget(&sydialog);

const QgsUniqueValRenderer* renderer = dynamic_cast < const QgsUniqueValRenderer * >(mVectorLayer->renderer());
const QgsUniqueValueRenderer* renderer = dynamic_cast < const QgsUniqueValueRenderer * >(mVectorLayer->renderer());

if (renderer)
{
Expand Down Expand Up @@ -112,7 +112,7 @@ QgsUValDialog::~QgsUValDialog()

void QgsUValDialog::apply()
{
QgsUniqueValRenderer *renderer = new QgsUniqueValRenderer(mVectorLayer->vectorType());
QgsUniqueValueRenderer *renderer = new QgsUniqueValueRenderer(mVectorLayer->vectorType());

//go through mValues and add the entries to the renderer
for(std::map<QString,QgsSymbol*>::iterator it=mValues.begin();it!=mValues.end();++it)
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsvectorlayer.cpp
Expand Up @@ -71,7 +71,7 @@
#include "qgssinglesymbolrenderer.h"
#include "qgsgraduatedsymbolrenderer.h"
#include "qgscontinuouscolorrenderer.h"
#include "qgsuniquevalrenderer.h"
#include "qgsuniquevaluerenderer.h"
#include "qgsrenderitem.h"
#include "qgsproviderregistry.h"
#include "qgsrect.h"
Expand Down Expand Up @@ -2277,7 +2277,7 @@ bool QgsVectorLayer::readXML_( QDomNode & layer_node )
}
else if (!uniquevaluenode.isNull())
{
renderer = new QgsUniqueValRenderer(vectorType());
renderer = new QgsUniqueValueRenderer(vectorType());
renderer->readXML(uniquevaluenode, *this);
}

Expand Down

0 comments on commit e6a6a91

Please sign in to comment.