dmpsymbollayer.h 2.1 KB
/**************************************************************************
* file:              dmpsymbollayer.h

* Author:            qingxiongf
* Date:              2021-08-04 16:30:05
* Email:             qingxiongf@chinadci.com
* copyright:         广州城市信息研究所有限公司
***************************************************************************/

#ifndef __dmpsymbollayer_h__
#define __dmpsymbollayer_h__

#include "dmap_core.h"

class DmpSymbol;
class CORE_EXPORT DmpSymbolLayer
{
     
    protected:
    DmpSymbol::SymbolType mType;

    
    bool mEnabled = true;  //! 如果图层已启用且应绘制,则为True

    bool mLocked = false; 

    QColor mColor;
    int mRenderingPass = 0;

    QgsPropertyCollection mDataDefinedProperties;

    std::unique_ptr< QgsPaintEffect > mPaintEffect;
    QgsFields mFields;

    // Configuration of selected symbology implementation
    //! Whether styles for selected features ignore symbol alpha
    static const bool SELECTION_IS_OPAQUE = true;
    //! Whether fill styles for selected features also highlight symbol stroke
    static const bool SELECT_FILL_BORDER = false;
    //! Whether fill styles for selected features uses symbol layer style
    static const bool SELECT_FILL_STYLE = false;

    /**
     * Restores older data defined properties from string map.
     * \since QGIS 3.0
     */
    void restoreOldDataDefinedProperties( const QVariantMap &stringMap );

    /**
     * Copies all data defined properties of this layer to another symbol layer.
     * \param destLayer destination layer
     */
    void copyDataDefinedProperties( QgsSymbolLayer *destLayer ) const;

    /**
     * Copies paint effect of this layer to another symbol layer
     * \param destLayer destination layer
     * \since QGIS 2.9
     */
    void copyPaintEffect( QgsSymbolLayer *destLayer ) const;

  private:
    static void initPropertyDefinitions();

    //! Property definitions
    static QgsPropertiesDefinition sPropertyDefinitions;

    //QgsSymbolLayer( const QgsSymbolLayer &other );
};

#endif // __dmpsymbollayer_h__