From 930339bb1a5090e57cfe0598d1562c383ce3038c Mon Sep 17 00:00:00 2001 From: ofTheo Date: Wed, 31 Mar 2010 14:42:39 -0400 Subject: [PATCH] first commit for ofxControlPanel - events hooked up still needs cleanup --- .gitignore | 6 + ofxControlPanelDemo.xcodeproj/project.pbxproj | 1262 +++++++++++++++++ openFrameworks-Info.plist | 20 + src/main.cpp | 16 + src/ofAddons.h | 47 + src/ofxControlPanel/guiBaseObject.h | 362 +++++ src/ofxControlPanel/guiCallback.cpp | 11 + src/ofxControlPanel/guiCallback.h | 20 + src/ofxControlPanel/guiCallbackValue.cpp | 11 + src/ofxControlPanel/guiCallbackValue.h | 71 + src/ofxControlPanel/guiColor.cpp | 71 + src/ofxControlPanel/guiColor.h | 36 + src/ofxControlPanel/guiCustomImpl.h | 30 + src/ofxControlPanel/guiIncludes.h | 25 + src/ofxControlPanel/guiTextBase.cpp | 112 ++ src/ofxControlPanel/guiTextBase.h | 36 + src/ofxControlPanel/guiType2DSlider.cpp | 90 ++ src/ofxControlPanel/guiType2DSlider.h | 28 + src/ofxControlPanel/guiTypeButtonSlider.cpp | 261 ++++ src/ofxControlPanel/guiTypeButtonSlider.h | 64 + src/ofxControlPanel/guiTypeCustom.cpp | 94 ++ src/ofxControlPanel/guiTypeCustom.h | 25 + src/ofxControlPanel/guiTypeDrawable.cpp | 87 ++ src/ofxControlPanel/guiTypeDrawable.h | 46 + src/ofxControlPanel/guiTypeFileLister.cpp | 153 ++ src/ofxControlPanel/guiTypeFileLister.h | 32 + src/ofxControlPanel/guiTypeLogger.cpp | 79 ++ src/ofxControlPanel/guiTypeLogger.h | 21 + src/ofxControlPanel/guiTypeMultiToggle.cpp | 88 ++ src/ofxControlPanel/guiTypeMultiToggle.h | 23 + src/ofxControlPanel/guiTypePanel.cpp | 233 +++ src/ofxControlPanel/guiTypePanel.h | 45 + src/ofxControlPanel/guiTypeSlider.cpp | 50 + src/ofxControlPanel/guiTypeSlider.h | 20 + src/ofxControlPanel/guiTypeText.cpp | 0 src/ofxControlPanel/guiTypeText.h | 15 + src/ofxControlPanel/guiTypeTextDropDown.cpp | 152 ++ src/ofxControlPanel/guiTypeTextDropDown.h | 25 + src/ofxControlPanel/guiTypeToggle.cpp | 56 + src/ofxControlPanel/guiTypeToggle.h | 20 + src/ofxControlPanel/guiTypeVideo.cpp | 102 ++ src/ofxControlPanel/guiTypeVideo.h | 30 + src/ofxControlPanel/guiValue.cpp | 145 ++ src/ofxControlPanel/guiValue.h | 61 + src/ofxControlPanel/ofxControlPanel.cpp | 863 +++++++++++ src/ofxControlPanel/ofxControlPanel.h | 212 +++ src/ofxControlPanel/simpleColor.cpp | 40 + src/ofxControlPanel/simpleColor.h | 38 + src/ofxControlPanel/simpleFileLister.cpp | 98 ++ src/ofxControlPanel/simpleFileLister.h | 39 + src/ofxControlPanel/simpleLogger.cpp | 142 ++ src/ofxControlPanel/simpleLogger.h | 57 + src/testApp.cpp | 136 ++ src/testApp.h | 53 + src/vectorField/vectorField.cpp | 0 src/vectorField/vectorField.h | 238 ++++ src/vision/computerVision.h | 395 ++++++ 57 files changed, 6492 insertions(+) create mode 100644 .gitignore create mode 100644 ofxControlPanelDemo.xcodeproj/project.pbxproj create mode 100644 openFrameworks-Info.plist create mode 100755 src/main.cpp create mode 100644 src/ofAddons.h create mode 100755 src/ofxControlPanel/guiBaseObject.h create mode 100644 src/ofxControlPanel/guiCallback.cpp create mode 100644 src/ofxControlPanel/guiCallback.h create mode 100644 src/ofxControlPanel/guiCallbackValue.cpp create mode 100644 src/ofxControlPanel/guiCallbackValue.h create mode 100755 src/ofxControlPanel/guiColor.cpp create mode 100755 src/ofxControlPanel/guiColor.h create mode 100755 src/ofxControlPanel/guiCustomImpl.h create mode 100755 src/ofxControlPanel/guiIncludes.h create mode 100755 src/ofxControlPanel/guiTextBase.cpp create mode 100755 src/ofxControlPanel/guiTextBase.h create mode 100755 src/ofxControlPanel/guiType2DSlider.cpp create mode 100755 src/ofxControlPanel/guiType2DSlider.h create mode 100755 src/ofxControlPanel/guiTypeButtonSlider.cpp create mode 100755 src/ofxControlPanel/guiTypeButtonSlider.h create mode 100755 src/ofxControlPanel/guiTypeCustom.cpp create mode 100755 src/ofxControlPanel/guiTypeCustom.h create mode 100755 src/ofxControlPanel/guiTypeDrawable.cpp create mode 100755 src/ofxControlPanel/guiTypeDrawable.h create mode 100755 src/ofxControlPanel/guiTypeFileLister.cpp create mode 100755 src/ofxControlPanel/guiTypeFileLister.h create mode 100755 src/ofxControlPanel/guiTypeLogger.cpp create mode 100755 src/ofxControlPanel/guiTypeLogger.h create mode 100755 src/ofxControlPanel/guiTypeMultiToggle.cpp create mode 100755 src/ofxControlPanel/guiTypeMultiToggle.h create mode 100755 src/ofxControlPanel/guiTypePanel.cpp create mode 100755 src/ofxControlPanel/guiTypePanel.h create mode 100755 src/ofxControlPanel/guiTypeSlider.cpp create mode 100755 src/ofxControlPanel/guiTypeSlider.h create mode 100755 src/ofxControlPanel/guiTypeText.cpp create mode 100755 src/ofxControlPanel/guiTypeText.h create mode 100755 src/ofxControlPanel/guiTypeTextDropDown.cpp create mode 100755 src/ofxControlPanel/guiTypeTextDropDown.h create mode 100755 src/ofxControlPanel/guiTypeToggle.cpp create mode 100755 src/ofxControlPanel/guiTypeToggle.h create mode 100644 src/ofxControlPanel/guiTypeVideo.cpp create mode 100644 src/ofxControlPanel/guiTypeVideo.h create mode 100755 src/ofxControlPanel/guiValue.cpp create mode 100755 src/ofxControlPanel/guiValue.h create mode 100755 src/ofxControlPanel/ofxControlPanel.cpp create mode 100755 src/ofxControlPanel/ofxControlPanel.h create mode 100755 src/ofxControlPanel/simpleColor.cpp create mode 100755 src/ofxControlPanel/simpleColor.h create mode 100755 src/ofxControlPanel/simpleFileLister.cpp create mode 100755 src/ofxControlPanel/simpleFileLister.h create mode 100755 src/ofxControlPanel/simpleLogger.cpp create mode 100755 src/ofxControlPanel/simpleLogger.h create mode 100755 src/testApp.cpp create mode 100755 src/testApp.h create mode 100755 src/vectorField/vectorField.cpp create mode 100755 src/vectorField/vectorField.h create mode 100755 src/vision/computerVision.h diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e55c83b --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +*.mode1v3 +*.pbxuser +build/ +obj/ +*.o +*.app/ diff --git a/ofxControlPanelDemo.xcodeproj/project.pbxproj b/ofxControlPanelDemo.xcodeproj/project.pbxproj new file mode 100644 index 0000000..fb67be9 --- /dev/null +++ b/ofxControlPanelDemo.xcodeproj/project.pbxproj @@ -0,0 +1,1262 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 42; + objects = { + +/* Begin PBXBuildFile section */ + A1A2F13C111F5772000703E4 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1A2F133111F5772000703E4 /* main.cpp */; }; + A1A2F13D111F5772000703E4 /* testApp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1A2F135111F5772000703E4 /* testApp.cpp */; }; + A1A2F13E111F5772000703E4 /* vectorField.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1A2F138111F5772000703E4 /* vectorField.cpp */; }; + A1A2F1EF111F57F9000703E4 /* ofxDirList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1A2F154111F57F9000703E4 /* ofxDirList.cpp */; }; + A1A2F1F8111F57F9000703E4 /* openCV.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A1A2F189111F57F9000703E4 /* openCV.a */; }; + A1A2F1FB111F57F9000703E4 /* ofxCvColorImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1A2F18C111F57F9000703E4 /* ofxCvColorImage.cpp */; }; + A1A2F1FC111F57F9000703E4 /* ofxCvContourFinder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1A2F18F111F57F9000703E4 /* ofxCvContourFinder.cpp */; }; + A1A2F1FD111F57F9000703E4 /* ofxCvFloatImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1A2F191111F57F9000703E4 /* ofxCvFloatImage.cpp */; }; + A1A2F1FE111F57F9000703E4 /* ofxCvGrayscaleImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1A2F193111F57F9000703E4 /* ofxCvGrayscaleImage.cpp */; }; + A1A2F1FF111F57F9000703E4 /* ofxCvImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1A2F195111F57F9000703E4 /* ofxCvImage.cpp */; }; + A1A2F200111F57F9000703E4 /* ofxCvShortImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1A2F198111F57F9000703E4 /* ofxCvShortImage.cpp */; }; + A1A2F20A111F57F9000703E4 /* ofxMatrix3x3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1A2F1D5111F57F9000703E4 /* ofxMatrix3x3.cpp */; }; + A1A2F20B111F57F9000703E4 /* ofxMatrix4x4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1A2F1D7111F57F9000703E4 /* ofxMatrix4x4.cpp */; }; + A1A2F20C111F57F9000703E4 /* ofxQuaternion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1A2F1DC111F57F9000703E4 /* ofxQuaternion.cpp */; }; + A1A2F20D111F57F9000703E4 /* tinyxml.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1A2F1E5111F57F9000703E4 /* tinyxml.cpp */; }; + A1A2F20E111F57F9000703E4 /* tinyxmlerror.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1A2F1E7111F57F9000703E4 /* tinyxmlerror.cpp */; }; + A1A2F20F111F57F9000703E4 /* tinyxmlparser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1A2F1E8111F57F9000703E4 /* tinyxmlparser.cpp */; }; + A1A2F210111F57F9000703E4 /* ofxXmlSettings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1A2F1EA111F57F9000703E4 /* ofxXmlSettings.cpp */; }; + E45BE0AA0E8CC67C009D7055 /* GLee.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE0A90E8CC67C009D7055 /* GLee.a */; }; + E45BE2E40E8CC69C009D7055 /* rtAudio.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE2E30E8CC69C009D7055 /* rtAudio.a */; }; + E45BE97B0E8CC7DD009D7055 /* AGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9710E8CC7DD009D7055 /* AGL.framework */; }; + E45BE97C0E8CC7DD009D7055 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9720E8CC7DD009D7055 /* ApplicationServices.framework */; }; + E45BE97D0E8CC7DD009D7055 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9730E8CC7DD009D7055 /* AudioToolbox.framework */; }; + E45BE97E0E8CC7DD009D7055 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9740E8CC7DD009D7055 /* Carbon.framework */; }; + E45BE97F0E8CC7DD009D7055 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9750E8CC7DD009D7055 /* CoreAudio.framework */; }; + E45BE9800E8CC7DD009D7055 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9760E8CC7DD009D7055 /* CoreFoundation.framework */; }; + E45BE9810E8CC7DD009D7055 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9770E8CC7DD009D7055 /* CoreServices.framework */; }; + E45BE9830E8CC7DD009D7055 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9790E8CC7DD009D7055 /* OpenGL.framework */; }; + E45BE9840E8CC7DD009D7055 /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE97A0E8CC7DD009D7055 /* QuickTime.framework */; }; + E48D9D011159443200A7B771 /* guiColor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E48D9CD41159443200A7B771 /* guiColor.cpp */; }; + E48D9D041159443200A7B771 /* guiTextBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E48D9CDA1159443200A7B771 /* guiTextBase.cpp */; }; + E48D9D051159443200A7B771 /* guiType2DSlider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E48D9CDC1159443200A7B771 /* guiType2DSlider.cpp */; }; + E48D9D061159443200A7B771 /* guiTypeButtonSlider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E48D9CDE1159443200A7B771 /* guiTypeButtonSlider.cpp */; }; + E48D9D071159443200A7B771 /* guiTypeCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E48D9CE01159443200A7B771 /* guiTypeCustom.cpp */; }; + E48D9D081159443200A7B771 /* guiTypeDrawable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E48D9CE21159443200A7B771 /* guiTypeDrawable.cpp */; }; + E48D9D091159443200A7B771 /* guiTypeFileLister.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E48D9CE41159443200A7B771 /* guiTypeFileLister.cpp */; }; + E48D9D0A1159443200A7B771 /* guiTypeLogger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E48D9CE61159443200A7B771 /* guiTypeLogger.cpp */; }; + E48D9D0B1159443200A7B771 /* guiTypeMultiToggle.h in Sources */ = {isa = PBXBuildFile; fileRef = E48D9CE81159443200A7B771 /* guiTypeMultiToggle.h */; }; + E48D9D0C1159443200A7B771 /* guiTypePanel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E48D9CEA1159443200A7B771 /* guiTypePanel.cpp */; }; + E48D9D0D1159443200A7B771 /* guiTypeSlider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E48D9CEC1159443200A7B771 /* guiTypeSlider.cpp */; }; + E48D9D0E1159443200A7B771 /* guiTypeText.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E48D9CEE1159443200A7B771 /* guiTypeText.cpp */; }; + E48D9D0F1159443200A7B771 /* guiTypeTextDropDown.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E48D9CF01159443200A7B771 /* guiTypeTextDropDown.cpp */; }; + E48D9D101159443200A7B771 /* guiTypeToggle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E48D9CF21159443200A7B771 /* guiTypeToggle.cpp */; }; + E48D9D111159443200A7B771 /* guiValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E48D9CF41159443200A7B771 /* guiValue.cpp */; }; + E48D9D131159443200A7B771 /* ofxControlPanel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E48D9CF81159443200A7B771 /* ofxControlPanel.cpp */; }; + E48D9D141159443200A7B771 /* simpleColor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E48D9CFA1159443200A7B771 /* simpleColor.cpp */; }; + E48D9D151159443200A7B771 /* simpleFileLister.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E48D9CFC1159443200A7B771 /* simpleFileLister.cpp */; }; + E48D9D161159443200A7B771 /* simpleLogger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E48D9CFE1159443200A7B771 /* simpleLogger.cpp */; }; + E48D9D191159484E00A7B771 /* guiTypeVideo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E48D9D181159484E00A7B771 /* guiTypeVideo.cpp */; }; + E4A056F11163AE860087BEF7 /* guiCallbackValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4A056F01163AE860087BEF7 /* guiCallbackValue.cpp */; }; + E4A056F41163B2000087BEF7 /* guiCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4A056F31163B2000087BEF7 /* guiCallback.cpp */; }; + E4C2422B10CC554B004149E2 /* openFrameworks.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E4C2421E10CC549C004149E2 /* openFrameworks.a */; }; + E4C2424710CC5A17004149E2 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4C2424410CC5A17004149E2 /* AppKit.framework */; }; + E4C2424810CC5A17004149E2 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4C2424510CC5A17004149E2 /* Cocoa.framework */; }; + E4C2424910CC5A17004149E2 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4C2424610CC5A17004149E2 /* IOKit.framework */; }; + E4C2426610CC5A78004149E2 /* GLUT.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4C2425F10CC5A78004149E2 /* GLUT.framework */; }; + E4C2426B10CC5AA6004149E2 /* GLUT.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = E4C2425F10CC5A78004149E2 /* GLUT.framework */; }; + E4C2427F10CC5B66004149E2 /* CppUnit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E4C2427A10CC5B66004149E2 /* CppUnit.a */; }; + E4C2428010CC5B66004149E2 /* PocoFoundation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E4C2427B10CC5B66004149E2 /* PocoFoundation.a */; }; + E4C2428110CC5B66004149E2 /* PocoNet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E4C2427C10CC5B66004149E2 /* PocoNet.a */; }; + E4C2428210CC5B66004149E2 /* PocoUtil.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E4C2427D10CC5B66004149E2 /* PocoUtil.a */; }; + E4C2428310CC5B66004149E2 /* PocoXML.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E4C2427E10CC5B66004149E2 /* PocoXML.a */; }; + E4C2429410CC5C38004149E2 /* freetype.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E4C2429310CC5C38004149E2 /* freetype.a */; }; + E4C242CD10CC650E004149E2 /* libfmodex.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = E4C242CC10CC650E004149E2 /* libfmodex.dylib */; }; + E4C2443910CC7693004149E2 /* openFrameworks-Info.plist in CopyFiles */ = {isa = PBXBuildFile; fileRef = E4B6FCAD0C3E899E008CF71C /* openFrameworks-Info.plist */; }; + E4C246DA10CCAE22004149E2 /* freeimage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E4C246D910CCAE22004149E2 /* freeimage.a */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + E4C2421D10CC549C004149E2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = E4C2421610CC549C004149E2 /* openFrameworksLib.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = E4B27C1510CBEB8E00536013; + remoteInfo = openFrameworks; + }; + E4C2422710CC54DA004149E2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = E4C2421610CC549C004149E2 /* openFrameworksLib.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = E4B27C1410CBEB8E00536013; + remoteInfo = openFrameworks; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + E4C2427710CC5ABF004149E2 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + E4C2426B10CC5AA6004149E2 /* GLUT.framework in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + E4C2444710CC769B004149E2 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 7; + files = ( + E4C2443910CC7693004149E2 /* openFrameworks-Info.plist in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + A1A2F133111F5772000703E4 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; + A1A2F134111F5772000703E4 /* ofAddons.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofAddons.h; sourceTree = ""; }; + A1A2F135111F5772000703E4 /* testApp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = testApp.cpp; sourceTree = ""; }; + A1A2F136111F5772000703E4 /* testApp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = testApp.h; sourceTree = ""; }; + A1A2F138111F5772000703E4 /* vectorField.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = vectorField.cpp; path = vectorField/vectorField.cpp; sourceTree = ""; }; + A1A2F139111F5772000703E4 /* vectorField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = vectorField.h; path = vectorField/vectorField.h; sourceTree = ""; }; + A1A2F13B111F5772000703E4 /* computerVision.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = computerVision.h; path = vision/computerVision.h; sourceTree = ""; }; + A1A2F151111F57F9000703E4 /* Instructions.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Instructions.txt; sourceTree = ""; }; + A1A2F152111F57F9000703E4 /* install.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = install.xml; sourceTree = ""; }; + A1A2F154111F57F9000703E4 /* ofxDirList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ofxDirList.cpp; sourceTree = ""; }; + A1A2F155111F57F9000703E4 /* ofxDirList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxDirList.h; sourceTree = ""; }; + A1A2F173111F57F9000703E4 /* install.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = install.xml; sourceTree = ""; }; + A1A2F177111F57F9000703E4 /* cv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cv.h; sourceTree = ""; }; + A1A2F178111F57F9000703E4 /* cv.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = cv.hpp; sourceTree = ""; }; + A1A2F179111F57F9000703E4 /* cvaux.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cvaux.h; sourceTree = ""; }; + A1A2F17A111F57F9000703E4 /* cvaux.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = cvaux.hpp; sourceTree = ""; }; + A1A2F17B111F57F9000703E4 /* cvcompat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cvcompat.h; sourceTree = ""; }; + A1A2F17C111F57F9000703E4 /* cvmat.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = cvmat.hpp; sourceTree = ""; }; + A1A2F17D111F57F9000703E4 /* cvstreams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cvstreams.h; sourceTree = ""; }; + A1A2F17E111F57F9000703E4 /* cvtypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cvtypes.h; sourceTree = ""; }; + A1A2F17F111F57F9000703E4 /* cvver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cvver.h; sourceTree = ""; }; + A1A2F180111F57F9000703E4 /* cvvidsurv.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = cvvidsurv.hpp; sourceTree = ""; }; + A1A2F181111F57F9000703E4 /* cvwimage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cvwimage.h; sourceTree = ""; }; + A1A2F182111F57F9000703E4 /* cxcore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cxcore.h; sourceTree = ""; }; + A1A2F183111F57F9000703E4 /* cxcore.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = cxcore.hpp; sourceTree = ""; }; + A1A2F184111F57F9000703E4 /* cxerror.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cxerror.h; sourceTree = ""; }; + A1A2F185111F57F9000703E4 /* cxmisc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cxmisc.h; sourceTree = ""; }; + A1A2F186111F57F9000703E4 /* cxtypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cxtypes.h; sourceTree = ""; }; + A1A2F189111F57F9000703E4 /* openCV.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = openCV.a; sourceTree = ""; }; + A1A2F18B111F57F9000703E4 /* ofxCvBlob.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxCvBlob.h; sourceTree = ""; }; + A1A2F18C111F57F9000703E4 /* ofxCvColorImage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ofxCvColorImage.cpp; sourceTree = ""; }; + A1A2F18D111F57F9000703E4 /* ofxCvColorImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxCvColorImage.h; sourceTree = ""; }; + A1A2F18E111F57F9000703E4 /* ofxCvConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxCvConstants.h; sourceTree = ""; }; + A1A2F18F111F57F9000703E4 /* ofxCvContourFinder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ofxCvContourFinder.cpp; sourceTree = ""; }; + A1A2F190111F57F9000703E4 /* ofxCvContourFinder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxCvContourFinder.h; sourceTree = ""; }; + A1A2F191111F57F9000703E4 /* ofxCvFloatImage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ofxCvFloatImage.cpp; sourceTree = ""; }; + A1A2F192111F57F9000703E4 /* ofxCvFloatImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxCvFloatImage.h; sourceTree = ""; }; + A1A2F193111F57F9000703E4 /* ofxCvGrayscaleImage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ofxCvGrayscaleImage.cpp; sourceTree = ""; }; + A1A2F194111F57F9000703E4 /* ofxCvGrayscaleImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxCvGrayscaleImage.h; sourceTree = ""; }; + A1A2F195111F57F9000703E4 /* ofxCvImage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ofxCvImage.cpp; sourceTree = ""; }; + A1A2F196111F57F9000703E4 /* ofxCvImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxCvImage.h; sourceTree = ""; }; + A1A2F197111F57F9000703E4 /* ofxCvMain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxCvMain.h; sourceTree = ""; }; + A1A2F198111F57F9000703E4 /* ofxCvShortImage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ofxCvShortImage.cpp; sourceTree = ""; }; + A1A2F199111F57F9000703E4 /* ofxCvShortImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxCvShortImage.h; sourceTree = ""; }; + A1A2F19A111F57F9000703E4 /* ofxOpenCv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxOpenCv.h; sourceTree = ""; }; + A1A2F1D3111F57F9000703E4 /* install.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = install.xml; sourceTree = ""; }; + A1A2F1D5111F57F9000703E4 /* ofxMatrix3x3.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ofxMatrix3x3.cpp; sourceTree = ""; }; + A1A2F1D6111F57F9000703E4 /* ofxMatrix3x3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxMatrix3x3.h; sourceTree = ""; }; + A1A2F1D7111F57F9000703E4 /* ofxMatrix4x4.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ofxMatrix4x4.cpp; sourceTree = ""; }; + A1A2F1D8111F57F9000703E4 /* ofxMatrix4x4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxMatrix4x4.h; sourceTree = ""; }; + A1A2F1D9111F57F9000703E4 /* ofxPoint2f.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxPoint2f.h; sourceTree = ""; }; + A1A2F1DA111F57F9000703E4 /* ofxPoint3f.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxPoint3f.h; sourceTree = ""; }; + A1A2F1DB111F57F9000703E4 /* ofxPoint4f.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxPoint4f.h; sourceTree = ""; }; + A1A2F1DC111F57F9000703E4 /* ofxQuaternion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ofxQuaternion.cpp; sourceTree = ""; }; + A1A2F1DD111F57F9000703E4 /* ofxQuaternion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxQuaternion.h; sourceTree = ""; }; + A1A2F1DE111F57F9000703E4 /* ofxVec2f.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxVec2f.h; sourceTree = ""; }; + A1A2F1DF111F57F9000703E4 /* ofxVec3f.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxVec3f.h; sourceTree = ""; }; + A1A2F1E0111F57F9000703E4 /* ofxVec4f.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxVec4f.h; sourceTree = ""; }; + A1A2F1E1111F57F9000703E4 /* ofxVectorMath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxVectorMath.h; sourceTree = ""; }; + A1A2F1E3111F57F9000703E4 /* install.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = install.xml; sourceTree = ""; }; + A1A2F1E5111F57F9000703E4 /* tinyxml.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tinyxml.cpp; sourceTree = ""; }; + A1A2F1E6111F57F9000703E4 /* tinyxml.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tinyxml.h; sourceTree = ""; }; + A1A2F1E7111F57F9000703E4 /* tinyxmlerror.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tinyxmlerror.cpp; sourceTree = ""; }; + A1A2F1E8111F57F9000703E4 /* tinyxmlparser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tinyxmlparser.cpp; sourceTree = ""; }; + A1A2F1EA111F57F9000703E4 /* ofxXmlSettings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ofxXmlSettings.cpp; sourceTree = ""; }; + A1A2F1EB111F57F9000703E4 /* ofxXmlSettings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxXmlSettings.h; sourceTree = ""; }; + A1A2F1F9111F57F9000703E4 /* emptyExampleDebug.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = emptyExampleDebug.app; sourceTree = BUILT_PRODUCTS_DIR; }; + E45BE0390E8CC647009D7055 /* FreeImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FreeImage.h; path = ../../../libs/freeimage/include/FreeImage.h; sourceTree = SOURCE_ROOT; }; + E45BE03F0E8CC650009D7055 /* fmod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = fmod.h; path = ../../../libs/fmodex/include/fmod.h; sourceTree = SOURCE_ROOT; }; + E45BE0400E8CC650009D7055 /* fmod.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = fmod.hpp; path = ../../../libs/fmodex/include/fmod.hpp; sourceTree = SOURCE_ROOT; }; + E45BE0410E8CC650009D7055 /* fmod_codec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = fmod_codec.h; path = ../../../libs/fmodex/include/fmod_codec.h; sourceTree = SOURCE_ROOT; }; + E45BE0420E8CC650009D7055 /* fmod_dsp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = fmod_dsp.h; path = ../../../libs/fmodex/include/fmod_dsp.h; sourceTree = SOURCE_ROOT; }; + E45BE0430E8CC650009D7055 /* fmod_errors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = fmod_errors.h; path = ../../../libs/fmodex/include/fmod_errors.h; sourceTree = SOURCE_ROOT; }; + E45BE0440E8CC650009D7055 /* fmod_output.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = fmod_output.h; path = ../../../libs/fmodex/include/fmod_output.h; sourceTree = SOURCE_ROOT; }; + E45BE0A70E8CC67C009D7055 /* GLee.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GLee.h; path = ../../../libs/GLee/include/GLee.h; sourceTree = SOURCE_ROOT; }; + E45BE0A90E8CC67C009D7055 /* GLee.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = GLee.a; path = ../../../libs/GLee/lib/osx/GLee.a; sourceTree = SOURCE_ROOT; }; + E45BE2E00E8CC69C009D7055 /* RtAudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RtAudio.h; path = ../../../libs/rtAudio/include/RtAudio.h; sourceTree = SOURCE_ROOT; }; + E45BE2E10E8CC69C009D7055 /* RtError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RtError.h; path = ../../../libs/rtAudio/include/RtError.h; sourceTree = SOURCE_ROOT; }; + E45BE2E30E8CC69C009D7055 /* rtAudio.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = rtAudio.a; path = ../../../libs/rtAudio/lib/osx/rtAudio.a; sourceTree = SOURCE_ROOT; }; + E45BE9710E8CC7DD009D7055 /* AGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AGL.framework; path = /System/Library/Frameworks/AGL.framework; sourceTree = ""; }; + E45BE9720E8CC7DD009D7055 /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = ""; }; + E45BE9730E8CC7DD009D7055 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = /System/Library/Frameworks/AudioToolbox.framework; sourceTree = ""; }; + E45BE9740E8CC7DD009D7055 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; + E45BE9750E8CC7DD009D7055 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = ""; }; + E45BE9760E8CC7DD009D7055 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = ""; }; + E45BE9770E8CC7DD009D7055 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = /System/Library/Frameworks/CoreServices.framework; sourceTree = ""; }; + E45BE9790E8CC7DD009D7055 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = ""; }; + E45BE97A0E8CC7DD009D7055 /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = ""; }; + E48D9CD31159443200A7B771 /* guiBaseObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = guiBaseObject.h; path = src/ofxControlPanel/guiBaseObject.h; sourceTree = SOURCE_ROOT; }; + E48D9CD41159443200A7B771 /* guiColor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = guiColor.cpp; path = src/ofxControlPanel/guiColor.cpp; sourceTree = SOURCE_ROOT; }; + E48D9CD51159443200A7B771 /* guiColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = guiColor.h; path = src/ofxControlPanel/guiColor.h; sourceTree = SOURCE_ROOT; }; + E48D9CD71159443200A7B771 /* guiCustomImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = guiCustomImpl.h; path = src/ofxControlPanel/guiCustomImpl.h; sourceTree = SOURCE_ROOT; }; + E48D9CD91159443200A7B771 /* guiIncludes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = guiIncludes.h; path = src/ofxControlPanel/guiIncludes.h; sourceTree = SOURCE_ROOT; }; + E48D9CDA1159443200A7B771 /* guiTextBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = guiTextBase.cpp; path = src/ofxControlPanel/guiTextBase.cpp; sourceTree = SOURCE_ROOT; }; + E48D9CDB1159443200A7B771 /* guiTextBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = guiTextBase.h; path = src/ofxControlPanel/guiTextBase.h; sourceTree = SOURCE_ROOT; }; + E48D9CDC1159443200A7B771 /* guiType2DSlider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = guiType2DSlider.cpp; path = src/ofxControlPanel/guiType2DSlider.cpp; sourceTree = SOURCE_ROOT; }; + E48D9CDD1159443200A7B771 /* guiType2DSlider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = guiType2DSlider.h; path = src/ofxControlPanel/guiType2DSlider.h; sourceTree = SOURCE_ROOT; }; + E48D9CDE1159443200A7B771 /* guiTypeButtonSlider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = guiTypeButtonSlider.cpp; path = src/ofxControlPanel/guiTypeButtonSlider.cpp; sourceTree = SOURCE_ROOT; }; + E48D9CDF1159443200A7B771 /* guiTypeButtonSlider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = guiTypeButtonSlider.h; path = src/ofxControlPanel/guiTypeButtonSlider.h; sourceTree = SOURCE_ROOT; }; + E48D9CE01159443200A7B771 /* guiTypeCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = guiTypeCustom.cpp; path = src/ofxControlPanel/guiTypeCustom.cpp; sourceTree = SOURCE_ROOT; }; + E48D9CE11159443200A7B771 /* guiTypeCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = guiTypeCustom.h; path = src/ofxControlPanel/guiTypeCustom.h; sourceTree = SOURCE_ROOT; }; + E48D9CE21159443200A7B771 /* guiTypeDrawable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = guiTypeDrawable.cpp; path = src/ofxControlPanel/guiTypeDrawable.cpp; sourceTree = SOURCE_ROOT; }; + E48D9CE31159443200A7B771 /* guiTypeDrawable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = guiTypeDrawable.h; path = src/ofxControlPanel/guiTypeDrawable.h; sourceTree = SOURCE_ROOT; }; + E48D9CE41159443200A7B771 /* guiTypeFileLister.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = guiTypeFileLister.cpp; path = src/ofxControlPanel/guiTypeFileLister.cpp; sourceTree = SOURCE_ROOT; }; + E48D9CE51159443200A7B771 /* guiTypeFileLister.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = guiTypeFileLister.h; path = src/ofxControlPanel/guiTypeFileLister.h; sourceTree = SOURCE_ROOT; }; + E48D9CE61159443200A7B771 /* guiTypeLogger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = guiTypeLogger.cpp; path = src/ofxControlPanel/guiTypeLogger.cpp; sourceTree = SOURCE_ROOT; }; + E48D9CE71159443200A7B771 /* guiTypeLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = guiTypeLogger.h; path = src/ofxControlPanel/guiTypeLogger.h; sourceTree = SOURCE_ROOT; }; + E48D9CE81159443200A7B771 /* guiTypeMultiToggle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = guiTypeMultiToggle.h; sourceTree = ""; }; + E48D9CE91159443200A7B771 /* guiTypeMultiToggle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = guiTypeMultiToggle.cpp; sourceTree = ""; }; + E48D9CEA1159443200A7B771 /* guiTypePanel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = guiTypePanel.cpp; path = src/ofxControlPanel/guiTypePanel.cpp; sourceTree = SOURCE_ROOT; }; + E48D9CEB1159443200A7B771 /* guiTypePanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = guiTypePanel.h; path = src/ofxControlPanel/guiTypePanel.h; sourceTree = SOURCE_ROOT; }; + E48D9CEC1159443200A7B771 /* guiTypeSlider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = guiTypeSlider.cpp; path = src/ofxControlPanel/guiTypeSlider.cpp; sourceTree = SOURCE_ROOT; }; + E48D9CED1159443200A7B771 /* guiTypeSlider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = guiTypeSlider.h; path = src/ofxControlPanel/guiTypeSlider.h; sourceTree = SOURCE_ROOT; }; + E48D9CEE1159443200A7B771 /* guiTypeText.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = guiTypeText.cpp; path = src/ofxControlPanel/guiTypeText.cpp; sourceTree = SOURCE_ROOT; }; + E48D9CEF1159443200A7B771 /* guiTypeText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = guiTypeText.h; path = src/ofxControlPanel/guiTypeText.h; sourceTree = SOURCE_ROOT; }; + E48D9CF01159443200A7B771 /* guiTypeTextDropDown.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = guiTypeTextDropDown.cpp; path = src/ofxControlPanel/guiTypeTextDropDown.cpp; sourceTree = SOURCE_ROOT; }; + E48D9CF11159443200A7B771 /* guiTypeTextDropDown.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = guiTypeTextDropDown.h; path = src/ofxControlPanel/guiTypeTextDropDown.h; sourceTree = SOURCE_ROOT; }; + E48D9CF21159443200A7B771 /* guiTypeToggle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = guiTypeToggle.cpp; path = src/ofxControlPanel/guiTypeToggle.cpp; sourceTree = SOURCE_ROOT; }; + E48D9CF31159443200A7B771 /* guiTypeToggle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = guiTypeToggle.h; path = src/ofxControlPanel/guiTypeToggle.h; sourceTree = SOURCE_ROOT; }; + E48D9CF41159443200A7B771 /* guiValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = guiValue.cpp; path = src/ofxControlPanel/guiValue.cpp; sourceTree = SOURCE_ROOT; }; + E48D9CF51159443200A7B771 /* guiValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = guiValue.h; path = src/ofxControlPanel/guiValue.h; sourceTree = SOURCE_ROOT; }; + E48D9CF81159443200A7B771 /* ofxControlPanel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ofxControlPanel.cpp; path = src/ofxControlPanel/ofxControlPanel.cpp; sourceTree = SOURCE_ROOT; }; + E48D9CF91159443200A7B771 /* ofxControlPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ofxControlPanel.h; path = src/ofxControlPanel/ofxControlPanel.h; sourceTree = SOURCE_ROOT; }; + E48D9CFA1159443200A7B771 /* simpleColor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = simpleColor.cpp; path = src/ofxControlPanel/simpleColor.cpp; sourceTree = SOURCE_ROOT; }; + E48D9CFB1159443200A7B771 /* simpleColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = simpleColor.h; path = src/ofxControlPanel/simpleColor.h; sourceTree = SOURCE_ROOT; }; + E48D9CFC1159443200A7B771 /* simpleFileLister.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = simpleFileLister.cpp; path = src/ofxControlPanel/simpleFileLister.cpp; sourceTree = SOURCE_ROOT; }; + E48D9CFD1159443200A7B771 /* simpleFileLister.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = simpleFileLister.h; path = src/ofxControlPanel/simpleFileLister.h; sourceTree = SOURCE_ROOT; }; + E48D9CFE1159443200A7B771 /* simpleLogger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = simpleLogger.cpp; path = src/ofxControlPanel/simpleLogger.cpp; sourceTree = SOURCE_ROOT; }; + E48D9CFF1159443200A7B771 /* simpleLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = simpleLogger.h; path = src/ofxControlPanel/simpleLogger.h; sourceTree = SOURCE_ROOT; }; + E48D9D171159484E00A7B771 /* guiTypeVideo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = guiTypeVideo.h; sourceTree = ""; }; + E48D9D181159484E00A7B771 /* guiTypeVideo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = guiTypeVideo.cpp; sourceTree = ""; }; + E4A056EF1163AE860087BEF7 /* guiCallbackValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = guiCallbackValue.h; sourceTree = ""; }; + E4A056F01163AE860087BEF7 /* guiCallbackValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = guiCallbackValue.cpp; sourceTree = ""; }; + E4A056F21163B2000087BEF7 /* guiCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = guiCallback.h; sourceTree = ""; }; + E4A056F31163B2000087BEF7 /* guiCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = guiCallback.cpp; sourceTree = ""; }; + E4B6FCAD0C3E899E008CF71C /* openFrameworks-Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; path = "openFrameworks-Info.plist"; sourceTree = ""; }; + E4C2421610CC549C004149E2 /* openFrameworksLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = openFrameworksLib.xcodeproj; path = ../../../libs/openFrameworksCompiled/project/osx/openFrameworksLib.xcodeproj; sourceTree = SOURCE_ROOT; }; + E4C2424410CC5A17004149E2 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; + E4C2424510CC5A17004149E2 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; + E4C2424610CC5A17004149E2 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = ""; }; + E4C2425F10CC5A78004149E2 /* GLUT.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLUT.framework; path = ../../../libs/glut/lib/osx/GLUT.framework; sourceTree = SOURCE_ROOT; }; + E4C2427A10CC5B66004149E2 /* CppUnit.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = CppUnit.a; path = ../../../libs/poco/lib/osx/CppUnit.a; sourceTree = SOURCE_ROOT; }; + E4C2427B10CC5B66004149E2 /* PocoFoundation.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = PocoFoundation.a; path = ../../../libs/poco/lib/osx/PocoFoundation.a; sourceTree = SOURCE_ROOT; }; + E4C2427C10CC5B66004149E2 /* PocoNet.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = PocoNet.a; path = ../../../libs/poco/lib/osx/PocoNet.a; sourceTree = SOURCE_ROOT; }; + E4C2427D10CC5B66004149E2 /* PocoUtil.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = PocoUtil.a; path = ../../../libs/poco/lib/osx/PocoUtil.a; sourceTree = SOURCE_ROOT; }; + E4C2427E10CC5B66004149E2 /* PocoXML.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = PocoXML.a; path = ../../../libs/poco/lib/osx/PocoXML.a; sourceTree = SOURCE_ROOT; }; + E4C2429310CC5C38004149E2 /* freetype.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = freetype.a; path = ../../../libs/freetype/lib/osx/freetype.a; sourceTree = SOURCE_ROOT; }; + E4C242CC10CC650E004149E2 /* libfmodex.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libfmodex.dylib; path = ../../../libs/fmodex/lib/osx/libfmodex.dylib; sourceTree = SOURCE_ROOT; }; + E4C246D910CCAE22004149E2 /* freeimage.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = freeimage.a; path = ../../../libs/FreeImage/lib/osx/freeimage.a; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + E4B69B590A3A1756003C02F2 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + E4C2422B10CC554B004149E2 /* openFrameworks.a in Frameworks */, + E45BE0AA0E8CC67C009D7055 /* GLee.a in Frameworks */, + E45BE2E40E8CC69C009D7055 /* rtAudio.a in Frameworks */, + E45BE97B0E8CC7DD009D7055 /* AGL.framework in Frameworks */, + E45BE97C0E8CC7DD009D7055 /* ApplicationServices.framework in Frameworks */, + E45BE97D0E8CC7DD009D7055 /* AudioToolbox.framework in Frameworks */, + E45BE97E0E8CC7DD009D7055 /* Carbon.framework in Frameworks */, + E45BE97F0E8CC7DD009D7055 /* CoreAudio.framework in Frameworks */, + E45BE9800E8CC7DD009D7055 /* CoreFoundation.framework in Frameworks */, + E45BE9810E8CC7DD009D7055 /* CoreServices.framework in Frameworks */, + E45BE9830E8CC7DD009D7055 /* OpenGL.framework in Frameworks */, + E45BE9840E8CC7DD009D7055 /* QuickTime.framework in Frameworks */, + E4C2424710CC5A17004149E2 /* AppKit.framework in Frameworks */, + E4C2424810CC5A17004149E2 /* Cocoa.framework in Frameworks */, + E4C2424910CC5A17004149E2 /* IOKit.framework in Frameworks */, + E4C2426610CC5A78004149E2 /* GLUT.framework in Frameworks */, + E4C2427F10CC5B66004149E2 /* CppUnit.a in Frameworks */, + E4C2428010CC5B66004149E2 /* PocoFoundation.a in Frameworks */, + E4C2428110CC5B66004149E2 /* PocoNet.a in Frameworks */, + E4C2428210CC5B66004149E2 /* PocoUtil.a in Frameworks */, + E4C2428310CC5B66004149E2 /* PocoXML.a in Frameworks */, + E4C2429410CC5C38004149E2 /* freetype.a in Frameworks */, + E4C242CD10CC650E004149E2 /* libfmodex.dylib in Frameworks */, + E4C246DA10CCAE22004149E2 /* freeimage.a in Frameworks */, + A1A2F1F8111F57F9000703E4 /* openCV.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + A1A2F142111F57F9000703E4 /* addons */ = { + isa = PBXGroup; + children = ( + A1A2F14F111F57F9000703E4 /* ofxDirList */, + A1A2F172111F57F9000703E4 /* ofxOpenCv */, + A1A2F1D2111F57F9000703E4 /* ofxVectorMath */, + A1A2F1E2111F57F9000703E4 /* ofxXmlSettings */, + ); + name = addons; + path = ../../../addons; + sourceTree = SOURCE_ROOT; + }; + A1A2F14F111F57F9000703E4 /* ofxDirList */ = { + isa = PBXGroup; + children = ( + A1A2F150111F57F9000703E4 /* doc */, + A1A2F152111F57F9000703E4 /* install.xml */, + A1A2F153111F57F9000703E4 /* src */, + ); + path = ofxDirList; + sourceTree = ""; + }; + A1A2F150111F57F9000703E4 /* doc */ = { + isa = PBXGroup; + children = ( + A1A2F151111F57F9000703E4 /* Instructions.txt */, + ); + path = doc; + sourceTree = ""; + }; + A1A2F153111F57F9000703E4 /* src */ = { + isa = PBXGroup; + children = ( + A1A2F154111F57F9000703E4 /* ofxDirList.cpp */, + A1A2F155111F57F9000703E4 /* ofxDirList.h */, + ); + path = src; + sourceTree = ""; + }; + A1A2F172111F57F9000703E4 /* ofxOpenCv */ = { + isa = PBXGroup; + children = ( + A1A2F173111F57F9000703E4 /* install.xml */, + A1A2F174111F57F9000703E4 /* libs */, + A1A2F18A111F57F9000703E4 /* src */, + ); + path = ofxOpenCv; + sourceTree = ""; + }; + A1A2F174111F57F9000703E4 /* libs */ = { + isa = PBXGroup; + children = ( + A1A2F175111F57F9000703E4 /* opencv */, + ); + path = libs; + sourceTree = ""; + }; + A1A2F175111F57F9000703E4 /* opencv */ = { + isa = PBXGroup; + children = ( + A1A2F176111F57F9000703E4 /* include */, + A1A2F187111F57F9000703E4 /* lib */, + ); + path = opencv; + sourceTree = ""; + }; + A1A2F176111F57F9000703E4 /* include */ = { + isa = PBXGroup; + children = ( + A1A2F177111F57F9000703E4 /* cv.h */, + A1A2F178111F57F9000703E4 /* cv.hpp */, + A1A2F179111F57F9000703E4 /* cvaux.h */, + A1A2F17A111F57F9000703E4 /* cvaux.hpp */, + A1A2F17B111F57F9000703E4 /* cvcompat.h */, + A1A2F17C111F57F9000703E4 /* cvmat.hpp */, + A1A2F17D111F57F9000703E4 /* cvstreams.h */, + A1A2F17E111F57F9000703E4 /* cvtypes.h */, + A1A2F17F111F57F9000703E4 /* cvver.h */, + A1A2F180111F57F9000703E4 /* cvvidsurv.hpp */, + A1A2F181111F57F9000703E4 /* cvwimage.h */, + A1A2F182111F57F9000703E4 /* cxcore.h */, + A1A2F183111F57F9000703E4 /* cxcore.hpp */, + A1A2F184111F57F9000703E4 /* cxerror.h */, + A1A2F185111F57F9000703E4 /* cxmisc.h */, + A1A2F186111F57F9000703E4 /* cxtypes.h */, + ); + path = include; + sourceTree = ""; + }; + A1A2F187111F57F9000703E4 /* lib */ = { + isa = PBXGroup; + children = ( + A1A2F188111F57F9000703E4 /* osx */, + ); + path = lib; + sourceTree = ""; + }; + A1A2F188111F57F9000703E4 /* osx */ = { + isa = PBXGroup; + children = ( + A1A2F189111F57F9000703E4 /* openCV.a */, + ); + path = osx; + sourceTree = ""; + }; + A1A2F18A111F57F9000703E4 /* src */ = { + isa = PBXGroup; + children = ( + A1A2F18B111F57F9000703E4 /* ofxCvBlob.h */, + A1A2F18C111F57F9000703E4 /* ofxCvColorImage.cpp */, + A1A2F18D111F57F9000703E4 /* ofxCvColorImage.h */, + A1A2F18E111F57F9000703E4 /* ofxCvConstants.h */, + A1A2F18F111F57F9000703E4 /* ofxCvContourFinder.cpp */, + A1A2F190111F57F9000703E4 /* ofxCvContourFinder.h */, + A1A2F191111F57F9000703E4 /* ofxCvFloatImage.cpp */, + A1A2F192111F57F9000703E4 /* ofxCvFloatImage.h */, + A1A2F193111F57F9000703E4 /* ofxCvGrayscaleImage.cpp */, + A1A2F194111F57F9000703E4 /* ofxCvGrayscaleImage.h */, + A1A2F195111F57F9000703E4 /* ofxCvImage.cpp */, + A1A2F196111F57F9000703E4 /* ofxCvImage.h */, + A1A2F197111F57F9000703E4 /* ofxCvMain.h */, + A1A2F198111F57F9000703E4 /* ofxCvShortImage.cpp */, + A1A2F199111F57F9000703E4 /* ofxCvShortImage.h */, + A1A2F19A111F57F9000703E4 /* ofxOpenCv.h */, + ); + path = src; + sourceTree = ""; + }; + A1A2F1D2111F57F9000703E4 /* ofxVectorMath */ = { + isa = PBXGroup; + children = ( + A1A2F1D3111F57F9000703E4 /* install.xml */, + A1A2F1D4111F57F9000703E4 /* src */, + ); + path = ofxVectorMath; + sourceTree = ""; + }; + A1A2F1D4111F57F9000703E4 /* src */ = { + isa = PBXGroup; + children = ( + A1A2F1D5111F57F9000703E4 /* ofxMatrix3x3.cpp */, + A1A2F1D6111F57F9000703E4 /* ofxMatrix3x3.h */, + A1A2F1D7111F57F9000703E4 /* ofxMatrix4x4.cpp */, + A1A2F1D8111F57F9000703E4 /* ofxMatrix4x4.h */, + A1A2F1D9111F57F9000703E4 /* ofxPoint2f.h */, + A1A2F1DA111F57F9000703E4 /* ofxPoint3f.h */, + A1A2F1DB111F57F9000703E4 /* ofxPoint4f.h */, + A1A2F1DC111F57F9000703E4 /* ofxQuaternion.cpp */, + A1A2F1DD111F57F9000703E4 /* ofxQuaternion.h */, + A1A2F1DE111F57F9000703E4 /* ofxVec2f.h */, + A1A2F1DF111F57F9000703E4 /* ofxVec3f.h */, + A1A2F1E0111F57F9000703E4 /* ofxVec4f.h */, + A1A2F1E1111F57F9000703E4 /* ofxVectorMath.h */, + ); + path = src; + sourceTree = ""; + }; + A1A2F1E2111F57F9000703E4 /* ofxXmlSettings */ = { + isa = PBXGroup; + children = ( + A1A2F1E3111F57F9000703E4 /* install.xml */, + A1A2F1E4111F57F9000703E4 /* libs */, + A1A2F1E9111F57F9000703E4 /* src */, + ); + path = ofxXmlSettings; + sourceTree = ""; + }; + A1A2F1E4111F57F9000703E4 /* libs */ = { + isa = PBXGroup; + children = ( + A1A2F1E5111F57F9000703E4 /* tinyxml.cpp */, + A1A2F1E6111F57F9000703E4 /* tinyxml.h */, + A1A2F1E7111F57F9000703E4 /* tinyxmlerror.cpp */, + A1A2F1E8111F57F9000703E4 /* tinyxmlparser.cpp */, + ); + path = libs; + sourceTree = ""; + }; + A1A2F1E9111F57F9000703E4 /* src */ = { + isa = PBXGroup; + children = ( + A1A2F1EA111F57F9000703E4 /* ofxXmlSettings.cpp */, + A1A2F1EB111F57F9000703E4 /* ofxXmlSettings.h */, + ); + path = src; + sourceTree = ""; + }; + E45BE0360E8CC5DE009D7055 /* libs */ = { + isa = PBXGroup; + children = ( + E45BEED60E8CCB34009D7055 /* core */, + ); + name = libs; + sourceTree = ""; + }; + E45BE0370E8CC647009D7055 /* freeimage */ = { + isa = PBXGroup; + children = ( + E4C246D810CCAE22004149E2 /* osx */, + E45BE0380E8CC647009D7055 /* include */, + ); + name = freeimage; + path = ../../../libs/freeimage; + sourceTree = SOURCE_ROOT; + }; + E45BE0380E8CC647009D7055 /* include */ = { + isa = PBXGroup; + children = ( + E45BE0390E8CC647009D7055 /* FreeImage.h */, + ); + name = include; + path = ../../../libs/freeimage/include; + sourceTree = SOURCE_ROOT; + }; + E45BE03D0E8CC650009D7055 /* fmodex */ = { + isa = PBXGroup; + children = ( + E45BE03E0E8CC650009D7055 /* inc */, + E4C2428E10CC5C18004149E2 /* osx */, + ); + name = fmodex; + path = ../../../libs/fmodex; + sourceTree = SOURCE_ROOT; + }; + E45BE03E0E8CC650009D7055 /* inc */ = { + isa = PBXGroup; + children = ( + E45BE03F0E8CC650009D7055 /* fmod.h */, + E45BE0400E8CC650009D7055 /* fmod.hpp */, + E45BE0410E8CC650009D7055 /* fmod_codec.h */, + E45BE0420E8CC650009D7055 /* fmod_dsp.h */, + E45BE0430E8CC650009D7055 /* fmod_errors.h */, + E45BE0440E8CC650009D7055 /* fmod_output.h */, + ); + name = inc; + path = ../../../libs/fmodex/include; + sourceTree = SOURCE_ROOT; + }; + E45BE0480E8CC657009D7055 /* core libraries */ = { + isa = PBXGroup; + children = ( + E4C2425B10CC5A78004149E2 /* glut */, + E45BEC7B0E8CC911009D7055 /* poco */, + E45BE2D50E8CC69C009D7055 /* rtAudio */, + E45BE0A50E8CC67C009D7055 /* GLee */, + E45BE0490E8CC676009D7055 /* freetype */, + E45BE03D0E8CC650009D7055 /* fmodex */, + E45BE0370E8CC647009D7055 /* freeimage */, + ); + name = "core libraries"; + sourceTree = ""; + }; + E45BE0490E8CC676009D7055 /* freetype */ = { + isa = PBXGroup; + children = ( + E4C2429210CC5C38004149E2 /* osx */, + ); + name = freetype; + path = ../../../libs/freetype; + sourceTree = SOURCE_ROOT; + }; + E45BE0A50E8CC67C009D7055 /* GLee */ = { + isa = PBXGroup; + children = ( + E45BE0A60E8CC67C009D7055 /* include */, + E45BE0A80E8CC67C009D7055 /* lib */, + ); + name = GLee; + path = ../../../libs/GLee; + sourceTree = SOURCE_ROOT; + }; + E45BE0A60E8CC67C009D7055 /* include */ = { + isa = PBXGroup; + children = ( + E45BE0A70E8CC67C009D7055 /* GLee.h */, + ); + name = include; + path = ../../../libs/GLee/include; + sourceTree = SOURCE_ROOT; + }; + E45BE0A80E8CC67C009D7055 /* lib */ = { + isa = PBXGroup; + children = ( + E45BE0A90E8CC67C009D7055 /* GLee.a */, + ); + name = lib; + path = ../../../libs/GLee/lib/osx; + sourceTree = SOURCE_ROOT; + }; + E45BE2D50E8CC69C009D7055 /* rtAudio */ = { + isa = PBXGroup; + children = ( + E45BE2D60E8CC69C009D7055 /* include */, + E45BE2E20E8CC69C009D7055 /* lib */, + ); + name = rtAudio; + path = ../../../libs/rtAudio; + sourceTree = SOURCE_ROOT; + }; + E45BE2D60E8CC69C009D7055 /* include */ = { + isa = PBXGroup; + children = ( + E45BE2D70E8CC69C009D7055 /* asio */, + E45BE2E00E8CC69C009D7055 /* RtAudio.h */, + E45BE2E10E8CC69C009D7055 /* RtError.h */, + ); + name = include; + path = ../../../libs/rtAudio/include; + sourceTree = SOURCE_ROOT; + }; + E45BE2D70E8CC69C009D7055 /* asio */ = { + isa = PBXGroup; + children = ( + ); + name = asio; + path = ../../../libs/rtAudio/include/asio; + sourceTree = SOURCE_ROOT; + }; + E45BE2E20E8CC69C009D7055 /* lib */ = { + isa = PBXGroup; + children = ( + E45BE2E30E8CC69C009D7055 /* rtAudio.a */, + ); + name = lib; + path = ../../../libs/rtAudio/lib/osx; + sourceTree = SOURCE_ROOT; + }; + E45BE5980E8CC70C009D7055 /* core frameworks */ = { + isa = PBXGroup; + children = ( + E4C2424410CC5A17004149E2 /* AppKit.framework */, + E4C2424510CC5A17004149E2 /* Cocoa.framework */, + E4C2424610CC5A17004149E2 /* IOKit.framework */, + E45BE9710E8CC7DD009D7055 /* AGL.framework */, + E45BE9720E8CC7DD009D7055 /* ApplicationServices.framework */, + E45BE9730E8CC7DD009D7055 /* AudioToolbox.framework */, + E45BE9740E8CC7DD009D7055 /* Carbon.framework */, + E45BE9750E8CC7DD009D7055 /* CoreAudio.framework */, + E45BE9760E8CC7DD009D7055 /* CoreFoundation.framework */, + E45BE9770E8CC7DD009D7055 /* CoreServices.framework */, + E45BE9790E8CC7DD009D7055 /* OpenGL.framework */, + E45BE97A0E8CC7DD009D7055 /* QuickTime.framework */, + ); + name = "core frameworks"; + sourceTree = ""; + }; + E45BEC7B0E8CC911009D7055 /* poco */ = { + isa = PBXGroup; + children = ( + E4C2427910CC5B66004149E2 /* osx */, + ); + name = poco; + path = ../../../libs/poco; + sourceTree = SOURCE_ROOT; + }; + E45BEED60E8CCB34009D7055 /* core */ = { + isa = PBXGroup; + children = ( + E45BE0480E8CC657009D7055 /* core libraries */, + E45BE5980E8CC70C009D7055 /* core frameworks */, + ); + name = core; + sourceTree = ""; + }; + E48D9CD11159443200A7B771 /* ofxControlPanel */ = { + isa = PBXGroup; + children = ( + E48D9CD31159443200A7B771 /* guiBaseObject.h */, + E48D9CD41159443200A7B771 /* guiColor.cpp */, + E48D9CD51159443200A7B771 /* guiColor.h */, + E48D9CD91159443200A7B771 /* guiIncludes.h */, + E48D9CDA1159443200A7B771 /* guiTextBase.cpp */, + E48D9CDB1159443200A7B771 /* guiTextBase.h */, + E48D9CDC1159443200A7B771 /* guiType2DSlider.cpp */, + E48D9CDD1159443200A7B771 /* guiType2DSlider.h */, + E48D9CDE1159443200A7B771 /* guiTypeButtonSlider.cpp */, + E48D9CDF1159443200A7B771 /* guiTypeButtonSlider.h */, + E48D9CD71159443200A7B771 /* guiCustomImpl.h */, + E48D9CE01159443200A7B771 /* guiTypeCustom.cpp */, + E48D9CE11159443200A7B771 /* guiTypeCustom.h */, + E48D9D181159484E00A7B771 /* guiTypeVideo.cpp */, + E48D9D171159484E00A7B771 /* guiTypeVideo.h */, + E48D9CE21159443200A7B771 /* guiTypeDrawable.cpp */, + E48D9CE31159443200A7B771 /* guiTypeDrawable.h */, + E48D9CE41159443200A7B771 /* guiTypeFileLister.cpp */, + E48D9CE51159443200A7B771 /* guiTypeFileLister.h */, + E48D9CE61159443200A7B771 /* guiTypeLogger.cpp */, + E48D9CE71159443200A7B771 /* guiTypeLogger.h */, + E48D9CE91159443200A7B771 /* guiTypeMultiToggle.cpp */, + E48D9CE81159443200A7B771 /* guiTypeMultiToggle.h */, + E48D9CEA1159443200A7B771 /* guiTypePanel.cpp */, + E48D9CEB1159443200A7B771 /* guiTypePanel.h */, + E48D9CEC1159443200A7B771 /* guiTypeSlider.cpp */, + E48D9CED1159443200A7B771 /* guiTypeSlider.h */, + E48D9CEE1159443200A7B771 /* guiTypeText.cpp */, + E48D9CEF1159443200A7B771 /* guiTypeText.h */, + E48D9CF01159443200A7B771 /* guiTypeTextDropDown.cpp */, + E48D9CF11159443200A7B771 /* guiTypeTextDropDown.h */, + E48D9CF21159443200A7B771 /* guiTypeToggle.cpp */, + E48D9CF31159443200A7B771 /* guiTypeToggle.h */, + E48D9CF41159443200A7B771 /* guiValue.cpp */, + E48D9CF51159443200A7B771 /* guiValue.h */, + E4A056F01163AE860087BEF7 /* guiCallbackValue.cpp */, + E4A056EF1163AE860087BEF7 /* guiCallbackValue.h */, + E4A056F31163B2000087BEF7 /* guiCallback.cpp */, + E4A056F21163B2000087BEF7 /* guiCallback.h */, + E48D9CF81159443200A7B771 /* ofxControlPanel.cpp */, + E48D9CF91159443200A7B771 /* ofxControlPanel.h */, + E48D9CFA1159443200A7B771 /* simpleColor.cpp */, + E48D9CFB1159443200A7B771 /* simpleColor.h */, + E48D9CFC1159443200A7B771 /* simpleFileLister.cpp */, + E48D9CFD1159443200A7B771 /* simpleFileLister.h */, + E48D9CFE1159443200A7B771 /* simpleLogger.cpp */, + E48D9CFF1159443200A7B771 /* simpleLogger.h */, + ); + name = ofxControlPanel; + path = src/ofxControlPanel; + sourceTree = SOURCE_ROOT; + }; + E4B69B4A0A3A1720003C02F2 = { + isa = PBXGroup; + children = ( + A1A2F142111F57F9000703E4 /* addons */, + E4B6FCAD0C3E899E008CF71C /* openFrameworks-Info.plist */, + E4B69E1C0A3A1BDC003C02F2 /* src */, + E4C2422310CC54B6004149E2 /* openFrameworks */, + E45BE0360E8CC5DE009D7055 /* libs */, + A1A2F1F9111F57F9000703E4 /* emptyExampleDebug.app */, + ); + sourceTree = ""; + }; + E4B69E1C0A3A1BDC003C02F2 /* src */ = { + isa = PBXGroup; + children = ( + E48D9CD11159443200A7B771 /* ofxControlPanel */, + A1A2F134111F5772000703E4 /* ofAddons.h */, + A1A2F138111F5772000703E4 /* vectorField.cpp */, + A1A2F139111F5772000703E4 /* vectorField.h */, + A1A2F13B111F5772000703E4 /* computerVision.h */, + A1A2F135111F5772000703E4 /* testApp.cpp */, + A1A2F136111F5772000703E4 /* testApp.h */, + A1A2F133111F5772000703E4 /* main.cpp */, + ); + path = src; + sourceTree = SOURCE_ROOT; + }; + E4C2421710CC549C004149E2 /* Products */ = { + isa = PBXGroup; + children = ( + E4C2421E10CC549C004149E2 /* openFrameworks.a */, + ); + name = Products; + sourceTree = ""; + }; + E4C2422310CC54B6004149E2 /* openFrameworks */ = { + isa = PBXGroup; + children = ( + E4C2421610CC549C004149E2 /* openFrameworksLib.xcodeproj */, + ); + name = openFrameworks; + sourceTree = ""; + }; + E4C2425B10CC5A78004149E2 /* glut */ = { + isa = PBXGroup; + children = ( + E4C2425D10CC5A78004149E2 /* lib */, + ); + name = glut; + path = ../../../libs/glut; + sourceTree = SOURCE_ROOT; + }; + E4C2425D10CC5A78004149E2 /* lib */ = { + isa = PBXGroup; + children = ( + E4C2425E10CC5A78004149E2 /* osx */, + ); + name = lib; + path = ../../../libs/glut/lib; + sourceTree = SOURCE_ROOT; + }; + E4C2425E10CC5A78004149E2 /* osx */ = { + isa = PBXGroup; + children = ( + E4C2425F10CC5A78004149E2 /* GLUT.framework */, + ); + name = osx; + path = ../../../libs/glut/lib/osx; + sourceTree = SOURCE_ROOT; + }; + E4C2427910CC5B66004149E2 /* osx */ = { + isa = PBXGroup; + children = ( + E4C2427A10CC5B66004149E2 /* CppUnit.a */, + E4C2427B10CC5B66004149E2 /* PocoFoundation.a */, + E4C2427C10CC5B66004149E2 /* PocoNet.a */, + E4C2427D10CC5B66004149E2 /* PocoUtil.a */, + E4C2427E10CC5B66004149E2 /* PocoXML.a */, + ); + name = osx; + path = ../../../libs/poco/lib/osx; + sourceTree = SOURCE_ROOT; + }; + E4C2428E10CC5C18004149E2 /* osx */ = { + isa = PBXGroup; + children = ( + E4C242CC10CC650E004149E2 /* libfmodex.dylib */, + ); + name = osx; + path = ../../../libs/fmodex/lib/osx; + sourceTree = SOURCE_ROOT; + }; + E4C2429210CC5C38004149E2 /* osx */ = { + isa = PBXGroup; + children = ( + E4C2429310CC5C38004149E2 /* freetype.a */, + ); + name = osx; + path = ../../../libs/freetype/lib/osx; + sourceTree = SOURCE_ROOT; + }; + E4C246D810CCAE22004149E2 /* osx */ = { + isa = PBXGroup; + children = ( + E4C246D910CCAE22004149E2 /* freeimage.a */, + ); + name = osx; + path = ../../../libs/FreeImage/lib/osx; + sourceTree = SOURCE_ROOT; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + E4B69B5A0A3A1756003C02F2 /* emptyExample */ = { + isa = PBXNativeTarget; + buildConfigurationList = E4B69B5F0A3A1757003C02F2 /* Build configuration list for PBXNativeTarget "emptyExample" */; + buildPhases = ( + E4B69B580A3A1756003C02F2 /* Sources */, + E4B69B590A3A1756003C02F2 /* Frameworks */, + E4B6FFFD0C3F9AB9008CF71C /* ShellScript */, + E4C2427710CC5ABF004149E2 /* CopyFiles */, + E4C2444710CC769B004149E2 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + E4C2422810CC54DA004149E2 /* PBXTargetDependency */, + ); + name = emptyExample; + productName = myOFApp; + productReference = A1A2F1F9111F57F9000703E4 /* emptyExampleDebug.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + E4B69B4C0A3A1720003C02F2 /* Project object */ = { + isa = PBXProject; + buildConfigurationList = E4B69B4D0A3A1720003C02F2 /* Build configuration list for PBXProject "ofxControlPanelDemo" */; + compatibilityVersion = "Xcode 2.4"; + hasScannedForEncodings = 0; + mainGroup = E4B69B4A0A3A1720003C02F2; + productRefGroup = E4B69B4A0A3A1720003C02F2; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = E4C2421710CC549C004149E2 /* Products */; + ProjectRef = E4C2421610CC549C004149E2 /* openFrameworksLib.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + E4B69B5A0A3A1756003C02F2 /* emptyExample */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + E4C2421E10CC549C004149E2 /* openFrameworks.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = openFrameworks.a; + remoteRef = E4C2421D10CC549C004149E2 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXShellScriptBuildPhase section */ + E4B6FFFD0C3F9AB9008CF71C /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "cp -f ../../../libs/fmodex/lib/osx/libfmodex.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/libfmodex.dylib\"\ninstall_name_tool -change ./libfmodex.dylib @executable_path/libfmodex.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/$PRODUCT_NAME\" "; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + E4B69B580A3A1756003C02F2 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A1A2F13C111F5772000703E4 /* main.cpp in Sources */, + A1A2F13D111F5772000703E4 /* testApp.cpp in Sources */, + A1A2F13E111F5772000703E4 /* vectorField.cpp in Sources */, + A1A2F1EF111F57F9000703E4 /* ofxDirList.cpp in Sources */, + A1A2F1FB111F57F9000703E4 /* ofxCvColorImage.cpp in Sources */, + A1A2F1FC111F57F9000703E4 /* ofxCvContourFinder.cpp in Sources */, + A1A2F1FD111F57F9000703E4 /* ofxCvFloatImage.cpp in Sources */, + A1A2F1FE111F57F9000703E4 /* ofxCvGrayscaleImage.cpp in Sources */, + A1A2F1FF111F57F9000703E4 /* ofxCvImage.cpp in Sources */, + A1A2F200111F57F9000703E4 /* ofxCvShortImage.cpp in Sources */, + A1A2F20A111F57F9000703E4 /* ofxMatrix3x3.cpp in Sources */, + A1A2F20B111F57F9000703E4 /* ofxMatrix4x4.cpp in Sources */, + A1A2F20C111F57F9000703E4 /* ofxQuaternion.cpp in Sources */, + A1A2F20D111F57F9000703E4 /* tinyxml.cpp in Sources */, + A1A2F20E111F57F9000703E4 /* tinyxmlerror.cpp in Sources */, + A1A2F20F111F57F9000703E4 /* tinyxmlparser.cpp in Sources */, + A1A2F210111F57F9000703E4 /* ofxXmlSettings.cpp in Sources */, + E48D9D011159443200A7B771 /* guiColor.cpp in Sources */, + E48D9D041159443200A7B771 /* guiTextBase.cpp in Sources */, + E48D9D051159443200A7B771 /* guiType2DSlider.cpp in Sources */, + E48D9D061159443200A7B771 /* guiTypeButtonSlider.cpp in Sources */, + E48D9D071159443200A7B771 /* guiTypeCustom.cpp in Sources */, + E48D9D081159443200A7B771 /* guiTypeDrawable.cpp in Sources */, + E48D9D091159443200A7B771 /* guiTypeFileLister.cpp in Sources */, + E48D9D0A1159443200A7B771 /* guiTypeLogger.cpp in Sources */, + E48D9D0B1159443200A7B771 /* guiTypeMultiToggle.h in Sources */, + E48D9D0C1159443200A7B771 /* guiTypePanel.cpp in Sources */, + E48D9D0D1159443200A7B771 /* guiTypeSlider.cpp in Sources */, + E48D9D0E1159443200A7B771 /* guiTypeText.cpp in Sources */, + E48D9D0F1159443200A7B771 /* guiTypeTextDropDown.cpp in Sources */, + E48D9D101159443200A7B771 /* guiTypeToggle.cpp in Sources */, + E48D9D111159443200A7B771 /* guiValue.cpp in Sources */, + E48D9D131159443200A7B771 /* ofxControlPanel.cpp in Sources */, + E48D9D141159443200A7B771 /* simpleColor.cpp in Sources */, + E48D9D151159443200A7B771 /* simpleFileLister.cpp in Sources */, + E48D9D161159443200A7B771 /* simpleLogger.cpp in Sources */, + E48D9D191159484E00A7B771 /* guiTypeVideo.cpp in Sources */, + E4A056F11163AE860087BEF7 /* guiCallbackValue.cpp in Sources */, + E4A056F41163B2000087BEF7 /* guiCallback.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + E4C2422810CC54DA004149E2 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = openFrameworks; + targetProxy = E4C2422710CC54DA004149E2 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + E4B27CA010CBF8A600536013 /* ReleaseUniversal */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = ( + ppc, + i386, + ); + CONFIGURATION_BUILD_DIR = "$(SRCROOT)/bin/"; + COPY_PHASE_STRIP = YES; + DEAD_CODE_STRIPPING = YES; + GCC_AUTO_VECTORIZATION = YES; + GCC_ENABLE_SSE3_EXTENSIONS = YES; + GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS = YES; + GCC_INLINES_ARE_PRIVATE_EXTERN = NO; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = 3; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_UNROLL_LOOPS = YES; + GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO; + GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO; + GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; + GCC_WARN_UNINITIALIZED_AUTOS = NO; + GCC_WARN_UNUSED_VALUE = NO; + GCC_WARN_UNUSED_VARIABLE = NO; + HEADER_SEARCH_PATHS = ( + "../../../libs/openFrameworks/**", + ../../../libs/freetype/include/, + ../../../libs/freetype/include/freetype2, + ../../../libs/poco/include, + ); + OTHER_CPLUSPLUSFLAGS = ( + "-D__MACOSX_CORE__", + "-lpthread", + ); + OTHER_LDFLAGS = ""; + SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + }; + name = ReleaseUniversal; + }; + E4B27CA110CBF8A600536013 /* ReleaseUniversal */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", + ); + FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../../libs/glut/lib/osx\""; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_MODEL_TUNING = G4; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Carbon.framework/Headers/Carbon.h"; + INFOPLIST_FILE = "openFrameworks-Info.plist"; + INSTALL_PATH = "$(HOME)/Applications"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_4)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_5)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_6)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_7)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_8)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_9)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_10)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_11)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_12)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_13)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_14)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_15)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_1)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_2)", + ); + LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/../../../addons/ofxOpenCv/libs/opencv/lib/osx\""; + LIBRARY_SEARCH_PATHS_QUOTED_2 = "\"$(SRCROOT)/../../../addons/ofxOsc/libs/oscpack/lib/osx\""; + LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../../libs/freeimage/lib/osx\""; + LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_14 = "\"$(SRCROOT)/../../../libs/fmodex/lib/osx\""; + LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_15 = "\"$(SRCROOT)/../../../libs/freetype/lib/osx\""; + LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2 = "\"$(SRCROOT)/../../../libs/FreeImage/lib/osx\""; + LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_4 = "\"$(SRCROOT)/../../../libs/GLee/lib/osx\""; + LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_5 = "\"$(SRCROOT)/../../../libs/poco/lib/osx\""; + LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_6 = "\"$(SRCROOT)/../../../libs/rtAudio/lib/osx\""; + PREBINDING = NO; + PRODUCT_NAME = "$(TARGET_NAME)Universal"; + WRAPPER_EXTENSION = app; + ZERO_LINK = NO; + }; + name = ReleaseUniversal; + }; + E4B69B4E0A3A1720003C02F2 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(NATIVE_ARCH)"; + CONFIGURATION_BUILD_DIR = "$(SRCROOT)/bin/"; + COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + GCC_AUTO_VECTORIZATION = YES; + GCC_ENABLE_SSE3_EXTENSIONS = YES; + GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS = YES; + GCC_INLINES_ARE_PRIVATE_EXTERN = NO; + GCC_MODEL_TUNING = G5; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO; + GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO; + GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; + GCC_WARN_UNINITIALIZED_AUTOS = NO; + GCC_WARN_UNUSED_VALUE = NO; + GCC_WARN_UNUSED_VARIABLE = NO; + HEADER_SEARCH_PATHS = ( + "../../../libs/openFrameworks/**", + ../../../libs/freetype/include/, + ../../../libs/freetype/include/freetype2, + ../../../libs/poco/include, + ); + OTHER_CPLUSPLUSFLAGS = ( + "-D__MACOSX_CORE__", + "-lpthread", + ); + OTHER_LDFLAGS = ""; + SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + }; + name = Debug; + }; + E4B69B4F0A3A1720003C02F2 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(NATIVE_ARCH)"; + CONFIGURATION_BUILD_DIR = "$(SRCROOT)/bin/"; + COPY_PHASE_STRIP = YES; + DEAD_CODE_STRIPPING = YES; + GCC_AUTO_VECTORIZATION = YES; + GCC_ENABLE_SSE3_EXTENSIONS = YES; + GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS = YES; + GCC_INLINES_ARE_PRIVATE_EXTERN = NO; + GCC_MODEL_TUNING = G5; + GCC_OPTIMIZATION_LEVEL = 3; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_UNROLL_LOOPS = YES; + GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO; + GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO; + GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; + GCC_WARN_UNINITIALIZED_AUTOS = NO; + GCC_WARN_UNUSED_VALUE = NO; + GCC_WARN_UNUSED_VARIABLE = NO; + HEADER_SEARCH_PATHS = ( + "../../../libs/openFrameworks/**", + ../../../libs/freetype/include/, + ../../../libs/freetype/include/freetype2, + ../../../libs/poco/include, + ); + OTHER_CPLUSPLUSFLAGS = ( + "-D__MACOSX_CORE__", + "-lpthread", + ); + OTHER_LDFLAGS = ""; + SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + }; + name = Release; + }; + E4B69B600A3A1757003C02F2 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", + ); + FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../../libs/glut/lib/osx\""; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_MODEL_TUNING = G4; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Carbon.framework/Headers/Carbon.h"; + INFOPLIST_FILE = "openFrameworks-Info.plist"; + INSTALL_PATH = "$(HOME)/Applications"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_4)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_5)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_6)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_7)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_8)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_9)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_10)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_11)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_12)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_13)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_14)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_15)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_7)", + ); + LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../../libs/freeimage/lib/osx\""; + LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_14 = "\"$(SRCROOT)/../../../libs/fmodex/lib/osx\""; + LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_15 = "\"$(SRCROOT)/../../../libs/freetype/lib/osx\""; + LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2 = "\"$(SRCROOT)/../../../libs/FreeImage/lib/osx\""; + LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3 = "\"$(SRCROOT)/../../../addons/ofxOpenCv/libs/opencv/lib/osx\""; + LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_4 = "\"$(SRCROOT)/../../../libs/GLee/lib/osx\""; + LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_5 = "\"$(SRCROOT)/../../../libs/poco/lib/osx\""; + LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_6 = "\"$(SRCROOT)/../../../libs/rtAudio/lib/osx\""; + LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_7 = "\"$(SRCROOT)/../../../addons/ofxOsc/libs/oscpack/lib/osx\""; + PREBINDING = NO; + PRODUCT_NAME = "$(TARGET_NAME)Debug"; + WRAPPER_EXTENSION = app; + ZERO_LINK = NO; + }; + name = Debug; + }; + E4B69B610A3A1757003C02F2 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", + ); + FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../../libs/glut/lib/osx\""; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_MODEL_TUNING = G4; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Carbon.framework/Headers/Carbon.h"; + INFOPLIST_FILE = "openFrameworks-Info.plist"; + INSTALL_PATH = "$(HOME)/Applications"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_4)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_5)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_6)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_7)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_8)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_9)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_10)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_11)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_12)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_13)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_14)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_15)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)", + "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_7)", + ); + LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../../libs/freeimage/lib/osx\""; + LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_14 = "\"$(SRCROOT)/../../../libs/fmodex/lib/osx\""; + LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_15 = "\"$(SRCROOT)/../../../libs/freetype/lib/osx\""; + LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2 = "\"$(SRCROOT)/../../../libs/FreeImage/lib/osx\""; + LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3 = "\"$(SRCROOT)/../../../addons/ofxOpenCv/libs/opencv/lib/osx\""; + LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_4 = "\"$(SRCROOT)/../../../libs/GLee/lib/osx\""; + LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_5 = "\"$(SRCROOT)/../../../libs/poco/lib/osx\""; + LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_6 = "\"$(SRCROOT)/../../../libs/rtAudio/lib/osx\""; + LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_7 = "\"$(SRCROOT)/../../../addons/ofxOsc/libs/oscpack/lib/osx\""; + PREBINDING = NO; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + ZERO_LINK = NO; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + E4B69B4D0A3A1720003C02F2 /* Build configuration list for PBXProject "ofxControlPanelDemo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E4B69B4E0A3A1720003C02F2 /* Debug */, + E4B69B4F0A3A1720003C02F2 /* Release */, + E4B27CA010CBF8A600536013 /* ReleaseUniversal */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + E4B69B5F0A3A1757003C02F2 /* Build configuration list for PBXNativeTarget "emptyExample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E4B69B600A3A1757003C02F2 /* Debug */, + E4B69B610A3A1757003C02F2 /* Release */, + E4B27CA110CBF8A600536013 /* ReleaseUniversal */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = E4B69B4C0A3A1720003C02F2 /* Project object */; +} diff --git a/openFrameworks-Info.plist b/openFrameworks-Info.plist new file mode 100644 index 0000000..e5db555 --- /dev/null +++ b/openFrameworks-Info.plist @@ -0,0 +1,20 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.yourcompany.openFrameworks + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleVersion + 1.0 + + diff --git a/src/main.cpp b/src/main.cpp new file mode 100755 index 0000000..ed4542a --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,16 @@ +#include "ofMain.h" +#include "testApp.h" + + +//======================================================================== +int main( ){ + + ofSetupOpenGL(960,768, OF_WINDOW); // <-------- setup the GL context + + // this kicks off the running of my app + // can be OF_WINDOW or OF_FULLSCREEN + // pass in width and height too: + + ofRunApp(new testApp()); + +} diff --git a/src/ofAddons.h b/src/ofAddons.h new file mode 100644 index 0000000..d996f62 --- /dev/null +++ b/src/ofAddons.h @@ -0,0 +1,47 @@ +// I just put this here because I couldn't be bothered to update all the files with +// the new way of using Addons yet. Pretty sure this isn't causing the problem. + +//-------------------------------------------- openCV +#ifdef OF_ADDON_USING_OFXOPENCV + #include "ofxCvMain.h" +#endif + +//-------------------------------------------- obj loader +#ifdef OF_ADDON_USING_OFXOBJLOADER + #include "ofxObjLoader.h" +#endif + +//-------------------------------------------- dir list +#ifdef OF_ADDON_USING_OFXDIRLIST + #include "ofxDirList.h" +#endif + +//-------------------------------------------- vector math +#ifdef OF_ADDON_USING_OFXVECTORMATH + #include "ofxVectorMath.h" +#endif + +//-------------------------------------------- network +#ifdef OF_ADDON_USING_OFXNETWORK + #include "ofxNetwork.h" +#endif + +//-------------------------------------------- vector graphics +#ifdef OF_ADDON_USING_OFXVECTORGRAPHICS + #include "ofxVectorGraphics.h" +#endif + +//-------------------------------------------- OSC +#ifdef OF_ADDON_USING_OFXOSC + #include "ofxOsc.h" +#endif + +//-------------------------------------------- ofthread +#ifdef OF_ADDON_USING_OFXTHREAD + #include "ofxThread.h" +#endif + +//-------------------------------------------- ofXML +#ifdef OF_ADDON_USING_OFXXMLSETTINGS + #include "ofxXmlSettings.h" +#endif diff --git a/src/ofxControlPanel/guiBaseObject.h b/src/ofxControlPanel/guiBaseObject.h new file mode 100755 index 0000000..a4b3480 --- /dev/null +++ b/src/ofxControlPanel/guiBaseObject.h @@ -0,0 +1,362 @@ +#pragma once + +#include "simpleColor.h" +#include "guiColor.h" +#include "guiValue.h" +#include "guiTextBase.h" +#include "guiCallback.h" + +typedef enum{ +SG_STATE_NORMAL, +SG_STATE_SELECTED +}sgState; + +typedef enum{ + SG_TYPE_FLOAT, + SG_TYPE_INT, + SG_TYPE_BOOL +}sgType; + +static bool isInsideRect(float x, float y, ofRectangle rect){ + return ( x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height ); +} + +class guiBaseObject{ + + public: + guiBaseObject(){ + readOnly = false; + bShowText = true; + locked = false; + dataType = SG_TYPE_FLOAT; + + numDecimalPlaces = 2; + storedTextWidth = 0; + + fgColor.setColor(180, 180, 180, 255); + fgColor.setSelectedColor(100, 140, 220, 255); + + outlineColor.setColor(255, 255, 255, 180); + outlineColor.setSelectedColor(255, 255, 255, 255); + + bgColor.setSelectedColor(12, 12, 12, 200); + bgColor.setColor(12, 12, 12, 200); + + //these need to be setable at some point + fontSize = 11; + titleSpacing = 5; + + } + + //------------------------------------------ + virtual void setXmlName(string _xmlName){ + xmlName = _xmlName; + } + + //-------------------------------------------- + virtual void setFont(ofTrueTypeFont * fontPtr){ + displayText.setFont(fontPtr); + } + + //should be called on mousedown + //------------------------------------------- + virtual bool checkHit(float x, float y, bool isRelative){ + if(readOnly)return false; + if( isInsideRect(x, y, hitArea) ){ + state = SG_STATE_SELECTED; + setSelected(); + updateGui(x, y, true, isRelative); + + float offsetX = x - hitArea.x; + float offsetY = y - hitArea.y; + + for(unsigned int i = 0; i < children.size(); i++){ + children[i]->checkHit(offsetX, offsetY, isRelative); + } + return true; + } + return false; + } + + //this is the equivilant of mouse moved if the gui element has been selected + //this is empty as it really should be specified by + //the extending class (gui element). + //------------------------------------------------ + virtual void updateGui(float x, float y, bool firstHit, bool isRelative){ + + } + + //should be called on mouse up + //------------------------------------------- + virtual void release(){ + state = SG_STATE_NORMAL; + setNormal(); + for(unsigned int i = 0; i < children.size(); i++){ + children[i]->release(); + } + } + + //these are here for the custom control types + //we notify all elements about these actions + virtual void saveSettings(string filename){} + virtual void reloadSettings(){} + virtual void saveSettings(){} + virtual void loadSettings(string filename){} + + virtual void lock(){ + locked = true; + } + + virtual void unlock(){ + locked = false; + } + + bool isLocked(){ + return locked; + } + + //------------------------------------------------ + virtual void setShowText(bool showText){ + bShowText = showText; + } + + //----------------------------------------------- + virtual void setTypeInt(){ + dataType = SG_TYPE_INT; + } + + //----------------------------------------------- + virtual void setTypeFloat(){ + dataType = SG_TYPE_FLOAT; + } + + //----------------------------------------------- + virtual void setTypeBool(){ + dataType = SG_TYPE_BOOL; + } + + //----------------------------------------------- + virtual void setPosition(float x, float y){ + boundingBox.x = x; + boundingBox.y = y; + hitArea.x = x; + hitArea.y = y; + } + + //------------------------------------------------ + virtual void setDimensions(float width, float height){ + hitArea.width = width; + hitArea.height = height; + boundingBox.width = width; + boundingBox.height = height; + } + + //----------------------------------------------- + virtual float getPosX(){ + return boundingBox.x; + } + + //------------------------------------------------ + virtual float getPosY(){ + return boundingBox.y; + } + + //------------------------------------------------ + virtual float getWidth(){ + return boundingBox.width; + + } + + //----------------------------------------------- + virtual float getHeight(){ + return boundingBox.height; + } + + //----------------------------------------------- + virtual void update(){ + updateText(); + } + + //----------------------------------------------- + virtual void notify(){ + guiCallbackData cbVal; + cbVal.setup(xmlName); + cbVal.addFloat(value.getValueF()); + ofNotifyEvent(guiEvent,cbVal,this); + //CB + } + + //----------------------------------------------- + virtual void checkPrescison(){ + //here we check the range of floating point values and change number of decimal places based on range + float range =fabs( value.getMax() - value.getMin() ); + if( range < 0.001 ){ + numDecimalPlaces = 6; + }else if( range < 0.01){ + numDecimalPlaces = 5; + }else if( range < 0.1 ){ + numDecimalPlaces = 4; + }else if( range < 1){ + numDecimalPlaces = 3; + }else if( range < 10){ + numDecimalPlaces = 2; + }else{ + numDecimalPlaces = 1; + } + } + +// //----------------------------------------------- +// virtual void setIsRelative( bool bIsRelative ){ +// isRelative = bIsRelative; +// } + + //every time we update the value of our text + //----------------------------------------------- + virtual void updateText(){ + + drawStr = name; + for(int i = 0; i < value.getNumValues(); i++){ + if( dataType == SG_TYPE_FLOAT ){ + checkPrescison(); + drawStr += " "+ofToString(value.getValueF(i), numDecimalPlaces); + }else if( dataType == SG_TYPE_INT ) drawStr += " "+ofToString(value.getValueI(i), 0); + else if( dataType == SG_TYPE_BOOL ) drawStr += " "+ofToString(value.getValueB(i), 0); + } + + displayText.setText(drawStr); + + //now update our bounding box + updateBoundingBox(); + } + + //--------------------------------------------- + virtual void updateBoundingBox(){ + if(bShowText){ + //we need to update out hitArea because the text will have moved the gui down + hitArea.y = boundingBox.y + displayText.getTextHeight() + titleSpacing; + boundingBox.height = hitArea.height + displayText.getTextHeight() + titleSpacing; + }else{ + //we need to update out hitArea because the text will have moved the gui down + hitArea.y = boundingBox.y; + } + } + + //--------------------------------------------- + virtual void renderText(){ + if(!bShowText) return; + + glColor4fv(textColor.getColorF()); + displayText.renderText(boundingBox.x, boundingBox.y + displayText.getTextSingleLineHeight()); + } + + //this also needs to be specified by the extending class + //-------------------------------------------- + virtual void render(){ + + } + + //------------------------------------------- + virtual void setSelected(){ + fgColor.setGuiColorMode(1); + bgColor.setGuiColorMode(1); + outlineColor.setGuiColorMode(1); + textColor.setGuiColorMode(1); + } + + //------------------------------------------- + virtual void setNormal(){ + fgColor.setGuiColorMode(0); + bgColor.setGuiColorMode(0); + outlineColor.setGuiColorMode(0); + textColor.setGuiColorMode(0); + } + + //------------------------------------------- + virtual void setForegroundColor( int norR, int norG, int norB, int norA = 255){ + fgColor.setColor(norR, norG, norB, norA); + } + + //------------------------------------------- + virtual void setForegroundSelectColor(int selR, int selG, int selB, int selA = 255){ + fgColor.setSelectedColor(selR, selG, selB, selA); + } + + //------------------------------------------- + virtual void setBackgroundColor( int norR, int norG, int norB, int norA = 255){ + bgColor.setColor(norR, norG, norB, norA); + } + + //------------------------------------------- + virtual void setBackgroundSelectColor(int selR, int selG, int selB, int selA = 255){ + bgColor.setSelectedColor(selR, selG, selB, selA); + } + + //------------------------------------------- + virtual void setOutlineColor( int norR, int norG, int norB, int norA = 255){ + outlineColor.setColor(norR, norG, norB, norA); + } + + //------------------------------------------- + virtual void setOutlineSelectColor(int selR, int selG, int selB, int selA = 255){ + outlineColor.setSelectedColor(selR, selG, selB, selA); + } + + //------------------------------------------- + virtual void setTextColor( int norR, int norG, int norB, int norA = 255){ + textColor.setColor(norR, norG, norB, norA); + } + + //------------------------------------------- + virtual void setTextSelectColor(int selR, int selG, int selB, int selA = 255){ + textColor.setSelectedColor(selR, selG, selB, selA); + } + + virtual void setValue(float _value, int whichParam) { + value.setValue(_value,whichParam); + } + + virtual void updateValue() { + + } + + //list of properties + //------------------ + string name; + string drawStr; + string xmlName; + + ofRectangle boundingBox; + ofRectangle hitArea; + + guiColor fgColor; + guiColor bgColor; + guiColor outlineColor; + guiColor textColor; + + int numDecimalPlaces; + + //------------------ + guiTextBase displayText; + + //------------------- + vector children; + + ofEvent guiEvent; + + //bool isRelative; + bool locked; + + float storedTextWidth; + float titleSpacing; + float fontSize; + bool bShowText; + bool readOnly; + int state; + int dataType; + +//protected: + + guiValue value; + +}; + diff --git a/src/ofxControlPanel/guiCallback.cpp b/src/ofxControlPanel/guiCallback.cpp new file mode 100644 index 0000000..0c7a33d --- /dev/null +++ b/src/ofxControlPanel/guiCallback.cpp @@ -0,0 +1,11 @@ +/* + * guiCallback.cpp + * ofxControlPanelDemo + * + * Created by theo on 31/03/2010. + * Copyright 2010 __MyCompanyName__. All rights reserved. + * + */ + +#include "guiCallback.h" + diff --git a/src/ofxControlPanel/guiCallback.h b/src/ofxControlPanel/guiCallback.h new file mode 100644 index 0000000..a8c0874 --- /dev/null +++ b/src/ofxControlPanel/guiCallback.h @@ -0,0 +1,20 @@ +/* + * guiCallback.h + * ofxControlPanelDemo + * + * Created by theo on 31/03/2010. + * Copyright 2010 __MyCompanyName__. All rights reserved. + * + */ + +#pragma once +#include "ofMain.h" +#include "guiCallbackValue.h" + +class guiCustomEvent{ + public: + vector names; + string group; + + ofEvent guiEvent; +}; \ No newline at end of file diff --git a/src/ofxControlPanel/guiCallbackValue.cpp b/src/ofxControlPanel/guiCallbackValue.cpp new file mode 100644 index 0000000..ed3394a --- /dev/null +++ b/src/ofxControlPanel/guiCallbackValue.cpp @@ -0,0 +1,11 @@ +/* + * guiCallbackValue.cpp + * ofxControlPanelDemo + * + * Created by theo on 31/03/2010. + * Copyright 2010 __MyCompanyName__. All rights reserved. + * + */ + +#include "guiCallbackValue.h" + diff --git a/src/ofxControlPanel/guiCallbackValue.h b/src/ofxControlPanel/guiCallbackValue.h new file mode 100644 index 0000000..3997682 --- /dev/null +++ b/src/ofxControlPanel/guiCallbackValue.h @@ -0,0 +1,71 @@ +/* + * guiCallbackValue.h + * ofxControlPanelDemo + * + * Created by theo on 31/03/2010. + * Copyright 2010 __MyCompanyName__. All rights reserved. + * + */ + +#pragma once + +#include "ofMain.h" + +class guiCallbackData{ + public: + + string elementName; + string groupName; + + void setup(string groupNameIn, string elementNameIn = ""){ + groupName = groupNameIn; + elementName = elementNameIn; + } + + void addFloat(float val){ + fVal.push_back(val); + } + + void addInt(int val){ + iVal.push_back(val); + } + + void addString(string val){ + sVal.push_back(val); + } + + float getFloat(int which){ + if( which < fVal.size() ){ + return fVal[which]; + }else{ + return 0.0; + } + } + + float getInt(unsigned int which){ + if( which < iVal.size() ){ + return iVal[which]; + }else{ + return 0; + } + } + + string getString(int which){ + if( which < sVal.size() ){ + return sVal[which]; + }else{ + return ""; + } + } + + vector sVal; + vector fVal; + vector iVal; +}; + + +class guiCallbackValue{ + public: + guiCallbackData val; +}; + diff --git a/src/ofxControlPanel/guiColor.cpp b/src/ofxControlPanel/guiColor.cpp new file mode 100755 index 0000000..9d56521 --- /dev/null +++ b/src/ofxControlPanel/guiColor.cpp @@ -0,0 +1,71 @@ +#include "guiColor.h" + +//------------------------------------------------ +guiColor::guiColor(){ + bUseSelected = false; + bUseDisabled = false; + colorMode = 0; +} + +//------------------------------------------------ +void guiColor::setColor(int r, int g, int b, int a){ + color.setColor(r, g, b, a); +} + +//------------------------------------------------ +void guiColor::setColor(int hexValue){ + color.setColor(hexValue); +} + +//------------------------------------------------ +void guiColor::setSelectedColor(int r, int g, int b, int a){ + selected.setColor(r, g, b, a); + bUseSelected = true; +} + +//------------------------------------------------ +void guiColor::setSelectedColor(int hexValue){ + selected.setColor(hexValue); + bUseSelected = true; +} + +//------------------------------------------------ +void guiColor::setDisabledColor(int r, int g, int b, int a){ + disabled.setColor(r, g, b, a); + bUseDisabled = true; +} + +//------------------------------------------------ +void guiColor::setDisabledColor(int hexValue){ + disabled.setColor(hexValue); + bUseDisabled = true; +} + +//------------------------------------------------ +void guiColor::setGuiColorMode(int whichColor){ + colorMode = whichColor; +} + +//---------------------------------------------------------- +simpleColor& guiColor::getColor(){ + if( colorMode == 1 && bUseSelected) return selected.getColor(); + else if( colorMode == 2 && bUseDisabled ) return disabled.getColor(); + else return color.getColor(); +} + +//---------------------------------------------------------- +float* guiColor::getColorF(){ + if( colorMode == 1 && bUseSelected) return selected.getColorF(); + else if( colorMode == 2 && bUseDisabled) return disabled.getColorF(); + else return color.getColorF(); +} + +//---------------------------------------------------------- +float* guiColor::getSelectedColorF(){ + return selected.getColorF(); +} + +//---------------------------------------------------------- +float* guiColor::getNormalColorF(){ + return color.getColorF(); +} diff --git a/src/ofxControlPanel/guiColor.h b/src/ofxControlPanel/guiColor.h new file mode 100755 index 0000000..7ed58f1 --- /dev/null +++ b/src/ofxControlPanel/guiColor.h @@ -0,0 +1,36 @@ +#pragma once + +#include "simpleColor.h" + +class guiColor{ + + public: + + //------------------------------------------------ + guiColor(); + void setColor(int r, int g, int b, int a); + void setColor(int hexValue); + void setSelectedColor(int r, int g, int b, int a); + void setSelectedColor(int hexValue); + void setDisabledColor(int r, int g, int b, int a); + void setDisabledColor(int hexValue); + void setGuiColorMode(int whichColor); + + simpleColor& getColor(); + + float* getColorF(); + float* getSelectedColorF(); + float* getNormalColorF(); + + //--------------- + //--------------- + simpleColor color; + simpleColor selected; + simpleColor disabled; + + int colorMode; + bool bUseDisabled; + bool bUseSelected; + +}; + diff --git a/src/ofxControlPanel/guiCustomImpl.h b/src/ofxControlPanel/guiCustomImpl.h new file mode 100755 index 0000000..976d214 --- /dev/null +++ b/src/ofxControlPanel/guiCustomImpl.h @@ -0,0 +1,30 @@ +#pragma once + +class guiCustomImpl{ + + public: + + guiCustomImpl(){ + mouseIsRelative = false; + } + + virtual ~guiCustomImpl(){ + + } + + virtual void saveSettings(string filename){} + virtual void reloadSettings(){} + virtual void saveSettings(){} + virtual void loadSettings(string filename){} + + virtual void update(){} + virtual void draw(float x, float y, float w, float h){} + + virtual void mousePressed(float x, float y){} + virtual void mouseDragged(float x, float y){} + virtual void mouseReleased(){} + + bool mouseIsRelative; + + ofRectangle boundingRect; +}; diff --git a/src/ofxControlPanel/guiIncludes.h b/src/ofxControlPanel/guiIncludes.h new file mode 100755 index 0000000..6b05078 --- /dev/null +++ b/src/ofxControlPanel/guiIncludes.h @@ -0,0 +1,25 @@ + +//fundementals +#include "guiValue.h" +#include "guiBaseObject.h" +#include "guiColor.h" +#include "simpleColor.h" +#include "guiValue.h" + +//interface +#include "guiTypePanel.h" + +//elements +#include "guiTypeText.h" +#include "guiTypeToggle.h" +#include "guiTypeMultiToggle.h" +#include "guiTypeSlider.h" +#include "guiType2DSlider.h" +#include "guiTypeDrawable.h" +#include "guiTypeButtonSlider.h" +#include "guiTypeTextDropDown.h" +#include "guiTypeCustom.h" +#include "guiCustomImpl.h" +#include "guiTypeVideo.h" + + diff --git a/src/ofxControlPanel/guiTextBase.cpp b/src/ofxControlPanel/guiTextBase.cpp new file mode 100755 index 0000000..322f8bc --- /dev/null +++ b/src/ofxControlPanel/guiTextBase.cpp @@ -0,0 +1,112 @@ +#include "guiTextBase.h" + +//------------------------------------------- +guiTextBase::guiTextBase(){ + textString = ""; + bRealFont = false; + fontSize = 13; + numNewLines = 0; + ourFont = NULL; +} + +//we should also have an option to load a font once +//then just pass a reference to the ofTTF font object +//-------------------------------------------- + void guiTextBase::setFont(ofTrueTypeFont * fontPtr){ + if( fontPtr != NULL && fontPtr->bLoadedOk ){ + ourFont = fontPtr; + bRealFont = true; + }else bRealFont = false; +} + +//-------------------------------------------- + float guiTextBase::getTextWidth(){ + float textWidth = 0; + + if(bRealFont)textWidth = ourFont->stringWidth(textString); + else textWidth = 0.615 * (float)fontSize * textString.size() ; + + return textWidth; +} + +//-------------------------------------------- + float guiTextBase::getTextHeight(){ + float textHeight = 0; + + if(bRealFont) + textHeight = ourFont->stringHeight(textString); + else + textHeight = fontSize + fontSize * numNewLines; + + return textHeight; +} + +//-------------------------------------------- + float guiTextBase::getTextSingleLineHeight(){ + float textHeight = 0; + + if(bRealFont) + textHeight = ourFont->stringHeight("A"); + else + textHeight = fontSize; + + return textHeight; +} + +//------------------------------------------- + void guiTextBase::setText(string textStr){ + textString = textStr; + + numNewLines = 0; + for(unsigned int i = 0; i < textString.size(); i++){ + if( textString[i] == '\n' )numNewLines++; + } + +} + +//-------------------------------------------- + void guiTextBase::renderText(float x, float y){ + + if(bRealFont){ + ourFont->drawString(textString, x, y); + } + else { + ofDrawBitmapString(textString, x, y); + } +} + +//-------------------------------------------- + void guiTextBase::renderString(string textToRender, float x, float y){ + + if(bRealFont){ + ourFont->drawString(textToRender, x, y); + } + else ofDrawBitmapString(textToRender, x, y); +} + +//-------------------------------------------- + float guiTextBase::stringHeight(string textToRender){ + float textHeight = 0; + + if(bRealFont)textHeight = ourFont->stringHeight(textToRender); + else{ + int numLines = 0; + for(unsigned int i = 0; i < textToRender.size(); i++){ + if( textToRender[i] == '\n' )numLines++; + } + textHeight = fontSize + fontSize * numLines; + } + return textHeight; +} + +//-------------------------------------------- + float guiTextBase::stringWidth(string textToRender){ + + float textWidth = 0; + + if(bRealFont)textWidth = ourFont->stringWidth(textToRender); + else textWidth = 0.615 * (float)fontSize * textToRender.size() ; + + return textWidth; +} + diff --git a/src/ofxControlPanel/guiTextBase.h b/src/ofxControlPanel/guiTextBase.h new file mode 100755 index 0000000..59fef81 --- /dev/null +++ b/src/ofxControlPanel/guiTextBase.h @@ -0,0 +1,36 @@ +#pragma once + +#include "guiColor.h" +#include "simpleColor.h" +#include "guiValue.h" + +class guiTextBase{ + + public: + + //------------------------------------------- + guiTextBase(); + virtual void setFont(ofTrueTypeFont * fontPtr); + + virtual float getTextWidth(); + virtual float getTextHeight(); + virtual float getTextSingleLineHeight(); + + virtual void setText(string textStr); + + virtual void renderText(float x, float y); + virtual void renderString(string textToRender, float x, float y); + + virtual float stringHeight(string textToRender); + virtual float stringWidth(string textToRender); + + //-------------------------------------------- + ofTrueTypeFont * ourFont; + + string textString; + + int numNewLines; + int fontSize; + bool bRealFont; + bool bShowText; +}; diff --git a/src/ofxControlPanel/guiType2DSlider.cpp b/src/ofxControlPanel/guiType2DSlider.cpp new file mode 100755 index 0000000..047c9e3 --- /dev/null +++ b/src/ofxControlPanel/guiType2DSlider.cpp @@ -0,0 +1,90 @@ +#include "guiType2DSlider.h" + +//------------------------------------------------ +guiType2DSlider::guiType2DSlider(){ + knobSize = 6.0; +} + +//------------------------------------------------ +void guiType2DSlider::setup(string sliderName, float defaultVal1, float min1, float max1, float defaultVal2, float min2, float max2){ + value.addValue(defaultVal1, min1, max1); + value.addValue(defaultVal2, min2, max2); + name = sliderName; + updateText(); +} + +//-----------------------------------------------. +void guiType2DSlider::updateGui(float x, float y, bool firstHit, bool isRelative){ + if( state == SG_STATE_SELECTED){ + float pct1 = ( x - ( hitArea.x ) ) / hitArea.width; + value.setValueAsPct( pct1, 0); + float pct2 = ( y - ( hitArea.y ) ) / hitArea.height; + value.setValueAsPct( pct2, 1); + updateText(); + //CB + notify(); + } +} + +//----------------------------------------------- +void guiType2DSlider::notify(){ + guiCallbackData cbVal; + cbVal.setup(xmlName); + cbVal.addFloat(value.getValueF(0)); + cbVal.addFloat(value.getValueF(1)); + ofNotifyEvent(guiEvent,cbVal,this); +} + +//----------------------------------------------- +void guiType2DSlider::setKnobSize(float _knobSize){ + knobSize = _knobSize; +} + +//----------------------------------------------- +void guiType2DSlider::setValue(float _value, int whichParam) { + value.setValue(_value, whichParam); +} + +//-----------------------------------------------. +void guiType2DSlider::updateValue(){ + //CB + notify(); +} + +//-----------------------------------------------. +void guiType2DSlider::render(){ + ofPushStyle(); + + glPushMatrix(); + //glTranslatef(boundingBox.x, boundingBox.y, 0); + guiBaseObject::renderText(); + + //draw the background + ofFill(); + glColor4fv(bgColor.getColorF()); + ofRect(hitArea.x, hitArea.y, hitArea.width, hitArea.height); + + //draw the foreground + + float boxWidth = knobSize; + float boxHeight = knobSize; + + float bx = hitArea.x + (boxWidth * 0.5) + ( value.getPct(0) * (hitArea.width - (boxWidth)) ); + float by = hitArea.y + (boxHeight * 0.5) + ( value.getPct(1) * (hitArea.height - (boxHeight)) ); + + glColor4fv(fgColor.getColorF()); + + ofSetRectMode(OF_RECTMODE_CENTER); + ofRect(bx, by, boxWidth, boxHeight); + ofSetRectMode(OF_RECTMODE_CORNER); + + //draw the outline + ofNoFill(); + glColor4fv(outlineColor.getColorF()); + ofRect(hitArea.x, hitArea.y, hitArea.width, hitArea.height); + + glPopMatrix(); + + ofPopStyle(); +} + diff --git a/src/ofxControlPanel/guiType2DSlider.h b/src/ofxControlPanel/guiType2DSlider.h new file mode 100755 index 0000000..b33df7a --- /dev/null +++ b/src/ofxControlPanel/guiType2DSlider.h @@ -0,0 +1,28 @@ +#pragma once + +#include "guiBaseObject.h" +#include "guiColor.h" +#include "simpleColor.h" +#include "guiValue.h" + +class guiType2DSlider : public guiBaseObject{ + + public: + + guiType2DSlider(); + + void setup(string sliderName, float defaultVal1, float min1, float max1, float defaultVal2, float min2, float max2); + + void updateGui(float x, float y, bool firstHit, bool isRelative); + void setKnobSize(float _knobSize); + + virtual void setValue(float _value, int whichParam); + virtual void updateValue(); + + virtual void notify(); + + void render(); + + float knobSize; + +}; diff --git a/src/ofxControlPanel/guiTypeButtonSlider.cpp b/src/ofxControlPanel/guiTypeButtonSlider.cpp new file mode 100755 index 0000000..60fbff5 --- /dev/null +++ b/src/ofxControlPanel/guiTypeButtonSlider.cpp @@ -0,0 +1,261 @@ +#include "guiTypeButtonSlider.h" + +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- + +void guiTypePlusButton::render(){ + ofPushStyle(); + glPushMatrix(); + guiBaseObject::renderText(); + + //draw the background + ofFill(); + glColor4fv(bgColor.getColorF()); + ofRect(hitArea.x, hitArea.y, hitArea.width, hitArea.height); + + //draw the outline + ofNoFill(); + glColor4fv(outlineColor.getColorF()); + ofRect(hitArea.x, hitArea.y, hitArea.width, hitArea.height); + + if( value.getValueI() == 1){ + ofFill(); + }else{ + ofNoFill(); + } + + glColor4fv(fgColor.getColorF()); + ofSetLineWidth(1.0f); + ofLine(hitArea.x+hitArea.width/2.0f, hitArea.y, hitArea.x+hitArea.width/2.0f, hitArea.y + hitArea.height -1.0f); + ofLine(hitArea.x +1.0f, hitArea.y+hitArea.height/2.0f, hitArea.x+hitArea.width, hitArea.y + hitArea.height/2.0f); + + glPopMatrix(); + ofPopStyle(); +} + + +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- + +void guiTypeMinusButton::render(){ + ofPushStyle(); + glPushMatrix(); + guiBaseObject::renderText(); + + //draw the background + ofFill(); + glColor4fv(bgColor.getColorF()); + ofRect(hitArea.x, hitArea.y, hitArea.width, hitArea.height); + + //draw the outline + ofNoFill(); + glColor4fv(outlineColor.getColorF()); + ofRect(hitArea.x, hitArea.y, hitArea.width, hitArea.height); + + if( value.getValueI() == 1){ + ofFill(); + }else{ + ofNoFill(); + } + + glColor4fv(fgColor.getColorF()); + ofSetLineWidth(1.0f); + ofLine(hitArea.x +1.0f, hitArea.y+hitArea.height/2.0f, hitArea.x+hitArea.width, hitArea.y + hitArea.height/2.0f); + + glPopMatrix(); + ofPopStyle(); +} + +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- + +guiTypeButtonSlider::guiTypeButtonSlider(){ + slider = NULL; + leftButton = NULL; + rightButton = NULL; + bgColor.setSelectedColor(255, 255, 255, 255); + bgColor.setColor(255, 255, 255, 255); +} + +guiTypeButtonSlider::~guiTypeButtonSlider() { + if(slider != NULL) { + delete slider; + } + if(leftButton != NULL){ + delete leftButton; + } + if(rightButton != NULL){ + delete rightButton; + } +} + +//------------------------------------------------ +void guiTypeButtonSlider::setup(string buttonSliderName, float panelWidth, float panelHeight, float defaultVal, float min, float max, bool isInt){ + + /* slider setup */ + slider = new guiTypeSlider(); + slider->setup(buttonSliderName, defaultVal, min, max); + value.addValue(defaultVal, min, max); + + slider->setDimensions(180, 10); + if(isInt){ + slider->setTypeInt(); + }else{ + slider->setTypeFloat(); + } + slider->setFont(displayText.ourFont); + + /* left button setup */ + leftButton = new guiTypeMinusButton(); + leftButton->setup(buttonSliderName+string("1"), false); + leftButton->setDimensions(10, 10); + leftButton->setTypeBool(); + leftButton->setShowText(false); + + /* right button setup */ + rightButton = new guiTypePlusButton(); + rightButton->setup(buttonSliderName+string("2"), false); + rightButton->setDimensions(10, 10); + rightButton->setTypeBool(); + rightButton->setShowText(false); + + name = buttonSliderName; + + setDimensions(panelWidth, panelHeight); + +} + +//----------------------------------------------- +void guiTypeButtonSlider::saveSettings(){ + +} + +//----------------------------------------------- +void guiTypeButtonSlider::saveSettings(string filename){ + +} + +//----------------------------------------------- +void guiTypeButtonSlider::loadSettings(string filename){ + +} + +//----------------------------------------------- +void guiTypeButtonSlider::reloadSettings(){ + +} + +//----------------------------------------------- +void guiTypeButtonSlider::setValue(float _value, int whichParam) { + slider->value.setValue(_value, whichParam); +} + +//----------------------------------------------- +void guiTypeButtonSlider::updateValue() { + + //CB +} + + +//----------------------------------------------- +void guiTypeButtonSlider::update(){ + updateText(); + slider->setShowText(true); + + slider->setPosition(boundingBox.x + 15, boundingBox.y ); + leftButton->setPosition(boundingBox.x,boundingBox.y + slider->displayText.getTextHeight() + leftButton->titleSpacing); + rightButton->setPosition(boundingBox.x + boundingBox.width - rightButton->getWidth(),boundingBox.y + slider->displayText.getTextHeight() + leftButton->titleSpacing); + + slider->update(); + leftButton->update(); + rightButton->update(); + + timeNow = ofGetElapsedTimef(); + if( (timeNow-timeThen) > 0.1f) { + if((leftButton->state == SG_STATE_SELECTED)||(rightButton->state == SG_STATE_SELECTED)) + updateGui(prevMouse.x, prevMouse.y, true, false ); + timeThen = timeNow; + } +} + +//-----------------------------------------------. +void guiTypeButtonSlider::updateGui(float x, float y, bool firstHit, bool isRelative){ + + + if(state != SG_STATE_SELECTED)return; + + if(this->readOnly) return; + + if( isInsideRect(x, y, slider->hitArea)) + { + slider->state = SG_STATE_SELECTED; + slider->setSelected(); + slider->updateGui(x,y,firstHit,isRelative); + prevMouse.set(x, y); + } + else + if ((slider->state == SG_STATE_SELECTED) && (!firstHit&&isRelative)) + { + slider->updateGui(x,y,firstHit,isRelative); + } + + if( isInsideRect(x, y, leftButton->hitArea) ){ + if(!firstHit) return; + leftButton->state = SG_STATE_SELECTED; + leftButton->setSelected(); + leftButton->updateGui(x,y,firstHit,isRelative); + slider->setSelected(); + + float pct = slider->value.getPct(); + pct = pct - INCREMENT; + slider->value.setValueAsPct( pct ); + prevMouse.set(x, y); + timeThen = timeNow; + } + if( isInsideRect(x, y, rightButton->hitArea) ){ + if(!firstHit) return; + leftButton->state = SG_STATE_SELECTED; + rightButton->setSelected(); + rightButton->updateGui(x,y,firstHit,isRelative); + slider->setSelected(); + + float pct = slider->value.getPct(); + pct = pct + INCREMENT; + slider->value.setValueAsPct( pct ); + prevMouse.set(x, y); + timeThen = timeNow; + } + + value.setValue(slider->value.getValueF()); // for xml settings saving + //CB + notify(); +} + +//should be called on mouse up +//------------------------------------------- +void guiTypeButtonSlider::release(){ + state = SG_STATE_NORMAL; + setNormal(); + + slider->state = SG_STATE_NORMAL; + slider->setNormal(); + leftButton->state = SG_STATE_NORMAL; + leftButton->setNormal(); + leftButtonOn = false; + rightButton->state = SG_STATE_NORMAL; + rightButton->setNormal(); + } + +//-----------------------------------------------. +void guiTypeButtonSlider::render(){ + + ofPushStyle(); + glPushMatrix(); + + slider->render(); + leftButton->render(); + rightButton->render(); + + glPopMatrix(); + ofPopStyle(); +} diff --git a/src/ofxControlPanel/guiTypeButtonSlider.h b/src/ofxControlPanel/guiTypeButtonSlider.h new file mode 100755 index 0000000..0de0413 --- /dev/null +++ b/src/ofxControlPanel/guiTypeButtonSlider.h @@ -0,0 +1,64 @@ +#pragma once + + +#include "guiBaseObject.h" +#include "guiColor.h" +#include "simpleColor.h" +#include "guiValue.h" +#include "guiTypeToggle.h" +#include "guiTypeSlider.h" + +#define INCREMENT 0.005f + +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +class guiTypePlusButton : public guiTypeToggle{ + public: + void render(); +}; + +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- + +class guiTypeMinusButton : public guiTypeToggle{ + public: + void render(); +}; + +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +class guiTypeButtonSlider : public guiBaseObject{ + + + public: + + guiTypeButtonSlider(); + + ~guiTypeButtonSlider(); + + //------------------------------------------------ + void setup(string buttonSliderName, float panelWidth, float panelHeight, float defaultVal, float min, float max, bool isInt); + + //----------------------------------------------- + virtual void saveSettings(); + virtual void saveSettings(string filename); + virtual void loadSettings(string filename); + virtual void reloadSettings(); + + virtual void setValue(float _value, int whichParam); + virtual void updateValue(); + + virtual void update(); + void updateGui(float x, float y, bool firstHit, bool isRelative); + virtual void release(); + void render(); + + guiTypeSlider* slider; + guiTypeMinusButton* leftButton; + guiTypePlusButton* rightButton; + ofPoint prevMouse; + bool leftButtonOn; + + float timeNow, timeThen; + +}; diff --git a/src/ofxControlPanel/guiTypeCustom.cpp b/src/ofxControlPanel/guiTypeCustom.cpp new file mode 100755 index 0000000..8efb84b --- /dev/null +++ b/src/ofxControlPanel/guiTypeCustom.cpp @@ -0,0 +1,94 @@ +#include "guiTypeCustom.h" + +//------------------------------------------------ +guiTypeCustom::guiTypeCustom(){ + custom = NULL; + bgColor.setSelectedColor(0, 0, 0, 255); + bgColor.setColor(0, 0, 0, 255); +} + +//------------------------------------------------ +void guiTypeCustom::setup(string customName, guiCustomImpl * customIn, float panelWidth, float panelHeight){ + custom = customIn; + name = customName; + updateText(); + + setDimensions(panelWidth, panelHeight); + if( custom != NULL )custom->boundingRect = hitArea; +} + +//----------------------------------------------- +void guiTypeCustom::saveSettings(){ + if( custom != NULL)custom->saveSettings(); +} + +//----------------------------------------------- +void guiTypeCustom::saveSettings(string filename){ + if( custom != NULL)custom->saveSettings(filename); +} + +//----------------------------------------------- +void guiTypeCustom::loadSettings(string filename){ + if( custom != NULL)custom->loadSettings(filename); +} + +//----------------------------------------------- +void guiTypeCustom::reloadSettings(){ + if( custom != NULL)custom->reloadSettings(); +} + +//----------------------------------------------- +void guiTypeCustom::update(){ + updateText(); + if( custom != NULL)custom->boundingRect = hitArea; + if( custom != NULL)custom->update(); +} + +//-----------------------------------------------. +void guiTypeCustom::updateGui(float x, float y, bool firstHit, bool isRelative){ + if( custom == NULL || state != SG_STATE_SELECTED)return; + + float realX = x - hitArea.x; + float realY = y - hitArea.y; + + custom->mouseIsRelative = isRelative; + + if(firstHit){ + custom->mousePressed(realX, realY); + }else{ + custom->mouseDragged(realX, realY); + } +} + +//should be called on mouse up +//------------------------------------------- +void guiTypeCustom::release(){ + if( custom == NULL)return; + + state = SG_STATE_NORMAL; + setNormal(); + custom->mouseReleased(); + } + +//-----------------------------------------------. +void guiTypeCustom::render(){ + + ofPushStyle(); + + glPushMatrix(); + guiBaseObject::renderText(); + + //draw the background + ofFill(); + glColor4fv(bgColor.getColorF()); + ofRect(hitArea.x, hitArea.y, hitArea.width, hitArea.height); + + ofDisableAlphaBlending(); + + ofSetColor(0xFFFFFF); + if( custom != NULL)custom->draw(hitArea.x, hitArea.y, hitArea.width, hitArea.height); + + glPopMatrix(); + + ofPopStyle(); +} diff --git a/src/ofxControlPanel/guiTypeCustom.h b/src/ofxControlPanel/guiTypeCustom.h new file mode 100755 index 0000000..f70b9b5 --- /dev/null +++ b/src/ofxControlPanel/guiTypeCustom.h @@ -0,0 +1,25 @@ +#pragma once + +#include "guiBaseObject.h" +#include "guiColor.h" +#include "simpleColor.h" +#include "guiValue.h" +#include "guiCustomImpl.h" + +class guiTypeCustom : public guiBaseObject{ + + public: + + guiTypeCustom(); + void setup(string customName, guiCustomImpl * customIn, float panelWidth, float panelHeight); + virtual void saveSettings(); + virtual void saveSettings(string filename); + virtual void loadSettings(string filename); + virtual void reloadSettings(); + virtual void update(); + void updateGui(float x, float y, bool firstHit, bool isRelative); + virtual void release(); + void render(); + + guiCustomImpl * custom; +}; diff --git a/src/ofxControlPanel/guiTypeDrawable.cpp b/src/ofxControlPanel/guiTypeDrawable.cpp new file mode 100755 index 0000000..d374759 --- /dev/null +++ b/src/ofxControlPanel/guiTypeDrawable.cpp @@ -0,0 +1,87 @@ +#include "guiTypeDrawable.h" + +//---------------------------------------------------------- +//---------------------------------------------------------- +void drawableStacker::addDrawer(ofBaseDraws * drawer){ + drawers.push_back(drawer); +} + +void drawableStacker::setWidth(float w){ + width = w; +} + +void drawableStacker::setHeight(float h){ + height = h; +} + +float drawableStacker::getWidth(){ + return width; +} + +float drawableStacker::getHeight(){ + return height; +} + +void drawableStacker::draw(float x, float y, float w, float h){ + ofSetColor(0xFFFFFF); + for(unsigned int i = 0; i < drawers.size(); i++){ + drawers[i]->draw(x, y, w, h); + } +} + +void drawableStacker::draw(float x, float y){ + ofSetColor(0xFFFFFF); + for(unsigned int i = 0; i < drawers.size(); i++){ + drawers[i]->draw(x, y, width, height); + } +} + + +//---------------------------------------------------------- +//---------------------------------------------------------- + +guiTypeDrawable::guiTypeDrawable(){ + vid = NULL; + bgColor.setSelectedColor(0, 0, 0, 255); + bgColor.setColor(0, 0, 0, 255); +} + +//------------------------------------------------ +void guiTypeDrawable::setup(string videoName, ofBaseDraws * vidIn, float videoWidth, float videoHeight){ + vid = vidIn; + name = videoName; + updateText(); + + setDimensions(videoWidth, videoHeight); + +} + +//-----------------------------------------------. +void guiTypeDrawable::updateGui(float x, float y, bool firstHit, bool isRelative){ + +} + +//-----------------------------------------------. +void guiTypeDrawable::render(){ + ofPushStyle(); + + glPushMatrix(); + //glTranslatef(boundingBox.x, boundingBox.y, 0); + guiBaseObject::renderText(); + + //draw the background + ofFill(); + glColor4fv(bgColor.getColorF()); + ofRect(hitArea.x, hitArea.y, hitArea.width, hitArea.height); + + ofDisableAlphaBlending(); + + ofSetColor(0xFFFFFF); + vid->draw(hitArea.x, hitArea.y, hitArea.width, hitArea.height); + + glPopMatrix(); + + ofPopStyle(); +} + + diff --git a/src/ofxControlPanel/guiTypeDrawable.h b/src/ofxControlPanel/guiTypeDrawable.h new file mode 100755 index 0000000..652f20f --- /dev/null +++ b/src/ofxControlPanel/guiTypeDrawable.h @@ -0,0 +1,46 @@ +#pragma once + +#include "guiBaseObject.h" +#include "guiColor.h" +#include "simpleColor.h" +#include "guiValue.h" + +//alows you to stack ofBaseDraw objects as layers on top of each other and then pass it to guiTypeDrawable::setup +//handy if you want to render drawing from one class ontop of a video of another class. + +class drawableStacker : public ofBaseDraws{ + public: + + void addDrawer(ofBaseDraws * drawer); + + void setWidth(float w); + + void setHeight(float h); + + float getWidth(); + + float getHeight(); + + void draw(float x, float y, float w, float h); + void draw(float x, float y); + + vector drawers; + float width; + float height; +}; + +//pass in any ofBaseDraws class ( videoPlayer, videoGrabber, image, or your own class ) +class guiTypeDrawable : public guiBaseObject{ + + public: + + guiTypeDrawable(); + + void setup(string videoName, ofBaseDraws * vidIn, float videoWidth, float videoHeight); + void updateGui(float x, float y, bool firstHit, bool isRelative); + + void render(); + + ofBaseDraws * vid; +}; + diff --git a/src/ofxControlPanel/guiTypeFileLister.cpp b/src/ofxControlPanel/guiTypeFileLister.cpp new file mode 100755 index 0000000..1b53b14 --- /dev/null +++ b/src/ofxControlPanel/guiTypeFileLister.cpp @@ -0,0 +1,153 @@ +#include "guiTypeFileLister.h" + + +//TODO: fix this! +static int lineSpacing = 18; +static int dblClickTime = 500; + +//TODO: fix bitmap type specific code + +//------------------------------------------------ +guiTypeFileLister::guiTypeFileLister(){ + lister = NULL; + pct = 0; + sliderWidth = 20; + selectPct = -1; + selection = -1; + selectionTmp = -1; + startPos = 0; + endPos = 0; + usingSlider = false; +} + +//------------------------------------------------ +void guiTypeFileLister::setup(string listerName, simpleFileLister * listerPtr , float listerWidth, float listerHeight){ + lister = listerPtr; + name = listerName; + updateText(); + + setDimensions(listerWidth, listerHeight); + outlineColor.selected = outlineColor.color; +} + +//----------------------------------------------- +void guiTypeFileLister::notify(){ + guiCallbackData cbVal; + cbVal.setup(xmlName); + cbVal.addString(lister->getSelectedPath()); + cbVal.addString(lister->getSelectedName()); + ofNotifyEvent(guiEvent,cbVal,this); +} + +//-----------------------------------------------. +void guiTypeFileLister::updateGui(float x, float y, bool firstHit, bool isRelative){ + if( firstHit && x < hitArea.x + sliderWidth){ + usingSlider = true; + } + + if( state == SG_STATE_SELECTED){ + if( usingSlider ){ + pct = ( y - ( hitArea.y ) ) / hitArea.height; + pct = ofClamp(pct, 0, 1); + }else if( x > hitArea.x + sliderWidth && firstHit){ + int numVisible = endPos - startPos; + + float ypos = y - hitArea.y; + selectPct = ( ypos ) / (float)(numVisible * lineSpacing); + selectPct = ofClamp(selectPct, 0, 1); + + int select = startPos + selectPct * (float)numVisible; + + if( select == selectionTmp && (ofGetElapsedTimeMillis() - lastClickTime) < dblClickTime ){ + selection = select; + lister->setSelectedFile(selection); + notify(); + } + + selectionTmp = select; + lastClickTime = ofGetElapsedTimeMillis(); + } + } +} + +//-----------------------------------------------. +void guiTypeFileLister::release(){ + guiBaseObject::release(); + usingSlider = false; +} + +//-----------------------------------------------. +void guiTypeFileLister::drawRecords(float x, float y, float width, float height){ + if( lister == NULL)return; + if( lister->entries.size() == 0)return; + + ofPushStyle(); + float yPos = lineSpacing; + startPos = (float)(lister->entries.size()-1) * (pct); + endPos = 0; + + int numCanFit = (height / lineSpacing)- 1; + endPos = startPos + numCanFit; + endPos = MIN(lister->entries.size(), endPos); + + for(int i = startPos; i < endPos; i++){ + + string str = lister->entries[i].filename; + if( str.length() * 8 > width ){ + int newLen = (float)width / 8; + //newLen = ofClamp(newLen, 1, 999999); + str = str.substr(0, newLen); + } + + if( i == selection ){ + ofPushStyle(); + ofFill(); + glColor4fv( fgColor.getSelectedColorF() ); + ofRect(x, y+yPos+4, width-5, -lineSpacing); + ofPopStyle(); + }else if( i == selectionTmp){ + ofPushStyle(); + ofNoFill(); + glColor4fv(outlineColor.getColorF()); + ofRect(x, y+yPos+4, width-2, -lineSpacing); + ofPopStyle(); + } + + glColor4fv(textColor.getColorF()); + + displayText.renderString(str, x, y + yPos); + yPos += lineSpacing; + //if(yPos+lineSpacing >= height)break; + } + ofPopStyle(); +} + +//-----------------------------------------------. +void guiTypeFileLister::render(){ + ofPushStyle(); + + glPushMatrix(); + //draw the background + ofFill(); + glColor4fv(bgColor.getColorF()); + ofRect(boundingBox.x, boundingBox.y, boundingBox.width, boundingBox.height); + + glColor4fv(textColor.getColorF()); + guiBaseObject::renderText(); + + ofFill(); + glColor4fv(fgColor.getColorF()); + ofRect(hitArea.x, hitArea.y + (hitArea.height - 5) * pct, sliderWidth, 5); + + ofNoFill(); + glColor4fv(outlineColor.getColorF()); + ofRect(boundingBox.x, boundingBox.y, boundingBox.width, boundingBox.height); + ofRect(hitArea.x , hitArea.y, sliderWidth, hitArea.height); + + glColor4fv(textColor.getColorF()); + if(lister != NULL)drawRecords(hitArea.x+sliderWidth + 5, hitArea.y, boundingBox.width-(sliderWidth + 5), boundingBox.height); + + glPopMatrix(); + + ofPopStyle(); +} diff --git a/src/ofxControlPanel/guiTypeFileLister.h b/src/ofxControlPanel/guiTypeFileLister.h new file mode 100755 index 0000000..027e88e --- /dev/null +++ b/src/ofxControlPanel/guiTypeFileLister.h @@ -0,0 +1,32 @@ +#pragma once + +#include "guiBaseObject.h" +#include "guiColor.h" +#include "simpleColor.h" +#include "guiValue.h" +#include "simpleFileLister.h" + +class guiTypeFileLister : public guiBaseObject{ + + public: + + guiTypeFileLister(); + void setup(string listerName, simpleFileLister * listerPtr , float listerWidth, float listerHeight); + + void updateGui(float x, float y, bool firstHit, bool isRelative); + void release(); + void drawRecords(float x, float y, float width, float height); + void render(); + + void notify(); + + int selection; + int selectionTmp; + long lastClickTime; + bool usingSlider; + float sliderWidth; + float selectPct; + float pct; + int startPos, endPos; + simpleFileLister * lister; +}; diff --git a/src/ofxControlPanel/guiTypeLogger.cpp b/src/ofxControlPanel/guiTypeLogger.cpp new file mode 100755 index 0000000..336e8fd --- /dev/null +++ b/src/ofxControlPanel/guiTypeLogger.cpp @@ -0,0 +1,79 @@ +#include "guiTypeLogger.h" + +guiTypeLogger::guiTypeLogger(){ + log = NULL; + pct = 0; +} + +//------------------------------------------------ +void guiTypeLogger::setup(string loggerName, simpleLogger * logger, float loggerWidth, float loggerHeight){ + log = logger; + name = loggerName; + updateText(); + + setDimensions(loggerWidth, loggerHeight); + hitArea.width = 20; + outlineColor.selected = outlineColor.color; +} + +//-----------------------------------------------. +void guiTypeLogger::updateGui(float x, float y, bool firstHit, bool isRelative){ + if( state == SG_STATE_SELECTED){ + pct = ( y - ( hitArea.y ) ) / hitArea.height; + pct = ofClamp(pct, 0, 1); + } +} + +//-----------------------------------------------. +void guiTypeLogger::drawRecords(float x, float y, float width, float height){ + if( log == NULL)return; + if( log->logs.size() == 0)return; + + ofPushStyle(); + float yPos = 13; + int startPos = (float)(log->logs.size()-1) * (1.0-pct); + for(int i = startPos; i >= 0; i--){ + string str = log->logs[i].logStr; + if( str.length() * 8> width ){ + int newLen = (float)width / 8; + //newLen = ofClamp(newLen, 1, 999999); + str = str.substr(0, newLen); + } + + displayText.renderString(str, x, y + yPos); + + yPos += 13.6; + if(yPos +14 >= height)break; + } + ofPopStyle(); +} + +//-----------------------------------------------. +void guiTypeLogger::render(){ + ofPushStyle(); + + glPushMatrix(); + //draw the background + ofFill(); + glColor4fv(bgColor.getColorF()); + ofRect(boundingBox.x, boundingBox.y, boundingBox.width, boundingBox.height); + + glColor4fv(textColor.getColorF()); + guiBaseObject::renderText(); + + ofFill(); + glColor4fv(fgColor.getColorF()); + ofRect(hitArea.x, hitArea.y + (hitArea.height - 5) * pct, hitArea.width, 5); + + ofNoFill(); + glColor4fv(outlineColor.getColorF()); + ofRect(boundingBox.x, boundingBox.y, boundingBox.width, boundingBox.height); + ofRect(hitArea.x , hitArea.y, hitArea.width, hitArea.height); + + glColor4fv(textColor.getColorF()); + if(log != NULL)drawRecords(hitArea.x+hitArea.width + 5, hitArea.y, boundingBox.width-(hitArea.width + 5), boundingBox.height); + + glPopMatrix(); + + ofPopStyle(); +} diff --git a/src/ofxControlPanel/guiTypeLogger.h b/src/ofxControlPanel/guiTypeLogger.h new file mode 100755 index 0000000..78cd30b --- /dev/null +++ b/src/ofxControlPanel/guiTypeLogger.h @@ -0,0 +1,21 @@ +#pragma once + +#include "guiBaseObject.h" +#include "guiColor.h" +#include "simpleColor.h" +#include "guiValue.h" +#include "simpleLogger.h" + +class guiTypeLogger : public guiBaseObject{ + + public: + + guiTypeLogger(); + void setup(string loggerName, simpleLogger * logger, float loggerWidth, float loggerHeight); + void updateGui(float x, float y, bool firstHit, bool isRelative); + void drawRecords(float x, float y, float width, float height); + void render(); + + float pct; + simpleLogger * log; +}; diff --git a/src/ofxControlPanel/guiTypeMultiToggle.cpp b/src/ofxControlPanel/guiTypeMultiToggle.cpp new file mode 100755 index 0000000..c960a51 --- /dev/null +++ b/src/ofxControlPanel/guiTypeMultiToggle.cpp @@ -0,0 +1,88 @@ +#include "guiTypeMultiToggle.h" + +//------------------------------------------------ +void guiTypeMultiToggle::setup(string multiToggleName, int defaultBox, vector boxNames){ + bNames = boxNames; + value.addValue( (int)defaultBox, 0, bNames.size()-1); + name = multiToggleName; + + float lineHeight = 0; + for(unsigned int i = 0; i < bNames .size(); i++){ + float lineWidth = boxSpacing + boxSize + displayText.stringWidth(bNames[i]); + + if( lineWidth > hitArea.width ){ + hitArea.width += lineWidth-hitArea.width; + boundingBox.width += lineWidth-hitArea.width; + } + + lineHeight += displayText.stringHeight(bNames[i]); + } + + if(lineHeight > hitArea.height){ + hitArea.height += lineHeight-hitArea.height; + boundingBox.height += lineHeight-hitArea.height; + } + +} + +//----------------------------------------------- +virtual void guiTypeMultiToggle::updateValue(){ + //CB + notify(); +} + +//-----------------------------------------------. +void guiTypeMultiToggle::updateGui(float x, float y, bool firstHit, bool isRelative){ + if(!firstHit)return; + + if( state == SG_STATE_SELECTED){ + float relX = x - hitArea.x; + float relY = y - hitArea.y; + + for(unsigned int i = 0; i < bNames.size(); i++){ + ofRectangle tmpRect(0, i * (boxSize+boxSpacing), boxSize, boxSize); + if( isInsideRect(relX, relY, tmpRect) ){ + value.setValue(i, 0); + break; + } + } + + //CB + notify(); + } + +} + +//-----------------------------------------------. +void guiTypeMultiToggle::render(){ + ofPushStyle(); + guiBaseObject::renderText(); + + //draw the background + ofFill(); + glColor4fv(bgColor.getColorF()); + ofRect(hitArea.x, hitArea.y, hitArea.width, hitArea.height); + + for(unsigned int i = 0; i < bNames.size(); i++){ + float bx = hitArea.x + 0; + float by = hitArea.y + i * (boxSize+boxSpacing); + + if(value.getValueI() == i){ + ofFill(); + }else{ + ofNoFill(); + } + + glColor4fv(fgColor.getColorF()); + ofRect(bx, by, boxSize, boxSize); + + ofNoFill(); + glColor4fv(outlineColor.getColorF()); + ofRect(bx, by, boxSize, boxSize); + + glColor4fv(textColor.getColorF()); + displayText.renderString(bNames[i], bx + boxSize + boxSpacing, by + boxSize -2); + } + + ofPopStyle(); +} diff --git a/src/ofxControlPanel/guiTypeMultiToggle.h b/src/ofxControlPanel/guiTypeMultiToggle.h new file mode 100755 index 0000000..4a557bc --- /dev/null +++ b/src/ofxControlPanel/guiTypeMultiToggle.h @@ -0,0 +1,23 @@ +#pragma once + +#include "guiBaseObject.h" +#include "guiColor.h" +#include "simpleColor.h" +#include "guiValue.h" + +class guiTypeMultiToggle : public guiBaseObject{ + + public: + static const int boxSpacing = 2; + static const int boxSize = 14; + + //------------------------------------------------ + void setup(string multiToggleName, int defaultBox, vector boxNames); + + //----------------------------------------------- + virtual void updateValue(); + void updateGui(float x, float y, bool firstHit, bool isRelative); + void render(); + + vector bNames; +}; diff --git a/src/ofxControlPanel/guiTypePanel.cpp b/src/ofxControlPanel/guiTypePanel.cpp new file mode 100755 index 0000000..d823616 --- /dev/null +++ b/src/ofxControlPanel/guiTypePanel.cpp @@ -0,0 +1,233 @@ +#include "guiTypePanel.h" + +//------------------------------------------------ +guiTypePanel::guiTypePanel(){ + currentXPos = 20; + currentYPos = 20; + spacingAmntX = 16; + spacingAmntY = 16; + + columns.clear(); + columns.push_back(ofRectangle(20, 20, 30, 20)); + col = 0; +} + +//------------------------------------------------ +void guiTypePanel::setup(string panelName, float defaultX, float defaultY){ + name = panelName; + + columns[0] = ofRectangle(defaultX, defaultY, 50, 20); + + //we don't want our panel flashing when we click :) + bgColor.selected = bgColor.color; + outlineColor.selected = outlineColor.color; +} + +//----------------------------------------------- +void guiTypePanel::addColumn(float minWidth){ + float colX = columns.back().x + columns.back().width + spacingAmntX; + columns.push_back(ofRectangle(colX, 20, minWidth, 20)); +} + +//----------------------------------------------- +bool guiTypePanel::selectColumn(int which){ + col = ofClamp(which, 0, columns.size()-1); + return true; +} + +//----------------------------------------------- +void guiTypePanel::setElementSpacing(float spacingX, float spacingY){ + spacingAmntX = spacingX; + spacingAmntY = spacingY; +} + +//-----------------------------------------------. +bool guiTypePanel::checkHit(float x, float y, bool isRelative){ + if(readOnly)return false; + if( x >= hitArea.x && x <= hitArea.x + hitArea.width && y >= hitArea.y && y <= hitArea.y + hitArea.height){ + state = SG_STATE_SELECTED; + + float xx = x - boundingBox.x; + float yy = y - boundingBox.y; + + if( xx > lockRect.x && xx < lockRect.x + lockRect.width && yy > lockRect.y && yy < lockRect.y + lockRect.height ){ + locked = !locked; + } + + setSelected(); + updateGui(x, y, true, isRelative); + + if( !locked ){ + + float offsetX = x - hitArea.x; + float offsetY = y - hitArea.y; + + for(unsigned int i = 0; i < children.size(); i++){ + bool result = children[i]->checkHit(offsetX, offsetY, isRelative); + if(result) break; + } + } + return true; + } + return false; +} + +//-----------------------------------------------. +void guiTypePanel::updateGui(float x, float y, bool firstHit, bool isRelative){ + if( state == SG_STATE_SELECTED){ + + float offsetX = 0; + float offsetY = 0; + + if( isRelative ){ + offsetX = x; + offsetY = y; + }else{ + offsetX = x - hitArea.x; + offsetY = y - hitArea.y; + } + + if( !locked ){ + + for(unsigned int i = 0; i < children.size(); i++){ + children[i]->updateGui(offsetX, offsetY, firstHit, isRelative); + } + + } + } +} + +//we should actually be checking our child heights +//every frame to see if the panel needs to adjust layout +//for now we only check heights when elements are first added +//---------------------------------------------- +void guiTypePanel::update(){ + updateText(); + + lockRect.x = boundingBox.width - (LOCK_WIDTH + spacingAmntX + LOCK_BORDER); + lockRect.y = spacingAmntY - LOCK_BORDER; + lockRect.width = LOCK_WIDTH + LOCK_BORDER * 2; + lockRect.height = LOCK_HEIGHT + LOCK_BORDER * 2; + + for(unsigned int i = 0; i < children.size(); i++){ + children[i]->update(); + } + + for(unsigned int i = 0; i < whichColumn.size(); i++){ + if( children[i]->boundingBox.x != columns[whichColumn[i]].x ){ + float amntToShiftX = columns[whichColumn[i]].x - children[i]->boundingBox.x; + + children[i]->hitArea.x += amntToShiftX; + children[i]->boundingBox.x += amntToShiftX; + } + } +} + +//----------------------------------------------- +void guiTypePanel::addElement( guiBaseObject * element ){ + element->updateText(); + element->setPosition(columns[col].x, columns[col].y); + whichColumn.push_back(col); + + //add the element to the panel list + children.push_back( element ); + + //update the current position for the next element + columns[col].y += element->getHeight() + spacingAmntY; + + float checkWidth = element->getWidth(); + if(checkWidth >= columns[col].width ){ + float amnt = checkWidth - columns[col].width; + columns[col].width += amnt; + + for(unsigned int i = col+1; i < columns.size(); i++){ + columns[i].x += amnt; + } + } + + //see if we need to resize! + //checkResize(element); + +} + +//-----------------------------------------------. +void guiTypePanel::drawLocked(){ + ofPushMatrix(); + ofFill(); + ofTranslate(lockRect.x, lockRect.y, 0); + + ofSetColor(200, 0, 0); + ofRect(0, 0, lockRect.width, lockRect.height); + + ofTranslate(LOCK_BORDER, LOCK_BORDER, 0); + + ofSetColor(255, 255, 255); + ofEllipse(LOCK_WIDTH/2, LOCK_HEIGHT/2, LOCK_WIDTH * 0.8, LOCK_HEIGHT * 0.9); + + ofSetColor(200, 0, 0); + ofEllipse(LOCK_WIDTH/2, LOCK_HEIGHT/2, LOCK_WIDTH * 0.8 * 0.6, LOCK_HEIGHT * 0.9 * 0.6); + + ofSetColor(255, 255, 255); + ofRect(0, LOCK_HEIGHT/2, LOCK_WIDTH, LOCK_HEIGHT/2); + ofPopMatrix(); +} + +//-----------------------------------------------. +void guiTypePanel::drawUnlocked(){ + ofPushMatrix(); + ofFill(); + ofTranslate(lockRect.x, lockRect.y, 0); + + ofSetColor(0, 0, 0); + ofRect(0, 0, lockRect.width, lockRect.height); + + ofTranslate(LOCK_BORDER, LOCK_BORDER, 0); + ofSetColor(255, 255, 255); + ofEllipse(LOCK_WIDTH/2, LOCK_HEIGHT * 0.4, LOCK_WIDTH * 0.8, LOCK_HEIGHT * 0.9); + + ofSetColor(0, 0, 0); + ofEllipse(LOCK_WIDTH/2, LOCK_HEIGHT * 0.44, LOCK_WIDTH * 0.8 * 0.6, LOCK_HEIGHT * 0.9 * 0.6); + + ofSetColor(255, 255, 255); + ofRect(0, LOCK_HEIGHT/2, LOCK_WIDTH, LOCK_HEIGHT/2); + + ofSetColor(0, 0, 0); + ofRect(0, LOCK_HEIGHT * 0.5 - LOCK_HEIGHT * 0.25 , LOCK_WIDTH * 0.35, LOCK_HEIGHT * 0.25); + + ofPopMatrix(); +} + +//-----------------------------------------------. +void guiTypePanel::render(){ + ofPushStyle(); + + glPushMatrix(); + glTranslatef(boundingBox.x, boundingBox.y, 0); + //draw the background + ofFill(); + glColor4fv(bgColor.getColorF()); + ofRect(0, 0, boundingBox.width, boundingBox.height); + + //draw the outline + ofNoFill(); + glColor4fv(outlineColor.getColorF()); + ofRect(0, 0, boundingBox.width, boundingBox.height); + + if( locked ){ + drawLocked(); + }else{ + drawUnlocked(); + } + + glPopMatrix(); + renderText(); + + glPushMatrix(); + glTranslatef(hitArea.x, hitArea.y, 0); + for(unsigned int i = 0; i < children.size(); i++){ + children[i]->render(); + } + glPopMatrix(); + + ofPopStyle(); +} diff --git a/src/ofxControlPanel/guiTypePanel.h b/src/ofxControlPanel/guiTypePanel.h new file mode 100755 index 0000000..d9c5f41 --- /dev/null +++ b/src/ofxControlPanel/guiTypePanel.h @@ -0,0 +1,45 @@ +#pragma once + +#include "guiBaseObject.h" +#include "guiColor.h" +#include "simpleColor.h" +#include "guiValue.h" + +#define LOCK_WIDTH 10 +#define LOCK_HEIGHT 10 +#define LOCK_BORDER 3 + +class guiTypePanel : public guiBaseObject{ + + public: + + //------------------------------------------------ + guiTypePanel(); + + void setup(string panelName, float defaultX = 20, float defaultY = 20); + void addColumn(float minWidth); + + bool selectColumn(int which); + void setElementSpacing(float spacingX, float spacingY); + virtual bool checkHit(float x, float y, bool isRelative); + + void updateGui(float x, float y, bool firstHit, bool isRelative); + virtual void update(); + + void addElement( guiBaseObject * element ); + void drawLocked(); + void drawUnlocked(); + void render(); + + ofRectangle lockRect; + + float currentXPos; + float currentYPos; + float spacingAmntX; + float spacingAmntY; + + vector columns; + vector whichColumn; + int col; + +}; diff --git a/src/ofxControlPanel/guiTypeSlider.cpp b/src/ofxControlPanel/guiTypeSlider.cpp new file mode 100755 index 0000000..3809de8 --- /dev/null +++ b/src/ofxControlPanel/guiTypeSlider.cpp @@ -0,0 +1,50 @@ +#include "guiTypeSlider.h" + +//------------------------------------------------ +void guiTypeSlider::setup(string sliderName, float defaultVal, float min, float max){ + value.addValue(defaultVal, min, max); + name = sliderName; +} + +//----------------------------------------------- +void guiTypeSlider::updateValue(){ + notify(); +} + +//-----------------------------------------------. +void guiTypeSlider::updateGui(float x, float y, bool firstHit, bool isRelative){ + if( state == SG_STATE_SELECTED){ + if( !isRelative ){ + float pct = ( x - ( hitArea.x ) ) / hitArea.width; + value.setValueAsPct( pct ); + }else if( !firstHit ){ + float pct = value.getPct(); + pct += (x * 0.02) / hitArea.width; + value.setValueAsPct( pct ); + } + notify(); + } +} + +//-----------------------------------------------. +void guiTypeSlider::render(){ + ofPushStyle(); + glPushMatrix(); + guiBaseObject::renderText(); + + //draw the background + ofFill(); + glColor4fv(bgColor.getColorF()); + ofRect(hitArea.x, hitArea.y, hitArea.width, hitArea.height); + + //draw the foreground + glColor4fv(fgColor.getColorF()); + ofRect(hitArea.x, hitArea.y, hitArea.width * value.getPct(), hitArea.height); + + //draw the outline + ofNoFill(); + glColor4fv(outlineColor.getColorF()); + ofRect(hitArea.x, hitArea.y, hitArea.width, hitArea.height); + glPopMatrix(); + ofPopStyle(); +} diff --git a/src/ofxControlPanel/guiTypeSlider.h b/src/ofxControlPanel/guiTypeSlider.h new file mode 100755 index 0000000..7ee5b78 --- /dev/null +++ b/src/ofxControlPanel/guiTypeSlider.h @@ -0,0 +1,20 @@ +#pragma once + + +#include "guiBaseObject.h" +#include "guiColor.h" +#include "simpleColor.h" +#include "guiValue.h" + +class guiTypeSlider : public guiBaseObject{ + + public: + + //------------------------------------------------ + void setup(string sliderName, float defaultVal, float min, float max); + + virtual void updateValue(); + void updateGui(float x, float y, bool firstHit, bool isRelative = false); + void render(); + +}; diff --git a/src/ofxControlPanel/guiTypeText.cpp b/src/ofxControlPanel/guiTypeText.cpp new file mode 100755 index 0000000..e69de29 diff --git a/src/ofxControlPanel/guiTypeText.h b/src/ofxControlPanel/guiTypeText.h new file mode 100755 index 0000000..3b26e8f --- /dev/null +++ b/src/ofxControlPanel/guiTypeText.h @@ -0,0 +1,15 @@ +#pragma once + +#include "guiBaseObject.h" +#include "guiTypeText.h" +#include "guiColor.h" +#include "simpleColor.h" +#include "guiValue.h" + +class guiTypeText : public guiBaseObject, public guiTextBase{ + + public: + + + +}; diff --git a/src/ofxControlPanel/guiTypeTextDropDown.cpp b/src/ofxControlPanel/guiTypeTextDropDown.cpp new file mode 100755 index 0000000..eb5cefe --- /dev/null +++ b/src/ofxControlPanel/guiTypeTextDropDown.cpp @@ -0,0 +1,152 @@ +#include "guiTypeTextDropDown.h" + +static const int boxHeight = 15; + +//------------------------------------------------ +void guiTypeTextDropDown::setup(string dropDownName, int defaultBox, vector boxNames){ + vecDropList = boxNames; + value.addValue( (int)defaultBox, 0, vecDropList.size()-1); + name = dropDownName; + + hitArea.height = boundingBox.height = boxHeight; + + bShowDropDown = false; +} + +//----------------------------------------------- +void guiTypeTextDropDown::updateValue(){ + //CB + notify(); +} + +//-----------------------------------------------. +void guiTypeTextDropDown::update(){ + //setShowText(false); + updateText(); + if(bShowDropDown) { + hitArea.height = boundingBox.height = boxHeight * vecDropList.size(); + } else { + hitArea.height = boundingBox.height = boxHeight; + state = SG_STATE_NORMAL; + setNormal(); + } +} + +void guiTypeTextDropDown::release(){ + if(state != SG_STATE_SELECTED) { + bShowDropDown = false; + } + state = SG_STATE_NORMAL; + } + +//----------------------------------------------- +void guiTypeTextDropDown::notify(){ + guiCallbackData cbVal; + cbVal.setup(xmlName); + cbVal.addInt(value.getValueI()); + if( value.getValueI() < vecDropList.size() ){ + cbVal.addString(vecDropList[value.getValueI()]); + } + ofNotifyEvent(guiEvent,cbVal,this); +} + +//-----------------------------------------------. +void guiTypeTextDropDown::updateGui(float x, float y, bool firstHit, bool isRelative) { + if(!firstHit)return; + + if( state == SG_STATE_SELECTED){ + float relX = x - hitArea.x; + float relY = y - hitArea.y; + + if(bShowDropDown) { + for(unsigned int i = 0; i < vecDropList.size(); i++){ + ofRectangle tmpRect(0, i * (boxHeight), boundingBox.width, boxHeight); + if( isInsideRect(relX, relY, tmpRect) ){ + value.setValue(i, 0); + bShowDropDown = false; + //CB + notify(); + break; + } + } + } else { + ofRectangle tmpRect(0, 0, boundingBox.width, boxHeight); + if( isInsideRect(relX, relY, tmpRect) ){ + bShowDropDown = true; + } + } + } +} + +//-----------------------------------------------. +void guiTypeTextDropDown::render(){ + + ofPushStyle(); + guiBaseObject::renderText(); + + //draw the background + ofFill(); + glColor4fv(bgColor.getColorF()); + ofRect(hitArea.x, hitArea.y, hitArea.width, hitArea.height); + + if(bShowDropDown) + { + + glTranslated(1,0,0.1f); + for(int i = 0; i < (int) vecDropList.size(); i++) + { + float bx = hitArea.x + 0; + float by = hitArea.y + i * (boxHeight); + + if(value.getValueI() == i){ + glColor4fv(fgColor.getSelectedColorF()); + }else{ + glColor4fv(fgColor.getNormalColorF()); + } + + ofFill(); + + ofRect(bx, by, boundingBox.width, boxHeight); + + ofNoFill(); + glColor4fv(outlineColor.getColorF()); + ofRect(bx, by, boundingBox.width, boxHeight); + + if(i==0) { + ofFill(); + glColor4fv(outlineColor.getColorF()); + //ofTriangle(bx + boundingBox.width - 7, by + boxHeight, bx + boundingBox.width - 14, by,bx + boundingBox.width, by); + ofRect(bx + boundingBox.width - boxHeight, by, boxHeight*0.666f, boxHeight*0.666f); + } + + glColor4fv(textColor.getColorF()); + + displayText.renderString(vecDropList[i], bx + 2, by + boxHeight -4); + + } + glTranslated(-1,0,-0.1f); + + } else { + float bx = hitArea.x; + float by = hitArea.y; + + ofFill(); + glColor4fv(bgColor.getColorF()); + ofRect(bx, by, boundingBox.width, boxHeight); + + ofNoFill(); + glColor4fv(outlineColor.getColorF()); + ofRect(bx, by, boundingBox.width, boxHeight); + + ofFill(); + glColor4fv(outlineColor.getColorF()); + //ofTriangle(bx + boundingBox.width - 7, by + boxHeight, bx + boundingBox.width - 14, by,bx + boundingBox.width, by); + ofRect(bx + boundingBox.width - boxHeight, by, boxHeight*0.666f, boxHeight*0.666f); + + glColor4fv(textColor.getColorF()); + displayText.renderString(vecDropList[value.getValueI()], bx + 2, by + boxHeight -4); + + } + + ofPopStyle(); +} diff --git a/src/ofxControlPanel/guiTypeTextDropDown.h b/src/ofxControlPanel/guiTypeTextDropDown.h new file mode 100755 index 0000000..cb9c8ad --- /dev/null +++ b/src/ofxControlPanel/guiTypeTextDropDown.h @@ -0,0 +1,25 @@ +#pragma once + +#include "guiBaseObject.h" +#include "guiColor.h" +#include "simpleColor.h" +#include "guiValue.h" + +class guiTypeTextDropDown : public guiBaseObject{ + + public: + + //------------------------------------------------ + void setup(string dropDownName, int defaultBox, vector boxNames); + virtual void updateValue(); + void update(); + virtual void release(); + void updateGui(float x, float y, bool firstHit, bool isRelative); + void render(); + + void notify(); + + vector vecDropList; + bool bShowDropDown; +}; + diff --git a/src/ofxControlPanel/guiTypeToggle.cpp b/src/ofxControlPanel/guiTypeToggle.cpp new file mode 100755 index 0000000..40f3c2f --- /dev/null +++ b/src/ofxControlPanel/guiTypeToggle.cpp @@ -0,0 +1,56 @@ +#include "guiTypeToggle.h" + +//------------------------------------------------ +void guiTypeToggle::setup(string toggleName, bool defaultVal){ + value.addValue( (int)defaultVal, 0, 1); + name = toggleName; +} + +//----------------------------------------------- +void guiTypeToggle::updateValue(){ + //CB +} + +//-----------------------------------------------. +void guiTypeToggle::updateGui(float x, float y, bool firstHit, bool isRelative){ + if(!firstHit)return; + + if( state == SG_STATE_SELECTED){ + if( value.getValueI() == 0 ){ + value.setValue(1, 0); + }else{ + value.setValue(0, 0); + } + + //CB + } +} + +//-----------------------------------------------. +void guiTypeToggle::render(){ + ofPushStyle(); + glPushMatrix(); + guiBaseObject::renderText(); + + //draw the background + ofFill(); + glColor4fv(bgColor.getColorF()); + ofRect(hitArea.x, hitArea.y, hitArea.width, hitArea.height); + + //draw the outline + ofNoFill(); + glColor4fv(outlineColor.getColorF()); + ofRect(hitArea.x, hitArea.y, hitArea.width, hitArea.height); + + if( value.getValueI() == 1){ + ofFill(); + }else{ + ofNoFill(); + } + + glColor4fv(fgColor.getColorF()); + ofRect(hitArea.x+3, hitArea.y+3, -6 + hitArea.width, -6 + hitArea.height); + + glPopMatrix(); + ofPopStyle(); +} diff --git a/src/ofxControlPanel/guiTypeToggle.h b/src/ofxControlPanel/guiTypeToggle.h new file mode 100755 index 0000000..57e8d63 --- /dev/null +++ b/src/ofxControlPanel/guiTypeToggle.h @@ -0,0 +1,20 @@ +#pragma once + + +#include "guiBaseObject.h" +#include "guiColor.h" +#include "simpleColor.h" +#include "guiValue.h" + +class guiTypeToggle : public guiBaseObject{ + + public: + + //------------------------------------------------ + void setup(string toggleName, bool defaultVal); + virtual void updateValue(); + void updateGui(float x, float y, bool firstHit, bool isRelative); + void render(); + + +}; diff --git a/src/ofxControlPanel/guiTypeVideo.cpp b/src/ofxControlPanel/guiTypeVideo.cpp new file mode 100644 index 0000000..1e2975a --- /dev/null +++ b/src/ofxControlPanel/guiTypeVideo.cpp @@ -0,0 +1,102 @@ +#include "guiTypeVideo.h" + + //------------------------------------------------ +void guiTypeVideo::setup(string videoName, ofVideoPlayer * vidIn, float videoWidth, float videoHeight){ + video = vidIn; + playPause = false; + + guiTypeDrawable::setup(videoName, video, videoWidth, videoHeight); +} + +//------------------------------------------------ +void guiTypeVideo::updateGui(float x, float y, bool firstHit, bool isRelative){ + + if( firstHit && state == SG_STATE_SELECTED && video != NULL ){ + if ( x >= pButtonX && x <= pButtonX + pButtonW && y >= pButtonY && y < pButtonY + pButtonH){ + + playPause = !playPause; + + if( playPause )video->setPaused(true); + else video->setPaused(false); + + } + } + + if( state == SG_STATE_SELECTED && video != NULL ){ + if ( x >= scX && x <= scX + scW && y >= scY && y < scY + scH){ + scrubPct = ofMap(x, scX, scX + scW, 0.0, 0.99); + video->setPosition(scrubPct); + } + } + +} + +//-----------------------------------------------. +void guiTypeVideo::render(){ + + pButtonX = hitArea.x + 4; + pButtonY = hitArea.y + hitArea.height - 20; + pButtonW = 16; + pButtonH = 16; + + scX = pButtonX + pButtonW + 6; + scY = pButtonY+1; + scW = hitArea.width - (pButtonW + 16); + scH = pButtonH-2; + + ofPushStyle(); + + if( video != NULL ){ + scrubPct = video->getPosition(); + }else scrubPct = 0.0; + + glPushMatrix(); + //glTranslatef(boundingBox.x, boundingBox.y, 0); + guiBaseObject::renderText(); + + //draw the background + ofFill(); + glColor4fv(bgColor.getColorF()); + ofRect(hitArea.x, hitArea.y, hitArea.width, hitArea.height); + + ofDisableAlphaBlending(); + + ofSetColor(0xFFFFFF); + vid->draw(hitArea.x, hitArea.y, hitArea.width, hitArea.height); + + ofEnableAlphaBlending(); + + //ofSetColor(20, 90, 220, 100); + glColor4fv( outlineColor.getColorF() ); + ofNoFill(); + ofRect(pButtonX, pButtonY, pButtonW, pButtonH); + + ofFill(); + + + glColor4fv( fgColor.getColorF() ); + if( playPause ){ + ofRect(pButtonX + 4, pButtonY + 3, 2, 9); + ofRect(pButtonX + 9, pButtonY + 3, 2, 9); + }else{ + float dx = pButtonX + 5; + float dy = pButtonY + 3; + + ofTriangle( dx, dy, dx + 7, dy + 5, dx, dy + 10); + } + + glColor4fv( outlineColor.getColorF() ); + ofNoFill(); + + //ofSetColor(20, 90, 220, 100); + ofRect(scX, scY, scW, scH); + + ofFill(); + glColor4fv( fgColor.getColorF() ); + ofRect( scX + 2, scY + 2, scrubPct * (scW-4.0), scH - 4); + + glPopMatrix(); + + ofPopStyle(); +} + \ No newline at end of file diff --git a/src/ofxControlPanel/guiTypeVideo.h b/src/ofxControlPanel/guiTypeVideo.h new file mode 100644 index 0000000..823a54b --- /dev/null +++ b/src/ofxControlPanel/guiTypeVideo.h @@ -0,0 +1,30 @@ +/* + * guiTypeVideo.h + * ofxControlPanelDemo + * + * Created by theo on 23/03/2010. + * Copyright 2010 __MyCompanyName__. All rights reserved. + * + */ + +#include "guiBaseObject.h" +#include "guiColor.h" +#include "simpleColor.h" +#include "guiValue.h" +#include "guiTypeDrawable.h" + +class guiTypeVideo : public guiTypeDrawable{ + + public: + //------------------------------------------------ + void setup(string videoName, ofVideoPlayer * vidIn, float videoWidth, float videoHeight); + void updateGui(float x, float y, bool firstHit, bool isRelative); + void render(); + + float pButtonX, pButtonY, pButtonW, pButtonH; + float scX, scY, scW, scH; + + float scrubPct; + bool playPause; + ofVideoPlayer * video; +}; diff --git a/src/ofxControlPanel/guiValue.cpp b/src/ofxControlPanel/guiValue.cpp new file mode 100755 index 0000000..2a706f3 --- /dev/null +++ b/src/ofxControlPanel/guiValue.cpp @@ -0,0 +1,145 @@ +#include "guiValue.h" + +guiValue::guiValue(){ + +} + +//------------------------------------------------ +void guiValue::addValue(float val, float _min, float _max){ + value.push_back(val); + valueI.push_back((int)val); + valueB.push_back((bool)val); + min.push_back(_min); + max.push_back(_max); + pct.push_back( 0.0 ); + + //update our pct + updatePct(value.size()-1); +} + +//------------------------------------------------ +void guiValue::addValueI(int val, int _min, int _max){ + value.push_back((float)val); + valueI.push_back(val); + valueB.push_back((bool)val); + min.push_back((float)_min); + max.push_back((float)_max); + pct.push_back( 0.0 ); + + //update our pct + updatePct(value.size()-1); +} + +//------------------------------------------------ +void guiValue::addValueB(bool val){ + value.push_back((float)val); + valueI.push_back((int)val); + valueB.push_back(val); + min.push_back(0); + max.push_back(1); + pct.push_back( 0.0 ); + + //update our pct + updatePct(value.size()-1); +} + +//------------------------------------------------ +bool guiValue::setValue(float val, unsigned int which){ + if(which >= 0 && which < value.size() ){ + + if( max[which] - min[which] == 0 ) return false; + + //check out bounds + if(val < min[which]) val = min[which]; + else if(val > max[which]) val = max[which]; + + value[which] = val; + valueI[which] = (int)val; + valueB[which] = (bool)val; + + //recalulate our pct + updatePct(which); + + return true; + } + return false; +} + +//------------------------------------------------ +bool guiValue::setValueAsPct(float percent, unsigned int which){ + if(which >= 0 && which < value.size() ){ + + if( max[which] - min[which] == 0 ) return false; + + if(percent < 0.0) percent = 0.0; + else if(percent > 1.0) percent = 1.0; + + pct[which] = percent; + + value[which] = ( pct[which] * ( max[which] - min[which] ) ) + min[which]; + valueI[which] = (int)value[which]; + valueB[which] = (bool)value[which]; + + return true; + } + return false; +} + +//------------------------------------------------ +float guiValue::getValueF(unsigned int which){ + if(which >= 0 && which < value.size() ){ + return value[which]; + } + return 0.0; +} + +//------------------------------------------------ +float guiValue::getValueI(unsigned int which){ + if(which >= 0 && which < valueI.size() ){ + return valueI[which]; + } + return false; +} + +//------------------------------------------------ +float guiValue::getValueB(unsigned int which){ + if(which >= 0 && which < valueB.size() ){ + return valueB[which]; + } + return false; +} + +//------------------------------------------------ +float guiValue::getMin(unsigned int which){ + if(which >= 0 && which < min.size() ){ + return min[which]; + } + return 0.0; +} + +//------------------------------------------------ +float guiValue::getMax(unsigned int which){ + if(which >= 0 && which < max.size() ){ + return max[which]; + } + return 0.0; +} + +//------------------------------------------------ +float guiValue::getPct(unsigned int which){ + if(which >= 0 && which < pct.size() ){ + return pct[which]; + } + return 0.0; +} + +//------------------------------------------------ +int guiValue::getNumValues(){ + return (int) value.size(); +} + +//----------------------------------------------- +void guiValue::updatePct(int which){ + pct[which] = (value[which] - min[which]) / (max[which] - min[which]); +} + diff --git a/src/ofxControlPanel/guiValue.h b/src/ofxControlPanel/guiValue.h new file mode 100755 index 0000000..e17d5fc --- /dev/null +++ b/src/ofxControlPanel/guiValue.h @@ -0,0 +1,61 @@ +#pragma once + +#include "ofMain.h" + +class guiValue{ + + public: + guiValue(); + + //------------------------------------------------ + void addValue(float val, float _min, float _max); + + //------------------------------------------------ + void addValueI(int val, int _min, int _max); + + //------------------------------------------------ + void addValueB(bool val); + + //------------------------------------------------ + bool setValue(float val, unsigned int which = 0); + + //------------------------------------------------ + bool setValueAsPct(float percent, unsigned int which = 0); + + //------------------------------------------------ + float getValueF(unsigned int which = 0); + + //------------------------------------------------ + float getValueI(unsigned int which = 0); + + //------------------------------------------------ + float getValueB(unsigned int which = 0); + + //------------------------------------------------ + float getMin(unsigned int which = 0); + + //------------------------------------------------ + float getMax(unsigned int which = 0); + + //------------------------------------------------ + float getPct(unsigned int which = 0); + + int getNumValues(); + + protected: + + //----------------------------------------------- + void updatePct(int which); + + //-------------- + //-------------- + vector value; + vector valueI; + vector valueB; + + vector min; + vector max; + vector pct; + +}; + diff --git a/src/ofxControlPanel/ofxControlPanel.cpp b/src/ofxControlPanel/ofxControlPanel.cpp new file mode 100755 index 0000000..4eefd77 --- /dev/null +++ b/src/ofxControlPanel/ofxControlPanel.cpp @@ -0,0 +1,863 @@ +#include "ofxControlPanel.h" + +float ofxControlPanel::borderWidth = 10; +float ofxControlPanel::topSpacing = 20; +float ofxControlPanel::tabWidth = 25; +float ofxControlPanel::tabHeight = 10; + +//---------------------------- +ofxControlPanel::ofxControlPanel(){ + dragging = false; + minimize = false; + selectedPanel = 0; + currentPanel = 0; + bUseTTFFont = false; + usingXml = true; + saveDown = false; + restoreDown = false; + incrementSave = false; + hidden = false; + bDraggable = true; + eventsEnabled = false; + bEventsSetup = false; + + currentXmlFile = ""; + incrementSaveName = ""; + xmlObjects.clear(); +} + +ofxControlPanel::~ofxControlPanel(){ + for(unsigned int i = 0; i < guiObjects.size(); i++){ + delete guiObjects[i]; + } +} + +//----------------------------- +void ofxControlPanel::setup(string controlPanelName, float panelX, float panelY, float width, float height){ + name = controlPanelName; + + setPosition(panelX, panelY); + setDimensions(width, height); + setShowText(true); + + // Setup depth buffer +// glClearDepth(1.0f); +// glDepthFunc(GL_LEQUAL ); +// glDepthMask(GL_TRUE); +// glEnable(GL_DEPTH_TEST); +} + +//----------------------------- +void ofxControlPanel::loadFont( string fontName, int fontsize ){ + guiTTFFont.loadFont(fontName, fontsize); + bool okay = guiTTFFont.bLoadedOk; + guiBaseObject::setFont(&guiTTFFont); + + if(okay){ + printf("font loaded okay!\n"); + bUseTTFFont = true; + for(unsigned int i = 0; i < guiObjects.size(); i++){ + guiObjects[i]->setFont(&guiTTFFont); + } + }else{ + printf("ahhhhhh why does my font no work!\n"); + } +} + +//--------------------------------------------- +guiTypePanel * ofxControlPanel::addPanel(string panelName, int numColumns, bool locked){ + guiTypePanel * panelPtr = new guiTypePanel(); + panelPtr->setup(panelName); + panelPtr->setPosition(borderWidth, topSpacing); + panelPtr->setDimensions(boundingBox.width - borderWidth*2, boundingBox.height - topSpacing*3); + if( locked )panelPtr->lock(); + else panelPtr->unlock(); + + if( numColumns > 1 ){ + for(int i = 1; i < numColumns; i++){ + panelPtr->addColumn(30); + } + } + + panels.push_back(panelPtr); + panelTabs.push_back(ofRectangle()); + + guiObjects.push_back(panelPtr); + if( bUseTTFFont ){ + panelPtr->setFont(&guiTTFFont); + } + + return panelPtr; +} + +// ############################################################## // +// ## +// ## Control where things are added to +// ## +// ############################################################## // + + +//--------------------------------------------- +void ofxControlPanel::setWhichPanel(int whichPanel){ + if( whichPanel < 0 || whichPanel >= (int) panels.size() )return; + currentPanel = whichPanel; + setWhichColumn(0); +} + +//--------------------------------------------- +void ofxControlPanel::setWhichPanel(string panelName){ + for(int i = 0; i < (int) panels.size(); i++){ + if( panels[i]->name == panelName){ + setWhichPanel(i); + setWhichColumn(0); + return; + } + } +} + +//--------------------------------------------- +void ofxControlPanel::setWhichColumn(int column){ + if( currentPanel < 0 || currentPanel >= (int) panels.size() )return; + panels[currentPanel]->selectColumn(column); +} + + +// ############################################################## // +// ## +// ## Gui elements +// ## +// ############################################################## // + +//------------------------------- +void ofxControlPanel::setSliderWidth(int width){ + +} + +//--------------------------------------------- +guiTypeToggle * ofxControlPanel::addToggle(string name, string xmlName, bool defaultValue) +{ + if( currentPanel < 0 || currentPanel >= (int) panels.size() )return NULL; + + //add a new toggle to our list + guiTypeToggle * tmp = new guiTypeToggle(); + + //setup and dimensions + tmp->setup(name, (bool)defaultValue); + tmp->setDimensions(14, 14); + tmp->setTypeBool(); + tmp->xmlName = xmlName; + + xmlObjects.push_back( xmlAssociation(tmp, xmlName, 1) ); + guiObjects.push_back(tmp); + + if( bUseTTFFont ){ + tmp->setFont(&guiTTFFont); + } + + panels[currentPanel]->addElement( tmp ); + + return tmp; +} + + +//--------------------------------------------- +guiTypeMultiToggle * ofxControlPanel::addMultiToggle(string name, string xmlName, int defaultBox, vector boxNames) +{ + if( currentPanel < 0 || currentPanel >= (int) panels.size() )return NULL; + + //add a new multi toggle to our list + guiTypeMultiToggle * tmp = new guiTypeMultiToggle(); + + //setup and dimensions + tmp->setup(name, defaultBox, boxNames); + tmp->setDimensions(180, boxNames.size()*(guiTypeMultiToggle::boxSize + guiTypeMultiToggle::boxSpacing) + 2); + tmp->xmlName = xmlName; + + //we can say we want to an int or a float! + tmp->setTypeInt(); + + xmlObjects.push_back( xmlAssociation(tmp, xmlName, 1) ); + guiObjects.push_back(tmp); + + if( bUseTTFFont ){ + tmp->setFont(&guiTTFFont); + } + + panels[currentPanel]->addElement( tmp ); + + return tmp; +} + +//------------------------------- +guiTypeSlider * ofxControlPanel::addSlider(string sliderName, string xmlName, float value , float min, float max, bool isInt) +{ + if( currentPanel < 0 || currentPanel >= (int) panels.size() )return NULL; + + //add a new slider to our list + guiTypeSlider * tmp = new guiTypeSlider(); + + //setup and dimensions + tmp->setup(sliderName, value, min, max); + tmp->setDimensions(180, 10); + tmp->xmlName = xmlName; + + //we can say we want to an int or a float! + if(isInt){ + tmp->setTypeInt(); + }else{ + tmp->setTypeFloat(); + } + + xmlObjects.push_back( xmlAssociation(tmp, xmlName, 1) ); + guiObjects.push_back(tmp); + + if( bUseTTFFont ){ + tmp->setFont(&guiTTFFont); + } + + panels[currentPanel]->addElement( tmp ); + + return tmp; +} + +//------------------------------- +guiType2DSlider * ofxControlPanel::addSlider2D(string sliderName, string xmlName, float valueX, float valueY, float minX, float maxX, float minY, float maxY, bool isInt) +{ + if( currentPanel < 0 || currentPanel >= (int) panels.size() )return NULL; + + //add a new slider to our list + guiType2DSlider * tmp = new guiType2DSlider(); + + //setup and dimensions + tmp->setup(sliderName, valueX, minX, maxX, valueY, minY, maxY); + tmp->setDimensions(200, 200); + tmp->xmlName = xmlName; + + //we can say we want to an int or a float! + if(isInt){ + tmp->setTypeInt(); + }else{ + tmp->setTypeFloat(); + } + + xmlObjects.push_back( xmlAssociation(tmp, xmlName, 2) ); + guiObjects.push_back(tmp); + + if( bUseTTFFont ){ + tmp->setFont(&guiTTFFont); + } + + panels[currentPanel]->addElement( tmp ); + + return tmp; +} + + + +//--------------------------------------------- +guiTypeDrawable * ofxControlPanel::addDrawableRect(string name, ofBaseDraws * drawablePtr, int drawW, int drawH){ + if( currentPanel < 0 || currentPanel >= (int) panels.size() )return NULL; + guiTypeDrawable * vid = new guiTypeDrawable(); + + vid->setup(name, drawablePtr, drawW, drawH); + panels[currentPanel]->addElement(vid); + + guiObjects.push_back(vid); + if( bUseTTFFont ){ + vid->setFont(&guiTTFFont); + } + + + return vid; +} + +//--------------------------------------------- +guiTypeVideo * ofxControlPanel::addVideoRect(string name, ofVideoPlayer * drawablePtr, int drawW, int drawH){ + if( currentPanel < 0 || currentPanel >= panels.size() )return NULL; + guiTypeVideo * vid = new guiTypeVideo(); + + vid->setup(name, drawablePtr, drawW, drawH); + panels[currentPanel]->addElement(vid); + + guiObjects.push_back(vid); + if( bUseTTFFont ){ + vid->setFont(&guiTTFFont); + } + + + return vid; +} + + +//--------------------------------------------- +guiTypeCustom * ofxControlPanel::addCustomRect(string name, guiCustomImpl * customPtr, int drawW, int drawH){ + if( currentPanel < 0 || currentPanel >= (int) panels.size() )return NULL; + guiTypeCustom * custom = new guiTypeCustom(); + + custom->setup(name, customPtr, drawW, drawH); + panels[currentPanel]->addElement(custom); + guiObjects.push_back(custom); + + if( bUseTTFFont ){ + custom->setFont(&guiTTFFont); + } + + return custom; +} + +//------------------------------- +guiTypeButtonSlider * ofxControlPanel::addButtonSlider(string sliderName, string xmlName, float value , float min, float max, bool isInt ) +{ + if( currentPanel < 0 || currentPanel >= (int) panels.size() )return NULL; + + //add a new slider to our list + guiTypeButtonSlider * tmp = new guiTypeButtonSlider(); + + //setup and dimensions + tmp->setup(sliderName, 210, 15, value, min, max, false); + tmp->xmlName = xmlName; + + //we can say we want to an int or a float! + if(isInt){ + tmp->setTypeInt(); + }else{ + tmp->setTypeFloat(); + } + + xmlObjects.push_back( xmlAssociation(tmp, xmlName, 1) ); + guiObjects.push_back(tmp); + + if( bUseTTFFont ) { + tmp->setFont(&guiTTFFont); + } + + panels[currentPanel]->addElement( tmp ); + + return tmp; +} + +//--------------------------------------------- +guiTypeTextDropDown * ofxControlPanel::addTextDropDown(string name, string xmlName, int defaultBox, vector boxNames) +{ + if( currentPanel < 0 || currentPanel >= (int) panels.size() )return NULL; + + //add a new multi toggle to our list + guiTypeTextDropDown * tmp = new guiTypeTextDropDown(); + + //setup and dimensions + tmp->setDimensions(180, 60); + tmp->setup(name, defaultBox, boxNames); + tmp->xmlName = xmlName; + + //we can say we want to an int or a float! + tmp->setTypeInt(); + + xmlObjects.push_back( xmlAssociation(tmp, xmlName, 1) ); + guiObjects.push_back(tmp); + + if( bUseTTFFont ){ + tmp->setFont(&guiTTFFont); + } + + panels[currentPanel]->addElement( tmp ); + + return tmp; +} + +// ############################################################## // +// ## +// ## get and set values +// ## +// ############################################################## // + +//--------------------------------------------- +void ofxControlPanel::setValueB(string xmlName, bool value, int whichParam){ + for(int i = 0; i < (int) guiObjects.size(); i++){ + if( guiObjects[i]->xmlName == xmlName){ + if( whichParam >= 0 ){ + guiObjects[i]->value.setValue(value, whichParam); + return; + } + } + } +} + +//--------------------------------------------- +void ofxControlPanel::setValueI(string xmlName, int value, int whichParam){ + for(int i = 0; i < (int) guiObjects.size(); i++){ + if( guiObjects[i]->xmlName == xmlName){ + if( whichParam >= 0 ){ + guiObjects[i]->value.setValue(value, whichParam); + return; + } + } + } +} + +//--------------------------------------------- +void ofxControlPanel::setValueF(string xmlName, float value, int whichParam){ + for(int i = 0; i < (int) guiObjects.size(); i++){ + if( guiObjects[i]->xmlName == xmlName){ + if( whichParam >= 0 ){ + guiObjects[i]->value.setValue(value, whichParam); + return; + } + } + } +} + + +//--------------------------------------------- +bool ofxControlPanel::getValueB(string xmlName, int whichParam){ + for(int i = 0; i < (int) xmlObjects.size(); i++){ + if( xmlObjects[i].guiObj != NULL && xmlName == xmlObjects[i].xmlName ){ + if( whichParam >= 0 && whichParam < xmlObjects[i].numParams ){ + return xmlObjects[i].guiObj->value.getValueB(whichParam); + } + } + } + ofLog(OF_LOG_WARNING, "ofxControlPanel - parameter requested %s doesn't exist - returning 0", xmlName.c_str()); + return 0; +} + +//--------------------------------------------- +float ofxControlPanel::getValueF(string xmlName, int whichParam){ + for(int i = 0; i < (int) xmlObjects.size(); i++){ + if( xmlObjects[i].guiObj != NULL && xmlName == xmlObjects[i].xmlName ){ + if( whichParam >= 0 && whichParam < xmlObjects[i].numParams ){ + return xmlObjects[i].guiObj->value.getValueF(whichParam); + } + } + } + ofLog(OF_LOG_WARNING, "ofxControlPanel - parameter requested %s doesn't exist - returning 0", xmlName.c_str()); + return 0; +} + +//--------------------------------------------- +int ofxControlPanel::getValueI(string xmlName, int whichParam){ + for(int i = 0; i < (int) xmlObjects.size(); i++){ + if( xmlObjects[i].guiObj != NULL && xmlName == xmlObjects[i].xmlName ){ + if( whichParam >= 0 && whichParam < xmlObjects[i].numParams ){ + return xmlObjects[i].guiObj->value.getValueI(whichParam); + } + } + } + ofLog(OF_LOG_WARNING, "ofxControlPanel - parameter requested %s doesn't exist - returning 0", xmlName.c_str()); + return 0; +} + +//--------------------------------------------- +string ofxControlPanel::getCurrentPanelName(){ + if( selectedPanel < 0 || selectedPanel >= panels.size() )return "no panel"; + return panels[selectedPanel]->name; +} + + + +// ############################################################## // +// ## +// ## Settings to/from xml +// ## +// ############################################################## // + +//----------------------------- +void ofxControlPanel::setIncrementSave(string incrementalFileBaseName){ + incrementSaveName = incrementalFileBaseName; + incrementSave = true; +} +//----------------------------- +void ofxControlPanel::disableIncrementSave(){ + incrementSave = false; +} + +//----------------------------- +void ofxControlPanel::loadSettings(string xmlFile){ + for(unsigned int i = 0; i < guiObjects.size(); i++)guiObjects[i]->loadSettings(xmlFile); + + currentXmlFile = xmlFile; + + settingsDirectory = currentXmlFile; + + int posLastSlash = settingsDirectory.rfind("/"); + if( posLastSlash > 0) settingsDirectory.erase(settingsDirectory.begin()+ posLastSlash+1, settingsDirectory.end() ); + else settingsDirectory = ""; + + settings.loadFile(currentXmlFile); + usingXml = true; + + for(unsigned int i = 0; i < xmlObjects.size(); i++){ + if( xmlObjects[i].guiObj != NULL ){ + int numParams = xmlObjects[i].numParams; + + for(int j = 0; j < numParams; j++){ + string str = xmlObjects[i].xmlName+":val_"+ofToString(j); + float val = settings.getValue(str, xmlObjects[i].guiObj->value.getValueF(j)); + + xmlObjects[i].guiObj->setValue(val, j); + } + xmlObjects[i].guiObj->updateValue(); + } + } +} + +//----------------------------- +void ofxControlPanel::reloadSettings(){ + for(unsigned int i = 0; i < guiObjects.size(); i++)guiObjects[i]->reloadSettings(); + + if( currentXmlFile != "" ){ + + bool loadedOK = settings.loadFile(currentXmlFile); + if(loadedOK) + { + usingXml = true; + + for(unsigned int i = 0; i < xmlObjects.size(); i++){ + if( xmlObjects[i].guiObj != NULL ){ + int numParams = xmlObjects[i].numParams; + + for(int j = 0; j < numParams; j++){ + string str = xmlObjects[i].xmlName+":val_"+ofToString(j); + float val = settings.getValue(str, xmlObjects[i].guiObj->value.getValueF(j)); + + xmlObjects[i].guiObj->setValue(val, j); + } + xmlObjects[i].guiObj->updateValue(); + } + } + + } else { + ofLog(OF_LOG_ERROR,"Could not load %s.",currentXmlFile.c_str()); + } + + } +} + +//------------------------------- +void ofxControlPanel::saveSettings(string xmlFile){ + for(int i = 0; i < (int) guiObjects.size(); i++)guiObjects[i]->saveSettings(xmlFile); + + for(int i = 0; i < (int) xmlObjects.size(); i++){ + if( xmlObjects[i].guiObj != NULL ){ + int numParams = xmlObjects[i].numParams; + + for(int j = 0; j < numParams; j++){ + string str = xmlObjects[i].xmlName+":val_"+ofToString(j); + settings.setValue(str, xmlObjects[i].guiObj->value.getValueF(j)); + } + } + } + + if( incrementSave ){ + string xmlName = incrementSaveName; + xmlName += ofToString(ofGetYear()) +"-"+ ofToString(ofGetMonth()) +"-"+ ofToString(ofGetDay()) +"-"+ ofToString(ofGetHours()) +"-"+ ofToString(ofGetMinutes())+"-"+ ofToString(ofGetSeconds()); + xmlName += ".xml"; + xmlName = settingsDirectory + xmlName; + + settings.saveFile(xmlName); + } + settings.saveFile(xmlFile); + currentXmlFile = xmlFile; + usingXml = true; +} + +//----------------------------- +void ofxControlPanel::saveSettings(){ + for(int i = 0; i < (int) guiObjects.size(); i++) + { + guiObjects[i]->saveSettings(); + } + + for(int i = 0; i < (int) xmlObjects.size(); i++) + { + if( xmlObjects[i].guiObj != NULL ) + { + int numParams = xmlObjects[i].numParams; + + for(int j = 0; j < numParams; j++){ + string str = xmlObjects[i].xmlName+":val_"+ofToString(j); + settings.setValue(str, xmlObjects[i].guiObj->value.getValueF(j)); + } + } + } + if( incrementSave ){ + string xmlName = incrementSaveName; + xmlName += ofToString(ofGetYear()) +"-"+ ofToString(ofGetMonth()) +"-"+ ofToString(ofGetDay()) +"-"+ ofToString(ofGetHours()) +"-"+ ofToString(ofGetMinutes())+"-"+ ofToString(ofGetSeconds()); + xmlName += ".xml"; + xmlName = settingsDirectory + xmlName; + + settings.saveFile(xmlName); + } + if(currentXmlFile == "") { + currentXmlFile = "controlPanelSettings.xml"; + } + settings.saveFile(currentXmlFile); + usingXml = true; +} + +//------------------------------- +void ofxControlPanel::setXMLFilename(string xmlFile) +{ + currentXmlFile = xmlFile; +} + +// ############################################################## // +// ## +// ## Visibilty +// ## +// ############################################################## // + + +//--------------------------- +void ofxControlPanel::setMinimized(bool bMinimize){ + minimize = bMinimize; +} + +//--------------------------- +void ofxControlPanel::setDraggable(bool bDrag){ + bDraggable = bDrag; +} + +//------------------------------- +void ofxControlPanel::show(){ + hidden = false; +} + +//------------------------------- +void ofxControlPanel::hide(){ + hidden = true; +} + +//------------------------------- +void ofxControlPanel::toggleView(){ + hidden = !hidden; +} + +// ############################################################## // +// ## +// ## Mouse Events +// ## +// ############################################################## // + + +//------------------------------- +void ofxControlPanel::mousePressed(float x, float y, int button){ + if( hidden ) return; + + bool tabButtonPressed = false; + + if( isInsideRect(x, y, minimizeButton)){ + minimize = !minimize; + }else if( usingXml && isInsideRect(x, y, saveButton) ){ + saveSettings(); + saveDown = true; + }else if( usingXml && isInsideRect(x, y, restoreButton) ){ + reloadSettings(); + restoreDown = true; + }else if( isInsideRect(x, y, topBar) && bDraggable){ + dragging = true; + mouseDownPoint.set(x - boundingBox.x, y-boundingBox.y, 0); + }else if(!minimize){ + for(int i = 0; i < (int) panels.size(); i++){ + if( isInsideRect(x, y, panelTabs[i]) ){ + selectedPanel = i; + tabButtonPressed = true; + break; + } + } + } + + if(minimize == false && tabButtonPressed == false && isInsideRect(x, y, boundingBox) ){ + for(int i = 0; i < (int) panels.size(); i++){ + if( i == selectedPanel )panels[i]->checkHit( x - hitArea.x, y - hitArea.y, button); + } + } + + prevMouse.set(x, y); +} + + +//------------------------------- +void ofxControlPanel::mouseDragged(float x, float y, int button){ + if( hidden ) return; + + if(dragging)setPosition( MAX(0, x - mouseDownPoint.x), MAX(0, y -mouseDownPoint.y)); + else if(!minimize){ + for(int i = 0; i < (int) panels.size(); i++){ + if( i == selectedPanel ){ + + if(button){ + panels[i]->updateGui( x - prevMouse.x, y - prevMouse.y, false, true); + }else{ + panels[i]->updateGui( x - hitArea.x, y - hitArea.y, false, false); + } + } + } + } + + prevMouse.set(x, y); +} + +//------------------------------- +void ofxControlPanel::mouseReleased(){ + if( hidden ) return; + + for(int i = 0; i < (int) panels.size(); i++){ + panels[i]->release(); + } + dragging = false; + saveDown = false; + restoreDown = false; +} + + +// ############################################################## // +// ## +// ## Updater +// ## +// ############################################################## // + +//------------------------------- +void ofxControlPanel::update(){ + guiBaseObject::update(); + + topBar = ofRectangle(boundingBox.x, boundingBox.y, boundingBox.width, 20); + minimizeButton = ofRectangle(boundingBox.x + boundingBox.width - 24, boundingBox.y + 4, 20, 10 ); + saveButton = ofRectangle(boundingBox.x + displayText.getTextWidth() + 20, boundingBox.y + 4, 40, 12 ); + restoreButton = ofRectangle(saveButton.x + saveButton.width + 15, boundingBox.y + 4, 60, 12 ); + + for(int i = 0; i < (int) panels.size(); i++){ + panels[i]->update(); + + panelTabs[i].x = i * tabWidth + hitArea.x + borderWidth; + panelTabs[i].y = hitArea.y + topSpacing - tabHeight; + panelTabs[i].width = tabWidth; + panelTabs[i].height = tabHeight; + + } +} + +//--------------------------------------------- +void ofxControlPanel::updateBoundingBox(){ + if(bShowText){ + //we need to update out hitArea because the text will have moved the gui down + hitArea.y = boundingBox.y + topSpacing; + boundingBox.height = hitArea.height + displayText.getTextHeight() + titleSpacing; + boundingBox.width = MAX( hitArea.width, displayText.getTextWidth() ); + }else{ + //we need to update out hitArea because the text will have moved the gui down + hitArea.y = boundingBox.y; + boundingBox.height = hitArea.height; + boundingBox.width = hitArea.width; + } +} + + +// ############################################################## // +// ## +// ## Drawing +// ## +// ############################################################## // + +//------------------------------- +void ofxControlPanel::draw(){ + if( hidden ) return; + + ofPushStyle(); + ofEnableAlphaBlending(); + + float panelH = boundingBox.height; + if( minimize ){ + panelH = 20; + } + + glPushMatrix(); + glTranslatef(boundingBox.x, boundingBox.y, 0); + //draw the background + ofFill(); + glColor4fv(bgColor.getColorF()); + ofRect(0, 0, boundingBox.width, panelH); + + //draw the outline + ofNoFill(); + glColor4fv(outlineColor.getColorF()); + ofRect(0, 0, boundingBox.width, panelH); + ofLine(0, 20, boundingBox.width, 20); + glPopMatrix(); + + ofRect(minimizeButton.x, minimizeButton.y, minimizeButton.width, minimizeButton.height); + + ofPushStyle(); + ofFill(); + + if( saveDown )glColor4fv(fgColor.getSelectedColorF()); + else glColor4fv(fgColor.getColorF()); + + ofRect(saveButton.x, saveButton.y, saveButton.width,saveButton.height); + ofSetColor(255, 255, 255); + if(bUseTTFFont) { + guiTTFFont.drawString("save", saveButton.x + 3, saveButton.y + saveButton.height -4); + } + else { + ofDrawBitmapString("save", saveButton.x + 3, saveButton.y + saveButton.height -3); + } + + ofPopStyle(); + + ofPushStyle(); + ofFill(); + + if( restoreDown )glColor4fv(fgColor.getSelectedColorF()); + else glColor4fv(fgColor.getColorF()); + + ofRect(restoreButton.x, restoreButton.y, restoreButton.width,restoreButton.height); + ofSetColor(255, 255, 255); + if(bUseTTFFont) { + guiTTFFont.drawString("restore", restoreButton.x + 3, restoreButton.y + restoreButton.height -4); + } + else { + ofDrawBitmapString("restore", restoreButton.x + 3, restoreButton.y + restoreButton.height -3); + } + ofPopStyle(); + + + ofPushMatrix(); + ofTranslate(2,0,0); + glColor4fv(textColor.getColorF()); + guiBaseObject::renderText(); + ofPopMatrix(); + + if( !minimize ){ + + //don't let gui elements go out of their panels + glEnable(GL_SCISSOR_TEST); + glScissor(boundingBox.x, ofGetHeight() - ( boundingBox.y + boundingBox.height - (-2 + topSpacing) ), boundingBox.width - borderWidth , boundingBox.height); + + for(int i = 0; i < (int) panelTabs.size(); i++){ + if( i == selectedPanel){ + ofPushStyle(); + ofFill(); + glColor4fv(fgColor.getSelectedColorF()); + ofRect(panelTabs[i].x, panelTabs[i].y, panelTabs[i].width, panelTabs[i].height); + glColor4fv(outlineColor.getColorF()); + ofPopStyle(); + } + glColor4fv(outlineColor.getColorF()); + ofNoFill(); + ofRect(panelTabs[i].x, panelTabs[i].y, panelTabs[i].width, panelTabs[i].height); + } + + glPushMatrix(); + glTranslatef(hitArea.x, hitArea.y, 0); + for(int i = 0; i < (int) panels.size(); i++){ + if( i == selectedPanel )panels[i]->render(); + } + glPopMatrix(); + + glDisable(GL_SCISSOR_TEST); + } + + ofPopStyle(); +} + + + diff --git a/src/ofxControlPanel/ofxControlPanel.h b/src/ofxControlPanel/ofxControlPanel.h new file mode 100755 index 0000000..71d89d8 --- /dev/null +++ b/src/ofxControlPanel/ofxControlPanel.h @@ -0,0 +1,212 @@ +#pragma once + +#include "ofMain.h" +#include "ofxXmlSettings.h" +#include "guiIncludes.h" + + +class xmlAssociation +{ + public: + xmlAssociation(guiBaseObject * objPtr, string xmlNameIn, int numParamsIn){ + guiObj = objPtr; + xmlName = xmlNameIn; + numParams = numParamsIn; + } + + guiBaseObject * guiObj; + string xmlName; + int numParams; +}; + +class ofxControlPanel: public guiBaseObject{ + + public: + static float borderWidth; + static float topSpacing; + static float tabWidth; + static float tabHeight; + + ofxControlPanel(); + ~ofxControlPanel(); + + void setup(string controlPanelName, float panelX, float panelY, float width, float height); + void loadFont( string fontName, int fontsize ); + + guiTypePanel * addPanel(string panelName, int numColumns, bool locked = false); + + void setWhichPanel(int whichPanel); + void setWhichPanel(string panelName); + void setWhichColumn(int column); + + string getCurrentPanelName(); + + void setSliderWidth(int width); + + guiTypeToggle * addToggle(string name, string xmlName, bool defaultValue); + guiTypeMultiToggle * addMultiToggle(string name, string xmlName, int defaultBox, vector boxNames); + guiTypeSlider * addSlider(string sliderName, string xmlName, float value , float min, float max, bool isInt); + guiType2DSlider * addSlider2D(string sliderName, string xmlName, float valueX, float valueY, float minX, float maxX, float minY, float maxY, bool isInt); + guiTypeDrawable * addDrawableRect(string name, ofBaseDraws * drawablePtr, int drawW, int drawH); + guiTypeVideo * addVideoRect(string name, ofVideoPlayer * drawablePtr, int drawW, int drawH); + guiTypeCustom * addCustomRect(string name, guiCustomImpl * customPtr, int drawW, int drawH); + guiTypeButtonSlider * addButtonSlider(string sliderName, string xmlName, float value , float min, float max, bool isInt); + guiTypeTextDropDown * addTextDropDown(string name, string xmlName, int defaultBox, vector boxNames); + + //THIS SHOULD BE CALLED AFTER ALL GUI SETUP CALLS HAVE HAPPENED + void setupEvents(){ + eventsEnabled = true; + for(int i = 0; i < guiObjects.size(); i++){ + ofAddListener(guiObjects[i]->guiEvent, this, &ofxControlPanel::eventsIn); + } + + //setup an event group for each panel + for(int i = 0; i < panels.size(); i++){ + + vector xmlNames; + + for(int j = 0; j < panels[i]->children.size(); j++){ + xmlNames.push_back(panels[i]->children[j]->xmlName); + } + + string groupName = "PANEL_EVENT_"+ofToString(i); + createEventGroup(groupName, xmlNames); + printf("creating %s\n", groupName.c_str()); + } + + bEventsSetup = true; + } + + void enableEvents(){ + if( !bEventsSetup ){ + setupEvents(); + } + eventsEnabled = true; + } + + void disableEvents(){ + eventsEnabled = false; + } + + ofEvent & getEventsForPanel(int panelNo){ + if( panelNo < panels.size() ){ + return getEventGroup("PANEL_EVENT_"+ofToString(panelNo)); + }else{ + return guiEvent; + } + } + + void createEventGroup(string eventGroupName, vector xmlNames){ + customEvents.push_back( new guiCustomEvent() ); + customEvents.back()->group = eventGroupName; + customEvents.back()->names = xmlNames; + } + + ofEvent & getEventGroup(string eventGroupName){ + for(int i = 0; i < customEvents.size(); i++){ + if( eventGroupName == customEvents[i]->group ){ + return customEvents[i]->guiEvent; + } + } + + //if we don't find a match we return the global event + ofLog(OF_LOG_ERROR, "error eventGroup %s does not exist - returning the global event instead", eventGroupName.c_str()); + return guiEvent; + } + + + void setValueB(string xmlName, bool value, int whichParam = 0); + void setValueI(string xmlName, int value, int whichParam = 0); + void setValueF(string xmlName, float value, int whichParam = 0); + bool getValueB(string xmlName, int whichParam = 0); + float getValueF(string xmlName, int whichParam = 0); + int getValueI(string xmlName, int whichParam = 0); + + void setIncrementSave(string incrmentalFileBaseName); + void disableIncrementSave(); + void loadSettings(string xmlFile); + void reloadSettings(); + void saveSettings(string xmlFile); + void saveSettings(); + void setXMLFilename(string xmlFile); + + void setDraggable(bool bDrag); + void setMinimized(bool bMinimize); + void show(); + void hide(); + + void toggleView(); + void mousePressed(float x, float y, int button); + void mouseDragged(float x, float y, int button); + void mouseReleased(); + + void updateBoundingBox(); + void update(); + void draw(); + + + ofTrueTypeFont guiTTFFont; + + vector xmlObjects; + vector guiObjects; + vector panels; + vector panelTabs; + + vector customEvents; + + ofxXmlSettings settings; + string currentXmlFile; + string settingsDirectory; + + ofRectangle topBar; + ofRectangle minimizeButton; + ofRectangle saveButton; + ofRectangle restoreButton; + + string incrementSaveName; + + bool hidden; + bool usingXml; + bool bUseTTFFont; + bool minimize; + bool saveDown; + bool incrementSave; + bool restoreDown; + bool bDraggable; + + int selectedPanel; + int currentPanel; + + ofPoint prevMouse; + + int sliderWidth; + + bool bEventsSetup; + bool eventsEnabled; + + ofPoint mouseDownPoint; + + bool dragging; + + + protected: + + void eventsIn(guiCallbackData & data){ + if( !eventsEnabled ) return; + + //we notify the ofxControlPanel event object - aka the global ALL events callback + ofNotifyEvent(guiEvent, data, this); + + //we then check custom event groups + for(int i = 0; i < customEvents.size(); i++){ + for(int k = 0; k < customEvents[i]->names.size(); k++){ + if( customEvents[i]->names[k] == data.groupName ){ + ofNotifyEvent(customEvents[i]->guiEvent, data, this); + } + } + } + } + + + +}; diff --git a/src/ofxControlPanel/simpleColor.cpp b/src/ofxControlPanel/simpleColor.cpp new file mode 100755 index 0000000..75bddb3 --- /dev/null +++ b/src/ofxControlPanel/simpleColor.cpp @@ -0,0 +1,40 @@ +#include "simpleColor.h" + +//---------------------------------------------------------- +simpleColor::simpleColor(){ + r = 1.0; + g = 1.0; + b = 1.0; + a = 1.0; +} + +//---------------------------------------------------------- +void simpleColor::setColor(int _r, int _g, int _b, int _a){ + r = (float)_r / 255.0f; r = MAX(0,MIN(r,1.0f)); + g = (float)_g / 255.0f; g = MAX(0,MIN(g,1.0f)); + b = (float)_b / 255.0f; b = MAX(0,MIN(b,1.0f)); + a = (float)_a / 255.0f; a = MAX(0,MIN(a,1.0f)); +} + +//---------------------------------------------------------- +void simpleColor::setColor(int hexColor){ + int r = (hexColor >> 24)& 0xff; + int g = (hexColor >> 16) & 0xff; + int b = (hexColor >> 8) & 0xff; + int a = (hexColor >> 0) & 0xff; + + setColor(r, g, b, a); +} + +//---------------------------------------------------------- +simpleColor& simpleColor::getColor(){ + return *this; +} + +//---------------------------------------------------------- +float * simpleColor::getColorF(){ + return color; +} + + + diff --git a/src/ofxControlPanel/simpleColor.h b/src/ofxControlPanel/simpleColor.h new file mode 100755 index 0000000..07f339b --- /dev/null +++ b/src/ofxControlPanel/simpleColor.h @@ -0,0 +1,38 @@ +#pragma once + +#include "ofMain.h" + +class simpleColor{ + + public: + + //---------------------------------------------------------- + simpleColor(); + + //---------------------------------------------------------- + void setColor(int _r, int _g, int _b, int _a); + + //---------------------------------------------------------- + void setColor(int hexColor); + + //---------------------------------------------------------- + simpleColor& getColor(); + + //---------------------------------------------------------- + float * getColorF(); + + //------------------ + //------------------ + union { + struct { + float r; + float g; + float b; + float a; + }; + float color[4]; + }; + +}; + + diff --git a/src/ofxControlPanel/simpleFileLister.cpp b/src/ofxControlPanel/simpleFileLister.cpp new file mode 100755 index 0000000..bc78f3a --- /dev/null +++ b/src/ofxControlPanel/simpleFileLister.cpp @@ -0,0 +1,98 @@ +#include "simpleFileLister.h" + +simpleFileLister::simpleFileLister(){ + bRevSort = false; + selectedChanged = false; + selected = 0; + lastDirectory = ""; +} + +//------------------------------------------------------------- +int simpleFileLister::refreshDir(){ + + if( lastDirectory != ""){ + int num = simpleFileLister::listDir(lastDirectory); + return num; + } + else return 0; +} + +//------------------------------------------------------------- +int simpleFileLister::listDir(string directory){ + bRevSort = false; + entries.clear(); + + ofxDirList::reset(); + int numFiles = ofxDirList::listDir(directory); + entries.assign(numFiles, entry()); + + for(int i = 0; i < numFiles; i++){ + entries[i].filename = ofxDirList::getName(i); + entries[i].fullpath = ofxDirList::getPath(i); + } + + lastDirectory = directory; + return entries.size(); +} + +//------------------------------------------------------------- +void simpleFileLister::reverseOrder(){ + if( entries.size() ){ + reverse(entries.begin(), entries.end()); + bRevSort = !bRevSort; + } +} + +//------------------------------------------------------------- +bool simpleFileLister::selectedHasChanged(){ + return selectedChanged; +} + +//------------------------------------------------------------- +void simpleFileLister::clearChangedFlag(){ + selectedChanged = false; +} + +//------------------------------------------------ +string simpleFileLister::getName(int which){ + if( which >= 0 && which < entries.size() ){ + return entries[which].filename; + }else{ + return ""; + } +} + +//------------------------------------------------ +string simpleFileLister::getPath(int which){ + if( which >= 0 && which < entries.size() ){ + return entries[which].fullpath; + }else{ + return ""; + } +} + +//------------------------------------------------ +void simpleFileLister::setSelectedFile(int which){ + if( which >= 0 && which < entries.size() ){ + selected = which; + selectedChanged = true; + } +} + +//------------------------------------------------ +string simpleFileLister::getSelectedName(){ + if( selected >= 0 && selected < entries.size() ){ + return entries[selected].filename; + }else{ + return ""; + } +} + +//------------------------------------------------ +string simpleFileLister::getSelectedPath(){ + if( selected >= 0 && selected < entries.size() ){ + return entries[selected].fullpath; + }else{ + return ""; + } +} diff --git a/src/ofxControlPanel/simpleFileLister.h b/src/ofxControlPanel/simpleFileLister.h new file mode 100755 index 0000000..028acdc --- /dev/null +++ b/src/ofxControlPanel/simpleFileLister.h @@ -0,0 +1,39 @@ +#pragma once + +#include "ofMain.h" +#include "ofxDirList.h" + +typedef struct{ + string filename; + string fullpath; +}entry; + + +class simpleFileLister : public ofxDirList{ + + public: + + simpleFileLister(); + int refreshDir(); + + int listDir(string directory); + + void reverseOrder(); + + bool selectedHasChanged(); + void clearChangedFlag(); + + string getName(int which); + string getPath(int which); + void setSelectedFile(int which); + string getSelectedName(); + string getSelectedPath(); + + int selected; + bool selectedChanged; + bool bRevSort; + + string lastDirectory; + + vector entries; +}; diff --git a/src/ofxControlPanel/simpleLogger.cpp b/src/ofxControlPanel/simpleLogger.cpp new file mode 100755 index 0000000..ca56c34 --- /dev/null +++ b/src/ofxControlPanel/simpleLogger.cpp @@ -0,0 +1,142 @@ +#include "simpleLogger.h" + +simpleLogger::simpleLogger(){ + fileLoaded = false; + bDate = true; + bTime = true; + bLevel = true; +} + +//------------------------------------------------ +simpleLogger::~simpleLogger(){ + if(fileLoaded){ + saveFile(); + } +} + +//------------------------------------------------ +void simpleLogger::setup(string logFileName, bool overwrite){ + logFile = logFileName; + + fileLoaded = xml.loadFile(logFile); + if(overwrite){ + xml.clear(); + xml.saveFile(logFile); + } + + if( !fileLoaded ){ + xml.saveFile(logFile); + fileLoaded = true; + } +} + +void simpleLogger::setIncludeDate(bool bIncludeDate){ + bDate = bIncludeDate; +} + +void simpleLogger::setIncludeTime(bool bIncludeTime){ + bTime = bIncludeTime; +} + +void simpleLogger::setIncludeLevelbool(bool bIncludeLevel){ + bLevel = bIncludeLevel; +} + +//-------------------------------------------------- +void simpleLogger::log(int logLevel, const char* format, ...){ + //thanks stefan! + //http://www.ozzu.com/cpp-tutorials/tutorial-writing-custom-printf-wrapper-function-t89166.html + + logRecord record; + record.year = ofGetYear(); + record.month = ofGetMonth(); + record.day = ofGetDay(); + record.hour = ofGetHours(); + record.minute = ofGetMinutes(); + record.seconds = ofGetSeconds(); + record.level = logLevel; + + char str[2048] = {0}; + + va_list args; + va_start( args, format ); + vsprintf(str, format, args ); + va_end( args ); + + record.msg = str; + record.logStr = convertToString(record); + + logs.push_back(record); + logToXml(record); +} + +float simpleLogger::getWidth(){ + return 0; +} + +float simpleLogger::getHeight(){ + return 0; +} + +//---------------------------------------------- +string simpleLogger::convertToString(logRecord & record){ + string timeStr; + string dateStr; + string levelStr; + + if(bDate) dateStr = ofToString(record.year) +"-"+ofToString(record.month) +"-"+ ofToString(record.day)+" "; + if(bTime) timeStr = ofToString(record.hour) + ":"+ ofToString(record.minute) + ":"+ ofToString(record.seconds)+" "; + + if( bLevel ){ + if(record.level == OF_LOG_VERBOSE) levelStr = "VERBOSE: "; + else if(record.level == OF_LOG_NOTICE)levelStr = "NOTICE: "; + else if(record.level == OF_LOG_WARNING)levelStr = "WARNING: "; + else if(record.level == OF_LOG_ERROR)levelStr = "ERROR: "; + else if(record.level == OF_LOG_FATAL_ERROR)levelStr = "FATAL_ERROR: "; + } + + return dateStr + timeStr + levelStr + record.msg; +} + +//----------------------------------------------- +void simpleLogger::logToXml(logRecord & record){ + if(!fileLoaded)return; + xml.addValue("log", record.logStr); +} + +//-----------------------------------------------. +void simpleLogger::saveFile(){ + xml.saveFile(logFile); +} + +//-----------------------------------------------. +void simpleLogger::draw(float x, float y){ + ofPushStyle(); + float yPos; + for(int i = logs.size()-1; i >= 0; i--){ + yPos += 13.6; + string str = logs[i].logStr; + ofDrawBitmapString(str, x, y + yPos); + } + ofPopStyle(); +} + +//-----------------------------------------------. +void simpleLogger::draw(float x, float y, float width, float height){ + ofPushStyle(); + float yPos; + for(int i = logs.size()-1; i >= 0; i--){ + yPos += 13.6; + if(yPos >= height)break; + + string str = logs[i].logStr; + if( str.length() * 8> width ){ + int newLen = (float)width / 8; + //newLen = ofClamp(newLen, 1, 999999); + str = str.substr(0, newLen); + } + + ofDrawBitmapString(str, x, y + yPos); + } + ofPopStyle(); +} \ No newline at end of file diff --git a/src/ofxControlPanel/simpleLogger.h b/src/ofxControlPanel/simpleLogger.h new file mode 100755 index 0000000..f41ac93 --- /dev/null +++ b/src/ofxControlPanel/simpleLogger.h @@ -0,0 +1,57 @@ +#pragma once + +#include "ofMain.h" +#include "ofxXmlSettings.h" + +typedef struct{ + string msg; + int level; + + string logStr; + + long timestamp; + int year; + int month; + int day; + int hour; + int minute; + int seconds; +}logRecord; + +class simpleLogger : public ofBaseDraws{ + + public: + + simpleLogger(); + ~simpleLogger(); + + void setup(string logFileName, bool overwrite); + void setIncludeDate(bool bIncludeDate); + void setIncludeTime(bool bIncludeTime); + void setIncludeLevelbool(bool bIncludeLevel); + + //-------------------------------------------------- + void log(int logLevel, const char* format, ...); + + float getWidth(); + float getHeight(); + + //---------------------------------------------- + string convertToString(logRecord & record); + + void logToXml(logRecord & record); + void saveFile(); + + void draw(float x, float y); + void draw(float x, float y, float width, float height); + + string logFile; + ofxXmlSettings xml; + bool fileLoaded; + + bool bLevel; + bool bTime; + bool bDate; + + vector logs; +}; diff --git a/src/testApp.cpp b/src/testApp.cpp new file mode 100755 index 0000000..bd06da9 --- /dev/null +++ b/src/testApp.cpp @@ -0,0 +1,136 @@ +#include "testApp.h" + + +//-------------------------------------------------------------- +void testApp::setup(){ + ofBackground(127,127,127); + //ofSetFrameRate(60); + //vision.loadVideo("video/motion2.mov"); + vision.setupCamera(0, 320, 240); + + camDraw.setup(&vision.gray, &vision.motionField); + threshDraw.setup(&vision.thresh, &vision.motionField); + + gui.setup("test cv", 0, 0, ofGetWidth(), 700); + gui.addPanel("first panel", 4, false); + gui.addPanel("second panel", 1, false); + gui.addPanel("third panel", 1, false); + + gui.setWhichPanel(0); + + vector names; + names.push_back("top"); + names.push_back("left"); + names.push_back("right"); + names.push_back("down"); + + gui.setWhichColumn(0); + gui.addDrawableRect("video and motion", &camDraw, 200, 150); + + gui.setWhichColumn(1); + gui.addDrawableRect("motion diff", &threshDraw, 200, 150); + + gui.setWhichColumn(2); + stats.setDrawScale(2000.0); + gui.addDrawableRect("average motion", &stats, 200, 150); + + gui.setWhichColumn(3); + gui.addSlider("field draw scale", "FIELD_DRAW_SCALE", 1.0, 1.0, 10.0, false); + gui.addTextDropDown("direction", "DIRECTION", 0, names); + + //if you want to use events call this after you have added all your gui elements + gui.setupEvents(); + + vector list; + list.push_back("FIELD_DRAW_SCALE"); + list.push_back("DIRECTION"); + gui.createEventGroup("TEST_GROUP", list); + + ofAddListener(gui.getEventsForPanel(0), this, &testApp::eventsIn); + +} + +//-------------------------------------------------------------- +void testApp::eventsIn(guiCallbackData & data){ + + printf("testApp::eventsIn - name is %s - \n", data.groupName.c_str()); + if( data.elementName != "" ){ + printf(" element name is %s \n", data.elementName.c_str()); + } + if( data.fVal.size() ){ + for(int i = 0; i < data.fVal.size(); i++){ + printf(" float value [%i] = %f \n", i, data.fVal[i]); + } + } + if( data.iVal.size() ){ + for(int i = 0; i < data.iVal.size(); i++){ + printf(" int value [%i] = %i \n", i, data.iVal[i]); + } + } + if( data.sVal.size() ){ + for(int i = 0; i < data.sVal.size(); i++){ + printf(" string value [%i] = %s \n", i, data.sVal[i].c_str()); + } + } + printf("\n"); +} + +//-------------------------------------------------------------- +void testApp::update(){ + +// vision.setThreshold(thresh); +// vision.setFadeAmnt(fade); + + camDraw.setDrawScale(gui.getValueF("FIELD_DRAW_SCALE")); + threshDraw.setDrawScale(gui.getValueF("FIELD_DRAW_SCALE")); + + vision.update(); + + stats.updateFromField(vision.motionField, 0.97); + + gui.update(); +} + +//-------------------------------------------------------------- +void testApp::draw(){ + ofSetColor(0xffffff); + gui.draw(); +} + + +//-------------------------------------------------------------- +void testApp::keyPressed (int key){ + + //if you need to adjust the camera properties + if(key == 's'){ + vision.camera.videoSettings(); + } + +// gui.keyPressed(key); +} + +//-------------------------------------------------------------- +void testApp::keyReleased (int key){ + +} + +//-------------------------------------------------------------- +void testApp::mouseMoved(int x, int y ){ + +} + +//-------------------------------------------------------------- +void testApp::mouseDragged(int x, int y, int button){ + gui.mouseDragged(x, y, button); +} + +//-------------------------------------------------------------- +void testApp::mousePressed(int x, int y, int button){ + gui.mousePressed(x, y, button); + +} + +//-------------------------------------------------------------- +void testApp::mouseReleased(){ + gui.mouseReleased(); +} diff --git a/src/testApp.h b/src/testApp.h new file mode 100755 index 0000000..69ca754 --- /dev/null +++ b/src/testApp.h @@ -0,0 +1,53 @@ +#ifndef _TEST_APP +#define _TEST_APP + + +//#define OF_ADDON_USING_OFXOPENCV +//#define OF_ADDON_USING_OFXOBJLOADER +//#define OF_ADDON_USING_OFXDIRLIST +//#define OF_ADDON_USING_OFXVECTORMATH +//#define OF_ADDON_USING_OFXNETWORK +//#define OF_ADDON_USING_OFXVECTORGRAPHICS +//#define OF_ADDON_USING_OFXOSC +//#define OF_ADDON_USING_OFXTHREAD +//#define OF_ADDON_USING_OFXXMLSETTINGS + +#include "ofMain.h" +#include "ofAddons.h" +#include "computerVision.h" +#include "ofxControlPanel.h" + + +class testApp : public ofSimpleApp{ + + public: + + int iAvrg; + float avrgArray[20]; + float xVec, yVec; + + void setup(); + void update(); + void draw(); + + void eventsIn(guiCallbackData & data); + + void keyPressed (int key); + void keyReleased (int key); + + void mouseMoved(int x, int y ); + void mouseDragged(int x, int y, int button); + void mousePressed(int x, int y, int button); + void mouseReleased(); + + ofxControlPanel gui; + + motionStats stats; + motionDraw threshDraw; + motionDraw camDraw; + computerVision vision; + +}; + +#endif + diff --git a/src/vectorField/vectorField.cpp b/src/vectorField/vectorField.cpp new file mode 100755 index 0000000..e69de29 diff --git a/src/vectorField/vectorField.h b/src/vectorField/vectorField.h new file mode 100755 index 0000000..39851ca --- /dev/null +++ b/src/vectorField/vectorField.h @@ -0,0 +1,238 @@ +#ifndef _VEC_FIELD +#define _VEC_FIELD + +#define OF_ADDON_USING_OFXVECTORMATH + +#include "ofMain.h" +#include "ofAddons.h" + +#define NUM_BINS_X 120 +#define NUM_BINS_Y 80 + +class vectorField{ + + public: + vectorField(){ + binW = 1.0/NUM_BINS_X; + binH = 1.0/NUM_BINS_Y; + } + + //------------------------------------------------- + void addIntoField(float x, float y, ofxVec2f vec, float radius = 1.0){ + + if(x >= 1.0 || x < 0 || y >= 1.0 || y < 0){ + return; + } + + ofxVec2f pos(x,y); + ofxVec2f raster; + + raster.x = pos.x; + raster.y = pos.y; + + float startX = raster.x - radius; + float startY = raster.y- radius; + + float endX = raster.x + radius; + float endY = raster.y + radius; + + int sx = (startX * NUM_BINS_X)-1; + int sy = (startY * NUM_BINS_Y)-1; + + int ex = (endX * NUM_BINS_X)+1; + int ey = (endY * NUM_BINS_Y)+1; + + sx = MAX(sx, 0); + sy = MAX(sy, 0); + ex = MAX(ex, 0); + ey = MAX(ey, 0); + + sx = MIN(sx, NUM_BINS_X); + sy = MIN(sy, NUM_BINS_Y); + ex = MIN(ex, NUM_BINS_X); + ey = MIN(ey, NUM_BINS_Y); + + ofxVec2f binPos; + ofxVec2f distVec; + float dist = 0; + float amnt = 0; + + for(int yy = sy; yy < ey; yy++){ + for(int xx = sx; xx < ex; xx++){ + + binPos.set( (float)xx * binW, (float)yy * binH); + distVec = binPos - pos; + dist = distVec.length(); + + if(dist > radius)continue; + + amnt = 1.0 - (dist - radius); + + //amnt * amnt makes the rolloff less linear + field[xx][yy] += vec*amnt*amnt; + } + } + } + + //------------------------------------------------- + void blur(float amnt){ + + if(amnt > 1.0)amnt = 1.0; + else if(amnt < 0.0)amnt = 0.0; + + ofxVec2f blur; + + float ramnt = (1.0 - amnt) * 0.25; + + for(int yy = 1; yy < NUM_BINS_Y-1; yy++){ + for(int xx = 1; xx < NUM_BINS_X-1; xx++){ + + blur = field[xx][yy] * amnt + field[xx+1][yy] * ramnt + field[xx-1][yy] * ramnt + field[xx][yy+1] * ramnt + field[xx][yy-1] * ramnt; + field[xx][yy] = blur; + + if( fabs(field[xx][yy].x) <= 0.0001 && fabs(field[xx][yy].y) <= 0.0001 ){ + field[xx][yy] = 0.0; + } + } + } + } + + //------------------------------------------------- + ofxVec2f getTrueAverage(){ + + ofxVec2f vec; + for(int yy = 0; yy < NUM_BINS_Y; yy++){ + for(int xx = 0; xx < NUM_BINS_X; xx++){ + vec += field[xx][yy]; + } + } + + int total = NUM_BINS_X * NUM_BINS_Y; + if( total <= 0 )return 0; + + vec /= (float)total; + + return vec; + } + + //------------------------------------------------- + ofxVec2f getModeAverage(){ + + int count = 0; + ofxVec2f vec; + for(int yy = 0; yy < NUM_BINS_Y; yy++){ + for(int xx = 0; xx < NUM_BINS_X; xx++){ + + if( field[xx][yy].x != 0.0 && field[xx][yy].y != 0.0 ){ + vec += field[xx][yy]; + count++; + } + } + } + + if( count <= 0 )return 0; + vec /= (float)count; + + return vec; + } + + //------------------------------------------------- + ofxVec2f readFromField(float x, float y){ + + if(x >= 1.0 || x < 0 || y >= 1.0 || y < 0){ + return ofxVec2f(); + } + + int rasterX = x * NUM_BINS_X; + int rasterY = y * NUM_BINS_Y; + + ofxVec2f vec = field[rasterX][rasterY]; + + return vec; + } + + + //------------------------------------------------- + void normalize(){ + + for(int yy = 0; yy < NUM_BINS_Y; yy++){ + for(int xx = 0; xx < NUM_BINS_X; xx++){ + field[xx][yy].normalize(); + } + } + } + + //------------------------------------------------- + void randomize(float mag, float pct){ + + pct = MIN(1.0, pct); + pct = MAX(0.0, pct); + + for(int yy = 0; yy < NUM_BINS_Y; yy++){ + for(int xx = 0; xx < NUM_BINS_X; xx++){ + field[xx][yy] *= 1.0 - pct; + field[xx][yy] += ofxVec2f( ofRandom(-1.0, 1.0), ofRandom(-1.0, 1.0)) * mag * pct; + } + } + } + + //------------------------------------------------- + void clear(){ + + for(int yy = 0; yy < NUM_BINS_Y; yy++){ + for(int xx = 0; xx < NUM_BINS_X; xx++){ + field[xx][yy].set(0,0); + } + } + } + + //------------------------------------------------- + void fade(float pct){ + + for(int yy = 0; yy < NUM_BINS_Y; yy++){ + for(int xx = 0; xx < NUM_BINS_X; xx++){ + field[xx][yy] *= pct; + } + } + } + + + //------------------------------------------------- + void draw(int x, int y, float width, float height, float scale = 1.0){ + + ofxVec2f pixelPos; + ofxVec2f vec; + + glPushMatrix(); + glTranslatef(x, y, 0); + + for(int yy = 0; yy < NUM_BINS_Y; yy++){ + for(int xx = 0; xx < NUM_BINS_X; xx++){ + + pixelPos.set( (float)xx * binW * width, (float)yy * binH * height ); + vec = (field[xx][yy]) * scale; + + + glBegin(GL_LINES); + ofSetColor(0x000044); + glVertex2f(pixelPos.x, pixelPos.y); + ofSetColor(0xFFFF33); + glVertex2f(pixelPos.x + vec.x, pixelPos.y + vec.y); + glEnd(); + + //ofCircle(pixelPos.x, pixelPos.y, 2); + } + } + + glPopMatrix(); + } + + + ofxVec2f field[NUM_BINS_X][NUM_BINS_Y]; + float binW, binH; + + +}; + +#endif + diff --git a/src/vision/computerVision.h b/src/vision/computerVision.h new file mode 100755 index 0000000..02723d9 --- /dev/null +++ b/src/vision/computerVision.h @@ -0,0 +1,395 @@ +#pragma once + +#define OF_ADDON_USING_OFXOPENCV +//#define OF_ADDON_USING_OFXDIRLIST +#define OF_ADDON_USING_OFXVECTORMATH +//#define OF_ADDON_USING_OFXXMLSETTINGS + + +#include "ofMain.h" +#include "ofAddons.h" +#include "vectorField.h" + + +class motionDraw : public ofBaseDraws{ + public: + + motionDraw(){ + vid = NULL; + field = NULL; + drawScale = 1.0; + } + + void setup( ofBaseDraws * vidPtr, vectorField * fieldPtr ){ + vid = vidPtr; + field = fieldPtr; + } + + void setDrawScale(float scale){ + drawScale = scale; + } + + void draw(float x, float y, float w, float h){ + ofSetColor(0xFFFFFF); + vid->draw(x, y, w, h); + field->draw(x, y, w, h, drawScale); + } + + void draw(float x, float y){ + draw(x, y, 320, 240); + } + + virtual float getHeight(){ + return 240.0f; + } + virtual float getWidth(){ + return 320.0f; + } + + ofBaseDraws * vid; + vectorField * field; + float drawScale; +}; + +class motionStats : public ofBaseDraws{ + public: + + motionStats(){ + drawScale = 1.0; + } + + void updateFromField( vectorField &field, float smoothing = 1.0){ + ofxVec2f valIn = field.getTrueAverage(); + + val *= 0.9; + val += valIn * 0.1; + + normalized *= smoothing; + normalized += valIn.normalized() * (1.0 - smoothing); + } + + void setDrawScale(float scale){ + drawScale = scale; + } + + void draw(float x, float y, float w, float h){ + ofPushMatrix(); + ofTranslate(x, y, 0); + + ofSetColor(255, 120, 33); + ofLine(w/2, h/2, w/2 + normalized.x * h * 0.4, h/2 + normalized.y * h * 0.4); + + ofSetColor(0, 200, 33); + ofLine(w/2, h/2, w/2 + val.x * drawScale, h/2 + val.y * drawScale); + + ofPopMatrix(); + } + + void draw(float x, float y){ + draw(x, y, 320, 240); + } + + virtual float getHeight(){ + return 240.0f; + } + virtual float getWidth(){ + return 320.0f; + } + + float drawScale; + ofxVec2f normalized; + ofPoint val; +}; + + +class computerVision{ + + public: + + //---------- + void loadVideo(string path){ + video.loadMovie(path); + video.play(); + + color.allocate(video.width, video.height); + gray.allocate(video.width, video.height); + thresh.allocate(video.width, video.height); + prev.allocate(video.width, video.height); + motion.allocate(video.width, video.height); + threshF.allocate(video.width, video.height); + + fadeAmnt = 0.66; + threshAmnt = 29; + bPauseVideo = false; + frameCount = 0; + bUseCamera = false; + } + + //------------ + void setupCamera(int which, int width, int height){ + camera.setDeviceID(which); + camera.initGrabber(width, height); + + color.allocate(camera.width, camera.height); + gray.allocate(camera.width, camera.height); + thresh.allocate(camera.width, camera.height); + prev.allocate(camera.width, camera.height); + motion.allocate(camera.width, camera.height); + threshF.allocate(camera.width, camera.height); + + fadeAmnt = 0.66; + threshAmnt = 29; + bPauseVideo = false; + frameCount = 0; + bUseCamera = true; + } + + + //----------- + //some funky code that theo wrote + //goes through for every vector in the vector field + //and looks at the closest pixel and its neighbours. + //motion is then calculated as the sum of the vectors between + //pixel and its neighbours + + //works on the motion history image (gradiant image) + void convertMotionHistoryToField(){ + int numPixels = motion.width * motion.height; + unsigned char * pixels = motion.getPixels(); + + unsigned char gradientThresh = 10; + int index = 0; + int yPos = 0; + int yypos = 0; + unsigned char tmpVal = 0; + int pixX, pixY; + + ofxVec2f vec; + ofxVec2f tmp; + + float xPct = 0; + float yPct = 0; + + float xStep = (float)motion.width / NUM_BINS_X; + float yStep = (float)motion.height / NUM_BINS_Y; + + //go through for every vector in the vector field + for(int y = 0; y < NUM_BINS_Y; y++){ + pixY = yStep * (float)y ; + yPos = pixY * motion.width; + + for(int x = 0; x < NUM_BINS_X; x++){ + pixX = xStep * (float)x; + + index = pixX + yPos; + + //if the pixel is close to black we don't want to use for motion information as it is old + if(pixels[index] < gradientThresh){ + motionField.field[x][y] = 0; + }else{ + tmp = 0; + //go through for the pixels neighbours + for(int yy = -1; yy < 2; yy++){ + for(int xx = -1; xx < 2; xx++){ + //if we are outside the image - we skip the pixel + if(pixX + xx < 0 || pixX + xx > motion.width || pixY + yy < 0 || pixY + yy > motion.height){ + continue; + }else{ + tmpVal = pixels[index + xx + (yy*motion.width) ]; + + //if the neighbour is dark enough to be considered black + if(tmpVal <= gradientThresh)continue; + + //otherwise we add the value to our overall vector for the pixel we are looking at + if( pixels[index] < tmpVal ){ + tmp.x += xx; + tmp.y += yy; + }else if( pixels[index] > tmpVal ){ + tmp.x -= xx; + tmp.y -= yy; + } + } + } + } + + //finally update the field + motionField.field[x][y] = tmp; + } + } + } + } + + //----------- + void update(){ + + if(bPauseVideo ) return; + + if(bUseCamera){ + camera.grabFrame(); + + if(camera.isFrameNew()){ + prev = gray; + color.setFromPixels(camera.getPixels(), camera.width, camera.height); + color.mirror(false, true); + } + + }else{ + + video.idleMovie(); + if(video.isFrameNew()){ + prev = gray; + frameCount++; + }else{ + return; + } + + color.setFromPixels(video.getPixels(), video.width, video.height); + } + + //convert the color image to grayscale + gray = color; + + //do absolute diff between the prev frame and current frame + //all pixels that are different will show up as non-black + thresh.absDiff(gray, prev); + + //threshold to 0 or 255 value + thresh.threshold(threshAmnt); + + //convert to float + threshF = thresh; + + //fade the motion history image + motion /= 2; + + //add in the floating point version of the thresholded image + motion += threshF; + + //do our motion tracking and blur the results a little + convertMotionHistoryToField(); + motionField.blur(0.1); + + } + + //----------- + //here we add up all the directions from the + //vector field and average them out to an overall + //direction - this will be quite small so you will want + //to scale it up. + ofxVec2f getOverallMotionFromField(){ + + int numVecs = NUM_BINS_X * NUM_BINS_Y; + + ofxVec2f avg = 0; + for(int y = 0; y < NUM_BINS_Y; y++){ + for(int x = 0; x < NUM_BINS_X; x++){ + avg += motionField.field[x][y]; + } + } + + avg /= numVecs; + return avg; + } + + float verticalMotion(){ + int numPixels = thresh.width * thresh.height; + unsigned char * pixels = thresh.getPixels(); + int runningTotal; + runningTotal = 0; + int xMovement[thresh.width]; + + int firstLeft, firstRight; + firstLeft = -1; + firstRight = -1; + + float moment; + moment = 0; + float weightTotal; + weightTotal = 0; + + for (int i = 0; i < thresh.width; i++){ + xMovement[i] = 0; + } + + for (int j = 0; j < numPixels; j += thresh.width){ + for (int i = 0; i < thresh.width; i ++){ + if (pixels[i+j] > 10) xMovement[i]++; + } + } + + for (int i = 0; i < thresh.width; i++){ + if(xMovement[i] != 0){ + if(firstLeft == -1) firstLeft = i; + firstRight = i; + } + } + + //cout << runningTotal << endl; + + for (int i = firstLeft; i < firstRight + 1; i++){ + moment += ((i - firstLeft) * xMovement[i]); + weightTotal += xMovement[i]; + } + + float weightedXVal; + weightedXVal = (moment / weightTotal) + firstLeft; + + if(firstLeft == -1 || firstRight == -1) weightedXVal = -1; + + + return weightedXVal; + } + + //----------- + void draw(float x, float y){ + ofSetColor(0xFFFFFF); + gray.draw(x, y); + thresh.draw(x, y + gray.height); + motion.draw(x, y + gray.height + thresh.height); + motionField.draw(x, y, gray.width, gray.height, 4); + motionField.draw(x, y + gray.height + thresh.height, gray.width,gray.height, 10); + } + + //----------- + void setFadeAmnt(float fadeVal){ + fadeAmnt = fadeVal; + } + + //----------- + void setThreshold(int threshVal){ + threshAmnt = threshVal; + } + + //----------- + void togglePlayback(){ + motion = thresh; + bPauseVideo = !bPauseVideo; + if(bPauseVideo){ + video.setPaused(true); + }else{ + video.setPaused(false); + } + } + + ofxCvGrayscaleImage gray; + ofxCvColorImage color; + + ofxCvGrayscaleImage thresh; + ofxCvGrayscaleImage prev; + + ofxCvFloatImage motion; + ofxCvFloatImage threshF; + + ofVideoPlayer video; + ofVideoGrabber camera; + + vectorField motionField; + + float threshAmnt, fadeAmnt; + bool bPauseVideo; + bool bUseCamera; + int frameCount; + +}; + +