/builds/gitlab-kitware-sciviz-ci/Utilities/Doxygen/pages/MultiSliceView.md
Go to the documentation of this file.
1 Implementation Details: Slice View {#DesignSliceView}
2 ===================================
3 
4 ![Slice View in ParaView](sliceview.png)
5 
6 [TOC]
7 
8 This page summarizes the design details of what ParaView calls the **Slice
9 View** (sometimes called the **Multi-Slice View** since it allows the users to
10 add multiple slices).
11 
12 ##Classes##
13 
14 Let's start by getting an overview of the new classes added for supporting this
15 Slice view.
16 
17 vtkSMMultiSliceViewProxy is the view-proxy. It's a vtkSMRenderViewProxy
18 subclass. This makes it possible for the application to treat this as simply a
19 specialization of the *Render View*, which it indeed is. Thus all toolbars for
20 setting axis of rotation, camera positions, selection etc. will continue to
21 work.
22 
23 pqMultiSliceView is the pqRenderView subclass created by the GUI whenever it
24 encounters a vtkSMMultiSliceViewProxy. The extra thing that this class does it
25 manage the UI components to allow the user to interactively place slices in the
26 view. Use pqMultiSliceAxisWidget, this class updates the *XSlicesValues*,
27 *YSlicesValues*, and *ZSlicesValues* properties on the vtkSMMultiSliceViewProxy
28 proxy.
29 
30 vtkPVMultiSliceView is a VTK-object controlled by the
31 vtkSMMultiSliceViewProxy. vtkPVMultiSliceView is a indeed a vtkPVRenderView
32 subclass. It adds API to set/get the slice positions along each of the
33 coordinate axes. Representations that want to respect the slices specified by
34 this view can access the view in vtkPVView::REQUEST_UPDATE() pass to get the
35 slice positions. This pass will indeed be triggered on all data-server ranks
36 after the slice positions have been changed.
37 
38 vtkGeometrySliceRepresentation is a vtkGeometryRepresentation subclass which is
39 used to add a new **Slices** representation type to the standard
40 *GeometryRepresentation* proxy.
41 vtkSMMultiSliceViewProxy::GetRepresentationType() will suggest creating of this
42 extended *GeometryRepresentation*, know as
43 (*representations*, *CompositeMultiSliceRepresentation*) to the ProxyManager.
44 
45 *CompositeMultiSliceRepresentation* supports the usual representation-types e.g.
46 Surface, Wireframe, etc. along with the new *Slices* type. Whenever the user
47 picks the *Slices* representation-type, the vtkGeometrySliceRepresentation will
48 be used.
49 
50 vtkGeometrySliceRepresentation works with vtkPVMultiSliceView to display any
51 dataset as a set of slices along the coordinate planes. The slice positions are
52 obtained from vtkPVMultiSliceView in the vtkPVView::REQUEST_UPDATE().
53 
54 vtkGeometrySliceRepresentation works by replacing the vtkPVGeometryFilter (in
55 vtkGeometryRepresentation) with an internal vtkPVGeometryFilter subclass that
56 extracts the slices from the input dataset before passing it to the
57 vtkPVGeometryFilter implementation. It uses the vtkThreeSliceFilter to apply a
58 collection of slice filters in one go.
59 
60 ##Supporting Miscellaneous Use-Cases##
61 
62 Let's look at how we support a bunch of miscellaneous use-cases.
63 
64 ###Choosing *Slices* representation by default###
65 
66 **Use-Case**: When user shows a new dataset in this Slice view, we want the
67 default representation-type to be "Slices", and not "Surface" or anything
68 that vtkSMRepresentationTypeDomain picks.
69 
70 **Solution (HACK)**: vtkSMMultiSliceViewProxy::CreateDefaultRepresentation()
71 changes the *Representation* property's value to *Slices*. Further more, to
72 avoid vtkSMParaViewPipelineController::PostInitializeProxy() from resetting the
73 property value to domain-defaults (using
74 vtkSMProperty::ResetToDomainDefaults()), we add an XML hint to the property.
75 This is done in vtkSMMultiSliceViewProxy::ForceRepresentationType().
76 
77 ###Setting default slice locations###
78 
79 **Use-Case**: When a new dataset is shown in this view, we want the view to
80 automatically place slices at the center of the dataset.
81 
82 **Solution (HACK)**: We set the properties on the view in
83 vtkSMMultiSliceViewProxy::CreateDefaultRepresentation(). Currently the
84 properties on the view are changed only when there are no slices specified
85 already.
86 
87 Notes
88 ------
89 This page is generated from *MultiSliceView.md*.