Inconsistent Block Coloring Behavior in Multiblock Inspector for PartitionedDataSetCollection

Description:
I am working with a PartitionedDataSetCollection that has an assembly with a large number of nodes. I select specific nodes from the tree to load only certain blocks in the hierarchy.
When I change the Block Coloring for the assembly in the Multiblock Inspector, I encounter several inconsistent behaviors:

  1. Loss of Block Coloring when switching between assembly and hierarchy:

If I switch from the assembly view to the hierarchy view, the block coloring disappears, even when switching back to the assembly.

  • Since the assembly is aware of its block hierarchy, the block coloring should be transferred, right?
  • The most frustrating part is that the block colors do not reappear when returning to the assembly view.
  1. Block Coloring reset after applying a different selection:

If I apply a different selection to add or remove block hierarchies, the previously set block colors are no longer available.
This means I have to recreate the block colors each time, even though the assembly tree structure remains unchanged.I am unsure if this is intended behavior, but it is causing significant issues in my workflow.

Steps to Reproduce:

Case1:
Create a PartitionedDataSetCollectionSource.Select Number Of Shapes = 9 for example.
Change the Block Coloring for the assembly in the Multiblock Inspector.

Switch between the assembly and hierarchy views.

Return on assembly.

Case2:
Create a PartitionedDataSetCollectionSource.Select Number Of Shapes = 9 for example.
Change the Block Coloring for the assembly in the Multiblock Inspector.


Apply a different “Number Of Shapes” and observe the block coloring behavior.

1 Like

I confirm the issues, could you open them here: https://gitlab.kitware.com/paraview/paraview/-/issues ?

FYI @spyridon97

That is not a bug, but an expected behavior based on the current implementation

You describe two cases that both have the same root problem.

Some Glossary:
There are two assembly options:

  1. Hierarchy (its label is Hierarchy): It’s created based on the structure of your dataset.
  2. Data Assembly (its label is Assembly): User provided that can be arbitrary

image

image

Case 1:

In the same dataset, you change which kind of assembly you use between the Data Assembly and the Hierarchy. There is no mapping to transfer from the Data Assembly to Hierarchy, because there are hard cases to deal with:

  1. The Data Assembly can omit certain blocks.
  2. The hierarchy has paths on partitioned datasets, but the user provided Data Assembly can organizes these partitioned datasets in many different ways (see picture above)

Since there is no direct mapping between the Hierarchy and the Assembly to be able to transfer your block properties from one assembly to another, we reset the properties each time you switch. Also, we only have a BlockColor property, not AssemblyBlockColor and HierarchyBlockColor, therefore when you switch back you can’t have access to what you assigned before.

Case 2: You change your dataset, including your DataAssembly and Hierrachy. Since this happens your block properties have to reset since they no longer apply to the same assembly (either choice).

Suggestions: Stick to one of the two organizations. During the exposure of the Data Assembly we had thought of hiding the Hierarchy if there is a Data Assembly, but we kept it in case someone prefers one or the other, but using both interchanably is not possible based ont he current implementation and it would add a lot of code complexity to support what you suggest which we deemed unnecessary.

I hope this helps.

cc: @cory.quammen

I agree for Case2, Case1 behavior is very surprising for users. Changing a tab of a docker widget should not impact anything.

If you refer to the properties panel of a filter, yes i agree, but if you refer to any representation setting that has auto-apply, then in my mind. and considering the current implementation, it makes sense.

From a UI/UX POV, selecting a tab of a dock widget is not a “property change” and should not have an impact to what is being rendered.

But maybe the selection of assembly/hierarchy is more than selecting a tab, but that was how I understand it.

Thank you for your detailed response and for taking the time to investigate this issue.

Regarding case 1:

You’ve correctly identified a potential ambiguity when multiple blocks in a hierarchy have different colorings and belong to the same assembly node. I agree that introducing separate AssemblyBlockColor and HierarchyBlockColor attributes could provide a more flexible and intuitive way to handle these cases.

I would be delighted if you ever decide to improve the block coloring feature.

Regarding case 2:

I understand that in my current workflow, I am primarily working with block colors at the assembly level and have not encountered scenarios where the assembly structure changes significantly between apply.

