mirror of
				https://github.com/qgis/QGIS.git
				synced 2025-11-04 00:04:25 -05:00 
			
		
		
		
	
		
			
				
	
	
		
			144 lines
		
	
	
		
			4.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			144 lines
		
	
	
		
			4.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
/************************************************************************
 | 
						|
 * This file has been generated automatically from                      *
 | 
						|
 *                                                                      *
 | 
						|
 * src/core/layertree/qgslegendpatchshape.h                             *
 | 
						|
 *                                                                      *
 | 
						|
 * Do not edit manually ! Edit header and run scripts/sipify.pl again   *
 | 
						|
 ************************************************************************/
 | 
						|
 | 
						|
 | 
						|
 | 
						|
class QgsLegendPatchShape
 | 
						|
{
 | 
						|
%Docstring
 | 
						|
Represents a patch shape for use in map legends.
 | 
						|
 | 
						|
.. versionadded:: 3.14
 | 
						|
%End
 | 
						|
 | 
						|
%TypeHeaderCode
 | 
						|
#include "qgslegendpatchshape.h"
 | 
						|
%End
 | 
						|
  public:
 | 
						|
 | 
						|
    QgsLegendPatchShape();
 | 
						|
%Docstring
 | 
						|
Constructor for a null QgsLegendPatchShape.
 | 
						|
 | 
						|
A null QgsLegendPatchShape indicates that the default legend patch shape
 | 
						|
should be used instead.
 | 
						|
%End
 | 
						|
 | 
						|
    QgsLegendPatchShape( QgsSymbol::SymbolType type,
 | 
						|
                         const QgsGeometry &geometry,
 | 
						|
                         bool preserveAspectRatio = true );
 | 
						|
%Docstring
 | 
						|
Constructor for QgsLegendPatchShape.
 | 
						|
 | 
						|
The ``type`` argument specifies the symbol type associated with this patch.
 | 
						|
 | 
						|
The ``geometry`` argument gives the shape of the patch to render. See :py:func:`~QgsLegendPatchShape.setGeometry`
 | 
						|
for further details on the geometry requirements.
 | 
						|
 | 
						|
If ``preserveAspectRatio`` is ``True``, then the patch shape should preserve its aspect ratio when
 | 
						|
it is resized to fit a desired legend patch size.
 | 
						|
%End
 | 
						|
 | 
						|
    bool isNull() const;
 | 
						|
%Docstring
 | 
						|
Returns ``True`` if the patch shape is a null QgsLegendPatchShape,
 | 
						|
which indicates that the default legend patch shape should be used instead.
 | 
						|
%End
 | 
						|
 | 
						|
    QgsSymbol::SymbolType symbolType() const;
 | 
						|
%Docstring
 | 
						|
Returns the symbol type associated with this patch.
 | 
						|
 | 
						|
.. seealso:: :py:func:`setSymbolType`
 | 
						|
%End
 | 
						|
 | 
						|
    void setSymbolType( QgsSymbol::SymbolType type );
 | 
						|
%Docstring
 | 
						|
Sets the symbol ``type`` associated with this patch.
 | 
						|
 | 
						|
.. seealso:: :py:func:`symbolType`
 | 
						|
%End
 | 
						|
 | 
						|
    QgsGeometry geometry() const;
 | 
						|
%Docstring
 | 
						|
Returns the geometry for the patch shape.
 | 
						|
 | 
						|
.. seealso:: :py:func:`setGeometry`
 | 
						|
%End
 | 
						|
 | 
						|
    void setGeometry( const QgsGeometry &geometry );
 | 
						|
%Docstring
 | 
						|
Sets the ``geometry`` for the patch shape.
 | 
						|
 | 
						|
The origin and size of the ``geometry`` is not important, as the legend
 | 
						|
renderer will automatically scale and transform the geometry to match
 | 
						|
the desired overall patch bounds.
 | 
						|
 | 
						|
Geometries for legend patches are rendered respecting the traditional
 | 
						|
"y values increase toward the top of the map" convention, as opposed
 | 
						|
to the standard computer graphics convention of "y values increase toward
 | 
						|
the bottom of the display".
 | 
						|
 | 
						|
.. warning::
 | 
						|
 | 
						|
   The geometry type should match the patch shape's :py:func:`~QgsLegendPatchShape.symbolType`,
 | 
						|
   e.g. a fill symbol type should only have Polygon or MultiPolygon geometries
 | 
						|
   set, while a line symbol type must have LineString or MultiLineString geometries.
 | 
						|
 | 
						|
.. seealso:: :py:func:`geometry`
 | 
						|
%End
 | 
						|
 | 
						|
    bool preserveAspectRatio() const;
 | 
						|
%Docstring
 | 
						|
Returns ``True`` if the patch shape should preserve its aspect ratio when
 | 
						|
it is resized to fit a desired legend patch size.
 | 
						|
 | 
						|
.. seealso:: :py:func:`setPreserveAspectRatio`
 | 
						|
%End
 | 
						|
 | 
						|
    void setPreserveAspectRatio( bool preserve );
 | 
						|
%Docstring
 | 
						|
Sets whether the patch shape should ``preserve`` its aspect ratio when
 | 
						|
it is resized to fit a desired legend patch size.
 | 
						|
 | 
						|
The default behavior is to respect the :py:func:`~QgsLegendPatchShape.geometry`'s aspect ratio.
 | 
						|
 | 
						|
.. seealso:: :py:func:`setPreserveAspectRatio`
 | 
						|
%End
 | 
						|
 | 
						|
    QList< QList< QPolygonF > > toQPolygonF( QgsSymbol::SymbolType type, QSizeF size ) const;
 | 
						|
%Docstring
 | 
						|
Converts the patch shape to a set of QPolygonF objects representing
 | 
						|
how the patch should be drawn for a symbol of the given ``type`` at the specified ``size`` (as
 | 
						|
geometry parts and rings).
 | 
						|
%End
 | 
						|
 | 
						|
    void readXml( const QDomElement &element, const QgsReadWriteContext &context );
 | 
						|
%Docstring
 | 
						|
Read settings from a DOM ``element``.
 | 
						|
 | 
						|
.. seealso:: :py:func:`writeXml`
 | 
						|
%End
 | 
						|
 | 
						|
    void writeXml( QDomElement &element, QDomDocument &doc, const QgsReadWriteContext &context ) const;
 | 
						|
%Docstring
 | 
						|
Write settings into a DOM ``element``.
 | 
						|
 | 
						|
.. seealso:: :py:func:`readXml`
 | 
						|
%End
 | 
						|
 | 
						|
};
 | 
						|
 | 
						|
/************************************************************************
 | 
						|
 * This file has been generated automatically from                      *
 | 
						|
 *                                                                      *
 | 
						|
 * src/core/layertree/qgslegendpatchshape.h                             *
 | 
						|
 *                                                                      *
 | 
						|
 * Do not edit manually ! Edit header and run scripts/sipify.pl again   *
 | 
						|
 ************************************************************************/
 |