|
QGIS API Documentation 4.1.0-Master (9af12b5a203)
|
Categorized 3D renderer. More...
#include <qgscategorized3drenderer.h>

Public Types | |
| using | Categories = Qgs3DCategoryList |
| using | Category = Qgs3DRendererCategory |
Public Member Functions | |
| QgsCategorized3DRenderer (const QString &attributeName=QString(), const Qgs3DCategoryList &categories=Qgs3DCategoryList()) | |
| Construct renderer with the given categories. | |
| void | addCategory (const Qgs3DRendererCategory &category) |
| Adds a new category to the renderer. | |
| const Qgs3DCategoryList & | categories () const |
| Returns a list of all categories recognized by the renderer. | |
| QString | classAttribute () const |
| Returns the class attribute for the renderer, which is the field name or expression string from the layer which will be matched against the renderer categories. | |
| QgsCategorized3DRenderer * | clone () const override |
| Returns a cloned instance. | |
| Qt3DCore::QEntity * | createEntity (Qgs3DMapSettings *mapSettings) const override |
| Returns a 3D entity that will be used to show renderer's data in 3D scene. | |
| void | deleteAllCategories () |
| Deletes all existing categories from the renderer. | |
| bool | deleteCategory (int catIndex) |
| Deletes the category with the specified index from the renderer. | |
| bool | moveCategory (int from, int to) |
| Moves an existing category at index position from to index position to. | |
| void | readXml (const QDomElement &elem, const QgsReadWriteContext &context) override |
| Reads renderer's properties from given XML element. | |
| void | setClassAttribute (QString attributeName) |
| Sets the class attribute for the renderer, which is the field name or expression string from the layer which will be matched against the renderer categories. | |
| void | setSourceColorRamp (QgsColorRamp *ramp) |
| Sets the source color ramp. | |
| void | setSourceSymbol (QgsAbstract3DSymbol *symbol) |
| Sets the source symbol for the renderer, which is the base symbol used for the each categories' symbol before applying the categories' color. | |
| void | sortByValue (Qt::SortOrder order=Qt::AscendingOrder) |
| Sorts the existing categories by their value. | |
| QgsColorRamp * | sourceColorRamp () |
| Returns the source color ramp, from which each categories' color is derived. | |
| const QgsColorRamp * | sourceColorRamp () const |
| Returns the source color ramp, from which each categories' color is derived. | |
| QgsAbstract3DSymbol * | sourceSymbol () |
| Returns the renderer's source symbol, which is the base symbol used for the each categories' symbol before applying the categories' color. | |
| const QgsAbstract3DSymbol * | sourceSymbol () const |
| Returns the renderer's source symbol, which is the base symbol used for the each categories' symbol before applying the categories' color. | |
| QString | type () const override |
| Returns unique identifier of the renderer class (used to identify subclass). | |
| bool | updateCategoryRenderState (int catIndex, bool render) |
| Changes the render state for the category with the specified index. | |
| bool | updateCategorySymbol (int catIndex, QgsAbstract3DSymbol *symbol) |
| Changes the symbol for the category with the specified index. | |
| bool | updateCategoryValue (int catIndex, const QVariant &value) |
| Changes the value for the category with the specified index. | |
| void | updateColorRamp (QgsColorRamp *ramp) |
| Update the color ramp used and all symbols colors. | |
| void | updateSymbols (QgsAbstract3DSymbol *symbol) |
| Update all the symbols but leave categories and colors. | |
| void | writeXml (QDomElement &elem, const QgsReadWriteContext &context) const override |
| Writes renderer's properties to given XML element. | |
| Public Member Functions inherited from QgsAbstractVectorLayer3DRenderer | |
| QgsAbstractVectorLayer3DRenderer () | |
| void | copyBaseProperties (QgsAbstractVectorLayer3DRenderer *r) const |
| Copies common properties of this object to another object. | |
| QgsVectorLayer * | layer () const |
| Returns vector layer associated with the renderer. | |
| void | resolveReferences (const QgsProject &project) override |
| Resolves references to other objects - second phase of loading - after readXml(). | |
| void | setLayer (QgsVectorLayer *layer) |
| Sets vector layer associated with the renderer. | |
| void | setTilingSettings (const QgsVectorLayer3DTilingSettings &settings) |
| Sets tiling settings of the renderer. | |
| QgsVectorLayer3DTilingSettings | tilingSettings () const |
| Returns tiling settings of the renderer. | |
| Public Member Functions inherited from QgsAbstract3DRenderer | |
| virtual | ~QgsAbstract3DRenderer ()=default |
Static Public Member Functions | |
| static Qgs3DCategoryList | createCategories (const QVariantList &values, const QgsAbstract3DSymbol *symbol, QgsVectorLayer *layer=nullptr, const QString &attributeName=QString()) |
| Create categories for a list of values. | |
Additional Inherited Members | |
| Protected Member Functions inherited from QgsAbstractVectorLayer3DRenderer | |
| void | readXmlBaseProperties (const QDomElement &elem, const QgsReadWriteContext &context) |
| Reads common properties of this object from DOM element. | |
| void | writeXmlBaseProperties (QDomElement &elem, const QgsReadWriteContext &context) const |
| Writes common properties of this object to DOM element. | |
| Protected Member Functions inherited from QgsAbstract3DRenderer | |
| QgsAbstract3DRenderer ()=default | |
Categorized 3D renderer.
Similar to Categorized 2D renderer and Categorized labeling, it allows specification of rules for 3D symbols.
Definition at line 145 of file qgscategorized3drenderer.h.
Definition at line 149 of file qgscategorized3drenderer.h.
Definition at line 148 of file qgscategorized3drenderer.h.
| QgsCategorized3DRenderer::QgsCategorized3DRenderer | ( | const QString & | attributeName = QString(), |
| const Qgs3DCategoryList & | categories = Qgs3DCategoryList() ) |
Construct renderer with the given categories.
Definition at line 100 of file qgscategorized3drenderer.cpp.
| void QgsCategorized3DRenderer::addCategory | ( | const Qgs3DRendererCategory & | category | ) |
Adds a new category to the renderer.
Definition at line 237 of file qgscategorized3drenderer.cpp.
|
inline |
Returns a list of all categories recognized by the renderer.
Definition at line 169 of file qgscategorized3drenderer.h.
|
inline |
Returns the class attribute for the renderer, which is the field name or expression string from the layer which will be matched against the renderer categories.
Definition at line 178 of file qgscategorized3drenderer.h.
|
overridevirtual |
Returns a cloned instance.
Implements QgsAbstract3DRenderer.
Definition at line 105 of file qgscategorized3drenderer.cpp.
|
static |
Create categories for a list of values.
The returned symbols in the category list will be a modification of symbol.
If layer and fieldName are specified it will try to find nicer values to represent the description for the categories based on the respective field configuration.
Definition at line 380 of file qgscategorized3drenderer.cpp.
|
overridevirtual |
Returns a 3D entity that will be used to show renderer's data in 3D scene.
Implements QgsAbstract3DRenderer.
Definition at line 123 of file qgscategorized3drenderer.cpp.
| void QgsCategorized3DRenderer::deleteAllCategories | ( | ) |
Deletes all existing categories from the renderer.
Definition at line 253 of file qgscategorized3drenderer.cpp.
| bool QgsCategorized3DRenderer::deleteCategory | ( | int | catIndex | ) |
Deletes the category with the specified index from the renderer.
Definition at line 242 of file qgscategorized3drenderer.cpp.
| bool QgsCategorized3DRenderer::moveCategory | ( | int | from, |
| int | to ) |
Moves an existing category at index position from to index position to.
Definition at line 258 of file qgscategorized3drenderer.cpp.
|
overridevirtual |
Reads renderer's properties from given XML element.
Implements QgsAbstract3DRenderer.
Definition at line 323 of file qgscategorized3drenderer.cpp.
| void QgsCategorized3DRenderer::setClassAttribute | ( | QString | attributeName | ) |
Sets the class attribute for the renderer, which is the field name or expression string from the layer which will be matched against the renderer categories.
Definition at line 148 of file qgscategorized3drenderer.cpp.
| void QgsCategorized3DRenderer::setSourceColorRamp | ( | QgsColorRamp * | ramp | ) |
Sets the source color ramp.
| ramp | color ramp. Ownership is transferred to the renderer |
Definition at line 178 of file qgscategorized3drenderer.cpp.
| void QgsCategorized3DRenderer::setSourceSymbol | ( | QgsAbstract3DSymbol * | symbol | ) |
Sets the source symbol for the renderer, which is the base symbol used for the each categories' symbol before applying the categories' color.
| symbol | source symbol, ownership is transferred to the renderer |
Definition at line 163 of file qgscategorized3drenderer.cpp.
| void QgsCategorized3DRenderer::sortByValue | ( | Qt::SortOrder | order = Qt::AscendingOrder | ) |
Sorts the existing categories by their value.
Definition at line 269 of file qgscategorized3drenderer.cpp.
| QgsColorRamp * QgsCategorized3DRenderer::sourceColorRamp | ( | ) |
Returns the source color ramp, from which each categories' color is derived.
Definition at line 168 of file qgscategorized3drenderer.cpp.
| const QgsColorRamp * QgsCategorized3DRenderer::sourceColorRamp | ( | ) | const |
Returns the source color ramp, from which each categories' color is derived.
Definition at line 173 of file qgscategorized3drenderer.cpp.
| QgsAbstract3DSymbol * QgsCategorized3DRenderer::sourceSymbol | ( | ) |
Returns the renderer's source symbol, which is the base symbol used for the each categories' symbol before applying the categories' color.
Definition at line 153 of file qgscategorized3drenderer.cpp.
| const QgsAbstract3DSymbol * QgsCategorized3DRenderer::sourceSymbol | ( | ) | const |
Returns the renderer's source symbol, which is the base symbol used for the each categories' symbol before applying the categories' color.
Definition at line 158 of file qgscategorized3drenderer.cpp.
|
inlineoverridevirtual |
Returns unique identifier of the renderer class (used to identify subclass).
Implements QgsAbstract3DRenderer.
Definition at line 154 of file qgscategorized3drenderer.h.
| bool QgsCategorized3DRenderer::updateCategoryRenderState | ( | int | catIndex, |
| bool | render ) |
Changes the render state for the category with the specified index.
The render state indicates whether or not the category will be rendered, and is reflected in whether the category is checked with the project's layer tree.
Definition at line 226 of file qgscategorized3drenderer.cpp.
| bool QgsCategorized3DRenderer::updateCategorySymbol | ( | int | catIndex, |
| QgsAbstract3DSymbol * | symbol ) |
Changes the symbol for the category with the specified index.
Ownership of symbol is transferred to the renderer.
Definition at line 215 of file qgscategorized3drenderer.cpp.
| bool QgsCategorized3DRenderer::updateCategoryValue | ( | int | catIndex, |
| const QVariant & | value ) |
Changes the value for the category with the specified index.
If value is a list, then the category will match any of the values from this list.
Definition at line 204 of file qgscategorized3drenderer.cpp.
| void QgsCategorized3DRenderer::updateColorRamp | ( | QgsColorRamp * | ramp | ) |
Update the color ramp used and all symbols colors.
| ramp | color ramp. Ownership is transferred to the renderer |
Definition at line 183 of file qgscategorized3drenderer.cpp.
| void QgsCategorized3DRenderer::updateSymbols | ( | QgsAbstract3DSymbol * | symbol | ) |
Update all the symbols but leave categories and colors.
This method also sets the source symbol for the renderer.
| symbol | source symbol to use for categories. Ownership is not transferred. |
Definition at line 135 of file qgscategorized3drenderer.cpp.
|
overridevirtual |
Writes renderer's properties to given XML element.
Implements QgsAbstract3DRenderer.
Definition at line 277 of file qgscategorized3drenderer.cpp.