-
Notifications
You must be signed in to change notification settings - Fork 143
Expand file tree
/
Copy pathLayerDrawer.cpp
More file actions
47 lines (42 loc) · 1.18 KB
/
LayerDrawer.cpp
File metadata and controls
47 lines (42 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include "stdafx.h"
#include "LayerDrawer.h"
#include "ShapefileHelper.h"
// ****************************************************************
// DrawCharts()
// ****************************************************************
void LayerDrawer::DrawCharts(Layer* layer, CChartDrawer& drawer, tkVerticalPosition position)
{
if (!layer) return;
CComPtr<IShapefile> sf = NULL;
if (!layer->QueryShapefile(&sf)) return;
CComPtr<ICharts> charts = NULL;
sf->get_Charts(&charts);
if (charts)
{
tkVerticalPosition vertPosition;
charts->get_VerticalPosition(&vertPosition);
if (vertPosition == position)
{
drawer.DrawCharts(sf);
}
}
}
// ****************************************************************
// DrawLabels()
// ****************************************************************
void LayerDrawer::DrawLabels(Layer* layer, CLabelDrawer& drawer, tkVerticalPosition position)
{
if (!layer) return;
ILabels* labels = layer->get_Labels();
if (labels != NULL)
{
tkVerticalPosition vertPos;
labels->get_VerticalPosition(&vertPos);
if (vertPos == position)
{
drawer.DrawLabels(labels);
}
labels->Release();
labels = NULL;
}
}