Some refactoring: projector calibration now has its own class. Makes testApp file shorter, easier to work with, and opens the door to working with multiple projectors in one application.Then the reference to 'proj' in testApp.cpp will change to 'currentProj' for all actions related to calibration. We will have a list of projectors, and a configuration which specifies in which viewport they should render. Also moved control-panel code to mainControlPanel.h: testApp.cpp becomes easier to work with. In the future we will probably have multiple control panels on the main GUI screen (as opposed to the projector screens), one for each active effect, and it's good to have a structure that makes this easy.
The ability to select, render and calibrate a project in a user-defined viewport seems to be working. Not tested with actual projector yet. Left some 'green code' in there for reference, will be cleaned up a bit in the next commit. There we will also define actual multiple projectorViews and see how that goes.
Selection mode works in all views it seems. To test: can we control all EasyCams in each view? Render mode is not functioning properly yet. The labeled points don't seem to listen to the viewport settings, and the calibration results gets a strangely large FOV.
Can now manipulate the EasyCam in each viewport individually. Improvement in calibration code: don't use viewport[2] and viewport[3] in update calibration (these still have the screen size at this point), but viewport.width and .height from the viewport defined in ProjectorView.
It seems the hardest nuts to get multi-projector mapamok running have been cracked. Now we can select, calibrate and render in multiple viewports.
Some code is probably redundant now. It turns out that a function in ofxCv called ofViewport -> this caused the 3D model to not appear in Render mode, and may have caused other problems, so this needs to be checked. For now, I'm just pushing this to the server for safe keeping. Many performance optimizations can (and should.. setup mode is really slow now.. in fact everything is slow with four viewports) still be made. Not to mention GUI addons/improvements. For example the ability to select the 3D points on the main screen, and only select the 2D points on the projectors.
Added ofxThreadedVideo as a replacement for ofVideoPlayer. Removed some old code.  Moved reload-check for the shader to the main draw() function, so that it doesn't happen four times per frame but just once. Renamed 'fingenMovie' to 'mappingMovie'. Changed slowLerpSpeed in mainControlPanel.h
Added radio button list in interface for projector selection. Use this selection for the current calibration.
Changed setup / show mode from a toggle to a Radio button for clarity. Made the selection of a picture vs a video vs one of the other rendering modes explicit in the control panel, so that we can always select the picture interactively (e.g. for calibration purposes, to prevent the calibration from being inside-out)
Major restructuring: projectorView and modelView are now owner of the functionality they should have, and which was originally performed by 'testApp'. They do their own drawing and updating. Access to specific variables has been made more explicit, for example by passing a referencee to the main control panel as a parameter to the draw() function. This structure makes it much easier to extend and understand the system, for example for the desired situation to have a main (laptop) screen that contains all the GUI, and separate 'screens' for the projectors. These are then viewports inside a large window that is stretched over a large virtual desktop.
Removed log statement, can now pause and resume a video.
Disabled vsync: huge performance improvement! Changed ofSetDrawBitmapMode(OF_BITMAPMODE_MODEL_VIEWPORT); to ofSetDrawBitmapMode(OF_BITMAPMODE_MODEL); in testApp.cpp -> now labels of points also appear correctly in other viewports (text used to be missing). Some old code is here that was made while searching for the performance problem when a video was playing (vsync..), will be removed in next commit.
Changed operation of loading/saving of calibration files. A folder with the name of the configuration serves as the starting point. Each projector has its own subfolder (with the name of the projector) to save its data into. Loading does not open a dialog anymore, location to load from is known from the specified configuration. Optimized render-mode in setup-mode: only compute the calibration of the view that is being calibrated (if we continuously do this for all views, framerate drops to 1 fps if the calibration is not very precise). Also: also only draw the view to calibrate in this mode, not the other ones: we don't want to other projectors shining light onto the shape while we are doing this.
Added ability to load a projector configuration by specifying its name on the command line
Added class showDefinition to define contents of a show. This is read from show.xml in the project folder. The GUI panel shows its contents. TODO: properly load the various movies and pictures, handle the toggles in the UI (only one can be selected, unchecking a movie means pausing it, etc), and pass the selected texture to the viewport (and from there to the render function)
Moved shader files to shaders folder (check if these are correctly moved, with history). Added config files to git.
Moved the 3D files to the models folder. small fix: when saving basic calibration data this was done in the root data dir, not the folder for the projector's calibration data
Fixed bug: not all points were read from the imagePoints / objectPoints lists when loading a calibration, which caused referencepoints to be lost. Now added code to remove the window border and position at 0,0. Added code to read the specified window-width and -height from the projectorConfiguration.xml, and use this when creating the window.
Added test of video with audio. Added GUI to select pictures and movies using radiobuttons. These pictures and movies are loaded based on the contents of the show.xml, which fills showDefinition. The showDefinition class is responsible for updating the current texture, based on both the GUI and the current time (will request new frames from a video, if it is playing) Also, now we use the width and height settings of the window from projectorConfiguration when the window is created. We can consider this the first beta (feature complete) version.
A few fixes for bugs (and include-file issues) found after building for Release
Background of projection changed to black for best contrast. Don't render viewport edge in Show mode.