Creating An Application
(under the Application Library paradigm)
To create a Vision application open up
XCode after installing the
Vision package. Create a new project and choose
Vision>Application for the template. Many settings that are
are already preconfigured.
To make Vision library functions and Repository headers available to your application you simply need to #import <Vision.h> in everyplace that you need those symbols available. Unless you use 100% custom Construct objects you will need to rely on the repository to some extent. Most development of Vision applications is based around using and adapting objects from the repository (/usr/local/Vision/Repository). Aoren provided server module projects all install into the repository when they are built and standalone Vision applications should grab a copy of all the modules that it requires to run from the repository and put them into their application bundle under the Resources directory when they are built. Something like the line below in a build run phase script will do the job:
Also, if any of the modules that your application is dependent on are those that you might be making modifications to as well, it might be helpful to drag those projects in under the "Dependencies" folder and then add those modules to the "Direct Dependencies" list under the "General" tab of your application target. This helps a lot because it makes sure that if changes have occurred in a dependent project that they are rebuilt and it also ensures that the correct type of module is built and put into the repository (by the above copy) as dictated by you module's build configuration style (Debug or Release).
There is a code file already prepared for you to start coding in called main.mm. It already has the main Vision library calls to get the program up and running inserted. The first thing that you should probably do is add LoadObject() calls to load in every module that your application is dependent on.
But these LoadObject() calls do not have to happen in main.mm. In fact, if possible they should happen in the code files for the objects that need them, in the same style as is done in server modules with the constructor/destructor attributes.
The next thing you might want to do is register your Abstraction needs in main.mm if there are any by adding a call like [VisionPassthrough need]. This makes sure that all subsequent code that has a need to know, is aware that your program is going to use certain specific kinds of input Abstractions. Then after that, and before the call to StartVision() you should create an initial set of Construct objects for your program to present for interaction. They can be instantiated there on the spot from Repository classes or custom classes defined in your project or elsewhere. They can also be loaded from saved Construct tree files in which case the modules that those objects are dependent on will automatically be loaded when the saved file is loaded. The rest of the work is defining what happens in your program by subclassing Construct objects and the like.