Download presentation
Presentation is loading. Please wait.
Published byHannah Gardner Modified over 9 years ago
1
VAPOR 3.0 Architecture Overview
2
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
3
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.
4
Control Executive API Centralized location for developer API Support functionality needed for anticipated UI’s Implemented based on methods in Params and Render libraries.
5
Library Dependencies CommonVDFFlowParamsRenderGUI 1GUI 2 Scripting UI Etc.
6
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
7
ParsedXML ParamsBase Params RenderParams XMLNode DataStatus ArrowParams Thick arrows indicate inheritance Thin arrows indicate “reference to” Params class diagram TransferFunction ParamNode Box Viewpoint BasicParams Region Animation Etc.
8
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
9
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.
10
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.
11
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
12
Other classes in Params lib Command: support for undo/redo queue DataStatus: Maintains information about currently loaded data
13
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.
14
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.
15
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().
16
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.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.