Conversation
4d64c84 to
849cc79
Compare
🍎 MacOS Qt6 buildsDownload MacOS Qt6 builds of this PR for testing. 🪟 Windows Qt6 buildsDownload Windows Qt6 builds of this PR for testing. |
61bf941 to
f796430
Compare
|
@ptitjano above review is partial only -- i haven't checked the gui or 3d handler yet. |
d37f249 to
690ab06
Compare
thanks |
690ab06 to
f78fa15
Compare
f78fa15 to
dd6687e
Compare
410a159 to
7219bba
Compare
python/PyQt6/3d/auto_generated/materials/qgsgoochmaterialsettings.sip.in
Outdated
Show resolved
Hide resolved
python/PyQt6/3d/auto_generated/materials/qgsmetalroughmaterialsettings.sip.in
Outdated
Show resolved
Hide resolved
python/PyQt6/3d/auto_generated/materials/qgsphongmaterialsettings.sip.in
Outdated
Show resolved
Hide resolved
python/PyQt6/3d/auto_generated/materials/qgsphongtexturedmaterialsettings.sip.in
Outdated
Show resolved
Hide resolved
python/PyQt6/3d/auto_generated/materials/qgssimplelinematerialsettings.sip.in
Outdated
Show resolved
Hide resolved
| void Qgs3DSymbolButton::showSettingsDialog() | ||
| { | ||
| QgsPanelWidget *panel = QgsPanelWidget::findParentPanel( this ); | ||
| QgsSingleSymbol3DRendererWidget *widget = new QgsSingleSymbol3DRendererWidget( mLayer, this ); |
There was a problem hiding this comment.
why QgsSingleSymbol3DRendererWidget? QgsSymbol3DWidget would be more appropriate.
There was a problem hiding this comment.
Because we need a widget which inherits from QgsPanelWidget. Maybe, the existing QgsSymbol3DWidget could be adapted to inherit from QgsPanelWidget?
There was a problem hiding this comment.
More precisely, I don't understand the difference between QgsSingleSymbol3DRendererWidget and QgsSymbol3DWidget
| : QgsTemplatedCategorizedRendererModel<QgsCategorized3DRenderer>( parent, screen ) | ||
| {} | ||
|
|
||
| Qt::ItemFlags QgsCategorized3DRendererModel::flags( const QModelIndex &index ) const |
There was a problem hiding this comment.
there's SO much duplicate code here. is there no way to reduce this via the template QgsTemplatedCategorizedRendererModel? (and similarly with the widget)
There was a problem hiding this comment.
I don't mind reducing reducing the duplicate code, quite the opposite. But I was under the impression that this was not the way to do it. Currently, almost no widget code is shared between 2D and 3D. Take for example the rulebasedrenderer. All the code is duplicated.
|
|
||
| virtual void sort( int column, Qt::SortOrder order = Qt::AscendingOrder ) override = 0; | ||
|
|
||
| int rowCount( const QModelIndex &parent = QModelIndex() ) const override |
There was a problem hiding this comment.
you can speed up compilation by moving these to the .cpp file, and then doing something like: https://github.com/qgis/QGIS/blob/master/src/core/project/qgsprojectstoredobjectmanager.cpp#L121
There was a problem hiding this comment.
I don't think this can be done because in that cause, one would need to include qgscategorized3drenderer.h in the cpp file. However, one cannot access 3d directory from the gui one. Or am I missing something?
`QgsCategorized3DRenderer::createEntity` is not implemented at the moment. This will be done with QgsCategorizedChunkLoader` in the next commit.
This function calculates a weighted average of the ambient, diffuse, and specular color components to produce a single representative color.
…e color This function calculates a weighted average of the ambient, diffuse, and specular color components to produce a single representative color.
This function calculates a weighted average of the cool, warm, diffuse and specular color components to produce a single representative color.
For phong and gooch, this uses the average logic introduced in the previous commits. For materials with only one color, this returns the base color.
This adds a utility function to get the average color of a 3d symbol.
This adds a new function to generate a preview icon of a vector 3d symbol based on its type (line, point or polygon) and its average color.
This function decomposes a base color into phong material components (ambient, diffuse, specular, shininess).
…e color This function decomposes a base color into phong material components (ambient, specular, shininess).
This function decomposes a base color into gooch components (cool, diffuse, specular, warm, alpha and beta).
…olor For phong and gooch, this uses the base color logic introduced in the previous commits. For materials with only one color, this sets its color.
This methods sets the base color of the material settings associated with a 3D vector symbol.
This function copies the material properties of a vector 3D symbol from one symbol to another.
984dde1 to
2dcf2b1
Compare
And add them in `QgsTemplatedCategorizedRendererModel`.
This will be needed by `Qgs3DSymbolButton` in the next commit.
This widget is used to configure a 3d categorized renderer. Closes: qgis#53963
This prevents fetching features that won't be rendered.
2dcf2b1 to
c64789a
Compare
Description
This PR ads support for categorized renderer in QGIS 3D.
On the 3d renderering side this adds:
QgsCategorizedChunkLoaderQgsCategorizedChunkLoaderBoth implementations are similar to the existing rule based and vector renderers.
On the widget side, this adds:
Qgs3DSymbolButton(a simplified version of its 2D counter part:QgsSymbolButton)QgsCategorized3DRendererWidgetto configure the renderer. It is similar to its 2D counterpart and it tries to factorize some common code (mostly the model of the tree view used to display the categories)Some new vector symbol and material utils functions are introduced. They are used in the new widgets:
Demo
qgis3d-categorized.mp4
Updates
20 january
QgsPhongTexturedMaterialSettings::textureAverageColorinstead of slow pixelColorQStringListto compare stringsQgs3DRendererCategory::swapQgsAbstract3DSymbol::setColorsFromBaseQgsAbstract3DSymbol::averageColorQgs3DSymbolButtonFunded by Stadt Frankfurt am Main
Closes #51640
Closes #53963