Quantum GIS API Documentation  1.7.5-Wroclaw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
qgsrenderer.cpp
Go to the documentation of this file.
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 
29 {
30 
31 }
32 
34 {
35 }
36 
37 void QgsRenderer::setSelectionColor( QColor color )
38 {
39  mSelectionColor = color;
40 }
41 
43 {
44  return mSelectionColor;
45 }
46 
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 }