vapor 3.0 architecture overview. purpose of this document provide understandable overview of 3.0...

16
VAPOR 3.0 Architecture Overview

Upload: hannah-gardner

Post on 05-Jan-2016

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: VAPOR 3.0 Architecture Overview. Purpose of this document Provide understandable overview of 3.0 architecture Enable the development team to maintain

VAPOR 3.0 Architecture Overview

Page 2: VAPOR 3.0 Architecture Overview. Purpose of this document Provide understandable overview of 3.0 architecture Enable the development team to maintain

Purpose of this document

• Provide understandable overview of 3.0 architecture

• Enable the development team to maintain the 3.0 code base

• Show how to implement extensions to the 3.0 design

Should be used in conjunction with Doxygen documentation of 3.0 API

Page 3: VAPOR 3.0 Architecture Overview. Purpose of this document Provide understandable overview of 3.0 architecture Enable the development team to maintain

Goals of 3.0 architecture refactoring

• Improved maintainability (with better O-O design, removal of obsolete code, consistent interfaces)

• Extensibility for external developers• Support various UI’s (scripting, Qt, spherical)• Better design understanding for internal

developers.

Page 4: VAPOR 3.0 Architecture Overview. Purpose of this document Provide understandable overview of 3.0 architecture Enable the development team to maintain

Control Executive API

• Centralized location for developer API• Support functionality needed for anticipated

UI’s• Implemented based on methods in Params

and Render libraries.

Page 5: VAPOR 3.0 Architecture Overview. Purpose of this document Provide understandable overview of 3.0 architecture Enable the development team to maintain

Library DependenciesCommon

VDF

Flow

Params

Render

GUI 1 GUI 2 Scripting UI Etc.

Page 6: VAPOR 3.0 Architecture Overview. Purpose of this document Provide understandable overview of 3.0 architecture Enable the development team to maintain

Params library

• Main purpose: provide a database for all the parameters used by the application

• Also supports: Undo/Redo, Parsing and loading of sessions, validation of settings, Python-derived variables

Page 7: VAPOR 3.0 Architecture Overview. Purpose of this document Provide understandable overview of 3.0 architecture Enable the development team to maintain

ParsedXML

ParamsBase

Params

RenderParams

XMLNode

DataStatus

ArrowParams

Thick arrows indicate inheritance

Thin arrows indicate “reference to”

Params class diagram

TransferFunction

ParamNode

Box

Viewpoint

BasicParamsRegion

Animation

Etc.Etc. Etc.

Page 8: VAPOR 3.0 Architecture Overview. Purpose of this document Provide understandable overview of 3.0 architecture Enable the development team to maintain

Params class• Container for parameters used in visualization• Basic unit for undo/redo • E.g. all parameters shown in a GUI tab• Params parameters are represented as XML node• Principal subclasses:– RegionParams, AnimationParams, ViewpointParams– RenderParams (pure virtual)

• Associated with rendering• Supports instancing

– BasicParams (pure virtual)• Single instance (contains general state of app)• Not associated with GUI tab

Page 9: VAPOR 3.0 Architecture Overview. Purpose of this document Provide understandable overview of 3.0 architecture Enable the development team to maintain

ParamsBase• Parent of Params class• Support (parsing, saving) for an object instance being

associated with an XML node.– The XML node (rootNode) is a ParamNode instance

• Session load and save are performed by using parse/save functionality of ParamsBase.

• Child classes are Params plus various classes that can be embedded in Params classes, (e.g. Box, TransferFunction, Viewpoint), so that these classes also have their state defined by an XML tree.

Page 10: VAPOR 3.0 Architecture Overview. Purpose of this document Provide understandable overview of 3.0 architecture Enable the development team to maintain

ParamNode

• An XML node used for containing parameters in ParamsBase instances.

• Each ParamsBase instance has an associated ParamNode, obtained by GetRootNode(), which contains all the data values of the ParamsBase instance.

• Support for various SetValue(), GetValue() methods, accessing vectors of long, double, or strings.

Page 11: VAPOR 3.0 Architecture Overview. Purpose of this document Provide understandable overview of 3.0 architecture Enable the development team to maintain

Params subclasses• RegionParams, ViewpointParams,

AnimationParams, VizFeatureParams– Support sharing (can be local or global depending on

whether state applies to one or all visualizers)• RenderParams– Has associated renderer, draws in a visualizer– Applies in just one visualizer– Supports multiple instances in each visualizer

• BasicParams– One unique instance for global state; e.g.

MouseModeParams, VizWinParams, InstanceParams

Page 12: VAPOR 3.0 Architecture Overview. Purpose of this document Provide understandable overview of 3.0 architecture Enable the development team to maintain

Other classes in Params lib

• Command: support for undo/redo queue• DataStatus: Maintains information about

currently loaded data

Page 13: VAPOR 3.0 Architecture Overview. Purpose of this document Provide understandable overview of 3.0 architecture Enable the development team to maintain

Undo/Redo

• Command class maintains a circular queue of recent Params changes

• Each Command is a (before,after) pair of ParamNode’s, associated with the state change of a Params instance.

• Whenever a SetValue occurs in a Params instance, an associated Command is inserted in the Command queue

• When user requests Undo or Redo, the appropriate ParamNode is installed as the rootNode of the proper Params instance.

Page 14: VAPOR 3.0 Architecture Overview. Purpose of this document Provide understandable overview of 3.0 architecture Enable the development team to maintain

Static Params Access

• At run time, all Params instances currently in use are maintained in static Params tables associated with the Params class.

• Any Params instance can be obtained from its XML tag, visualizer (int), and instance (int) using Params::GetParamsInstance()

• Params tables are populated on startup, on session load, and during creation of visualizer or renderer instance.

Page 15: VAPOR 3.0 Architecture Overview. Purpose of this document Provide understandable overview of 3.0 architecture Enable the development team to maintain

Implementing a Params class

• Define a tag (name) of the Params class• Specify XML tree structure consisting of:

– Vectors of string, long, double, with tags– ParamsBase instances for embedded classes (e.g. transfer functions)

• Implement GetValue, SetValue methods using methods on Params (SetValue automatically validates, and handles undo/redo)

• Implement all pure virtual Params (or RenderParams) methods• Provide Params registration method (RegisterParamsBaseClass)

in ControlExec::createAllDefaultParams().

Page 16: VAPOR 3.0 Architecture Overview. Purpose of this document Provide understandable overview of 3.0 architecture Enable the development team to maintain

Important virtual Params methods

In addition to providing SetValue, GetValue methods, the following must be implemented:• Params::Validate() – Ensure that all the values in the

object are consistent with currently loaded data; optionally set all values to default values for current data.

• Params::restart() – Initialize object, defining the XML tree associated with root node.

Other required methods are fairly trivial to implement. See ArrowParams implementation.