Renderer.h 2.0 KB

#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