~ubuntu-branches/ubuntu/wily/qgis/wily

« back to all changes in this revision

Viewing changes to src/core/renderer/qgsrenderer.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Johan Van de Wauw
  • Date: 2010-07-11 20:23:24 UTC
  • mfrom: (3.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100711202324-5ktghxa7hracohmr
Tags: 1.4.0+12730-3ubuntu1
* Merge from Debian unstable (LP: #540941).
* Fix compilation issues with QT 4.7
* Add build-depends on libqt4-webkit-dev 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
                           qgsrenderer.cpp
 
3
 
 
4
                             -------------------
 
5
    begin                : Sat Jan 4 2003
 
6
    copyright            : (C) 2003 by Gary E.Sherman
 
7
    email                : sherman at mrcc.com
 
8
***************************************************************************/
 
9
 
 
10
/***************************************************************************
 
11
 *                                                                         *
 
12
 *   This program is free software; you can redistribute it and/or modify  *
 
13
 *   it under the terms of the GNU General Public License as published by  *
 
14
 *   the Free Software Foundation; either version 2 of the License, or     *
 
15
 *   (at your option) any later version.                                   *
 
16
 *                                                                         *
 
17
 ***************************************************************************/
 
18
#include "qgsrenderer.h"
 
19
 
 
20
#include <QBrush>
 
21
#include <QColor>
 
22
#include <QMatrix>
 
23
#include <QString>
 
24
 
 
25
 
 
26
QColor QgsRenderer::mSelectionColor = QColor( 0, 0, 0 );
 
27
 
 
28
QgsRenderer::QgsRenderer()
 
29
{
 
30
 
 
31
}
 
32
 
 
33
QgsRenderer::~QgsRenderer()
 
34
{
 
35
}
 
36
 
 
37
void QgsRenderer::setSelectionColor( QColor color )
 
38
{
 
39
  mSelectionColor = color;
 
40
}
 
41
 
 
42
QColor QgsRenderer::selectionColor()
 
43
{
 
44
  return mSelectionColor;
 
45
}
 
46
 
 
47
bool QgsRenderer::containsPixmap() const
 
48
{
 
49
  //default implementation returns true only for points
 
50
  switch ( mGeometryType )
 
51
  {
 
52
    case QGis::Point:
 
53
      return true;
 
54
    default:
 
55
      return false;
 
56
  }
 
57
}
 
58
 
 
59
void QgsRenderer::scaleBrush( QBrush& b, double rasterScaleFactor )
 
60
{
 
61
  if ( rasterScaleFactor != 1.0 )
 
62
  {
 
63
    QMatrix m;
 
64
    m.scale( 1.0 / rasterScaleFactor, 1.0 / rasterScaleFactor );
 
65
    b.setMatrix( m );
 
66
  }
 
67
}