dmpsymbol.h 2.2 KB
/**************************************************************************
* file:              dmpsymbol.h

* Author:            wanzhongping
* Date:              2021-07-04 15:11:06
* Email:             zhongpingw@chinadci.com
* copyright:         广州城市信息研究所有限公司
***************************************************************************/

#ifndef __dmpsymbol_h__
#define __dmpsymbol_h__

#include <vector>
#include "dmap_core.h"
#include "dmpsymbol.h"
#include "dmpwkbtypes.h"
#include "dmprendercontext.h"

class DmpFeature;
class DmpFeatureRenderer;
class DmpSymbolLayer;

typedef std::vector<DmpSymbolLayer*> DmpSymbolLayerList;

class CORE_EXPORT DmpSymbol
{
    //友元类
    friend class DmpFeatureRenderer;

  public:
     /**
     * Type of the symbol
     */
    enum SymbolType
    {
      Marker, //!< 点标记符号
      Line,   //!< 线条符合
      Fill,   //!< 填充符号
      Hybrid  //!< 混合符号
    };

  public:
    static DmpSymbol* DefaultSymbol(DmpWkbTypes::GeometryType geomType); 
    void RenderFeature( const DmpFeature &feature, DmpRenderContext &context, int layer = -1);
    void StartRender(DmpRenderContext &context);
    void StopRender(DmpRenderContext &context);

    /**
     * 指定图层位置(index)插入一个新符号.
     * \param index 应添加图层的索引
     * \param layer 要添加的符号图层
     * \returns TRUE 符号图层添加成功, FALSE 符号图层添加失败
     */
    bool insertSymbolLayer( int index, DmpSymbolLayer *layer  );

    /**
     * 在当前符号图层列表的末尾追加符号图层.
     * \param layer 要添加的符号图层
     * \returns TRUE 符号图层添加成功, FALSE 符号图层添加失败
     */
    bool appendSymbolLayer( DmpSymbolLayer *layer);

    /**
     * 删除和删除指定索引处的符号图层。
     */
    bool deleteSymbolLayer( int index );

  protected:
    DmpSymbolLayerList layers_;
};

class CORE_EXPORT DmpMarkerSymbol : public DmpSymbol
{
   
};

class CORE_EXPORT DmpLineSymbol : public DmpSymbol
{
     
};

class CORE_EXPORT DmpFillSymbol : public DmpSymbol
{
};

#endif //__dmpsymbol_h__