# Setting default properties of filters doesn't work with XML

**URL:** https://discourse.paraview.org/t/setting-default-properties-of-filters-doesnt-work-with-xml/388
**Category:** Development
**Created:** [August 3, 2018, 9:24am UTC](https://discourse.paraview.org/t/setting-default-properties-of-filters-doesnt-work-with-xml/388 "2018-08-03T09:24:49Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![embeddedmz](https://discourse.paraview.org/user_avatar/discourse.paraview.org/embeddedmz/32/142_2.png) [@embeddedmz](https://discourse.paraview.org/u/embeddedmz)
#### Post date: [August 3, 2018, 9:24am UTC](https://discourse.paraview.org/t/setting-default-properties-of-filters-doesnt-work-with-xml/388/1 "2018-08-03T09:24:49Z")

</div>

Hello,

I have noticed that when a filter’s output is vtkMultiBlocDataSet, the chosen representation is “Outline”. In this representation I can’t see the data generated by my filter, so I have to change it manually to “Surface” each time I add my filter to the pipeline.

In the XML file of the filter, I added this hint to set the default representation of my filter to Surface

> Representation type=“Surface”

But it didn’t work…

In other cases, I also have a problem with “Coloring” defaulting to “Solid Color” or “vtkBlockColors” and not the array I added to the vtkPointData of an vtkImageData belonging to vtkMultiBlockDataSet; So, I also have to fix that manually.

I feel that XML “hints” are futile (e.g. ShowComponentLabels hint doesn’t work to show the labels of a table representing DoubleVectorProperty).

What can I change in the code to fix that fastly ?

---

<div class="post-metadata">

### Author: ![utkarsh.ayachit](https://discourse.paraview.org/user_avatar/discourse.paraview.org/utkarsh.ayachit/32/39_2.png) [@utkarsh.ayachit](https://discourse.paraview.org/u/utkarsh.ayachit)
#### Post date: [August 5, 2018, 2:44pm UTC](https://discourse.paraview.org/t/setting-default-properties-of-filters-doesnt-work-with-xml/388/2 "2018-08-05T14:44:24Z")

</div>

> [@embeddedmz](#):
>
> I have noticed that when a filter’s output is vtkMultiBlocDataSet, the chosen representation is “Outline”.

That’s not entirely correct. For example try loading the `can.ex2` dataset from ParaView examples dataset. It renders as surface, by default.

I suspect you’re being hit by the **Outline Threshold**. There’s a separate setting that controls if the data is too big and better rendered as outline by default.

![image](https://discourse.paraview.org/uploads/default/original/1X/55935b32e91b1a7f2927f218a3a39fd45ebef499.jpg)

Try adjusting this from the Settings (or Preferences on macOS) dialog.

---

<div class="post-metadata">

### Author: ![embeddedmz](https://discourse.paraview.org/user_avatar/discourse.paraview.org/embeddedmz/32/142_2.png) [@embeddedmz](https://discourse.paraview.org/u/embeddedmz)
#### Post date: [August 6, 2018, 8:39am UTC](https://discourse.paraview.org/t/setting-default-properties-of-filters-doesnt-work-with-xml/388/3 "2018-08-06T08:39:29Z")

</div>

Hello,

I tried playing with the outline threshold but the representation is still “Outlline”.

The solution I found is to modify this method of the source file “vtkSMRepresentationTypeDomain.cxx” :

> int vtkSMRepresentationTypeDomain::SetDefaultValues(  
> vtkSMProperty\* property, bool use\_unchecked\_values)

> // for vtkImageData show slice (for 2D datasets) or outline (for all others).  
> if (info-\>DataSetTypeIsA(“vtkImageData”))  
> {  
> const int\* ext = info-\>GetExtent();
> 
> ```
> if (ext[0] == ext[1] || ext[2] == ext[3] || ext[4] == ext[5])
> {
> if ((info->GetCompositeDataSetType() == -1) && this->IsInDomain("Slice", temp))
> {
> helper.Set("Slice");
> return 1;
> }
> // The fix that will permit vtkMultiBlocDataSet representation to default to "Surface"
> else if (this->IsInDomain("Surface", temp))
> {
> helper.Set("Surface");
> return 1;
> }
> }
> else if (this->IsInDomain("Outline", temp))
> {
> helper.Set("Outline");
> return 1;
> }
> 
> ```

Otherwise, I carry 2-D vtkImageData in the vtkMultiBlocDataSet (not heavy data).

Curiously, the code I added fixed my color issue too !

So there’s only one problem I want to fix now :

> ShowComponentLabels hint doesn’t work to show the labels of a table representing DoubleVectorProperty).

Is that feature works only for a specific plugin ? Which source file can I debug to fix that issue ? I know that in “void pqDoubleVectorPropertyWidget::propertyDomainModified(vtkObject\* domainObject)” we test if “ShowComponentLabels” hint is available in the “vtkPVXMLElement” named “hints” but then I don’t understand why it’s not being used for my filter (it has number\_of\_elements\_per\_command=2).

---

<div class="post-metadata">

### Author: ![utkarsh.ayachit](https://discourse.paraview.org/user_avatar/discourse.paraview.org/utkarsh.ayachit/32/39_2.png) [@utkarsh.ayachit](https://discourse.paraview.org/u/utkarsh.ayachit)
#### Post date: [August 6, 2018, 11:38am UTC](https://discourse.paraview.org/t/setting-default-properties-of-filters-doesnt-work-with-xml/388/4 "2018-08-06T11:38:42Z")

</div>

> [@embeddedmz](#):
>
> So there’s only one problem I want to fix now :

If you don’t mind, can you create a separate topic for a new issue please? It’s better for archival purposes, easy for someone else follow the thread to follow the conversation, also easier on the responders. thanks in advance.

---

<div class="post-metadata">

### Author: ![embeddedmz](https://discourse.paraview.org/user_avatar/discourse.paraview.org/embeddedmz/32/142_2.png) [@embeddedmz](https://discourse.paraview.org/u/embeddedmz)
#### Post date: [August 6, 2018, 12:29pm UTC](https://discourse.paraview.org/t/setting-default-properties-of-filters-doesnt-work-with-xml/388/5 "2018-08-06T12:29:20Z")

</div>

OK, you are right !
