All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Trackers and Applications

Cornerstone has two fundamental main concepts: tracker and application.

Tracker

Tracker is the piece of software that produces touch-input from the hardware. The term tracker can refer to the actual tracker software running inside MultiTaction devices, a separate tracking process running on the same PC as an application, or a separate tracker PC handling tracking from one or more older MultiTouch Cells. The tracker may also be embedded in a Cornerstone application where it runs in a separate thread.

The user never needs to instantiate or setup trackers directly. The creation and setup of trackers is handled by the application class automatically.

Input Samples

Tracker works with input samples, or samples. Input sample is a snapshot of the state of the touch-screen at specific point in time. The sample contains what fingers, markers, etc. are detected on the screen at that point. The tracker will run at certain frequency, usually 100Hz - 200Hz, and generates input samples at the same rate. The tracker buffers these samples so they can be queried by applications running at different speeds, typically around 60 Hz.

Tracked Objects

All objects that the Cornerstone tracker can recognize are referred to as tracked objects represented by the class MultiTouch::TrackedObject. They can be fingers, hands, pens, markers, etc.

Application

All Cornerstone applications have an instance of the MultiWidgets::Application class. The application class connects to a tracker usually through a socket (either local or over network) where it receives the touch-input from.

The application class provides common services for writing applications, like:

  • Handle touch-input
  • Manage OpenGL windows and resources
  • Provide background resource streaming

The basic main-loop for a Cornerstone application in pseudo-code is as follows:

getNewSamples();
for each(sample) {
input(sample);
update();
render();
}

What the application does is, in every frame, it first gets the list of buffered samples that have not yet been processed from a tracker. It then iterates over all these samples and provides the input information to any widgets added to the application as needed.

After the input has been processed, the application updates all the widgets so they can perform any tasks that need regular execution, like handle physics, update state-machines, etc.

After all the widgets have been updated, the application renders them on screen.

Creating an application

To create and setup an application can be done with only few lines of C++ code:

#include <MultiWidgets/Application.hpp>
int main(int argc, char ** argv)
{
if(!app.init(argc, argv))
return 1;
return app.run();
}

What this code does is create an instance of MultiWidgets::Application class, initialize it, and execute its main-loop. If you execute the following code, it doesn't really do much except open up an empty application. To actually make the application do something interesting, we need to add some widgets to it.

Command-line Arguments

The MultiWidgets::Application class accepts a number of command-line arguments by default. They are described here.