Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3D] Add support for data defined properties of points #57929

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion python/PyQt6/core/auto_additions/qgsabstract3dsymbol.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,29 @@
QgsAbstract3DSymbol.Property.PropertyExtrusionHeight = QgsAbstract3DSymbol.Property.ExtrusionHeight
QgsAbstract3DSymbol.PropertyExtrusionHeight.is_monkey_patched = True
QgsAbstract3DSymbol.PropertyExtrusionHeight.__doc__ = "Extrusion height (zero means no extrusion)"
QgsAbstract3DSymbol.Property.__doc__ = "Data definable properties.\n\n" + '* ``PropertyHeight``: ' + QgsAbstract3DSymbol.Property.Height.__doc__ + '\n' + '* ``PropertyExtrusionHeight``: ' + QgsAbstract3DSymbol.Property.ExtrusionHeight.__doc__
QgsAbstract3DSymbol.PropertyLength = QgsAbstract3DSymbol.Property.Length
QgsAbstract3DSymbol.Property.PropertyLength = QgsAbstract3DSymbol.Property.Length
QgsAbstract3DSymbol.PropertyLength.is_monkey_patched = True
QgsAbstract3DSymbol.PropertyLength.__doc__ = "Length"
QgsAbstract3DSymbol.PropertyRadius = QgsAbstract3DSymbol.Property.Radius
QgsAbstract3DSymbol.Property.PropertyRadius = QgsAbstract3DSymbol.Property.Radius
QgsAbstract3DSymbol.PropertyRadius.is_monkey_patched = True
QgsAbstract3DSymbol.PropertyRadius.__doc__ = "Radius"
QgsAbstract3DSymbol.PropertyHeight = QgsAbstract3DSymbol.Property.BottomRadius
QgsAbstract3DSymbol.Property.PropertyHeight = QgsAbstract3DSymbol.Property.BottomRadius
QgsAbstract3DSymbol.PropertyHeight.is_monkey_patched = True
QgsAbstract3DSymbol.PropertyHeight.__doc__ = "Bottom Radius"
QgsAbstract3DSymbol.PropertySize = QgsAbstract3DSymbol.Property.MinorRadius
QgsAbstract3DSymbol.Property.PropertySize = QgsAbstract3DSymbol.Property.MinorRadius
QgsAbstract3DSymbol.PropertySize.is_monkey_patched = True
QgsAbstract3DSymbol.PropertySize.__doc__ = "Minor Radius"
QgsAbstract3DSymbol.PropertyHeight = QgsAbstract3DSymbol.Property.TopRadius
QgsAbstract3DSymbol.Property.PropertyHeight = QgsAbstract3DSymbol.Property.TopRadius
QgsAbstract3DSymbol.PropertyHeight.is_monkey_patched = True
QgsAbstract3DSymbol.PropertyHeight.__doc__ = "Top Radius"
QgsAbstract3DSymbol.PropertySize = QgsAbstract3DSymbol.Property.Size
QgsAbstract3DSymbol.Property.PropertySize = QgsAbstract3DSymbol.Property.Size
QgsAbstract3DSymbol.PropertySize.is_monkey_patched = True
QgsAbstract3DSymbol.PropertySize.__doc__ = "Size"
QgsAbstract3DSymbol.Property.__doc__ = "Data definable properties.\n\n" + '* ``PropertyHeight``: ' + QgsAbstract3DSymbol.Property.Height.__doc__ + '\n' + '* ``PropertyExtrusionHeight``: ' + QgsAbstract3DSymbol.Property.ExtrusionHeight.__doc__ + '\n' + '* ``PropertyLength``: ' + QgsAbstract3DSymbol.Property.Length.__doc__ + '\n' + '* ``PropertyRadius``: ' + QgsAbstract3DSymbol.Property.Radius.__doc__ + '\n' + '* ``PropertyHeight``: ' + QgsAbstract3DSymbol.Property.BottomRadius.__doc__ + '\n' + '* ``PropertySize``: ' + QgsAbstract3DSymbol.Property.MinorRadius.__doc__ + '\n' + '* ``PropertyHeight``: ' + QgsAbstract3DSymbol.Property.TopRadius.__doc__ + '\n' + '* ``PropertySize``: ' + QgsAbstract3DSymbol.Property.Size.__doc__
# --
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ Returns the list of the vector layer geometry types which are compatible with th
{
Height,
ExtrusionHeight,
Length,
Radius,
BottomRadius,
MinorRadius,
TopRadius,
Size,
};

