This page describes application's global structure, to help you start with modificating the application.

The diagram below represents entire application structure. Yes, there are a lot of connections, but do not worry. The structure itself is not so complicated and in addition to that you do not even need to go through it all. Just go through the section you need, to do your modifications.

The namespaces of the application are organized into four main categories.
  • Graphic user interface
    • PresentationAid
    • PresentationAid.Tabs
    • PresentationAid.Dialog
    • PresentationAid.Control
    • PresentationAid.GestureEngines.GestureSettings
  • Kinect sensor management
    • PresentationAid.Core
  • Gesture engines (Execution engine)
    • PresentationAid.Lib.GestureEngines
  • Gesture recognition (Gesture controllers)
    • PresentationAid.Lib.Gestures
    • PresentationAid.Lib.GestureControllers
  • Helpers and supporting classes
    • PresentationAid.Lib
    • PresentationAid.Lib.Helpers
    • PresentationAid.Settings

Graphic user interface

First, lets take a look at classes that create the graphic user interface of PresentationAid.
As you can see, the PresentationAid (base) namespace contains the MainWindow and App classes and it represents the application's starting point. Main user interface is stored in MainWindow, including notification icon and helper methods that display notifications and overlay windows. App class is the application's entry point and it creates a single MainWindow instance.

The Tabs namespace contains all the tabs that are displayed on main window, including the user interface for settings. Dialog namespace contains helper dialog windows, such as gesture tutorial and about window, not much of the code is here. Control namespace has additional small controls used throughout the application such as Kinect sensor elevation control and Overlay window.

Kinect Sensor management

This section describes classes used to manage Kinect sensor using the built in wrapper.
The KinectSensorManager wrapper class provides you the singleton access to Kinect sensors. It has subscribable events for changing the sensor status, or when sensor sends data to the application. It also contains the gesture controller, who reads the gestures from Kinect sensor data. You may change this controller to any instance you wish, by default it uses a multiplexing gesture controller (more about this in recognition section. KinectSensorManager also contains a gesture engine, which executes gestures detected in gesture controller. You can also change the gesture engine and put any kind you want in.

Important: If you are using this wrapper in another project, make sure to initialize Kinect sensor, before calling any other instance methods. You can do this by calling InitializeDefaultSensor function or InitializeSensor function, provided you choose KinectSensor object manually.

Mostly, you will not need to modify any other classes in this group, as KinectSensorManager provides all the access you need.

Gesture engines

Gesture engines are the part of application that maps the gestures to certain application commands. Those commands can be either in PresentationAid application or the gesture engine can send the command to another application, in most cases Microsoft PowerPoint.
The GestureEngine class represents the base object for all gesture engines. It also contains PresentationAid gesture commands, which currently only has TakeControl command. Other commands are handled by it's derivatives, respectively.

If you want to create another gesture engine, simply create a new class that derives from GestureEngine and implement the methods required. Each gesture engine must have default configuration.

Gesture engine settings or mapping must be savable to a string, because configuration is automatically saved by setting manager object. You can use Keystroke engine as a basic example, of how gestures are mapped to keys on keyboard.

Gesture recognition

Gesture recognition is handled by gesture controllers. We implemented more gesture controllers, to keep recognition rate high.
Gesture controller is simply implemented by implementing the IGestureController interface, which contains the gesture recognized event and the recognition method, which receives SkeletonFrame object from Kinect sensor.

Important: Kinect sensor sends data many times per second, so if you are detecting a posture, not a gesture it might be wise to derive from DelayGestureController class. It is a simple wrapper class, that does not send more than 1 gesture in the defined delay.

As previously mentioned, by default MultiplexingGestureController class is used. The class can combine more gesture controllers in a single controllers. The purpose of this class is to enhance the recognition rate. If you implement more gesture controllers, each with a different technique, you can use MultiplexingGestureController to combine them into one. The class does not allow for multiple recognitions of the same gesture, so for example if three gesture controllers detect same gesture, only one is forwarded to gesture engine.

To add a new gesture type, you need to add the type to GestureCommand enum, which can be found in PresentationAid.Enums namespace. Then you need to implement a gesture controller that recognizes the gesture and fire the GestureRecognized event with event arguments containing the gesture.


Helper and supporting classes just contain classes for minor tasks, that do not need their own particular category (except the settings is put in another namespace).
The MetroSkeletonDisplayManager class is used on Kinect tab to render the person skeleton over the camera feed. It only renders a canvas on top of the image with few lines and circles, see the class code for details.

The SettingManager is a singleton class, used to get access to user-defined settings. The settings may be changed by the user or by the code. Call LoadSettings or SaveSettings methods to commit the setting update. It uses two approaches to storing settings, one is XML file and other is settings built in project's properties (default).

To add another setting, create a field to hold the setting value and a .NET property wrapper that calls the save settings method on set (just see the SettingManager class code for example). *Do not forget to add the setting to project properties, unless you change the default method for saving to XML file).

CustomLoggerTarget class is another singleton class that handles messages received from NLog instance and displays them in a WPF text box.

Last edited Feb 10, 2013 at 7:54 PM by Legoless, version 11


No comments yet.