Forcing the View type for a Custom filter

Hello all,

I have created a custom filter from the Annotate Time source and exported as XML. I then edited the XML to create a plugin that I can autoload from my plugins directory.

When I use it, instead of text rendered in the Renderview, it creates by a table displayed in the spreadsheet view. It will render happily in the Renderview when visibility is set. Is there a way I can force the view type within the xml so the filter works in the same way as Annotate Time?

Here is my xml:

<ServerManagerConfiguration>
    <ProxyGroup name="sources">
    <CompoundSourceProxy id="9521" servers="1" name="Annotate Angle" label="Annotate Angle">
      <Proxy group="sources" type="TimeToTextConvertorSource" id="9475" servers="1" compound_name="AnnotateTime1">
        <Property name="Format" id="9475.Format" number_of_elements="1">
          <Element index="0" value="Angle: %06.2f°"/>
        </Property>
      </Proxy>
      <ExposedProperties>
        <Property name="Format" proxy_name="AnnotateTime1" exposed_name="Format"/>
      </ExposedProperties>
      <OutputPort name="Output" proxy="AnnotateTime1" port_index="0"/>
      <Hints>
        <ShowInMenu category="My Source Category" icon="..\..\ParaviewPlugins\icons\icons8-counter-50.png" />
        <Visibility replace_input="0" />
      </Hints>
    </CompoundSourceProxy>
    </ProxyGroup>
</ServerManagerConfiguration>

Many thanks,

Duncan

I’ve just tried similar with the Python Annotation filter.

If I use the filter to display time, the text renders in the Renderview. If I create a custom filter and use it within the same session (Ie no XML exported and re-imported), then the spreadsheet view pops up.

This can be done using either Representation or RepresentationType hints.
https://kitware.github.io/paraview-docs/latest/cxx/ProxyHints.html

Hi Mathieu,

Thanks for your reply.

I tried setting both Representation and RepresentationType in the hints and found no change. In the end I have copied the Annotate Time XML from Sources.XML and edited as below to achieve what I wanted. Again, a representation type is not required in the hints.

<ServerManagerConfiguration>
<ProxyGroup name="sources">
    <SourceProxy class="vtkTimeToTextConvertor"
                 label="Annotate Angle"
                 name="TimeToAngleConvertorSource">
      <Documentation long_help="Shows the animation time as an angle in the view."
                     short_help="Show animation time as angle">The Annotate Angle
                     source can be used to show the animation angle in text
                     annotation.</Documentation>
      <StringVectorProperty command="SetFormat"
                            default_values="Angle: %06.2f°"
                            name="Format"
                            number_of_elements="1"
                            panel_visibility="default">
        <Documentation>This property specifies the format used to display the
        input angle (using printf style).</Documentation>
      </StringVectorProperty>
      <Hints>
        <ShowInMenu category="My Source Category" icon="..\..\ParaviewPlugins\icons\icons8-counter-50.png" />
        <OutputPort index="0"
                    name="Output-0"
                    type="text" />
      </Hints>
    </SourceProxy>
</ProxyGroup>

It seems that creating a compound/ custom filter from this source within the GUI changes the output type.

Regards,

Duncan

1 Like