Demo entry 6745929

de

   

Submitted by anonymous on May 28, 2018 at 04:35
Language: C++. Code size: 1.5 kB.

#ifndef GMPGFCEXPORTSETTINGS_H 
#define GMPGFCEXPORTSETTINGS_H

#include "GMModel/IGMPRegion.h"
#include "GMModel/IGMPProperties.h"

//针对数据导出的外部过滤器
class GMPExportFilter
{
public:
    virtual ~GMPExportFilter(){}

    //是否导出指定区域(包括区域中楼层,构件,图元),返回true则导出,返回false则不导出
    virtual bool isExportRegion(IGMPRegion *pRegion) { return true; }
    //是否导出指定楼层(包括楼层中构件,图元),返回true则导出,返回false则不导出
    virtual bool isExportFloor(IGMPRegion *pRegion, IGMPFloor *pFloor) { return true; }
    //是否导出指定的图元,返回true则导出,返回false则不导出
    virtual bool isExportElementDrawObj(IGMPElementDrawObj *pEdo) { return true; }
    //是否导出指定构件类型的属性值(每类构件的每个属性只会询问一次),返回true则导出,返回false则不导出
    virtual bool isExportElementProperty(int64_t nElementType, int64_t nElementSubType, GMPPropPtr pProp) { return true; }
};

typedef QList<QPair<QString, QVariant>> ExtendInfoList; //List<属性名,属性值>

//针对导出数据的扩展接口,目前只支持KV形式的数据导出。注意目前Key会与各个对象本身的自带的放在一起,所以起名时不要重复
class GMPExportExtend
{
public:
    virtual ~GMPExportExtend(){}

    //导出基于项目的扩展信息(可以通过相应的Reader方法读取,下同)
    virtual void exportProjectExtend(ExtendInfoList &projectExtendInfo){}
    //导出基于指定区域的扩展信息
    virtual void exportRegionExtend(IGMPRegion *pRegion, ExtendInfoList &regionExtendInfo){}
    //导出基于指定楼层的扩展信息
    virtual void exportFloorExtend(IGMPRegion *pRegion, IGMPFloor *pFloor, ExtendInfoList &floorExtendInfo) {}
    //导出基于指定图元的扩展信息
    virtual void exportElementDrawObjExtend(IGMPElementDrawObj *pEdo, ExtendInfoList &edoExtendInfo) {}
};

#endif  //GMPGFCEXPORTSETTINGS_H

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).