Plot View Management

From ParaQ Wiki
Jump to navigationJump to search

Overview

This document describes the design of the GUI layer between the server manager and the Qt plot widgets. The describes how plotting views and plotting displays are managed by the GUI Core.

View Modules

  • pqGenericViewModule is a PQ abstraction for any view module. It manages the linking between displays and render modules and defines generic API such are render(), forceRender() etc.
  • pqRenderModule is a PQ abstraction for a view with 3D render window. Every pqRenderModule keeps an interaction undo stack. pqRenderModule is a pqGenericViewModule.
  • pqPlotViewModule is a PQ abstraction for all types of plot views. Currently this class itself manages different types of views such as XY plot, bar chart. If need be we may create separate suclasses for each type. pqPlotViewModule is a pqGenericViewModule subclass, as well.
  • GUI components use pqGenericViewModule, unless that component specifically requires a view of a particular type.
  • pqGenericViewModule defines abstract method canDisplaySource(pqPipelineSource*) which is overridden by subclass to indicate if a particular source can be displayed in that view. This is used by pqPiplineBrowser

to determine the eye ball state for all the sources in a given view.

  • pqPlotViewModule define MaxNumberOfVisibleDisplays which is used to control the maximum number of displays that be viewed in the view. eg. in case of bar chart, this is set to 1, since we can only see 1 bar chart at a time. -1 indicates no limit.

Displays

  • pqDisplay represents any display proxy (vtkSMDisplayProxy subclass).
  • pqConsumerDisplay represents display proxies that are associated with pqPipelineSources. Currently all plot displays are of this type.
  • pqPipelineDisplay is a pqConsumerDisplay subclass that is used for 3D displays for a pqPipelineSource. It provides API to manage scalar color, lookup tables etc etc.

Rendering of Plot Views

  • In case of 3D render views, vtkSMRenderModule::Render() updates the displays and renders them in the window. However, in case of plot views, vtkSMRenderModule::Render() does not do the rendering, it simply updates the displays. Hence, pqPlotViewModule's render() call iterates over all visible displays, gets their output vtkDataSet and sends it to the model for the plot. pqPlotViewModule creates this model for the view in the constructor based on the type of the view.
  • All plot models should support update() API that either takes in a display (or list of them) or vtkDataSet which is should use to generate the plot eg. pqVTKLineChartModel::update takes a QList<pqDisplay*> which are all the visible displays, while pqVTKHistogramModel::update takes a vtkDataSet*. model::update() is equivalent to render, the model checks if the data has modified since the last time update was called and if so, trigger appropriate signals so that the view is redrawn.

pqVTKHistogramModel

  • simply delivers a vtkRectilinearGrid information to the view for drawing histograms.

pqVTKLineChartModel

  • pqVTKLineChartModel::update takes a list of visible displays. Display proxy for histograms have properties which define the arrays to plot on Y axis, and the type of X axis etc. pqVTKLineChartModel creates a new plot (pqVTKLineChartPlot) for every array on the Y axis, and sets appropriate parameters on the pqVTKLineChartPlot using the properties on the displays.