dmpproject.h 1.7 KB
/**************************************************************************
* 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"

//配图文件
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;
  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__