dmpproject.h
1.8 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
/**************************************************************************
* file: dmpproject.h
* Author: wanzhongping
* Date: 2021-07-07 16:20:50
* Email: zhongpingw@chinadci.com
* copyright: 广州城市信息研究所有限公司
***************************************************************************/
#ifndef __dmpproject_h__
#define __dmpproject_h__
#include "dmap_core.h"
#include <string>
#include <map>
#include <boost/filesystem.hpp>
#include "dmpcoordinatereferencesystem.h"
#include "dmpmaplayer.h"
#include <memory>
//配图文件
class CORE_EXPORT DmpProject
{
public:
static DmpProject *Instance();
explicit DmpProject();
~DmpProject();
bool Read(const std::string &data);
bool Write(const std::string &filename, const std::string &data);
bool WritePtree(boost::property_tree::ptree& ptDoc);
//初始化矢量图层金字塔信息
bool initVectorLayerVacuate(std::function<std::string(const std::string &)> getVacuateFun);
bool initVectorLayerVacuate(DmpProject* project);
std::string WriteXml();
std::string WriteJson();
DmpCoordinateReferenceSystem crs() const;
std::map<std::string, DmpMapLayer*> mapLayers() const;
std::vector<DmpMapLayer*> vectorLayers() const;
DmpMapLayer* getLayer(const std::string &layerName) const;
DmpMapLayer* getLayer()const;
std::shared_ptr<DmpRectangle> GetExtent();
private:
static DmpProject *project_;
std::string projectName_;
std::string version_;
std::string file_;
DmpCoordinateReferenceSystem crs_;
std::map<std::string, DmpMapLayer*> mapLayers_;
std::vector<DmpMapLayer*> vectorLayers_;
};
#endif //__dmpproject_h__