QGIS API Documentation
2.8.2-Wien
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
src
core
qgsrendercontext.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
qgsrendercontext.cpp
3
--------------------
4
begin : March 16, 2008
5
copyright : (C) 2008 by Marco Hugentobler
6
email : marco dot hugentobler at karto dot baug dot ethz dot ch
7
***************************************************************************/
8
9
/***************************************************************************
10
* *
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
15
* *
16
***************************************************************************/
17
18
19
#include "
qgsrendercontext.h
"
20
21
#include "
qgsmapsettings.h
"
22
23
QgsRenderContext::QgsRenderContext
()
24
: mPainter( 0 ),
25
mCoordTransform( 0 ),
26
mDrawEditingInformation( true ),
27
mForceVectorOutput( false ),
28
mUseAdvancedEffects( true ),
29
mRenderingStopped( false ),
30
mScaleFactor( 1.0 ),
31
mRasterScaleFactor( 1.0 ),
32
mRendererScale( 1.0 ),
33
mLabelingEngine( NULL ),
34
mShowSelection( true ),
35
mUseRenderingOptimization( true )
36
{
37
mVectorSimplifyMethod.
setSimplifyHints
(
QgsVectorSimplifyMethod::NoSimplification
);
38
}
39
40
QgsRenderContext::~QgsRenderContext
()
41
{
42
}
43
44
QgsRenderContext
QgsRenderContext::fromMapSettings
(
const
QgsMapSettings
& mapSettings )
45
{
46
QgsRenderContext
ctx;
47
ctx.
setMapToPixel
( mapSettings.
mapToPixel
() );
48
ctx.
setExtent
( mapSettings.
visibleExtent
() );
49
ctx.
setDrawEditingInformation
( mapSettings.
testFlag
(
QgsMapSettings::DrawEditingInfo
) );
50
ctx.
setForceVectorOutput
( mapSettings.
testFlag
(
QgsMapSettings::ForceVectorOutput
) );
51
ctx.
setUseAdvancedEffects
( mapSettings.
testFlag
(
QgsMapSettings::UseAdvancedEffects
) );
52
ctx.
setUseRenderingOptimization
( mapSettings.
testFlag
(
QgsMapSettings::UseRenderingOptimization
) );
53
ctx.
setCoordinateTransform
( 0 );
54
ctx.
setSelectionColor
( mapSettings.
selectionColor
() );
55
ctx.
setShowSelection
( mapSettings.
testFlag
(
QgsMapSettings::DrawSelection
) );
56
ctx.
setRasterScaleFactor
( 1.0 );
57
ctx.
setScaleFactor
( mapSettings.
outputDpi
() / 25.4 );
// = pixels per mm
58
ctx.
setRendererScale
( mapSettings.
scale
() );
59
60
//this flag is only for stopping during the current rendering progress,
61
//so must be false at every new render operation
62
ctx.
setRenderingStopped
(
false
);
63
64
return
ctx;
65
}
66
67
void
QgsRenderContext::setCoordinateTransform
(
const
QgsCoordinateTransform
* t )
68
{
69
mCoordTransform = t;
70
}
Generated on Sun May 10 2015 16:33:24 for QGIS API Documentation by
1.8.1.2