static const QgsPropertiesDefinition &propertyDefinitions();
Expand Down
26 changes: 25 additions & 1 deletion python/core/auto_additions/qgsabstract3dsymbol.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,29 @@
QgsAbstract3DSymbol.Property.PropertyExtrusionHeight = QgsAbstract3DSymbol.Property.ExtrusionHeight
QgsAbstract3DSymbol.PropertyExtrusionHeight.is_monkey_patched = True
QgsAbstract3DSymbol.PropertyExtrusionHeight.__doc__ = "Extrusion height (zero means no extrusion)"
QgsAbstract3DSymbol.Property.__doc__ = "Data definable properties.\n\n" + '* ``PropertyHeight``: ' + QgsAbstract3DSymbol.Property.Height.__doc__ + '\n' + '* ``PropertyExtrusionHeight``: ' + QgsAbstract3DSymbol.Property.ExtrusionHeight.__doc__
QgsAbstract3DSymbol.PropertyLength = QgsAbstract3DSymbol.Property.Length
QgsAbstract3DSymbol.Property.PropertyLength = QgsAbstract3DSymbol.Property.Length
QgsAbstract3DSymbol.PropertyLength.is_monkey_patched = True
QgsAbstract3DSymbol.PropertyLength.__doc__ = "Length"
QgsAbstract3DSymbol.PropertyRadius = QgsAbstract3DSymbol.Property.Radius
QgsAbstract3DSymbol.Property.PropertyRadius = QgsAbstract3DSymbol.Property.Radius
QgsAbstract3DSymbol.PropertyRadius.is_monkey_patched = True
QgsAbstract3DSymbol.PropertyRadius.__doc__ = "Radius"
QgsAbstract3DSymbol.PropertyHeight = QgsAbstract3DSymbol.Property.BottomRadius
QgsAbstract3DSymbol.Property.PropertyHeight = QgsAbstract3DSymbol.Property.BottomRadius
QgsAbstract3DSymbol.PropertyHeight.is_monkey_patched = True
QgsAbstract3DSymbol.PropertyHeight.__doc__ = "Bottom Radius"
QgsAbstract3DSymbol.PropertySize = QgsAbstract3DSymbol.Property.MinorRadius
QgsAbstract3DSymbol.Property.PropertySize = QgsAbstract3DSymbol.Property.MinorRadius
QgsAbstract3DSymbol.PropertySize.is_monkey_patched = True
QgsAbstract3DSymbol.PropertySize.__doc__ = "Minor Radius"
QgsAbstract3DSymbol.PropertyHeight = QgsAbstract3DSymbol.Property.TopRadius
QgsAbstract3DSymbol.Property.PropertyHeight = QgsAbstract3DSymbol.Property.TopRadius
QgsAbstract3DSymbol.PropertyHeight.is_monkey_patched = True
QgsAbstract3DSymbol.PropertyHeight.__doc__ = "Top Radius"
QgsAbstract3DSymbol.PropertySize = QgsAbstract3DSymbol.Property.Size
QgsAbstract3DSymbol.Property.PropertySize = QgsAbstract3DSymbol.Property.Size
QgsAbstract3DSymbol.PropertySize.is_monkey_patched = True
QgsAbstract3DSymbol.PropertySize.__doc__ = "Size"
QgsAbstract3DSymbol.Property.__doc__ = "Data definable properties.\n\n" + '* ``PropertyHeight``: ' + QgsAbstract3DSymbol.Property.Height.__doc__ + '\n' + '* ``PropertyExtrusionHeight``: ' + QgsAbstract3DSymbol.Property.ExtrusionHeight.__doc__ + '\n' + '* ``PropertyLength``: ' + QgsAbstract3DSymbol.Property.Length.__doc__ + '\n' + '* ``PropertyRadius``: ' + QgsAbstract3DSymbol.Property.Radius.__doc__ + '\n' + '* ``PropertyHeight``: ' + QgsAbstract3DSymbol.Property.BottomRadius.__doc__ + '\n' + '* ``PropertySize``: ' + QgsAbstract3DSymbol.Property.MinorRadius.__doc__ + '\n' + '* ``PropertyHeight``: ' + QgsAbstract3DSymbol.Property.TopRadius.__doc__ + '\n' + '* ``PropertySize``: ' + QgsAbstract3DSymbol.Property.Size.__doc__
# --
6 changes: 6 additions & 0 deletions python/core/auto_generated/3d/qgsabstract3dsymbol.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ Returns the list of the vector layer geometry types which are compatible with th
{
Height,
ExtrusionHeight,
Length,
Radius,
BottomRadius,
MinorRadius,
TopRadius,
Size,
};

static const QgsPropertiesDefinition &propertyDefinitions();
Expand Down
8 changes: 8 additions & 0 deletions src/3d/symbols/qgspoint3dsymbol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ void QgsPoint3DSymbol::writeXml( QDomElement &elem, const QgsReadWriteContext &c

elem.appendChild( symbolElem );
}

QDomElement elemDDP = doc.createElement( QStringLiteral( "data-defined-properties" ) );
mDataDefinedProperties.writeXml( elemDDP, propertyDefinitions() );
elem.appendChild( elemDDP );
}

void QgsPoint3DSymbol::readXml( const QDomElement &elem, const QgsReadWriteContext &context )
Expand All @@ -114,6 +118,10 @@ void QgsPoint3DSymbol::readXml( const QDomElement &elem, const QgsReadWriteConte
const QDomElement symbolElem = elem.firstChildElement( QStringLiteral( "symbol" ) );

setBillboardSymbol( QgsSymbolLayerUtils::loadSymbol< QgsMarkerSymbol >( symbolElem, context ) );

const QDomElement elemDDP = elem.firstChildElement( QStringLiteral( "data-defined-properties" ) );
if ( !elemDDP.isNull() )
mDataDefinedProperties.readXml( elemDDP, propertyDefinitions() );
}

QList<Qgis::GeometryType> QgsPoint3DSymbol::compatibleGeometryTypes() const
Expand Down
Loading
Loading