SimpleLineSymbol.h
2.9 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#pragma once
#ifndef _SimpleLineSymbol_H_
#define _SimpleLineSymbol_H_
#include<string>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/xml_parser.hpp>
#include <boost/foreach.hpp>
#include "Renderer.h"
#include "clsStruct.h"
#include "clsCrSurf.h"
#include "DataCollection.h"
//#include "clsPng.h"
using namespace std;
namespace DmapCore_30
{
class clsCrSurf;
class Path;
class DataCollection;
class CORE_EXPORT SimpleLineSymbol :public Renderer
{
public:
//没有实现 captype,jointype
SimpleLineSymbol();
~SimpleLineSymbol();
static SimpleLineSymbol* CreateNew();
virtual int RendererType();
virtual bool Parse(boost::property_tree::ptree &pt, AppendBuffer *f);
virtual bool ParsePtree( boost::property_tree::ptree &pt);
virtual void ToJson(AppendBuffer *ab);
//virtual bool RendererString(Renderer** ppRen, const char** psXML);
virtual bool DrawData(clsCrSurf* clsCS, DataCollection* data, bool drawSimpleData, char* pFlag = NULL);
virtual bool DrawData(clsCrSurf* clsCS, DataCollection* data, int dataIndex, char* pFlag = NULL);
virtual bool DrawLegend(clsCrSurf* pClsCS, shared_ptr<legendParamater> pLegendParamater,int layerType, char* pFlag = NULL);
//clsPng *png;
/*
全局变量
*/
int m_iAntialiasing;
unsigned int m_iColor;
int m_iType;
string m_sPNG;
double m_dWidth;
int m_iCapType;
int m_iJionType;
double r, g, b, a;
int GetAntialiasing();
bool SetAntialiasing(int newVal);
unsigned int GetColor();
bool SetColor(unsigned int color);
int GetType();
bool SetType(int type);
const char* GetPNG();
bool SetPNG(const char* png);
double GetWidth();
bool SetWidth(double width);
int GetCapType();
bool SetCapType(int iCapType);
int GetJionType();
bool SetJionType(int iJionType);
//此处传的 geom 都是屏幕坐标
int BytesPerLine(int nWidth, int nBitsPerPixel);
bool TryFindHeatRenderer(){ return false; }
//线条有点难办啊, 需要传surface宽和高,还要传 绘图 buffer指针
bool DrawLINE(clsCrSurf* clsCS, clsStruct::LINE * pLine);
bool DrawMLINE(clsCrSurf* clsCS, clsStruct::MLINE* pMLine);
bool DrawLINESimple(clsCrSurf* clsCS, clsStruct::LINE* pLine);
bool DrawLINEPNG(clsCrSurf* clsCS, clsStruct::LINE* pLine);
bool DrawMLINESimple(clsCrSurf* clsCS, clsStruct::MLINE* pMLine);
bool DrawMLINEPNG(clsCrSurf* clsCS, clsStruct::MLINE* pMLine);
private:
bool m_mustReloadPng;
unsigned int m_LastBGColor;
bool TryReadPng(unsigned int colorThis);
//clsCrSurf* m_pClsSurfBackup;
bool TryCreatePatta(clsCrSurf * clsCS);
bool TryCreateRendererBase();
};
}
#endif