├── .gitignore ├── README.md ├── example-simplePoints ├── Makefile ├── Project.xcconfig ├── addons.make ├── config.make ├── example-simplePoints.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ └── focus.xcuserdatad │ │ ├── UserInterfaceState.xcuserstate │ │ └── WorkspaceSettings.xcsettings ├── openFrameworks-Info.plist └── src │ ├── main.cpp │ ├── testApp.cpp │ └── testApp.h ├── libs └── Delaunay │ └── src │ ├── Delaunay.cpp │ └── Delaunay.h └── src ├── ofxDelaunay2D.cpp └── ofxDelaunay2D.h /.gitignore: -------------------------------------------------------------------------------- 1 | *.mode* 2 | *.pbxuser 3 | build/ 4 | obj/ 5 | *.o 6 | openFrameworks.a 7 | openFrameworksDebug.a 8 | openFrameworksUniversal.a 9 | *.app/ 10 | 11 | CustomAdddons/ 12 | 13 | #rule to avoid non-official addons going into git 14 | #see addons/.gitignore 15 | 16 | #codeblocks files 17 | apps/*/*/*.layout 18 | apps/*/*/*.depend 19 | apps/*/*/bin/clickToLaunch* 20 | apps/*/*/bin/libs 21 | apps/*/*/obj 22 | 23 | #rule to avoid non-official apps going into git 24 | #see apps/.gitignore 25 | apps 26 | 27 | #codeblocks OF lib files 28 | libs/openFrameworksCompiled/project/*/*.depend 29 | libs/openFrameworksCompiled/project/*/*.layout 30 | 31 | #linux temporary files 32 | *~ 33 | 34 | #eclipse build folders 35 | #Mac OS X 36 | addons/Debug Mac OS X 37 | addons/Release Mac OS X 38 | libs/openFrameworks/Debug Mac OS X 39 | libs/openFrameworks/Release Mac OS X 40 | apps/*/*/Debug Mac OS X 41 | apps/*/*/Release Mac OS X 42 | .DS_Store 43 | *.perspectivev3 44 | xcuserdata/ 45 | 46 | #Linux 47 | addons/Debug Linux 48 | addons/Release Linux 49 | libs/openFrameworks/Debug Linux 50 | libs/openFrameworks/Release Linux 51 | apps/*/*/Debug Linux 52 | apps/*/*/Release Linux 53 | apps/*/*/Debug Linux64 54 | apps/*/*/Release Linux64 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ofxDelaunay 2 | 3 | Paul Bourke's Delaunay Triangulation implementation. 4 | 5 | This is a big refactor from Julapy (Lukasz Karluk) and Pat Long's version (http://code.google.com/p/julapy/source/browse/trunk/openframeworks/ofxDelaunay/?r=708) 6 | 7 | Changes: 8 | * Now uses ofMesh rather than custom data structure 9 | * uses std::vector for internal storage, which removes need for reallocating memory or constructor/destructors 10 | * Removed need for setMaxPoints(). No max points enforced 11 | * Simplified API to just two functions 12 | 13 | Known issues: 14 | * The core triangulation code does not always take into account all points, resulting in missing triangles. -------------------------------------------------------------------------------- /example-simplePoints/Makefile: -------------------------------------------------------------------------------- 1 | # Attempt to load a config.make file. 2 | # If none is found, project defaults in config.project.make will be used. 3 | ifneq ($(wildcard config.make),) 4 | include config.make 5 | endif 6 | 7 | # make sure the the OF_ROOT location is defined 8 | ifndef OF_ROOT 9 | OF_ROOT=../../.. 10 | endif 11 | 12 | # call the project makefile! 13 | include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk 14 | -------------------------------------------------------------------------------- /example-simplePoints/Project.xcconfig: -------------------------------------------------------------------------------- 1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. 2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED 3 | OF_PATH = ../../.. 4 | 5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE 6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" 7 | 8 | OTHER_LDFLAGS = $(OF_CORE_LIBS) 9 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 10 | -------------------------------------------------------------------------------- /example-simplePoints/addons.make: -------------------------------------------------------------------------------- 1 | ofxDelaunay2D 2 | -------------------------------------------------------------------------------- /example-simplePoints/config.make: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # CONFIGURE PROJECT MAKEFILE (optional) 3 | # This file is where we make project specific configurations. 4 | ################################################################################ 5 | 6 | ################################################################################ 7 | # OF ROOT 8 | # The location of your root openFrameworks installation 9 | # (default) OF_ROOT = ../../.. 10 | ################################################################################ 11 | # OF_ROOT = ../../.. 12 | 13 | ################################################################################ 14 | # PROJECT ROOT 15 | # The location of the project - a starting place for searching for files 16 | # (default) PROJECT_ROOT = . (this directory) 17 | # 18 | ################################################################################ 19 | # PROJECT_ROOT = . 20 | 21 | ################################################################################ 22 | # PROJECT SPECIFIC CHECKS 23 | # This is a project defined section to create internal makefile flags to 24 | # conditionally enable or disable the addition of various features within 25 | # this makefile. For instance, if you want to make changes based on whether 26 | # GTK is installed, one might test that here and create a variable to check. 27 | ################################################################################ 28 | # None 29 | 30 | ################################################################################ 31 | # PROJECT EXTERNAL SOURCE PATHS 32 | # These are fully qualified paths that are not within the PROJECT_ROOT folder. 33 | # Like source folders in the PROJECT_ROOT, these paths are subject to 34 | # exlclusion via the PROJECT_EXLCUSIONS list. 35 | # 36 | # (default) PROJECT_EXTERNAL_SOURCE_PATHS = (blank) 37 | # 38 | # Note: Leave a leading space when adding list items with the += operator 39 | ################################################################################ 40 | # PROJECT_EXTERNAL_SOURCE_PATHS = 41 | 42 | ################################################################################ 43 | # PROJECT EXCLUSIONS 44 | # These makefiles assume that all folders in your current project directory 45 | # and any listed in the PROJECT_EXTERNAL_SOURCH_PATHS are are valid locations 46 | # to look for source code. The any folders or files that match any of the 47 | # items in the PROJECT_EXCLUSIONS list below will be ignored. 48 | # 49 | # Each item in the PROJECT_EXCLUSIONS list will be treated as a complete 50 | # string unless teh user adds a wildcard (%) operator to match subdirectories. 51 | # GNU make only allows one wildcard for matching. The second wildcard (%) is 52 | # treated literally. 53 | # 54 | # (default) PROJECT_EXCLUSIONS = (blank) 55 | # 56 | # Will automatically exclude the following: 57 | # 58 | # $(PROJECT_ROOT)/bin% 59 | # $(PROJECT_ROOT)/obj% 60 | # $(PROJECT_ROOT)/%.xcodeproj 61 | # 62 | # Note: Leave a leading space when adding list items with the += operator 63 | ################################################################################ 64 | # PROJECT_EXCLUSIONS = 65 | 66 | ################################################################################ 67 | # PROJECT LINKER FLAGS 68 | # These flags will be sent to the linker when compiling the executable. 69 | # 70 | # (default) PROJECT_LDFLAGS = -Wl,-rpath=./libs 71 | # 72 | # Note: Leave a leading space when adding list items with the += operator 73 | # 74 | # Currently, shared libraries that are needed are copied to the 75 | # $(PROJECT_ROOT)/bin/libs directory. The following LDFLAGS tell the linker to 76 | # add a runtime path to search for those shared libraries, since they aren't 77 | # incorporated directly into the final executable application binary. 78 | ################################################################################ 79 | # PROJECT_LDFLAGS=-Wl,-rpath=./libs 80 | 81 | ################################################################################ 82 | # PROJECT DEFINES 83 | # Create a space-delimited list of DEFINES. The list will be converted into 84 | # CFLAGS with the "-D" flag later in the makefile. 85 | # 86 | # (default) PROJECT_DEFINES = (blank) 87 | # 88 | # Note: Leave a leading space when adding list items with the += operator 89 | ################################################################################ 90 | # PROJECT_DEFINES = 91 | 92 | ################################################################################ 93 | # PROJECT CFLAGS 94 | # This is a list of fully qualified CFLAGS required when compiling for this 95 | # project. These CFLAGS will be used IN ADDITION TO the PLATFORM_CFLAGS 96 | # defined in your platform specific core configuration files. These flags are 97 | # presented to the compiler BEFORE the PROJECT_OPTIMIZATION_CFLAGS below. 98 | # 99 | # (default) PROJECT_CFLAGS = (blank) 100 | # 101 | # Note: Before adding PROJECT_CFLAGS, note that the PLATFORM_CFLAGS defined in 102 | # your platform specific configuration file will be applied by default and 103 | # further flags here may not be needed. 104 | # 105 | # Note: Leave a leading space when adding list items with the += operator 106 | ################################################################################ 107 | # PROJECT_CFLAGS = 108 | 109 | ################################################################################ 110 | # PROJECT OPTIMIZATION CFLAGS 111 | # These are lists of CFLAGS that are target-specific. While any flags could 112 | # be conditionally added, they are usually limited to optimization flags. 113 | # These flags are added BEFORE the PROJECT_CFLAGS. 114 | # 115 | # PROJECT_OPTIMIZATION_CFLAGS_RELEASE flags are only applied to RELEASE targets. 116 | # 117 | # (default) PROJECT_OPTIMIZATION_CFLAGS_RELEASE = (blank) 118 | # 119 | # PROJECT_OPTIMIZATION_CFLAGS_DEBUG flags are only applied to DEBUG targets. 120 | # 121 | # (default) PROJECT_OPTIMIZATION_CFLAGS_DEBUG = (blank) 122 | # 123 | # Note: Before adding PROJECT_OPTIMIZATION_CFLAGS, please note that the 124 | # PLATFORM_OPTIMIZATION_CFLAGS defined in your platform specific configuration 125 | # file will be applied by default and further optimization flags here may not 126 | # be needed. 127 | # 128 | # Note: Leave a leading space when adding list items with the += operator 129 | ################################################################################ 130 | # PROJECT_OPTIMIZATION_CFLAGS_RELEASE = 131 | # PROJECT_OPTIMIZATION_CFLAGS_DEBUG = 132 | 133 | ################################################################################ 134 | # PROJECT COMPILERS 135 | # Custom compilers can be set for CC and CXX 136 | # (default) PROJECT_CXX = (blank) 137 | # (default) PROJECT_CC = (blank) 138 | # Note: Leave a leading space when adding list items with the += operator 139 | ################################################################################ 140 | # PROJECT_CXX = 141 | # PROJECT_CC = 142 | -------------------------------------------------------------------------------- /example-simplePoints/example-simplePoints.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 42; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | BBAB23CB13894F3D00AA2426 /* GLUT.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = BBAB23BE13894E4700AA2426 /* GLUT.framework */; }; 11 | E4328149138ABC9F0047C5CB /* openFrameworksDebug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E4328148138ABC890047C5CB /* openFrameworksDebug.a */; }; 12 | E45BE97B0E8CC7DD009D7055 /* AGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9710E8CC7DD009D7055 /* AGL.framework */; }; 13 | E45BE97C0E8CC7DD009D7055 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9720E8CC7DD009D7055 /* ApplicationServices.framework */; }; 14 | E45BE97D0E8CC7DD009D7055 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9730E8CC7DD009D7055 /* AudioToolbox.framework */; }; 15 | E45BE97E0E8CC7DD009D7055 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9740E8CC7DD009D7055 /* Carbon.framework */; }; 16 | E45BE97F0E8CC7DD009D7055 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9750E8CC7DD009D7055 /* CoreAudio.framework */; }; 17 | E45BE9800E8CC7DD009D7055 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9760E8CC7DD009D7055 /* CoreFoundation.framework */; }; 18 | E45BE9810E8CC7DD009D7055 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9770E8CC7DD009D7055 /* CoreServices.framework */; }; 19 | E45BE9830E8CC7DD009D7055 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9790E8CC7DD009D7055 /* OpenGL.framework */; }; 20 | E45BE9840E8CC7DD009D7055 /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE97A0E8CC7DD009D7055 /* QuickTime.framework */; }; 21 | E4B69E200A3A1BDC003C02F2 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4B69E1D0A3A1BDC003C02F2 /* main.cpp */; }; 22 | E4B69E210A3A1BDC003C02F2 /* testApp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4B69E1E0A3A1BDC003C02F2 /* testApp.cpp */; }; 23 | E4C2424710CC5A17004149E2 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4C2424410CC5A17004149E2 /* AppKit.framework */; }; 24 | E4C2424810CC5A17004149E2 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4C2424510CC5A17004149E2 /* Cocoa.framework */; }; 25 | E4C2424910CC5A17004149E2 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4C2424610CC5A17004149E2 /* IOKit.framework */; }; 26 | E4EB6799138ADC1D00A09F29 /* GLUT.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BBAB23BE13894E4700AA2426 /* GLUT.framework */; }; 27 | E761F4D81622CA3D00029E43 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E761F4D71622CA3D00029E43 /* Accelerate.framework */; }; 28 | E7A5A30816DEE72E003FCBB8 /* Delaunay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E7A5A30216DEE72E003FCBB8 /* Delaunay.cpp */; }; 29 | E7A5A30916DEE72E003FCBB8 /* ofxDelaunay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E7A5A30616DEE72E003FCBB8 /* ofxDelaunay.cpp */; }; 30 | E7E077E515D3B63C0020DFD4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E7E077E415D3B63C0020DFD4 /* CoreVideo.framework */; }; 31 | E7E077E815D3B6510020DFD4 /* QTKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E7E077E715D3B6510020DFD4 /* QTKit.framework */; }; 32 | /* End PBXBuildFile section */ 33 | 34 | /* Begin PBXContainerItemProxy section */ 35 | E4328147138ABC890047C5CB /* PBXContainerItemProxy */ = { 36 | isa = PBXContainerItemProxy; 37 | containerPortal = E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */; 38 | proxyType = 2; 39 | remoteGlobalIDString = E4B27C1510CBEB8E00536013; 40 | remoteInfo = openFrameworks; 41 | }; 42 | E4EEB9AB138B136A00A80321 /* PBXContainerItemProxy */ = { 43 | isa = PBXContainerItemProxy; 44 | containerPortal = E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */; 45 | proxyType = 1; 46 | remoteGlobalIDString = E4B27C1410CBEB8E00536013; 47 | remoteInfo = openFrameworks; 48 | }; 49 | /* End PBXContainerItemProxy section */ 50 | 51 | /* Begin PBXCopyFilesBuildPhase section */ 52 | E4C2427710CC5ABF004149E2 /* CopyFiles */ = { 53 | isa = PBXCopyFilesBuildPhase; 54 | buildActionMask = 2147483647; 55 | dstPath = ""; 56 | dstSubfolderSpec = 10; 57 | files = ( 58 | BBAB23CB13894F3D00AA2426 /* GLUT.framework in CopyFiles */, 59 | ); 60 | runOnlyForDeploymentPostprocessing = 0; 61 | }; 62 | /* End PBXCopyFilesBuildPhase section */ 63 | 64 | /* Begin PBXFileReference section */ 65 | BBAB23BE13894E4700AA2426 /* GLUT.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLUT.framework; path = ../../../libs/glut/lib/osx/GLUT.framework; sourceTree = ""; }; 66 | E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = openFrameworksLib.xcodeproj; path = ../../../libs/openFrameworksCompiled/project/osx/openFrameworksLib.xcodeproj; sourceTree = SOURCE_ROOT; }; 67 | E45BE9710E8CC7DD009D7055 /* AGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AGL.framework; path = /System/Library/Frameworks/AGL.framework; sourceTree = ""; }; 68 | E45BE9720E8CC7DD009D7055 /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = ""; }; 69 | E45BE9730E8CC7DD009D7055 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = /System/Library/Frameworks/AudioToolbox.framework; sourceTree = ""; }; 70 | E45BE9740E8CC7DD009D7055 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; 71 | E45BE9750E8CC7DD009D7055 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = ""; }; 72 | E45BE9760E8CC7DD009D7055 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = ""; }; 73 | E45BE9770E8CC7DD009D7055 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = /System/Library/Frameworks/CoreServices.framework; sourceTree = ""; }; 74 | E45BE9790E8CC7DD009D7055 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = ""; }; 75 | E45BE97A0E8CC7DD009D7055 /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = ""; }; 76 | E4B69B5B0A3A1756003C02F2 /* example-simplePointsDebug.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "example-simplePointsDebug.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 77 | E4B69E1D0A3A1BDC003C02F2 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = main.cpp; path = src/main.cpp; sourceTree = SOURCE_ROOT; }; 78 | E4B69E1E0A3A1BDC003C02F2 /* testApp.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; name = testApp.cpp; path = src/testApp.cpp; sourceTree = SOURCE_ROOT; }; 79 | E4B69E1F0A3A1BDC003C02F2 /* testApp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = testApp.h; path = src/testApp.h; sourceTree = SOURCE_ROOT; }; 80 | E4B6FCAD0C3E899E008CF71C /* openFrameworks-Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; path = "openFrameworks-Info.plist"; sourceTree = ""; }; 81 | E4C2424410CC5A17004149E2 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 82 | E4C2424510CC5A17004149E2 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 83 | E4C2424610CC5A17004149E2 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = ""; }; 84 | E4EB691F138AFCF100A09F29 /* CoreOF.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = CoreOF.xcconfig; path = ../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig; sourceTree = SOURCE_ROOT; }; 85 | E4EB6923138AFD0F00A09F29 /* Project.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Project.xcconfig; sourceTree = ""; }; 86 | E761F4D71622CA3D00029E43 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = /System/Library/Frameworks/Accelerate.framework; sourceTree = ""; }; 87 | E7A5A30216DEE72E003FCBB8 /* Delaunay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Delaunay.cpp; sourceTree = ""; }; 88 | E7A5A30316DEE72E003FCBB8 /* Delaunay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Delaunay.h; sourceTree = ""; }; 89 | E7A5A30416DEE72E003FCBB8 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README.md; sourceTree = ""; }; 90 | E7A5A30616DEE72E003FCBB8 /* ofxDelaunay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ofxDelaunay.cpp; sourceTree = ""; }; 91 | E7A5A30716DEE72E003FCBB8 /* ofxDelaunay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxDelaunay.h; sourceTree = ""; }; 92 | E7E077E415D3B63C0020DFD4 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = /System/Library/Frameworks/CoreVideo.framework; sourceTree = ""; }; 93 | E7E077E715D3B6510020DFD4 /* QTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QTKit.framework; path = /System/Library/Frameworks/QTKit.framework; sourceTree = ""; }; 94 | /* End PBXFileReference section */ 95 | 96 | /* Begin PBXFrameworksBuildPhase section */ 97 | E4B69B590A3A1756003C02F2 /* Frameworks */ = { 98 | isa = PBXFrameworksBuildPhase; 99 | buildActionMask = 2147483647; 100 | files = ( 101 | E761F4D81622CA3D00029E43 /* Accelerate.framework in Frameworks */, 102 | E7E077E815D3B6510020DFD4 /* QTKit.framework in Frameworks */, 103 | E4EB6799138ADC1D00A09F29 /* GLUT.framework in Frameworks */, 104 | E4328149138ABC9F0047C5CB /* openFrameworksDebug.a in Frameworks */, 105 | E45BE97B0E8CC7DD009D7055 /* AGL.framework in Frameworks */, 106 | E45BE97C0E8CC7DD009D7055 /* ApplicationServices.framework in Frameworks */, 107 | E45BE97D0E8CC7DD009D7055 /* AudioToolbox.framework in Frameworks */, 108 | E45BE97E0E8CC7DD009D7055 /* Carbon.framework in Frameworks */, 109 | E45BE97F0E8CC7DD009D7055 /* CoreAudio.framework in Frameworks */, 110 | E45BE9800E8CC7DD009D7055 /* CoreFoundation.framework in Frameworks */, 111 | E45BE9810E8CC7DD009D7055 /* CoreServices.framework in Frameworks */, 112 | E45BE9830E8CC7DD009D7055 /* OpenGL.framework in Frameworks */, 113 | E45BE9840E8CC7DD009D7055 /* QuickTime.framework in Frameworks */, 114 | E4C2424710CC5A17004149E2 /* AppKit.framework in Frameworks */, 115 | E4C2424810CC5A17004149E2 /* Cocoa.framework in Frameworks */, 116 | E4C2424910CC5A17004149E2 /* IOKit.framework in Frameworks */, 117 | E7E077E515D3B63C0020DFD4 /* CoreVideo.framework in Frameworks */, 118 | ); 119 | runOnlyForDeploymentPostprocessing = 0; 120 | }; 121 | /* End PBXFrameworksBuildPhase section */ 122 | 123 | /* Begin PBXGroup section */ 124 | BB4B014C10F69532006C3DED /* addons */ = { 125 | isa = PBXGroup; 126 | children = ( 127 | E7A5A2FF16DEE72E003FCBB8 /* ofxDelaunay */, 128 | ); 129 | name = addons; 130 | sourceTree = ""; 131 | }; 132 | BBAB23C913894ECA00AA2426 /* system frameworks */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | E761F4D71622CA3D00029E43 /* Accelerate.framework */, 136 | E4C2424410CC5A17004149E2 /* AppKit.framework */, 137 | E4C2424510CC5A17004149E2 /* Cocoa.framework */, 138 | E4C2424610CC5A17004149E2 /* IOKit.framework */, 139 | E45BE9710E8CC7DD009D7055 /* AGL.framework */, 140 | E45BE9720E8CC7DD009D7055 /* ApplicationServices.framework */, 141 | E45BE9730E8CC7DD009D7055 /* AudioToolbox.framework */, 142 | E45BE9740E8CC7DD009D7055 /* Carbon.framework */, 143 | E45BE9750E8CC7DD009D7055 /* CoreAudio.framework */, 144 | E45BE9760E8CC7DD009D7055 /* CoreFoundation.framework */, 145 | E45BE9770E8CC7DD009D7055 /* CoreServices.framework */, 146 | E45BE9790E8CC7DD009D7055 /* OpenGL.framework */, 147 | E45BE97A0E8CC7DD009D7055 /* QuickTime.framework */, 148 | E7E077E415D3B63C0020DFD4 /* CoreVideo.framework */, 149 | E7E077E715D3B6510020DFD4 /* QTKit.framework */, 150 | ); 151 | name = "system frameworks"; 152 | sourceTree = ""; 153 | }; 154 | BBAB23CA13894EDB00AA2426 /* 3rd party frameworks */ = { 155 | isa = PBXGroup; 156 | children = ( 157 | BBAB23BE13894E4700AA2426 /* GLUT.framework */, 158 | ); 159 | name = "3rd party frameworks"; 160 | sourceTree = ""; 161 | }; 162 | E4328144138ABC890047C5CB /* Products */ = { 163 | isa = PBXGroup; 164 | children = ( 165 | E4328148138ABC890047C5CB /* openFrameworksDebug.a */, 166 | ); 167 | name = Products; 168 | sourceTree = ""; 169 | }; 170 | E45BE5980E8CC70C009D7055 /* frameworks */ = { 171 | isa = PBXGroup; 172 | children = ( 173 | BBAB23CA13894EDB00AA2426 /* 3rd party frameworks */, 174 | BBAB23C913894ECA00AA2426 /* system frameworks */, 175 | ); 176 | name = frameworks; 177 | sourceTree = ""; 178 | }; 179 | E4B69B4A0A3A1720003C02F2 = { 180 | isa = PBXGroup; 181 | children = ( 182 | E4B6FCAD0C3E899E008CF71C /* openFrameworks-Info.plist */, 183 | E4EB6923138AFD0F00A09F29 /* Project.xcconfig */, 184 | E4B69E1C0A3A1BDC003C02F2 /* src */, 185 | E4EEC9E9138DF44700A80321 /* openFrameworks */, 186 | BB4B014C10F69532006C3DED /* addons */, 187 | E45BE5980E8CC70C009D7055 /* frameworks */, 188 | E4B69B5B0A3A1756003C02F2 /* example-simplePointsDebug.app */, 189 | ); 190 | sourceTree = ""; 191 | }; 192 | E4B69E1C0A3A1BDC003C02F2 /* src */ = { 193 | isa = PBXGroup; 194 | children = ( 195 | E4B69E1D0A3A1BDC003C02F2 /* main.cpp */, 196 | E4B69E1F0A3A1BDC003C02F2 /* testApp.h */, 197 | E4B69E1E0A3A1BDC003C02F2 /* testApp.cpp */, 198 | ); 199 | path = src; 200 | sourceTree = SOURCE_ROOT; 201 | }; 202 | E4EEC9E9138DF44700A80321 /* openFrameworks */ = { 203 | isa = PBXGroup; 204 | children = ( 205 | E4EB691F138AFCF100A09F29 /* CoreOF.xcconfig */, 206 | E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */, 207 | ); 208 | name = openFrameworks; 209 | sourceTree = ""; 210 | }; 211 | E7A5A2FF16DEE72E003FCBB8 /* ofxDelaunay */ = { 212 | isa = PBXGroup; 213 | children = ( 214 | E7A5A30016DEE72E003FCBB8 /* libs */, 215 | E7A5A30416DEE72E003FCBB8 /* README.md */, 216 | E7A5A30516DEE72E003FCBB8 /* src */, 217 | ); 218 | name = ofxDelaunay; 219 | path = ../../../addons/ofxDelaunay; 220 | sourceTree = ""; 221 | }; 222 | E7A5A30016DEE72E003FCBB8 /* libs */ = { 223 | isa = PBXGroup; 224 | children = ( 225 | E7A5A30116DEE72E003FCBB8 /* Delaunay */, 226 | ); 227 | path = libs; 228 | sourceTree = ""; 229 | }; 230 | E7A5A30116DEE72E003FCBB8 /* Delaunay */ = { 231 | isa = PBXGroup; 232 | children = ( 233 | E7A5A30216DEE72E003FCBB8 /* Delaunay.cpp */, 234 | E7A5A30316DEE72E003FCBB8 /* Delaunay.h */, 235 | ); 236 | path = Delaunay; 237 | sourceTree = ""; 238 | }; 239 | E7A5A30516DEE72E003FCBB8 /* src */ = { 240 | isa = PBXGroup; 241 | children = ( 242 | E7A5A30616DEE72E003FCBB8 /* ofxDelaunay.cpp */, 243 | E7A5A30716DEE72E003FCBB8 /* ofxDelaunay.h */, 244 | ); 245 | path = src; 246 | sourceTree = ""; 247 | }; 248 | /* End PBXGroup section */ 249 | 250 | /* Begin PBXNativeTarget section */ 251 | E4B69B5A0A3A1756003C02F2 /* example-simplePoints */ = { 252 | isa = PBXNativeTarget; 253 | buildConfigurationList = E4B69B5F0A3A1757003C02F2 /* Build configuration list for PBXNativeTarget "example-simplePoints" */; 254 | buildPhases = ( 255 | E4B69B580A3A1756003C02F2 /* Sources */, 256 | E4B69B590A3A1756003C02F2 /* Frameworks */, 257 | E4B6FFFD0C3F9AB9008CF71C /* ShellScript */, 258 | E4C2427710CC5ABF004149E2 /* CopyFiles */, 259 | ); 260 | buildRules = ( 261 | ); 262 | dependencies = ( 263 | E4EEB9AC138B136A00A80321 /* PBXTargetDependency */, 264 | ); 265 | name = "example-simplePoints"; 266 | productName = myOFApp; 267 | productReference = E4B69B5B0A3A1756003C02F2 /* example-simplePointsDebug.app */; 268 | productType = "com.apple.product-type.application"; 269 | }; 270 | /* End PBXNativeTarget section */ 271 | 272 | /* Begin PBXProject section */ 273 | E4B69B4C0A3A1720003C02F2 /* Project object */ = { 274 | isa = PBXProject; 275 | attributes = { 276 | }; 277 | buildConfigurationList = E4B69B4D0A3A1720003C02F2 /* Build configuration list for PBXProject "example-simplePoints" */; 278 | compatibilityVersion = "Xcode 2.4"; 279 | developmentRegion = English; 280 | hasScannedForEncodings = 0; 281 | knownRegions = ( 282 | English, 283 | Japanese, 284 | French, 285 | German, 286 | ); 287 | mainGroup = E4B69B4A0A3A1720003C02F2; 288 | productRefGroup = E4B69B4A0A3A1720003C02F2; 289 | projectDirPath = ""; 290 | projectReferences = ( 291 | { 292 | ProductGroup = E4328144138ABC890047C5CB /* Products */; 293 | ProjectRef = E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */; 294 | }, 295 | ); 296 | projectRoot = ""; 297 | targets = ( 298 | E4B69B5A0A3A1756003C02F2 /* example-simplePoints */, 299 | ); 300 | }; 301 | /* End PBXProject section */ 302 | 303 | /* Begin PBXReferenceProxy section */ 304 | E4328148138ABC890047C5CB /* openFrameworksDebug.a */ = { 305 | isa = PBXReferenceProxy; 306 | fileType = archive.ar; 307 | path = openFrameworksDebug.a; 308 | remoteRef = E4328147138ABC890047C5CB /* PBXContainerItemProxy */; 309 | sourceTree = BUILT_PRODUCTS_DIR; 310 | }; 311 | /* End PBXReferenceProxy section */ 312 | 313 | /* Begin PBXShellScriptBuildPhase section */ 314 | E4B6FFFD0C3F9AB9008CF71C /* ShellScript */ = { 315 | isa = PBXShellScriptBuildPhase; 316 | buildActionMask = 2147483647; 317 | files = ( 318 | ); 319 | inputPaths = ( 320 | ); 321 | outputPaths = ( 322 | ); 323 | runOnlyForDeploymentPostprocessing = 0; 324 | shellPath = /bin/sh; 325 | shellScript = "cp -f ../../../libs/fmodex/lib/osx/libfmodex.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/libfmodex.dylib\"; install_name_tool -change ./libfmodex.dylib @executable_path/libfmodex.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/$PRODUCT_NAME\";"; 326 | }; 327 | /* End PBXShellScriptBuildPhase section */ 328 | 329 | /* Begin PBXSourcesBuildPhase section */ 330 | E4B69B580A3A1756003C02F2 /* Sources */ = { 331 | isa = PBXSourcesBuildPhase; 332 | buildActionMask = 2147483647; 333 | files = ( 334 | E4B69E200A3A1BDC003C02F2 /* main.cpp in Sources */, 335 | E4B69E210A3A1BDC003C02F2 /* testApp.cpp in Sources */, 336 | E7A5A30816DEE72E003FCBB8 /* Delaunay.cpp in Sources */, 337 | E7A5A30916DEE72E003FCBB8 /* ofxDelaunay.cpp in Sources */, 338 | ); 339 | runOnlyForDeploymentPostprocessing = 0; 340 | }; 341 | /* End PBXSourcesBuildPhase section */ 342 | 343 | /* Begin PBXTargetDependency section */ 344 | E4EEB9AC138B136A00A80321 /* PBXTargetDependency */ = { 345 | isa = PBXTargetDependency; 346 | name = openFrameworks; 347 | targetProxy = E4EEB9AB138B136A00A80321 /* PBXContainerItemProxy */; 348 | }; 349 | /* End PBXTargetDependency section */ 350 | 351 | /* Begin XCBuildConfiguration section */ 352 | E4B69B4E0A3A1720003C02F2 /* Debug */ = { 353 | isa = XCBuildConfiguration; 354 | baseConfigurationReference = E4EB6923138AFD0F00A09F29 /* Project.xcconfig */; 355 | buildSettings = { 356 | ARCHS = "$(NATIVE_ARCH)"; 357 | CONFIGURATION_BUILD_DIR = "$(SRCROOT)/bin/"; 358 | COPY_PHASE_STRIP = NO; 359 | DEAD_CODE_STRIPPING = YES; 360 | GCC_AUTO_VECTORIZATION = YES; 361 | GCC_ENABLE_SSE3_EXTENSIONS = YES; 362 | GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS = YES; 363 | GCC_INLINES_ARE_PRIVATE_EXTERN = NO; 364 | GCC_OPTIMIZATION_LEVEL = 0; 365 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 366 | GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES; 367 | GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO; 368 | GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; 369 | GCC_WARN_UNINITIALIZED_AUTOS = NO; 370 | GCC_WARN_UNUSED_VALUE = NO; 371 | GCC_WARN_UNUSED_VARIABLE = NO; 372 | HEADER_SEARCH_PATHS = ( 373 | "$(OF_CORE_HEADERS)", 374 | src, 375 | ); 376 | OTHER_CPLUSPLUSFLAGS = ( 377 | "-D__MACOSX_CORE__", 378 | "-lpthread", 379 | "-mtune=native", 380 | ); 381 | }; 382 | name = Debug; 383 | }; 384 | E4B69B4F0A3A1720003C02F2 /* Release */ = { 385 | isa = XCBuildConfiguration; 386 | baseConfigurationReference = E4EB6923138AFD0F00A09F29 /* Project.xcconfig */; 387 | buildSettings = { 388 | ARCHS = "$(NATIVE_ARCH)"; 389 | CONFIGURATION_BUILD_DIR = "$(SRCROOT)/bin/"; 390 | COPY_PHASE_STRIP = YES; 391 | DEAD_CODE_STRIPPING = YES; 392 | GCC_AUTO_VECTORIZATION = YES; 393 | GCC_ENABLE_SSE3_EXTENSIONS = YES; 394 | GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS = YES; 395 | GCC_INLINES_ARE_PRIVATE_EXTERN = NO; 396 | GCC_OPTIMIZATION_LEVEL = 3; 397 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 398 | GCC_UNROLL_LOOPS = YES; 399 | GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES; 400 | GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO; 401 | GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; 402 | GCC_WARN_UNINITIALIZED_AUTOS = NO; 403 | GCC_WARN_UNUSED_VALUE = NO; 404 | GCC_WARN_UNUSED_VARIABLE = NO; 405 | HEADER_SEARCH_PATHS = ( 406 | "$(OF_CORE_HEADERS)", 407 | src, 408 | ); 409 | OTHER_CPLUSPLUSFLAGS = ( 410 | "-D__MACOSX_CORE__", 411 | "-lpthread", 412 | "-mtune=native", 413 | ); 414 | }; 415 | name = Release; 416 | }; 417 | E4B69B600A3A1757003C02F2 /* Debug */ = { 418 | isa = XCBuildConfiguration; 419 | buildSettings = { 420 | COPY_PHASE_STRIP = NO; 421 | FRAMEWORK_SEARCH_PATHS = ( 422 | "$(inherited)", 423 | "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", 424 | ); 425 | FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../../libs/glut/lib/osx\""; 426 | GCC_DYNAMIC_NO_PIC = NO; 427 | GCC_ENABLE_FIX_AND_CONTINUE = YES; 428 | GCC_GENERATE_DEBUGGING_SYMBOLS = YES; 429 | GCC_MODEL_TUNING = NONE; 430 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 431 | GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Carbon.framework/Headers/Carbon.h"; 432 | INFOPLIST_FILE = "openFrameworks-Info.plist"; 433 | INSTALL_PATH = "$(HOME)/Applications"; 434 | LIBRARY_SEARCH_PATHS = ( 435 | "$(inherited)", 436 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", 437 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", 438 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)", 439 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_4)", 440 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_5)", 441 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_6)", 442 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_7)", 443 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_8)", 444 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_9)", 445 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_10)", 446 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_11)", 447 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_12)", 448 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_13)", 449 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_14)", 450 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_15)", 451 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", 452 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)", 453 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_7)", 454 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_8)", 455 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_9)", 456 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_10)", 457 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_11)", 458 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_12)", 459 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_13)", 460 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_16)", 461 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_17)", 462 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_18)", 463 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_19)", 464 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_20)", 465 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_21)", 466 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_22)", 467 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_23)", 468 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_24)", 469 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_25)", 470 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_26)", 471 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_27)", 472 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_28)", 473 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_29)", 474 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_30)", 475 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_31)", 476 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_32)", 477 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_33)", 478 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_34)", 479 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_35)", 480 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_36)", 481 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_37)", 482 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_38)", 483 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_39)", 484 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_40)", 485 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_41)", 486 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_42)", 487 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_43)", 488 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_44)", 489 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_45)", 490 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_46)", 491 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_47)", 492 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_48)", 493 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_49)", 494 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_50)", 495 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_51)", 496 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_52)", 497 | ); 498 | PREBINDING = NO; 499 | PRODUCT_NAME = "example-simplePointsDebug"; 500 | SDKROOT = macosx10.8; 501 | WRAPPER_EXTENSION = app; 502 | }; 503 | name = Debug; 504 | }; 505 | E4B69B610A3A1757003C02F2 /* Release */ = { 506 | isa = XCBuildConfiguration; 507 | buildSettings = { 508 | COPY_PHASE_STRIP = YES; 509 | FRAMEWORK_SEARCH_PATHS = ( 510 | "$(inherited)", 511 | "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", 512 | ); 513 | FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../../libs/glut/lib/osx\""; 514 | GCC_ENABLE_FIX_AND_CONTINUE = NO; 515 | GCC_GENERATE_DEBUGGING_SYMBOLS = YES; 516 | GCC_MODEL_TUNING = NONE; 517 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 518 | GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Carbon.framework/Headers/Carbon.h"; 519 | INFOPLIST_FILE = "openFrameworks-Info.plist"; 520 | INSTALL_PATH = "$(HOME)/Applications"; 521 | LIBRARY_SEARCH_PATHS = ( 522 | "$(inherited)", 523 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", 524 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", 525 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)", 526 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_4)", 527 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_5)", 528 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_6)", 529 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_7)", 530 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_8)", 531 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_9)", 532 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_10)", 533 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_11)", 534 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_12)", 535 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_13)", 536 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_14)", 537 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_15)", 538 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", 539 | "$(LIBRARY_SEARCH_PATHS_QUOTED_1)", 540 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)", 541 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_7)", 542 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_8)", 543 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_9)", 544 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_10)", 545 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_11)", 546 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_12)", 547 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_13)", 548 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_16)", 549 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_17)", 550 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_18)", 551 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_19)", 552 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_20)", 553 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_21)", 554 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_22)", 555 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_23)", 556 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_24)", 557 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_25)", 558 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_26)", 559 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_27)", 560 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_28)", 561 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_29)", 562 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_30)", 563 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_31)", 564 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_32)", 565 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_33)", 566 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_34)", 567 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_35)", 568 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_36)", 569 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_37)", 570 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_38)", 571 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_39)", 572 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_40)", 573 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_41)", 574 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_42)", 575 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_43)", 576 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_44)", 577 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_45)", 578 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_46)", 579 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_47)", 580 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_48)", 581 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_49)", 582 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_50)", 583 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_51)", 584 | ); 585 | PREBINDING = NO; 586 | PRODUCT_NAME = "example-simplePoints"; 587 | SDKROOT = macosx10.8; 588 | WRAPPER_EXTENSION = app; 589 | }; 590 | name = Release; 591 | }; 592 | /* End XCBuildConfiguration section */ 593 | 594 | /* Begin XCConfigurationList section */ 595 | E4B69B4D0A3A1720003C02F2 /* Build configuration list for PBXProject "example-simplePoints" */ = { 596 | isa = XCConfigurationList; 597 | buildConfigurations = ( 598 | E4B69B4E0A3A1720003C02F2 /* Debug */, 599 | E4B69B4F0A3A1720003C02F2 /* Release */, 600 | ); 601 | defaultConfigurationIsVisible = 0; 602 | defaultConfigurationName = Release; 603 | }; 604 | E4B69B5F0A3A1757003C02F2 /* Build configuration list for PBXNativeTarget "example-simplePoints" */ = { 605 | isa = XCConfigurationList; 606 | buildConfigurations = ( 607 | E4B69B600A3A1757003C02F2 /* Debug */, 608 | E4B69B610A3A1757003C02F2 /* Release */, 609 | ); 610 | defaultConfigurationIsVisible = 0; 611 | defaultConfigurationName = Release; 612 | }; 613 | /* End XCConfigurationList section */ 614 | }; 615 | rootObject = E4B69B4C0A3A1720003C02F2 /* Project object */; 616 | } 617 | -------------------------------------------------------------------------------- /example-simplePoints/example-simplePoints.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example-simplePoints/example-simplePoints.xcodeproj/project.xcworkspace/xcuserdata/focus.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mruegenberg/ofxDelaunay2D/fb44605bda09c366dd9e6d31b8f56d6c815fd857/example-simplePoints/example-simplePoints.xcodeproj/project.xcworkspace/xcuserdata/focus.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /example-simplePoints/example-simplePoints.xcodeproj/project.xcworkspace/xcuserdata/focus.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges 6 | 7 | SnapshotAutomaticallyBeforeSignificantChanges 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example-simplePoints/openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.yourcompany.openFrameworks 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | 20 | 21 | -------------------------------------------------------------------------------- /example-simplePoints/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "testApp.h" 2 | #include "ofAppGlutWindow.h" 3 | 4 | //-------------------------------------------------------------- 5 | int main(){ 6 | 7 | // set width, height, mode (OF_WINDOW or OF_FULLSCREEN) 8 | ofSetupOpenGL(1024, 768, OF_WINDOW); 9 | ofRunApp(new testApp()); // start the app 10 | } 11 | -------------------------------------------------------------------------------- /example-simplePoints/src/testApp.cpp: -------------------------------------------------------------------------------- 1 | #include "testApp.h" 2 | #include "ofxDelaunay2D.h" 3 | 4 | //-------------------------------------------------------------- 5 | void testApp::setup(){ 6 | ofEnableSmoothing(); 7 | ofBackground(0); 8 | 9 | } 10 | 11 | //-------------------------------------------------------------- 12 | void testApp::update(){ 13 | 14 | } 15 | 16 | //-------------------------------------------------------------- 17 | void testApp::draw(){ 18 | ofBackground(255,250,240); 19 | 20 | ofNoFill(); 21 | ofSetColor(0,70,255); 22 | m_triangulation.drawWireframe(); 23 | 24 | ofFill(); 25 | ofSetColor(200,0,50); 26 | for(size_t i=0; i m_points; 24 | }; 25 | -------------------------------------------------------------------------------- /libs/Delaunay/src/Delaunay.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Delaunay.cpp 3 | * 4 | * Gilles Dumoulin's C++ implementation of Paul Bourke's Delaunay triangulation algorithm. 5 | * Source: http://local.wasp.uwa.edu.au/~pbourke/papers/triangulate/cpp.zip 6 | * Paper: http://local.wasp.uwa.edu.au/~pbourke/papers/triangulate/index.html 7 | * 8 | */ 9 | 10 | #include "Delaunay.h" 11 | 12 | using namespace std; 13 | 14 | //////////////////////////////////////////////////////////////////////// 15 | // CircumCircle() : 16 | // Return true if a point (xp,yp) is inside the circumcircle made up 17 | // of the points (x1,y1), (x2,y2), (x3,y3) 18 | // The circumcircle centre is returned in (xc,yc) and the radius r 19 | // Note : A point on the edge is inside the circumcircle 20 | //////////////////////////////////////////////////////////////////////// 21 | 22 | int CircumCircle(double xp, double yp, double x1, double y1, double x2, 23 | double y2, double x3, double y3, double &xc, double &yc, double &r){ 24 | double m1, m2, mx1, mx2, my1, my2; 25 | double dx, dy, rsqr, drsqr; 26 | 27 | // Check for coincident points 28 | if(abs(y1 - y2) < EPSILON && abs(y2 - y3) < EPSILON) 29 | return(false); 30 | 31 | if(abs(y2-y1) < EPSILON){ 32 | m2 = - (x3 - x2) / (y3 - y2); 33 | mx2 = (x2 + x3) / 2.0; 34 | my2 = (y2 + y3) / 2.0; 35 | xc = (x2 + x1) / 2.0; 36 | yc = m2 * (xc - mx2) + my2; 37 | }else if(abs(y3 - y2) < EPSILON){ 38 | m1 = - (x2 - x1) / (y2 - y1); 39 | mx1 = (x1 + x2) / 2.0; 40 | my1 = (y1 + y2) / 2.0; 41 | xc = (x3 + x2) / 2.0; 42 | yc = m1 * (xc - mx1) + my1; 43 | }else{ 44 | m1 = - (x2 - x1) / (y2 - y1); 45 | m2 = - (x3 - x2) / (y3 - y2); 46 | mx1 = (x1 + x2) / 2.0; 47 | mx2 = (x2 + x3) / 2.0; 48 | my1 = (y1 + y2) / 2.0; 49 | my2 = (y2 + y3) / 2.0; 50 | xc = (m1 * mx1 - m2 * mx2 + my2 - my1) / (m1 - m2); 51 | yc = m1 * (xc - mx1) + my1; 52 | } 53 | 54 | dx = x2 - xc; 55 | dy = y2 - yc; 56 | rsqr = dx * dx + dy * dy; 57 | r = sqrt(rsqr); 58 | dx = xp - xc; 59 | dy = yp - yc; 60 | drsqr = dx * dx + dy * dy; 61 | 62 | return((drsqr <= rsqr) ? true : false); 63 | } 64 | 65 | /////////////////////////////////////////////////////////////////////////////// 66 | // Triangulate() : 67 | // Triangulation subroutine 68 | // Takes as input NV vertices in array pxyz 69 | // Returned is a list of ntri triangular faces in the array v 70 | // These triangles are arranged in a consistent clockwise order. 71 | // The triangle array 'v' should be malloced to 3 * nv 72 | // The vertex array pxyz must be big enough to hold 3 more points 73 | // The vertex array must be sorted in increasing x values say 74 | // 75 | // qsort(p,nv,sizeof(XYZ),XYZCompare); 76 | /////////////////////////////////////////////////////////////////////////////// 77 | 78 | int Triangulate(int nv, XY pxyz[], ITRIANGLE v[], int &ntri) 79 | { 80 | int *complete = NULL; 81 | IEDGE *edges = NULL; 82 | IEDGE *p_EdgeTemp; 83 | int nedge = 0; 84 | int trimax, emax = 900; 85 | // int status = 0; 86 | 87 | int inside; 88 | int i, j, k; 89 | double xp, yp, x1, y1, x2, y2, x3, y3; 90 | double xc = 0; double yc = 0; double r = 0; 91 | double xmin, xmax, ymin, ymax, xmid, ymid; 92 | double dx, dy, dmax; 93 | 94 | // Allocate memory for the completeness list, flag for each triangle 95 | trimax = 4 * nv; 96 | complete = new int[trimax]; 97 | // Allocate memory for the edge list 98 | edges = new IEDGE[emax]; 99 | 100 | // Find the maximum and minimum vertex bounds. 101 | // This is to allow calculation of the bounding triangle 102 | xmin = pxyz[0].x; 103 | ymin = pxyz[0].y; 104 | xmax = xmin; 105 | ymax = ymin; 106 | for(i = 1; i < nv; i++){ 107 | if (pxyz[i].x < xmin) xmin = pxyz[i].x; 108 | if (pxyz[i].x > xmax) xmax = pxyz[i].x; 109 | if (pxyz[i].y < ymin) ymin = pxyz[i].y; 110 | if (pxyz[i].y > ymax) ymax = pxyz[i].y; 111 | } 112 | dx = xmax - xmin; 113 | dy = ymax - ymin; 114 | dmax = (dx > dy) ? dx : dy; 115 | xmid = (xmax + xmin) / 2.0; 116 | ymid = (ymax + ymin) / 2.0; 117 | 118 | // Set up the supertriangle 119 | // This is a triangle which encompasses all the sample points. 120 | // The supertriangle coordinates are added to the end of the 121 | // vertex list. The supertriangle is the first triangle in 122 | // the triangle list. 123 | pxyz[nv+0].x = xmid - 20 * dmax; 124 | pxyz[nv+0].y = ymid - dmax; 125 | pxyz[nv+1].x = xmid; 126 | pxyz[nv+1].y = ymid + 20 * dmax; 127 | pxyz[nv+2].x = xmid + 20 * dmax; 128 | pxyz[nv+2].y = ymid - dmax; 129 | v[0].p1 = nv; 130 | v[0].p2 = nv+1; 131 | v[0].p3 = nv+2; 132 | complete[0] = false; 133 | ntri = 1; 134 | 135 | 136 | // Include each point one at a time into the existing mesh 137 | for(i = 0; i < nv; i++){ 138 | xp = pxyz[i].x; 139 | yp = pxyz[i].y; 140 | nedge = 0; 141 | 142 | // Set up the edge buffer. 143 | // If the point (xp,yp) lies inside the circumcircle then the 144 | // three edges of that triangle are added to the edge buffer 145 | // and that triangle is removed. 146 | for(j = 0; j < ntri; j++){ 147 | if(complete[j]) 148 | continue; 149 | x1 = pxyz[v[j].p1].x; 150 | y1 = pxyz[v[j].p1].y; 151 | x2 = pxyz[v[j].p2].x; 152 | y2 = pxyz[v[j].p2].y; 153 | x3 = pxyz[v[j].p3].x; 154 | y3 = pxyz[v[j].p3].y; 155 | inside = CircumCircle(xp, yp, x1, y1, x2, y2, x3, y3, xc, yc, r); 156 | // if (xc + r < xp) 157 | 158 | // Suggested 159 | // if (xc + r + EPSILON < xp) 160 | if (xc < xp && ((xp-xc)*(xp-xc)) > r) 161 | complete[j] = true; 162 | 163 | if(inside){ 164 | // Check that we haven't exceeded the edge list size 165 | if(nedge + 3 >= emax){ 166 | emax += 100; 167 | p_EdgeTemp = new IEDGE[emax]; 168 | for (int i = 0; i < nedge; i++) { // Fix by John Bowman 169 | p_EdgeTemp[i] = edges[i]; 170 | } 171 | delete []edges; 172 | edges = p_EdgeTemp; 173 | } 174 | 175 | edges[nedge+0].p1 = v[j].p1; 176 | edges[nedge+0].p2 = v[j].p2; 177 | edges[nedge+1].p1 = v[j].p2; 178 | edges[nedge+1].p2 = v[j].p3; 179 | edges[nedge+2].p1 = v[j].p3; 180 | edges[nedge+2].p2 = v[j].p1; 181 | nedge += 3; 182 | v[j] = v[ntri-1]; 183 | complete[j] = complete[ntri-1]; 184 | ntri--; 185 | j--; 186 | } 187 | } 188 | 189 | // Tag multiple edges 190 | // Note: if all triangles are specified anticlockwise then all 191 | // interior edges are opposite pointing in direction. 192 | for(j = 0; j < nedge - 1; j++){ 193 | for(k = j + 1; k < nedge; k++){ 194 | if((edges[j].p1 == edges[k].p2) && (edges[j].p2 == edges[k].p1)){ 195 | edges[j].p1 = -1; 196 | edges[j].p2 = -1; 197 | edges[k].p1 = -1; 198 | edges[k].p2 = -1; 199 | } 200 | // Shouldn't need the following, see note above */ 201 | if((edges[j].p1 == edges[k].p1) && (edges[j].p2 == edges[k].p2)){ 202 | edges[j].p1 = -1; 203 | edges[j].p2 = -1; 204 | edges[k].p1 = -1; 205 | edges[k].p2 = -1; 206 | } 207 | } 208 | } 209 | 210 | // Form new triangles for the current point 211 | // Skipping over any tagged edges. 212 | // All edges are arranged in clockwise order. 213 | for(j = 0; j < nedge; j++) { 214 | if(edges[j].p1 < 0 || edges[j].p2 < 0) 215 | continue; 216 | 217 | if (ntri >= trimax) { 218 | break; 219 | } 220 | 221 | v[ntri].p1 = edges[j].p1; 222 | v[ntri].p2 = edges[j].p2; 223 | v[ntri].p3 = i; 224 | complete[ntri] = false; 225 | ntri++; 226 | } 227 | 228 | if (ntri >= trimax) { 229 | break; 230 | } 231 | } 232 | 233 | // Remove triangles with supertriangle vertices 234 | // These are triangles which have a vertex number greater than nv 235 | int offset = 0; 236 | for(int i=0; i= nv || v[i].p2 >= nv || v[i].p3 >= nv || (! complete[i])) 238 | offset++; 239 | else 240 | v[i - offset] = v[i]; 241 | } 242 | ntri -= offset; 243 | 244 | delete[] edges; 245 | delete[] complete; 246 | return 0; 247 | } 248 | 249 | int XYZCompare(const void *v1, const void *v2){ 250 | XY *p1, *p2; 251 | 252 | p1 = (XY*)v1; 253 | p2 = (XY*)v2; 254 | if(p1->x < p2->x) 255 | return(-1); 256 | else if(p1->x > p2->x) 257 | return(1); 258 | else 259 | return(0); 260 | } 261 | -------------------------------------------------------------------------------- /libs/Delaunay/src/Delaunay.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Delaunay.h 3 | * 4 | * Gilles Dumoulin's C++ implementation of Paul Bourke's Delaunay triangulation algorithm. 5 | * Source: http://local.wasp.uwa.edu.au/~pbourke/papers/triangulate/cpp.zip 6 | * Paper: http://local.wasp.uwa.edu.au/~pbourke/papers/triangulate/index.html 7 | * 8 | */ 9 | 10 | #ifndef Delaunay_H 11 | #define Delaunay_H 12 | 13 | #include 14 | #include // for C qsort 15 | #include 16 | #include // for random 17 | 18 | const double EPSILON = 0.000001; 19 | 20 | struct ITRIANGLE{ 21 | int p1, p2, p3; 22 | }; 23 | 24 | struct IEDGE{ 25 | int p1, p2; 26 | }; 27 | 28 | struct XY{ 29 | double x, y; 30 | }; 31 | 32 | int XYCompare(const void *v1, const void *v2); 33 | int Triangulate(int nv, XY pxyz[], ITRIANGLE v[], int &ntri); 34 | int CircumCircle(double, double, double, double, double, double, double, 35 | double, double&, double&, double&); 36 | 37 | #endif 38 | 39 | 40 | -------------------------------------------------------------------------------- /src/ofxDelaunay2D.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * ofxDelaunay.h 3 | * 4 | * Created by Pat Long on 29/10/09. 5 | * Copyright 2009 Tangible Interaction. All rights reserved. 6 | * 7 | * Some parts based on demo code by Gilles Dumoulin. 8 | * Source: http://local.wasp.uwa.edu.au/~pbourke/papers/triangulate/cpp.zip 9 | * 10 | * Cleaned up by Lukasz Karluk, 19/05/2010 11 | * 12 | * Refactored for 0071 + ofMesh by James George on 21/06/2012 13 | * 14 | * Fixing of memory bugs and massive API simplification by Marcel Ruegenberg in 2015. 15 | */ 16 | 17 | #include "ofxDelaunay2D.h" 18 | #include "Delaunay.h" 19 | #include 20 | 21 | struct XYI{ 22 | double x, y; 23 | int i; // index 24 | }; 25 | 26 | int XYICompare(const void *v1, const void *v2){ 27 | XYI *p1, *p2; 28 | 29 | p1 = (XYI*)v1; 30 | p2 = (XYI*)v2; 31 | if(p1->x < p2->x) 32 | return(-1); 33 | else if(p1->x > p2->x) 34 | return(1); 35 | else 36 | return(0); 37 | } 38 | 39 | ofMesh ofxDelaunay2D::triangulate(vector &points) { 40 | ofMesh result; 41 | 42 | if(points.size() < 3){ 43 | return result; 44 | } 45 | 46 | int nv = points.size(); 47 | 48 | // make clone not to destroy vertices 49 | vector verticesTemp; verticesTemp.reserve(points.size()); 50 | for(int i=0; i verticesXY; 61 | 62 | //copy XYZIs to XYZ 63 | for (int i = 0; i < nv; i++) { 64 | XY v; 65 | v.x = verticesTemp.at(i).x; 66 | v.y = verticesTemp.at(i).y; 67 | verticesXY.push_back(v); 68 | } 69 | 70 | //add 3 emptly slots, required by the Triangulate call 71 | verticesXY.push_back(XY()); 72 | verticesXY.push_back(XY()); 73 | verticesXY.push_back(XY()); 74 | 75 | int ntri; 76 | vector triangles; 77 | 78 | //allocate space for triangle indices 79 | triangles.resize(4*nv); // be sure that Triangulate never uses more triangles than this! 80 | 81 | Triangulate( nv, &verticesXY[0], &triangles[0], ntri ); 82 | 83 | //copy triangle data to ofxDelaunay2DTriangle. 84 | result.setMode(OF_PRIMITIVE_TRIANGLES); 85 | 86 | //copy vertices 87 | for (int i = 0; i < nv; i++){ 88 | result.addVertex(ofVec3f(points[i].x,points[i].y,0.0)); 89 | } 90 | 91 | //copy triangles 92 | for(int i = 0; i < ntri; i++) { 93 | //if(triangles[i].p1 > nv) 94 | // printf("Tri %d %d | %d %d %d", i, ntri, triangles[ i ].p1, triangles[ i ].p2, triangles[ i ].p3); 95 | assert(triangles[i].p1 <= nv); 96 | result.addIndex(verticesTemp.at(triangles[ i ].p1).i); 97 | assert(triangles[i].p2 <= nv); 98 | result.addIndex(verticesTemp.at(triangles[ i ].p2).i); 99 | assert(triangles[i].p3 <= nv); 100 | result.addIndex(verticesTemp.at(triangles[ i ].p3).i); 101 | } 102 | 103 | return result; 104 | } 105 | 106 | // adjacency list of triangulation 107 | vector< set > ofxDelaunay2D::adjacencyForTriMesh(ofMesh &triMesh) { 108 | vector< set > adjacency; adjacency.reserve(triMesh.getNumVertices()); 109 | 110 | for(size_t i=0; i<(size_t)(triMesh.getNumVertices()); ++i) { 111 | adjacency.push_back(set()); 112 | } 113 | 114 | for(int i0=0; i0<(int)triMesh.getIndices().size() - 2; i0+=3) { 115 | size_t i = triMesh.getIndex(i0); 116 | size_t j = triMesh.getIndex(i0 + 1); 117 | size_t k = triMesh.getIndex(i0 + 2); 118 | 119 | adjacency[i].insert(j); 120 | adjacency[j].insert(i); 121 | adjacency[i].insert(k); 122 | adjacency[k].insert(i); 123 | adjacency[j].insert(k); 124 | adjacency[k].insert(j); 125 | } 126 | 127 | return adjacency; 128 | } 129 | -------------------------------------------------------------------------------- /src/ofxDelaunay2D.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ofxDelaunay.h 3 | * 4 | * Created by Pat Long on 29/10/09. 5 | * Copyright 2009 Tangible Interaction. All rights reserved. 6 | * 7 | * Some parts based on demo code by Gilles Dumoulin. 8 | * Source: http://local.wasp.uwa.edu.au/~pbourke/papers/triangulate/cpp.zip 9 | * 10 | * Cleaned up by Lukasz Karluk, 19/05/2010 11 | * 12 | * Refactored for 0071 + ofMesh by James George on 21/06/2012 13 | * 14 | * Fixing of memory bugs and a massive API simplification by Marcel Ruegenberg in 2015. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include "ofMain.h" 20 | 21 | class ofxDelaunay2D { 22 | 23 | public: 24 | 25 | /// returns a triangle mesh, i.e each 3 set of 3 indices makes up one triangle in the triangulation 26 | static ofMesh triangulate(vector &points); 27 | 28 | /// computes an unidirectional adjacency list for a triangle mesh. 29 | /// for each edge (i,j) in the mesh, results[i] contains j if i < j 30 | static vector< set > adjacencyForTriMesh(ofMesh &triMesh); 31 | }; 32 | --------------------------------------------------------------------------------