Renderer.h
2.0 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#ifndef _Renderer_H_
#define _Renderer_H_
#pragma once
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/xml_parser.hpp>
#include <boost/foreach.hpp>
#include <string>
#include "AppendBuffer.h"
#include "legendParamater.h"
#include <memory>
#include <cairo/cairo.h>
#include"clsXML.h"
#include "dmap_core.h"
using namespace std;
namespace DmapCore_30
{
enum RendererType
{
dmapSimpleMarkerSymbol = 1,
dmapSimpleLineSymbol = 2,
dmapSimplePolygonSymbol = 3,
dmapValueMapRenderer = 4,
dmapRangeMapRenderer = 5,
dmapGroupRenderer = 6,
dmapScaleDependentRenderer = 7,
dmapSimpleLabelRenderer = 8,
dmapTrueTypeMarkerSymbol = 9,
dmapSimpleRenderer = 10,
dmapTextSymbol = 11,
dmapHeatMapRenderer = 12
};
class clsCrSurf;
class DataCollection;
class CORE_EXPORT Renderer
{
public:
Renderer();
~Renderer();
bool AddRef();
bool Release();
virtual int RendererType() = 0;
virtual void ToJson(AppendBuffer *ab)=0;
virtual bool DrawData(clsCrSurf* pClsCS, DataCollection* data, bool drawSimpleData, char* pFlag = NULL) = 0;
virtual bool DrawData(clsCrSurf* pClsCS, DataCollection* data, int dataIndex, char* pFlag = NULL) =0;
virtual bool Parse( boost::property_tree::ptree &pt, AppendBuffer *f) = 0;
virtual bool ParsePtree( boost::property_tree::ptree &pt)=0;
//static bool RendererXmlParse(Renderer**pRen, const char* fileName);
//static bool RenStr(Renderer** ppRen, const char** psXML); //纯粹作弊,什么都没干,直接调用现有接口
virtual bool DrawLegend(clsCrSurf* pClsCS, shared_ptr<legendParamater> pLegendParamater, int layerType, char* pFlag = NULL) = 0;
virtual void TryAddField(vector<string>&pvField);
virtual bool TryFindHeatRenderer()=0;
void TryAddField2(vector<string>&pvField, std::string field);
string GetFilePath(string path);
int GetCurrentFolderPath(char* processdir, size_t len);
int GetN();//仅作调试使用
string m_sXML;
bool m_simpleRenderer;
private:
int m_iN;
};
}
#endif