Quantum GIS API Documentation  1.7.4
src/core/renderer/qgsrenderer.cpp
Go to the documentation of this file.
00001 /***************************************************************************
00002                            qgsrenderer.cpp
00003 
00004                              -------------------
00005     begin                : Sat Jan 4 2003
00006     copyright            : (C) 2003 by Gary E.Sherman
00007     email                : sherman at mrcc.com
00008 ***************************************************************************/
00009 
00010 /***************************************************************************
00011  *                                                                         *
00012  *   This program is free software; you can redistribute it and/or modify  *
00013  *   it under the terms of the GNU General Public License as published by  *
00014  *   the Free Software Foundation; either version 2 of the License, or     *
00015  *   (at your option) any later version.                                   *
00016  *                                                                         *
00017  ***************************************************************************/
00018 #include "qgsrenderer.h"
00019 
00020 #include <QBrush>
00021 #include <QColor>
00022 #include <QMatrix>
00023 #include <QString>
00024 
00025 
00026 QColor QgsRenderer::mSelectionColor = QColor( 0, 0, 0 );
00027 
00028 QgsRenderer::QgsRenderer()
00029 {
00030 
00031 }
00032 
00033 QgsRenderer::~QgsRenderer()
00034 {
00035 }
00036 
00037 void QgsRenderer::setSelectionColor( QColor color )
00038 {
00039   mSelectionColor = color;
00040 }
00041 
00042 QColor QgsRenderer::selectionColor()
00043 {
00044   return mSelectionColor;
00045 }
00046 
00047 bool QgsRenderer::containsPixmap() const
00048 {
00049   //default implementation returns true only for points
00050   switch ( mGeometryType )
00051   {
00052     case QGis::Point:
00053       return true;
00054     default:
00055       return false;
00056   }
00057 }
00058 
00059 void QgsRenderer::scaleBrush( QBrush& b, double rasterScaleFactor )
00060 {
00061   if ( rasterScaleFactor != 1.0 )
00062   {
00063     QMatrix m;
00064     m.scale( 1.0 / rasterScaleFactor, 1.0 / rasterScaleFactor );
00065     b.setMatrix( m );
00066   }
00067 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines