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