new question
While developing a ParaView plugin, I’m encountering an issue with applying colors to blocks. The colors are applied on the first call (in RequestData) no reset ?
but on subsequent apply calls, the colors are reset after.
Is there a way to intervene after this reset and reapply the colors at that moment?

I can maybe add a note when you hover over it?

1 Like

From a development cost point of view, i don’t foresee the addition of Assembly and Hierarchy specific properties. But we would be open to implementing it assuming there is a funding option, or you want to contribute these changes yourself.

As far as your question, you would need to be more specific to which RequestData do you refer to and what you are trying to do,

My question regarding RequestData might not be related to my previous post. I’ll open a new ticket if necessary.

But based on the responses, I’m still confused. Let me explain with an example.

Create a PartitionedDataSetCollectionSource.Select Number Of Shapes = 12 for example and switch to hierarchy views.

In Python Shell

partitionedDataSetCollectionSource1 = GetActiveSource()
SetActiveSource(partitionedDataSetCollectionSource1)
renderView1 = GetActiveViewOrCreate(‘RenderView’)
partitionedDataSetCollectionSource1Display = GetDisplayProperties(partitionedDataSetCollectionSource1, view=renderView1)

Next always in Python Shell

partitionedDataSetCollectionSource1Display.BlockColors = [‘/vtkPartitionedDataSetCollection/Boy’, ‘0.000000’, ‘0.764706’, ‘1.000000’]


=> No change on hierarchy or assembly views.

now let’s return to the hierarchy view an in Python Shell:

partitionedDataSetCollectionSource1Display.BlockColors = [‘/Assembly/NonOrientableSurfaces’, ‘0.000000’, ‘0.764706’, ‘1.000000’]


=> No change on hierarchy view

Switch to assembly view:

=> The coloring option is visible.

Could it be that I’m not using Python correctly to alter the block colors in the hierarchy?

I’ve figured out why my command didn’t update the hierarchy view.

with block color value: ‘/Root/Boy’, ‘0.066667’, ‘0.000000’, ‘1.000000’ it’s ok

The first element in the XML actually determines the view name:
For the hierarchy view:

<Root type=“vtkDataAssembly” version=“1.0” id=“0” vtk_type=“38” vtk_category=“hierarchy” label=“vtkPartitionedDataSetCollection”>

=> /Root/

For the assembly view:

<Assembly type=“vtkDataAssembly” version=“1.0” id=“0”>

=> /Assembly/

Is this correct?
If so, considering that we know the difference between hierarchy and assembly, why does ParaView need to perform a reset when switching from hierarchy to assembly or from assembly to hierarchy?

That is correct, the name of the root node is /Root/ not but its label is vtkPartitionedDataSetCollection. In the paths you should always use the names.

What do you mean we know the difference between hierarchy and assembly?
It needs to perform a reset because we don’t have assembly specific and hierarchy specific properties. We only have block properties that apply to both.

The XML name of the parent node for both the hierarchy and the assembly should be different, allowing for distinct paths between the hierarchy and assembly.

This would enable ParaView to have separate block colors for the hierarchy and the assembly within the same ‘blockColor’ property.

Consequently, there would be no need for a reset between the two, as the property would unambiguously hold the colors for both.

ParaView could ignore the links between the assembly and the hierarchy as they are too complex to implement.

For example:
partitionedDataSetCollectionSource1Display.BlockColors = [‘/Assembly/NonOrientableSurfaces’, ‘0.000000’, ‘0.764706’, ‘1.000000’,‘/Root/Boy’,‘0.000000’, ‘0.1’, ‘1.000000’]

=> Assembly view = 1 color on node “NonOrientableSurfaces” and Hierarchy view = 1 color on node “Boy”

Nobody can guarantee that they will be different, nor can we mandate it.

Also, each property needs to be a valid property with respect to the select assembly (Data Assembly or Hierarchy)

Therefore,

  1. ‘/Root/Boy’,‘0.000000’, ‘0.1’, ‘1.000000’ is not valid for Assembly view
  2. ‘/Assembly/NonOrientableSurfaces’, ‘0.000000’, ‘0.764706’, ‘1.000000’, is not valid for hierarchy view