/builds/gitlab-kitware-sciviz-ci/Utilities/Doxygen/pages/ProxyHints.md
Go to the documentation of this file.
1 Proxy Hints And Annotations {#ProxyHints}
2 ===========================
3 
4 This page documents *Proxy Hints*, which are XML tags accepted under *Hints*
5 for a *Proxy* element in the Server-Manager configuration XMLs.
6 
7 WarnOnRepresentationChange
8 --------------------------
9 Warn the user on changing to a specific representation type.
10 
11 For the motivation behind this hint, see BUG #15117.
12 This is used to indicate to the pqDisplayRepresentationWidget that the user must
13 be prompted with a *'Are you sure?'* if they manually switch to this
14 representation from the UI.
15 
16  <RepresentationProxy ...>
17  ...
18  <Hints>
19  <WarnOnRepresentationChange value="Volume" />
20  </Hints>
21  </RepresentationProxy>
22 
23 WarnOnCreate
24 ------------
25 Warn the user when creating the filter or source in the UI.
26 
27 The motivation behind this hint is to warn the user when executing filters
28 like **Temporal Statistics** filter since they can potentially take a long time
29 for large file series or when a filter may uses too much memory relative to
30 the remaining memory.
31 
32  <SourceProxy ...>
33  ...
34  <Hints>
35  <WarnOnCreate>
36  <Text title="Potentially slow operations">
37  **Temporal Statistics** filter needs to process all timesteps
38  available in your dataset and can potentially take a long time to complete.
39  Do you want to continue?
40  </Text>
41  </WarnOnCreate>
42  </SourceProxy>
43 
44 It is possible to specify some conditions for the warn based on memory usage and inputs types.
45 In the below example, the warning will be presented to the user only if the input is a vtkImageData
46 and the remaining memory is smaller than the expected size of the output, which is `10` times the size of the input.
47 If relative is not set, a default value of `1` will be used.
48 The DataTypeDomain syntax is the same as the one for the DataTypeDomain with InputProperty.
49 
50  <SourceProxy ...>
51  ...
52  <Hints>
53  <WarnOnCreate>
54  <DataTypeDomain name="input_type">
55  <DataType value="vtkImageData" />
56  </DataTypeDomain>
57  <MemoryUsage relative="10" />
58  <Text title="Potentially running out of memory">
59  This filter may not have enough memory to process
60  Do you want to continue?
61  </Text>
62  </WarnOnCreate>
63  </SourceProxy>
64 
65 ReaderFactory
66 -------------
67 Mark a proxy as reader proxy so that it's used to open files from the **File |
68 Open** dialog.
69 
70 This hint is used to mark a proxy as a reader. It provides the ParaView
71 application with information about extensions supported by this reader.
72 **extensions** attribute to list the supported extensions e.g. "foo foo.bar" for
73 files named as `somename.foo` or `somename.foo.bar`.
74 **filename_patterns** attribute is used to list the filename patterns to match.
75 The format is similar to what one would use for `ls` or `dir` using wildcards e.g.
76 spcth\* to match spcta, spctb etc.
77 
78  <!-- using extensions -->
79  <SourceProxy ...>
80  ...
81  <Hints>
82  <ReaderFactory extensions="[space separated extensions w/o leading '.']"
83  filename_patterns="[space separated filename patters (using wildcards)]"
84  file_description="[user-friendly description]" />
85  </Hints>
86  </SourceProxy>
87 
88 View
89 ----
90 Specify the default view to use for showing the output produced by a
91 source/filter.
92 
93 This hint is used to indicate the name of the view to use by default for showing
94 the output of this source/filter on first *Apply*. To specify the view type for
95 a specific output port, you can use the optional attribute **port**.
96 
97  <SourceProxy ...>
98  ...
99  <Hints>
100  <View type="XYChartView" />
101  </Hints>
102  </SourceProxy>
103 
104 In certain cases, in addition to showing the data in the "preferred" default
105 view, you may want to show the result in the current view as well e.g. when
106 **Plot Over Line** filter is created, while the result is shown in the
107 **XYChartView**, we want to show the line representation for the data being
108 plotted in the current Render View too. For that one can add the
109 `also_show_in_current_view` attribute to the `<View/>` tag.
110 
111  <SourceProxy ...>
112  ...
113  <Hints>
114  <View type="XYChartView" also_show_in_current_view="1" />
115  </Hints>
116  </SourceProxy>
117 
118 If the source/filter has more than 1 output ports, you can choose which port the
119 hint corresponds to by using the optional `port` attribute.
120 
121  <SourceProxy ...>
122  ...
123  <Hints>
124  <View type="XYChartView" port="1" />
125  </Hints>
126  </SourceProxy>
127 
128 The `<View/>` hint can also be used to prevent automatic display of an output in
129 any view. To do that, use the **None** type. Such source can then still be
130 displayed manually by toggling the visibility when an appropriate View is active.
131 
132  <SourceProxy ...>
133  ...
134  <Hints>
135  <View type="None" />
136  </Hints>
137  </SourceProxy>
138 
139 PipelineIcon
140 ------------
141 Specify the pipeline icon view to use in the pipeline browser for this
142 source/filter proxy.
143 
144 This hint is used to indicate the icon to use in the pipeline browser.
145 It can be either the full name of a qt resource icon or the name of a view type
146 for which an icon as already been defined.
147 
148  <SourceProxy ...>
149  ...
150  <Hints>
151  <PipelineIcon name="XYChartView" />
152  </Hints>
153  </SourceProxy>
154 
155 If the source/filter has more than 1 output port, you can choose which port the
156 hint corresponds to by using the optional `port` attribute.
157 
158  <SourceProxy ...>
159  ...
160  <Hints>
161  <PipelineIcon name="XYChartView" port="1" />
162  </Hints>
163  </SourceProxy>
164 
165 At the time of writing, the supported stock icon names were:
166  * "SERVER"
167  * "SECURE_SERVER"
168  * "LINK"
169  * "GEOMETRY"
170  * "XYChartView"
171  * "XYBarChartView"
172  * "XYHistogramChartView"
173  * "BoxChartView"
174  * "SpreadSheetView"
175  * "INDETERMINATE"
176  * "None"
177  * "EYEBALL"
178  * "EYEBALL_GRAY"
179  * "INSITU_EXTRACT"
180  * "INSITU_EXTRACT_GRAY"
181  * "INSITU_SERVER_RUNNING"
182  * "INSITU_SERVER_PAUSED"
183  * "INSITU_BREAKPOINT"
184  * "INSITU_WRITER_PARAMETERS"
185  * "CINEMA_MARK"
186 
187 If the desired icon is not present in the list, it is possible to use a Qt resource icon name directly.
188 
189  <SourceProxy ...>
190  ...
191  <Hints>
192  <PipelineIcon name=":/pqWidgets/Icons/pqCalculator.svg" />
193  </Hints>
194  </SourceProxy>
195 
196 Available icons are visible in the sources of ParaView
197 
198 If the desired icon is not present, it can be added, for example in the context of a plugin, using
199 GUI_RESOURCES in your ADD_PARAVIEW_PLUGIN macro, a .qrc file and your own icon file.
200 
201  <SourceProxy ...>
202  ...
203  <Hints>
204  <PipelineIcon name=":/MyPluginQtResource/Icons/myIcon.png" />
205  </Hints>
206  </SourceProxy>
207 
208 Plotable
209 --------
210 Mark output data as plotable in 2D chart views.
211 
212 Chart views in ParaView e.g. **Bar Chart View**, **Line Chart View**, support
213 plotting data of any type. However, since such plots don't use distributed
214 rendering techniques, to avoid accidentally plotting large datasets, the plots
215 by default can only show sources/filters that produce `vtkTable` as the output.
216 If a source/filter doesn't produce a `vtkTable`, but produces data that should
217 indeed be plotted by such views, one can use this hint.
218 
219  <SourceProxy ...>
220  <Hints>
221  <Plotable />
222  </Hints>
223  </SourceProxy>
224 
225 RepresentationType
226 ------------------
227 Specify the representation type to use by default when showing the output from a
228 source/filter in a particular view.
229 
230 This hint is used to indicate the default representation type in any/all views.
231 The **view** attribute is optional. When not specified it matches all views.
232 Likewise, **port** attribute is optional. When not specified it matches all
233 output ports. The hints are processed in order. Hence when specifying multiple
234 Representation elements, start with most restrictive to least restrictive.
235 
236 Note, this hint doesn't control which representation proxy gets created, but the
237 default value for the "Representation" property on the representation proxy
238 set using `vtkSMRepresentationProxy::SetRepresentationType()`.
239 
240  <SourceProxy ...>
241  ...
242  <Hints>
243  <RepresentationType view="ComparativeRenderView" type="Surface" port="1"/>
244  <RepresentationType view="RenderView" type="Wireframe" />
245  </Hints>
246  </SourceProxy>
247 
248 Representation
249 --------------
250 Specify the representation proxy to create to show the output from a
251 source/filter in a particular view.
252 
253 This hint is used to indicate the representation proxy to create to show the
254 output from a source/filter in a particular view, rather than letting the view
255 determine which representation proxy to create. This is rare. The more common
256 use-case of picking the default representation type is satisfied by
257 **RepresentationType** XML hint documented above.
258 
259 The required **view** attribute specifies the view to which the hint applies and
260 should be set to the XML proxy name of the view. The required **type** attribute
261 specifies the XML proxy name for representation to create. The optional
262 **port** attribute can be used to limit the hint to specific output port.
263 
264  <SourceProxy ...>
265  ...
266  <Hints>
267  <Representation view="RenderView" type="TextSourceRepresentation" />
268  </Hints>
269  </SourceProxy>
270 
271 OutputPort
272 --------------------------
273 Set name and representation of a specific output port.
274 
275 This hint is used to rename a specific output port
276 and also the type of representation to use.
277 Type can be either "text", "logo" or "progress".
278 
279 The representation part of this hint may be deprecated soon.
280 Use Representation hint instead.
281 
282  <SourceProxy ...>
283  ...
284  <Hints>
285  <OutputPort index="0"
286  name="Output-0"
287  type="text" />
288  </Hints>
289  </SourceProxy>
290 
291 ShowProxyDocumentationInPanel
292 -----------------------------
293 Show an annotation label in the auto-generated panel generated using
294 pqProxyWidget.
295 
296 This hint is used to indicate that the documentation for the proxy should be
297 shown in special label at the top of the panel generated for the proxy. This is
298 useful to show information to the user directly on the panel.
299 
300 The ShowProxyDocumentationInPanel take one optional attribute **type**. The
301 possible values are:
302 1. *description*: (default) to use vtkSMDocumentation::GetDescription(),
303 2. *short_help*: to use vtkSMDocumentation::GetShortHelp(), and
304 3. *long_help*: to use vtkSMDocumentation::GetLongHelp().
305 
306  <SourceProxy ...>
307  <Documentation>
308  Some text that will be shown in the label.
309  </Documentation>
310  ...
311  <Hints>
312  <ShowProxyDocumentationInPanel type="description"/>
313  </Hints>
314  </SourceProxy>
315 
316 ReloadFiles
317 -----------
318 Indicate the property on a reader to use to refresh (or reload) the reader to
319 make it re-read the data files.
320 
321 This hint can be used for readers that support "smart refresh" to re-read files
322 when they are changed. Otherwise, ParaView will use the default mechanism which
323 simply recreated the reader thus forgoing any previous data cached by the
324 reader. The attribute **property** indicates the name of the property on the
325 reader proxy to invoke to make the reader refresh.
326 
327  <SourceProxy>
328  ...
329  <Hints>
330  <ReloadFiles property="Refresh" />
331  </Hints>
332  </SourceProxy>
333 
334 View Annotations
335 ----------------
336 Views support the following annotations:
337 
338 1. **ParaView::DetachedFromLayout**: **Deprecated in ParaView 5.7**.
339 This is no longer applicable as all views are created detached from layout by default.
340 
341 Live Source
342 ------------
343 Certain algorithms can generate new data autonomously, e.g. a source that reads
344 data from the network. The **LiveSource** hint allows ParaView to periodically
345 check with the algorithm if it has new data and update the application, if so.
346 
347 For that, one simply adds a hint to the proxy as follows:
348 
349  <SourceProxy ...>
350  ...
351  <Hints>
352  <LiveSource interval="100" />
353  </Hints>
354  </SourceProxy>
355 
356 The algorithm subclass must have `bool GetNeedsUpdate()` method that returns
357 true if the algorithm needs update.
358 
359 The `interval` attribute is optional (defaults to 100) and can be used to
360 provide a refresh rate in milliseconds.
361 
362 The `refresh_on_interaction` boolean attribute is optional (defaults to false).
363 When enabled, allows live sources to be refreshed upon user interaction.
364 However, enabling this option can complicate interactions, especially with
365 large data sets.
366 
367 The `emulated_time` attribute is optional and defaults to 0. It is a boolean
368 value that marks the live source as an emulated real-time algorithm, which
369 is an algorithm updated at regular time intervals based on real-time and
370 its available time steps (in seconds). Note that the proxy class must
371 inherit from the `vtkEmulatedTimeAlgorithm` class.
372 
373  <SourceProxy ...>
374  ...
375  <Hints>
376  <LiveSource interval="50" emulated_time="1" />
377  </Hints>
378  </SourceProxy>
379 
380 ConnectToPortIndex
381 --------------------------
382 Connect to a specific port index.
383 
384 This is used to connect a representation to an output port of a filter
385 other than the default (index = 0). Currently, this is only used to
386 modify the input port for the selection representation subproxy in
387 vtkSMPVRepresentationProxy.
388 
389  <RepresentationProxy ...>
390  ...
391  <Hints>
392  <ConnectToPortIndex value="2" />
393  </Hints>
394  </RepresentationProxy>
395 
396 ShowInMenu
397 --------------------------
398 Plugin specific hint to control how a filter/source is shown in menus
399 
400 This is used **in plugins only** to configure how a source or filter
401 should be shown in the filters/sources menu. It enables to place them
402 into an existing category or a new category, as well as set the icon.
403 
404  <SourceProxy ...>
405  ...
406  <Hints>
407  <ShowInMenu category="Category" icon=":/path/to/resource/icon.png" />
408  </Hints>
409  </SourceProxy>
410 
411 NoSolidColor
412 --------------------------
413 Disable the "Solid Color" option for a specific representation type.
414 
415 This is used to indicate to the pqDisplayColorWidget to disable the
416 "Solid Color" option because this representation type doesn't handle it
417 usefully.
418 
419  <RepresentationProxy ...>
420  ...
421  <Hints>
422  <NoSolidColor representation="Slice" />
423  <NoSolidColor representation="Volume" />
424  </Hints>
425  </RepresentationProxy>
426 
427 HideCursor
428 --------------------------
429 Hide the mouse cursor when hovering a render view.
430 
431  <RenderViewProxy ...>
432  ...
433  <Hints>
434  <HideCursor/>
435  </Hints>
436  </RenderViewProxy>