Download presentation
Presentation is loading. Please wait.
1
Object Oriented Framework for Filtering
Jonathan Wiersma Jarett Hailes MITACS-PINTS
2
Presentation Overview
Overview of Programming Concepts Procedural Programming Object Oriented Design Current State of PINTS Projects Proposed Improvements Filtering project framework Common Interfaces Shared set of utility classes Refactoring Implementation and Challenges Conclusion & Future Directions
3
Procedural Programming - Overview
integer char Variables float pointer Data Structures combinations of previous Functions multiple inputs (parameters) single output (return value) Different than functions in math: May map same input to different outputs behavior can depend on state of global variables variables are mutable
4
Procedural Programming – Example 1
Global variable (accessible to all functions) int global_var; void main() { int a,b,c; a = 3; b = 4; c = sum(a,b); output(c); } int sum(int x, int y) { return x + y; function variables Variable assignment Function call
5
Object Oriented Design - Basics
Objects Classes Variables/State Methods
6
Object Oriented Design - Classes
Combines a data structure (set of variables) with operations related to that data structure (methods) Describes a class of objects (like a set) An object is an instance of a class and has a state
7
Object Oriented Programming: Code Structure
Procedural Program: Object Oriented Program: Data Structures Global variables Class 1 Data Structure methods Procedures/functions Class 2 Data Structure methods
8
Object Oriented Design - Concepts
Encapsulation Inheritance Polymorphism
9
State of Code at PINTS Each project is a completely separate entity
Interfaces are different between projects Interfaces are not clearly defined (templates) No code reuse – improvements only effect one project Large undertaking to create a new project Not easy to read and understand
10
Improvements being Developed
Create a filtering project framework Shared underlying structure Suite of useful utility classes Abstract output model (M-V-C pattern)
11
Framework for Filtering Projects
Create a set of generic classes and interfaces (via inheritance) Have filters use these generic interfaces so they don’t require customized code Design a framework to ease the development effort of applying a filter to a new application
12
Shared Filtering Interface
SERP Filter DType Signal Observation Observer POD Signal POD 13 Observation POD 13 SERP Observer
13
CVS – Concurrent Versioning System
Allows several users to work on the same files at the same time Stores old versions and changes Also useful for text and latex documents
14
CVS Layout
15
Interfaces Filter SERP Filter DType Signal Observation Observer
POD Signal POD 13 Observation POD 13 SERP Observer
16
Interfaces Signal BoundedSignal DType position void evolve()
AbsDomain domain AbsDomain domain()
17
Interfaces Observation ODType position void observe(Signal, double dt)
18
Interfaces Observer SERP Observer Observation
void observe(Observation, double dt) SERP Observer double weightedOffset(Signal, double dt)
19
CVS Math Package - Algebra
Ideally: Matrix Row Matrix Column Matrix Row Vector Column Vector
20
CVS Math Package - Algebra
Row Vector Scalar values[] int dimension math operators (+,-,*,+=,-=,*=,etc) accessors RowVector norm() void normalize()
21
CVS Math Package - Algebra
Column Vector Scalar values[] int dimension math operators (+,-,*,+=,-=,*=,etc) accessors ColumnVector norm() void normalize()
22
CVS Math Package - Algebra
Row Matrix RowVector values[] int nrows, ncols math operators (+,-,*,+=,-=,*=,etc) accessors RowMatrix inverse() void invert()
23
CVS Math Package - Coordinates
Euclidean Coordinate Polar Coordinate
24
CVS Math Package - Coordinates
CType value math operators (+,-,*,+=,-=,*=,etc) accessors
25
CVS Math Package - Coordinates
Polar Coordinate CType max, min math operators (+,-,*,+=,-=,*=,etc) accessors
26
CVS Math Package - Domain
Abstract Domain Abstract Bounded Domain Vector Box Domain
27
CVS Math Package - Domain
Abstract Domain bool contains(DType) Abstract Bounded Domain DType min, max DType min() DType max()
28
CVS Math Package - Domain
Range Type Abstract Function Domain Type Continuous Function Discrete Function
29
CVS Math Package - Domain
Abstract Function int dimension Range operator()(Domain val) int dimension() Range Type Domain Type
30
CVS Math Package - Domain
Abstract Function Range Type int dimension Domain Type Range operator()(Domain val) int dimension() Continuous Function Range operator()(Domain val) DiscreteFunction discretize() DiscreteFunction fft(VBoxDom<DType>, int)
31
CVS Math Package - Domain
Abstract Function Range Type int dimension Domain Type Range operator()(Domain val) int dimension() Discrete Function VectorBoxDomain<DType> domain MultiDArray<RType> data int numDivisions DType delta[] RType index(int idx[]) DiscreteFunction fft(int type) accessors
32
Graphics - Legacy Packages of raster graphics procedures Outdated
Custom code Not supported Very low level
33
Graphics - povray 3D Ray Tracing program Beautiful output
Slow Rendering Separate Application Requires specific input format
34
Graphics - VTK Object Oriented 3D Visualization Toolkit
Uses standard visualization network Fairly fast Easy to incorporate into real-time display Support for several languages
35
Graphics – Output Classes
Text Output PovRay Output VTK Output POD 13 PovRay Output POD 13 VTK Output
36
Utilities - Simulations
Abstract Simulation Classes Rapid Simulation Development Code reuse Standard Code Layout Signal Simulation Observation Simulation Filter Simulation
37
Utilities - Simulations
Controller Simulation View Model Simulation View Simulation Model POD 13 Filter View 1 Filter Simulation Model Filter Output SERP Filter Signal Observation Text Output VTK Output POD Signal POD 13 Observation
38
Utilities - Structures
Data Structures Hash Table / Hash Bin List Multi Dimensional Array Dictionary We’ve made some container data structures for use in all other directories. Are there to facilitate portability of data across classes (much like Vector and matrix classes in math) Most containers are templatable.
39
Refactoring Splitting large classes into smaller ones
Better encapsulation Fewer variables to remember Fewer methods to remember More abstraction Splitting large methods into smaller ones Less code to read through to understand method Easier to reuse code Moving methods (feature envy) Easier to understand Easier to locate
40
Implementation Signal – evolve() Observation - observe(Signal)
Observer – depends on filter(s) used Output – output()
41
Challenges Multiple Inheritance Return by value Graphics MVC Model
Observer Interfaces Return by value multiple copies inheritance Graphics MVC Model templates
42
Future Directions Single Filtering Application for all Projects
Scripting Language Language Change (java?) Talk on using CVS for latex papers Suggestions
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.