Go to the documentation of this file.
1 Implementation Details: Slice View {#DesignSliceView}
2 ===================================
4 ![Slice View in ParaView](sliceview.png)
6 [TOC]
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).
12 ##Classes##
14 Let's start by getting an overview of the new classes added for supporting this
15 Slice view.
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.
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.
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.
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.
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.
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().
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.
60 ##Supporting Miscellaneous Use-Cases##
62 Let's look at how we support a bunch of miscellaneous use-cases.
64 ###Choosing *Slices* representation by default###
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.
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().
77 ###Setting default slice locations###
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.
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.
87 Notes
88 ------
89 This page is generated from *MultiSliceView.md*.