├── DelaunayTest ├── en.lproj │ ├── InfoPlist.strings │ ├── MainWindow.xib │ └── DelaunayTestViewController.xib ├── todo ├── DelaunayView.h ├── DelaunayTest-Prefix.pch ├── main.m ├── DelaunayTestAppDelegate.h ├── DelaunayTestViewController.h ├── DelaunayTest-Info.plist ├── DelaunayTestAppDelegate.m ├── DelaunayView.m └── DelaunayTestViewController.m ├── Edgy Demo ├── en.lproj │ └── InfoPlist.strings ├── EDViewController.h ├── EDAppDelegate.h ├── EDDiagnosticView.h ├── main.m ├── Edgy Demo-Prefix.pch ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── LaunchImage.launchimage │ │ └── Contents.json ├── Edgy Demo-Info.plist ├── EDAppDelegate.m ├── EDDiagnosticView.m ├── EDViewController.m └── Base.lproj │ ├── Main_iPad.storyboard │ └── Main_iPhone.storyboard ├── Edgy DemoTests ├── en.lproj │ └── InfoPlist.strings ├── Edgy_DemoTests.m └── Edgy DemoTests-Info.plist ├── Edgy ├── Edgy-Prefix.pch ├── VoronoiCell.h ├── DelaunayPoint.h ├── DelaunayEdge.h ├── DelaunayTriangulation.h ├── DelaunayTriangle.h ├── VoronoiCell.m ├── DelaunayPoint.m ├── DelaunayEdge.m ├── DelaunayTriangle.m └── DelaunayTriangulation.m ├── Edgy.xcodeproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── project.pbxproj ├── .gitignore └── README.markdown /DelaunayTest/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Edgy Demo/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Edgy DemoTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Edgy/Edgy-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Edgy' target in the 'Edgy' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif 9 | -------------------------------------------------------------------------------- /Edgy.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DelaunayTest/todo: -------------------------------------------------------------------------------- 1 | - Keep a queue of triangles to check for Delaunay and add all triangles initially, then add any new triangles as they are added from flipping 2 | - Figure out what to do with initial points (so that the first two clicks don't seem to not do anything) 3 | -------------------------------------------------------------------------------- /Edgy Demo/EDViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // EDViewController.h 3 | // Edgy Demo 4 | // 5 | // Created by Mike Rotondo on 6/18/13. 6 | // Copyright (c) 2013 Stanford. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface EDViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | build/* 3 | *.pbxuser 4 | !default.pbxuser 5 | *.mode1v3 6 | !default.mode1v3 7 | *.mode2v3 8 | !default.mode2v3 9 | *.perspectivev3 10 | !default.perspectivev3 11 | *.xcworkspace 12 | !default.xcworkspace 13 | xcuserdata 14 | profile 15 | *.moved-aside 16 | *.xcbkptlist 17 | 18 | .DS_Store -------------------------------------------------------------------------------- /Edgy Demo/EDAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // EDAppDelegate.h 3 | // Edgy Demo 4 | // 5 | // Created by Mike Rotondo on 6/18/13. 6 | // Copyright (c) 2013 Stanford. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface EDAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Edgy Demo/EDDiagnosticView.h: -------------------------------------------------------------------------------- 1 | // 2 | // EDDiagnosticView.h 3 | // Edgy 4 | // 5 | // Created by Mike Rotondo on 6/18/13. 6 | // Copyright (c) 2013 Stanford. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class DelaunayTriangulation; 12 | 13 | @interface EDDiagnosticView : UIView 14 | 15 | @property (nonatomic, strong) DelaunayTriangulation *triangulation; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /DelaunayTest/DelaunayView.h: -------------------------------------------------------------------------------- 1 | // 2 | // DelaunayView.h 3 | // DelaunayTest 4 | // 5 | // Created by Mike Rotondo on 7/17/11. 6 | // Copyright 2011 Stanford. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class DelaunayTriangulation; 12 | 13 | @interface DelaunayView : UIView { 14 | 15 | } 16 | 17 | @property (nonatomic, strong) DelaunayTriangulation* triangulation; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /DelaunayTest/DelaunayTest-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'DelaunayTest' target in the 'DelaunayTest' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /Edgy Demo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Edgy Demo 4 | // 5 | // Created by Mike Rotondo on 6/18/13. 6 | // Copyright (c) 2013 Stanford. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "EDAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([EDAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Edgy Demo/Edgy Demo-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /DelaunayTest/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // DelaunayTest 4 | // 5 | // Created by Mike Rotondo on 7/17/11. 6 | // Copyright 2011 Stanford. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "DelaunayTestAppDelegate.h" 11 | 12 | int main(int argc, char *argv[]) 13 | { 14 | @autoreleasepool { 15 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([DelaunayTestAppDelegate class])); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /DelaunayTest/DelaunayTestAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // DelaunayTestAppDelegate.h 3 | // DelaunayTest 4 | // 5 | // Created by Mike Rotondo on 7/17/11. 6 | // Copyright 2011 Stanford. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class DelaunayTestViewController; 12 | 13 | @interface DelaunayTestAppDelegate : NSObject { 14 | 15 | } 16 | 17 | @property (nonatomic, strong) IBOutlet UIWindow *window; 18 | 19 | @property (nonatomic, strong) IBOutlet DelaunayTestViewController *viewController; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Edgy/VoronoiCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // VoronoiCell.h 3 | // DelaunayTest 4 | // 5 | // Created by Mike Rotondo on 7/21/11. 6 | // Copyright 2011 Stanford. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "DelaunayPoint.h" 11 | 12 | @interface VoronoiCell : NSObject { 13 | 14 | DelaunayPoint *site; 15 | NSArray *nodes; 16 | } 17 | 18 | @property (nonatomic, strong) DelaunayPoint *site; 19 | @property (nonatomic, strong) NSArray *nodes; 20 | 21 | + (VoronoiCell *)voronoiCellAtSite:(DelaunayPoint *)site withNodes:(NSArray *)nodes; 22 | - (void)drawInContext:(CGContextRef)ctx; 23 | - (float)area; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Edgy DemoTests/Edgy_DemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // Edgy_DemoTests.m 3 | // Edgy DemoTests 4 | // 5 | // Created by Mike Rotondo on 6/18/13. 6 | // Copyright (c) 2013 Stanford. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Edgy_DemoTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation Edgy_DemoTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | 21 | // Set-up code here. 22 | } 23 | 24 | - (void)tearDown 25 | { 26 | // Tear-down code here. 27 | 28 | [super tearDown]; 29 | } 30 | 31 | - (void)testExample 32 | { 33 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /DelaunayTest/DelaunayTestViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DelaunayTestViewController.h 3 | // DelaunayTest 4 | // 5 | // Created by Mike Rotondo on 7/17/11. 6 | // Copyright 2011 Stanford. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "DelaunayTriangulation.h" 11 | 12 | @interface DelaunayTestViewController : UIViewController { 13 | DelaunayTriangulation *triangulation; 14 | } 15 | 16 | @property (nonatomic, strong) DelaunayTriangulation *triangulation; 17 | @property (nonatomic, strong) IBOutlet UISwitch *interpaderpSwitch; 18 | @property BOOL interpolating; 19 | 20 | - (void) reset; 21 | - (IBAction)toggleInterpolation:(UISwitch *)sender; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Edgy DemoTests/Edgy DemoTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | rototyping.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Edgy/DelaunayPoint.h: -------------------------------------------------------------------------------- 1 | // 2 | // DelaunayPoint.h 3 | // DelaunayTest 4 | // 5 | // Created by Mike Rotondo on 7/17/11. 6 | // Copyright 2011 Stanford. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface DelaunayPoint : NSObject 13 | 14 | @property (nonatomic) float x; 15 | @property (nonatomic) float y; 16 | @property (nonatomic) float contribution; 17 | @property (nonatomic, strong) NSNumber *idNumber; 18 | @property (nonatomic, readonly) NSMutableSet *edges; 19 | @property (nonatomic, strong) id value; 20 | @property (nonatomic, strong) UIColor *color; 21 | 22 | + (DelaunayPoint *)pointAtX:(float)x andY:(float)y; 23 | + (DelaunayPoint *)pointAtX:(float)newX andY:(float)newY withID:(NSNumber *)idNumber; 24 | - (NSArray *)counterClockwiseEdges; 25 | 26 | - (BOOL)isEqual:(id)object; 27 | - (NSUInteger)hash; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Edgy/DelaunayEdge.h: -------------------------------------------------------------------------------- 1 | // 2 | // DelaunayEdge.h 3 | // DelaunayTest 4 | // 5 | // Created by Mike Rotondo on 7/20/11. 6 | // Copyright 2011 Stanford. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class DelaunayTriangle; 12 | @class DelaunayPoint; 13 | 14 | @interface DelaunayEdge : NSObject 15 | 16 | @property (nonatomic, strong) NSMutableSet *triangles; 17 | @property (nonatomic, strong) NSArray *points; 18 | 19 | + (DelaunayEdge *)edgeWithPoints:(NSArray *)points; 20 | - (DelaunayTriangle *)neighborOf:(DelaunayTriangle *)triangle; 21 | - (DelaunayPoint *)otherPoint:(DelaunayPoint *)point; 22 | - (BOOL)pointOnLeft:(DelaunayPoint*)point withStartPoint:(DelaunayPoint *)startPoint; 23 | - (DelaunayTriangle *)sharedTriangleWithEdge:(DelaunayEdge *)otherEdge; 24 | - (float)length; 25 | 26 | - (BOOL)isEqual:(id)object; 27 | - (NSUInteger)hash; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Edgy Demo/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "60x60", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "ipad", 15 | "size" : "29x29", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "ipad", 20 | "size" : "29x29", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "ipad", 25 | "size" : "50x50", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "ipad", 30 | "size" : "50x50", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "72x72", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "72x72", 41 | "scale" : "2x" 42 | } 43 | ], 44 | "info" : { 45 | "version" : 1, 46 | "author" : "xcode" 47 | } 48 | } -------------------------------------------------------------------------------- /Edgy/DelaunayTriangulation.h: -------------------------------------------------------------------------------- 1 | // 2 | // DelaunayTriangulation.h 3 | // DelaunayTest 4 | // 5 | // Created by Mike Rotondo on 7/17/11. 6 | // Copyright 2011 Stanford. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class DelaunayPoint; 12 | @class DelaunayTriangle; 13 | 14 | @interface DelaunayTriangulation : NSObject { 15 | 16 | NSMutableSet *points; 17 | NSMutableSet *edges; 18 | NSMutableSet *triangles; 19 | } 20 | 21 | @property (nonatomic, strong) NSMutableSet *points; 22 | @property (nonatomic, strong) NSMutableSet *edges; 23 | @property (nonatomic, strong) NSMutableSet *triangles; 24 | @property (nonatomic, strong) NSSet *frameTrianglePoints; 25 | 26 | + (DelaunayTriangulation *)triangulation; 27 | + (DelaunayTriangulation *)triangulationWithSize:(CGSize)size; 28 | + (DelaunayTriangulation *)triangulationWithRect:(CGRect)rect; 29 | - (BOOL)addPoint:(DelaunayPoint *)newPoint withColor:(UIColor *)color; 30 | - (DelaunayTriangle *)triangleContainingPoint:(DelaunayPoint *)point; 31 | - (void)enforceDelaunayProperty; 32 | - (NSDictionary*)voronoiCells; 33 | - (void)interpolateWeightsWithPoint:(DelaunayPoint *)point; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Edgy/DelaunayTriangle.h: -------------------------------------------------------------------------------- 1 | // 2 | // DelaunayTriangle.h 3 | // DelaunayTest 4 | // 5 | // Created by Mike Rotondo on 7/17/11. 6 | // Copyright 2011 Stanford. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class DelaunayPoint; 12 | @class DelaunayEdge; 13 | @class DelaunayTriangulation; 14 | 15 | @interface DelaunayTriangle : NSObject 16 | 17 | @property (nonatomic, readonly) NSArray *edges; 18 | @property (nonatomic, weak) DelaunayPoint *startPoint; 19 | @property (nonatomic, strong) UIColor *color; 20 | @property (nonatomic, readonly) NSArray *points; 21 | 22 | + (DelaunayTriangle *) triangleWithEdges:(NSArray *)edges andStartPoint:(DelaunayPoint *)startPoint andColor:(UIColor *)color; 23 | - (BOOL)containsPoint:(DelaunayPoint *)point; 24 | - (CGPoint)circumcenter; 25 | - (BOOL)inFrameTriangleOfTriangulation:(DelaunayTriangulation *)triangulation; 26 | - (void)drawInContext:(CGContextRef)ctx; 27 | - (NSSet *)neighbors; 28 | - (DelaunayPoint *)pointNotInEdge:(DelaunayEdge *)edge; 29 | - (DelaunayEdge *)edgeStartingWithPoint:(DelaunayPoint *)point; 30 | - (DelaunayEdge *)edgeEndingWithPoint:(DelaunayPoint *)point; 31 | - (DelaunayPoint *)startPointOfEdge:(DelaunayEdge *)edgeInQuestion; 32 | - (DelaunayPoint *)endPointOfEdge:(DelaunayEdge *)edgeInQuestion; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /README.markdown: -------------------------------------------------------------------------------- 1 | ## Edgy does 3 things: 2 | 3 | ### Delaunay Triangulations 4 | 5 |
 6 | #import "DelaunayTriangulation.h"
 7 | DelaunayTriangulation *triangulation = [DelaunayTriangulation triangulationWithSize:CGSizeMake(1000, 1000)];
 8 | 
 9 | UITouch *touch = (UITouch *)[touches anyObject];
10 | CGPoint loc = [touch locationInView:self.view];
11 | DelaunayPoint *newPoint = [DelaunayPoint pointAtX:loc.x andY:loc.y];
12 | [self.triangulation addPoint:newPoint];
13 | 
14 | 15 | ### Voronoi Diagrams 16 | 17 |
18 | NSDictionary *voronoiCells = [self.triangulation voronoiCells];
19 | 
20 | 21 | ### Natural Neighbor Interpolation 22 | 23 |
24 | UITouch *touch = (UITouch *)[touches anyObject];
25 | CGPoint loc = [touch locationInView:self.view];
26 | DelaunayPoint *newPoint = [DelaunayPoint pointAtX:loc.x andY:loc.y];
27 | [self.triangulation interpolateWeightsWithPoint:newPoint];
28 | 
29 | 30 | After interpolateWeightsWithPoint is called, each DelaunayPoint in the DelaunayTriangulation object's points set will have a contribution property that is between [0, 1] and represents the weight of that point's contribution to the output at the interpolated point. 31 | 32 | 33 | License 34 | ------- 35 | Code is under the [Creative Commons Attribution 3.0 Unported license][license]. 36 | 37 | [license]:http://creativecommons.org/licenses/by/3.0/ 38 | -------------------------------------------------------------------------------- /Edgy Demo/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "orientation" : "portrait", 20 | "idiom" : "ipad", 21 | "extent" : "full-screen", 22 | "minimum-system-version" : "7.0", 23 | "scale" : "1x" 24 | }, 25 | { 26 | "orientation" : "landscape", 27 | "idiom" : "ipad", 28 | "extent" : "full-screen", 29 | "minimum-system-version" : "7.0", 30 | "scale" : "1x" 31 | }, 32 | { 33 | "orientation" : "portrait", 34 | "idiom" : "ipad", 35 | "extent" : "full-screen", 36 | "minimum-system-version" : "7.0", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "orientation" : "landscape", 41 | "idiom" : "ipad", 42 | "extent" : "full-screen", 43 | "minimum-system-version" : "7.0", 44 | "scale" : "2x" 45 | } 46 | ], 47 | "info" : { 48 | "version" : 1, 49 | "author" : "xcode" 50 | } 51 | } -------------------------------------------------------------------------------- /Edgy/VoronoiCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // VoronoiCell.m 3 | // DelaunayTest 4 | // 5 | // Created by Mike Rotondo on 7/21/11. 6 | // Copyright 2011 Stanford. All rights reserved. 7 | // 8 | 9 | #import "VoronoiCell.h" 10 | #import "DelaunayPoint.h" 11 | 12 | @implementation VoronoiCell 13 | @synthesize site; 14 | @synthesize nodes; 15 | 16 | + (VoronoiCell *)voronoiCellAtSite:(DelaunayPoint *)site withNodes:(NSArray *)nodes 17 | { 18 | VoronoiCell *cell = [[self alloc] init]; 19 | 20 | cell.site = site; 21 | cell.nodes = nodes; 22 | 23 | return cell; 24 | } 25 | 26 | 27 | - (void)drawInContext:(CGContextRef)ctx 28 | { 29 | NSValue *prevPoint = [self.nodes lastObject]; 30 | CGPoint p = [prevPoint CGPointValue]; 31 | CGContextMoveToPoint(ctx, p.x, p.y); 32 | for ( NSValue *point in self.nodes) 33 | { 34 | CGPoint p = [point CGPointValue]; 35 | CGContextAddLineToPoint(ctx, p.x, p.y); 36 | } 37 | } 38 | 39 | - (float)area 40 | { 41 | float xys = 0.0; 42 | float yxs = 0.0; 43 | 44 | NSValue *prevPoint = [self.nodes objectAtIndex:0]; 45 | CGPoint prevP = [prevPoint CGPointValue]; 46 | for ( NSValue *point in [self.nodes reverseObjectEnumerator]) 47 | { 48 | CGPoint p = [point CGPointValue]; 49 | xys += prevP.x * p.y; 50 | yxs += prevP.y * p.x; 51 | prevP = p; 52 | } 53 | 54 | return (xys - yxs) * 0.5; 55 | } 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /DelaunayTest/DelaunayTest-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | UIStatusBarHidden 6 | 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleDisplayName 10 | ${PRODUCT_NAME} 11 | CFBundleExecutable 12 | ${EXECUTABLE_NAME} 13 | CFBundleIconFile 14 | 15 | CFBundleIdentifier 16 | Rototyping.${PRODUCT_NAME:rfc1034identifier} 17 | CFBundleInfoDictionaryVersion 18 | 6.0 19 | CFBundleName 20 | ${PRODUCT_NAME} 21 | CFBundlePackageType 22 | APPL 23 | CFBundleShortVersionString 24 | 1.0 25 | CFBundleSignature 26 | ???? 27 | CFBundleVersion 28 | 1.0 29 | LSRequiresIPhoneOS 30 | 31 | NSMainNibFile 32 | MainWindow 33 | UISupportedInterfaceOrientations~ipad 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationPortraitUpsideDown 37 | UIInterfaceOrientationLandscapeLeft 38 | UIInterfaceOrientationLandscapeRight 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Edgy Demo/Edgy Demo-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | rototyping.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | Main_iPhone 29 | UIMainStoryboardFile~ipad 30 | Main_iPad 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UIStatusBarHidden 36 | 37 | UISupportedInterfaceOrientations 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationLandscapeLeft 41 | UIInterfaceOrientationLandscapeRight 42 | 43 | UISupportedInterfaceOrientations~ipad 44 | 45 | UIInterfaceOrientationPortrait 46 | UIInterfaceOrientationPortraitUpsideDown 47 | UIInterfaceOrientationLandscapeLeft 48 | UIInterfaceOrientationLandscapeRight 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /Edgy Demo/EDAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // EDAppDelegate.m 3 | // Edgy Demo 4 | // 5 | // Created by Mike Rotondo on 6/18/13. 6 | // Copyright (c) 2013 Stanford. All rights reserved. 7 | // 8 | 9 | #import "EDAppDelegate.h" 10 | 11 | @implementation EDAppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | // Override point for customization after application launch. 16 | return YES; 17 | } 18 | 19 | - (void)applicationWillResignActive:(UIApplication *)application 20 | { 21 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 22 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 23 | } 24 | 25 | - (void)applicationDidEnterBackground:(UIApplication *)application 26 | { 27 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | - (void)applicationWillEnterForeground:(UIApplication *)application 32 | { 33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | - (void)applicationDidBecomeActive:(UIApplication *)application 37 | { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application 42 | { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /DelaunayTest/DelaunayTestAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // DelaunayTestAppDelegate.m 3 | // DelaunayTest 4 | // 5 | // Created by Mike Rotondo on 7/17/11. 6 | // Copyright 2011 Stanford. All rights reserved. 7 | // 8 | 9 | #import "DelaunayTestAppDelegate.h" 10 | 11 | #import "DelaunayTestViewController.h" 12 | 13 | @implementation DelaunayTestAppDelegate 14 | 15 | 16 | @synthesize window=_window; 17 | 18 | @synthesize viewController=_viewController; 19 | 20 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 21 | { 22 | // Override point for customization after application launch. 23 | 24 | self.window.rootViewController = self.viewController; 25 | [self.window makeKeyAndVisible]; 26 | return YES; 27 | } 28 | 29 | - (void)applicationWillResignActive:(UIApplication *)application 30 | { 31 | /* 32 | Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 33 | Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 34 | */ 35 | } 36 | 37 | - (void)applicationDidEnterBackground:(UIApplication *)application 38 | { 39 | /* 40 | Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 41 | If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 42 | */ 43 | } 44 | 45 | - (void)applicationWillEnterForeground:(UIApplication *)application 46 | { 47 | /* 48 | Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 49 | */ 50 | } 51 | 52 | - (void)applicationDidBecomeActive:(UIApplication *)application 53 | { 54 | /* 55 | Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 56 | */ 57 | } 58 | 59 | - (void)applicationWillTerminate:(UIApplication *)application 60 | { 61 | /* 62 | Called when the application is about to terminate. 63 | Save data if appropriate. 64 | See also applicationDidEnterBackground:. 65 | */ 66 | } 67 | 68 | 69 | @end 70 | -------------------------------------------------------------------------------- /DelaunayTest/DelaunayView.m: -------------------------------------------------------------------------------- 1 | // 2 | // DelaunayView.m 3 | // DelaunayTest 4 | // 5 | // Created by Mike Rotondo on 7/17/11. 6 | // Copyright 2011 Stanford. All rights reserved. 7 | // 8 | 9 | #import "DelaunayView.h" 10 | #import "DelaunayTriangulation.h" 11 | #import "DelaunayPoint.h" 12 | #import "DelaunayEdge.h" 13 | #import "DelaunayTriangle.h" 14 | #import "VoronoiCell.h" 15 | 16 | @implementation DelaunayView 17 | @synthesize triangulation; 18 | 19 | - (id)initWithFrame:(CGRect)frame 20 | { 21 | self = [super initWithFrame:frame]; 22 | if (self) { 23 | } 24 | return self; 25 | } 26 | 27 | - (void)awakeFromNib 28 | { 29 | } 30 | 31 | - (void)drawRect:(CGRect)rect 32 | { 33 | CGContextRef ctx = UIGraphicsGetCurrentContext(); 34 | 35 | for (DelaunayTriangle *triangle in self.triangulation.triangles) 36 | { 37 | if ([triangle inFrameTriangleOfTriangulation:self.triangulation]) 38 | continue; 39 | 40 | [triangle.color set]; 41 | // [[UIColor whiteColor] set]; 42 | [[UIColor whiteColor] setStroke]; 43 | [triangle drawInContext:ctx]; 44 | CGContextDrawPath(ctx, kCGPathFillStroke); 45 | //CGContextStrokePath(ctx); 46 | 47 | } 48 | 49 | // // Draw circumcenters & circumcircles 50 | // for (DelaunayTriangle *triangle in self.triangulation.triangles) 51 | // { 52 | // // Don't draw Delaunay triangles that include the frame edges 53 | //// if ([triangle inFrameTriangleOfTriangulation:self.triangulation]) 54 | //// continue; 55 | // 56 | // [[UIColor redColor] set]; 57 | // CGPoint circumcenter = [triangle circumcenter]; 58 | // CGContextMoveToPoint(ctx, circumcenter.x + 10, circumcenter.y); 59 | // CGContextAddArc(ctx, circumcenter.x, circumcenter.y, 10, 0, 2 * M_PI, 0); 60 | // CGContextFillPath(ctx); 61 | // 62 | // DelaunayPoint *p = [triangle startPoint]; 63 | // float bigradius = sqrtf(powf(p.x - circumcenter.x, 2) + powf(p.y - circumcenter.y, 2)); 64 | // CGContextMoveToPoint(ctx, circumcenter.x + bigradius, circumcenter.y); 65 | // CGContextAddArc(ctx, circumcenter.x, circumcenter.y, bigradius, 0, 2 * M_PI, 0); 66 | // CGContextStrokePath(ctx); 67 | // } 68 | 69 | // Draw the voronoi cells 70 | NSDictionary *voronoiCells = [self.triangulation voronoiCells]; 71 | for (VoronoiCell *cell in [voronoiCells objectEnumerator]) 72 | { 73 | [[UIColor colorWithWhite:cell.site.contribution alpha:0.5] set]; 74 | [cell drawInContext:ctx]; 75 | CGContextFillPath(ctx); 76 | } 77 | } 78 | 79 | 80 | @end 81 | -------------------------------------------------------------------------------- /Edgy/DelaunayPoint.m: -------------------------------------------------------------------------------- 1 | // 2 | // DelaunayPoint.m 3 | // DelaunayTest 4 | // 5 | // Created by Mike Rotondo on 7/17/11. 6 | // Copyright 2011 Stanford. All rights reserved. 7 | // 8 | 9 | #import "DelaunayPoint.h" 10 | #import "DelaunayEdge.h" 11 | #import "DelaunayTriangle.h" 12 | 13 | @interface DelaunayPoint () 14 | 15 | @property (nonatomic, strong) NSMutableSet *edges; 16 | 17 | @end 18 | 19 | @implementation DelaunayPoint 20 | 21 | + (DelaunayPoint *)pointAtX:(float)newX andY:(float)newY 22 | { 23 | NSInteger newID = random(); 24 | DelaunayPoint *point = [DelaunayPoint pointAtX:newX andY:newY withID:[NSNumber numberWithInteger:newID]]; 25 | return point; 26 | } 27 | 28 | + (DelaunayPoint *)pointAtX:(float)newX andY:(float)newY withID:(NSNumber *)idNumber 29 | { 30 | DelaunayPoint *point = [[self alloc] init]; 31 | point.x = newX; 32 | point.y = newY; 33 | point.idNumber = idNumber; 34 | point.contribution = 0.0; 35 | // point.color = [UIColor colorWithRed:(float)rand() / RAND_MAX 36 | // green:(float)rand() / RAND_MAX 37 | // blue:(float)rand() / RAND_MAX 38 | // alpha:1.0]; 39 | return point; 40 | } 41 | 42 | - (id)init 43 | { 44 | self = [super init]; 45 | if (self) 46 | { 47 | self.edges = [NSMutableSet set]; 48 | } 49 | return self; 50 | } 51 | 52 | - (NSString *)description 53 | { 54 | return [NSString stringWithFormat:@"(%.0f, %.0f)", self.x, self.y]; 55 | } 56 | 57 | - (BOOL)isEqual:(id)object 58 | { 59 | assert([object isKindOfClass:[self class]]); 60 | DelaunayPoint *otherPoint = (DelaunayPoint *)object; 61 | return [self.idNumber integerValue] == [otherPoint.idNumber integerValue]; 62 | } 63 | - (NSUInteger)hash 64 | { 65 | return [self.idNumber integerValue]; 66 | } 67 | 68 | - (id)copyWithZone:(NSZone *)zone 69 | { 70 | DelaunayPoint *copy = [DelaunayPoint pointAtX:self.x andY:self.y withID:self.idNumber]; 71 | copy.contribution = self.contribution; 72 | copy.value = self.value; 73 | return copy; 74 | } 75 | 76 | - (NSArray *)counterClockwiseEdges 77 | { 78 | return [[self.edges allObjects] sortedArrayUsingComparator:^(id obj1, id obj2) { 79 | DelaunayEdge *e1 = obj1; 80 | DelaunayEdge *e2 = obj2; 81 | 82 | DelaunayPoint *p1 = [e1 otherPoint:self]; 83 | DelaunayPoint *p2 = [e2 otherPoint:self]; 84 | 85 | float angle1 = atan2(p1.y - self.y, p1.x - self.x); 86 | float angle2 = atan2(p2.y - self.y, p2.x - self.x); 87 | if ( angle1 > angle2 ) 88 | return NSOrderedAscending; 89 | else if ( angle1 < angle2 ) 90 | return NSOrderedDescending; 91 | else 92 | return NSOrderedSame; 93 | }]; 94 | } 95 | 96 | @end 97 | -------------------------------------------------------------------------------- /Edgy Demo/EDDiagnosticView.m: -------------------------------------------------------------------------------- 1 | // 2 | // EDDiagnosticView.m 3 | // Edgy 4 | // 5 | // Created by Mike Rotondo on 6/18/13. 6 | // Copyright (c) 2013 Stanford. All rights reserved. 7 | // 8 | 9 | #import "EDDiagnosticView.h" 10 | #import "DelaunayTriangulation.h" 11 | #import "DelaunayPoint.h" 12 | #import "DelaunayEdge.h" 13 | #import "DelaunayTriangle.h" 14 | #import "VoronoiCell.h" 15 | 16 | @implementation EDDiagnosticView 17 | 18 | - (id)initWithFrame:(CGRect)frame 19 | { 20 | self = [super initWithFrame:frame]; 21 | if (self) { 22 | } 23 | return self; 24 | } 25 | 26 | - (void)drawRect:(CGRect)rect 27 | { 28 | CGContextRef ctx = UIGraphicsGetCurrentContext(); 29 | 30 | for (DelaunayTriangle *triangle in self.triangulation.triangles) 31 | { 32 | if ([triangle inFrameTriangleOfTriangulation:self.triangulation]) 33 | continue; 34 | 35 | // [triangle.color set]; 36 | [[UIColor whiteColor] set]; 37 | [[UIColor blackColor] setStroke]; 38 | [triangle drawInContext:ctx]; 39 | CGContextDrawPath(ctx, kCGPathFillStroke); 40 | //CGContextStrokePath(ctx); 41 | 42 | } 43 | 44 | // // Draw circumcenters & circumcircles 45 | // for (DelaunayTriangle *triangle in self.triangulation.triangles) 46 | // { 47 | // // Don't draw Delaunay triangles that include the frame edges 48 | // // if ([triangle inFrameTriangleOfTriangulation:self.triangulation]) 49 | // // continue; 50 | // 51 | // [[UIColor redColor] set]; 52 | // CGPoint circumcenter = [triangle circumcenter]; 53 | // CGContextMoveToPoint(ctx, circumcenter.x + 10, circumcenter.y); 54 | // CGContextAddArc(ctx, circumcenter.x, circumcenter.y, 10, 0, 2 * M_PI, 0); 55 | // CGContextFillPath(ctx); 56 | // 57 | // DelaunayPoint *p = [triangle startPoint]; 58 | // float bigradius = sqrtf(powf(p.x - circumcenter.x, 2) + powf(p.y - circumcenter.y, 2)); 59 | // CGContextMoveToPoint(ctx, circumcenter.x + bigradius, circumcenter.y); 60 | // CGContextAddArc(ctx, circumcenter.x, circumcenter.y, bigradius, 0, 2 * M_PI, 0); 61 | // CGContextStrokePath(ctx); 62 | // } 63 | 64 | //Draw the voronoi cells 65 | NSDictionary *voronoiCells = [self.triangulation voronoiCells]; 66 | for (VoronoiCell *cell in [voronoiCells objectEnumerator]) 67 | { 68 | [cell drawInContext:ctx]; 69 | if (cell.site.color) 70 | { 71 | [cell.site.color set]; 72 | CGContextDrawPath(ctx, kCGPathFill); 73 | } 74 | else 75 | { 76 | [[UIColor colorWithRed:(arc4random() / (float)0x100000000) green:(arc4random() / (float)0x100000000) blue:(arc4random() / (float)0x100000000) alpha:0.9] set]; 77 | CGContextDrawPath(ctx, kCGPathStroke); 78 | } 79 | } 80 | } 81 | 82 | 83 | @end 84 | -------------------------------------------------------------------------------- /Edgy Demo/EDViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // EDViewController.m 3 | // Edgy Demo 4 | // 5 | // Created by Mike Rotondo on 6/18/13. 6 | // Copyright (c) 2013 Stanford. All rights reserved. 7 | // 8 | 9 | #import "EDViewController.h" 10 | #import "DelaunayTriangulation.h" 11 | #import "DelaunayPoint.h" 12 | #import "EDDiagnosticView.h" 13 | 14 | @interface EDViewController () 15 | 16 | @end 17 | 18 | @implementation EDViewController 19 | { 20 | IBOutlet EDDiagnosticView *_diagnosticView; 21 | DelaunayTriangulation *_triangulation; 22 | NSTimeInterval _touchTimeThreshold; 23 | NSDate *_lastTouchTime; 24 | UIColor *_currentColor; 25 | } 26 | 27 | - (void)viewDidLoad 28 | { 29 | [super viewDidLoad]; 30 | [self reset]; 31 | _touchTimeThreshold = 0.05; 32 | _lastTouchTime = [NSDate distantPast]; 33 | } 34 | 35 | - (BOOL)shouldAutorotate 36 | { 37 | return NO; 38 | } 39 | 40 | - (void)reset 41 | { 42 | CGRect triangulationRect = CGRectInset(self.view.bounds, 0, 0); 43 | _triangulation = [DelaunayTriangulation triangulationWithRect:triangulationRect]; 44 | _diagnosticView.triangulation = _triangulation; 45 | 46 | for (int i = 0; i < 100; i++) 47 | { 48 | CGPoint loc = CGPointMake(self.view.bounds.size.width * (arc4random() / (float)0x100000000), 49 | self.view.bounds.size.height * (arc4random() / (float)0x100000000)); 50 | DelaunayPoint *newPoint = [DelaunayPoint pointAtX:loc.x andY:loc.y]; 51 | [_triangulation addPoint:newPoint withColor:nil]; 52 | } 53 | } 54 | 55 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 56 | { 57 | UITouch *touch = (UITouch *)[touches anyObject]; 58 | CGPoint loc = [touch locationInView:self.view]; 59 | DelaunayPoint *newPoint = [DelaunayPoint pointAtX:loc.x andY:loc.y]; 60 | [_triangulation addPoint:newPoint withColor:nil]; 61 | _currentColor = [UIColor colorWithRed:(arc4random() / (float)0x100000000) 62 | green:(arc4random() / (float)0x100000000) 63 | blue:(arc4random() / (float)0x100000000) 64 | alpha:1.0]; 65 | newPoint.color = _currentColor; 66 | _lastTouchTime = [NSDate date]; 67 | 68 | [_diagnosticView setNeedsDisplay]; 69 | } 70 | 71 | - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event 72 | { 73 | if ([[NSDate date] timeIntervalSinceDate:_lastTouchTime] < _touchTimeThreshold) 74 | { 75 | return; 76 | } 77 | else 78 | { 79 | _lastTouchTime = [NSDate date]; 80 | } 81 | 82 | UITouch *touch = (UITouch *)[touches anyObject]; 83 | CGPoint loc = [touch locationInView:self.view]; 84 | DelaunayPoint *newPoint = [DelaunayPoint pointAtX:loc.x andY:loc.y]; 85 | newPoint.color = _currentColor; 86 | [_triangulation addPoint:newPoint withColor:nil]; 87 | [_diagnosticView setNeedsDisplay]; 88 | } 89 | 90 | - (void)didReceiveMemoryWarning 91 | { 92 | [super didReceiveMemoryWarning]; 93 | // Dispose of any resources that can be recreated. 94 | } 95 | 96 | @end 97 | -------------------------------------------------------------------------------- /Edgy Demo/Base.lproj/Main_iPad.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /DelaunayTest/DelaunayTestViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DelaunayTestViewController.m 3 | // DelaunayTest 4 | // 5 | // Created by Mike Rotondo on 7/17/11. 6 | // Copyright 2011 Stanford. All rights reserved. 7 | // 8 | 9 | #import "DelaunayTestViewController.h" 10 | #import "DelaunayView.h" 11 | #import "DelaunayPoint.h" 12 | #import "VoronoiCell.h" 13 | 14 | @implementation DelaunayTestViewController 15 | @synthesize triangulation; 16 | @synthesize interpaderpSwitch; 17 | @synthesize interpolating; 18 | 19 | 20 | - (void)didReceiveMemoryWarning 21 | { 22 | // Releases the view if it doesn't have a superview. 23 | [super didReceiveMemoryWarning]; 24 | 25 | // Release any cached data, images, etc that aren't in use. 26 | } 27 | 28 | #pragma mark - View lifecycle 29 | 30 | 31 | - (void)viewDidLoad 32 | { 33 | [super viewDidLoad]; 34 | [self reset]; 35 | } 36 | 37 | - (void)viewDidUnload 38 | { 39 | [super viewDidUnload]; 40 | // Release any retained subviews of the main view. 41 | // e.g. self.myOutlet = nil; 42 | } 43 | 44 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 45 | { 46 | // Return YES for supported orientations 47 | return YES; 48 | } 49 | 50 | - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation 51 | { 52 | [self reset]; 53 | } 54 | 55 | - (void)reset 56 | { 57 | self.triangulation = [DelaunayTriangulation triangulationWithRect:self.view.bounds]; 58 | 59 | for (int i = 0; i < 20; i++) 60 | { 61 | CGPoint loc = CGPointMake(self.view.bounds.size.width * (arc4random() / (float)0x100000000), 62 | self.view.bounds.size.height * (arc4random() / (float)0x100000000)); 63 | DelaunayPoint *newPoint = [DelaunayPoint pointAtX:loc.x andY:loc.y]; 64 | [self.triangulation addPoint:newPoint withColor:nil]; 65 | } 66 | 67 | ((DelaunayView *)self.view).triangulation = triangulation; 68 | self.interpaderpSwitch.on = NO; 69 | self.interpolating = NO; 70 | } 71 | 72 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 73 | { 74 | if (interpolating) 75 | { 76 | UITouch *touch = (UITouch *)[touches anyObject]; 77 | CGPoint loc = [touch locationInView:self.view]; 78 | DelaunayPoint *newPoint = [DelaunayPoint pointAtX:loc.x andY:loc.y]; 79 | [self.triangulation interpolateWeightsWithPoint:newPoint]; 80 | [self.view setNeedsDisplay]; 81 | } 82 | else 83 | { 84 | UITouch *touch = (UITouch *)[touches anyObject]; 85 | CGPoint loc = [touch locationInView:self.view]; 86 | DelaunayPoint *newPoint = [DelaunayPoint pointAtX:loc.x andY:loc.y]; 87 | [self.triangulation addPoint:newPoint withColor:nil]; 88 | 89 | [self.view setNeedsDisplay]; 90 | } 91 | } 92 | 93 | - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event 94 | { 95 | if (interpolating) 96 | { 97 | UITouch *touch = (UITouch *)[touches anyObject]; 98 | CGPoint loc = [touch locationInView:self.view]; 99 | DelaunayPoint *newPoint = [DelaunayPoint pointAtX:loc.x andY:loc.y]; 100 | [self.triangulation interpolateWeightsWithPoint:newPoint]; 101 | [self.view setNeedsDisplay]; 102 | } 103 | } 104 | 105 | - (IBAction)toggleInterpolation:(UISwitch *)sender 106 | { 107 | self.interpolating = sender.on; 108 | } 109 | 110 | @end 111 | -------------------------------------------------------------------------------- /Edgy Demo/Base.lproj/Main_iPhone.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /Edgy/DelaunayEdge.m: -------------------------------------------------------------------------------- 1 | // 2 | // DelaunayEdge.m 3 | // DelaunayTest 4 | // 5 | // Created by Mike Rotondo on 7/20/11. 6 | // Copyright 2011 Stanford. All rights reserved. 7 | // 8 | 9 | #import "DelaunayEdge.h" 10 | #import "DelaunayTriangle.h" 11 | #import "DelaunayPoint.h" 12 | 13 | @interface DelaunayEdge () 14 | 15 | - (float) determinant:(float[3][3])matrix; 16 | 17 | @end 18 | 19 | @implementation DelaunayEdge 20 | { 21 | float cachedLength; 22 | } 23 | 24 | + (DelaunayEdge *)edgeWithPoints:(NSArray *)points 25 | { 26 | DelaunayEdge *edge = [[self alloc] init]; 27 | 28 | edge.points = points; 29 | 30 | for (DelaunayPoint *point in points) 31 | { 32 | [point.edges addObject:edge]; 33 | } 34 | 35 | edge.triangles = [NSMutableSet setWithCapacity:2]; 36 | 37 | return edge; 38 | } 39 | 40 | 41 | - (BOOL)isEqual:(id)object 42 | { 43 | if ([object isKindOfClass:[self class]]) 44 | { 45 | DelaunayEdge *otherEdge = object; 46 | return ([self.points[0] isEqual:otherEdge.points[0]] && 47 | [self.points[1] isEqual:otherEdge.points[1]]); 48 | } 49 | return NO; 50 | } 51 | - (NSUInteger)hash 52 | { 53 | return [(DelaunayPoint*)[self.points objectAtIndex:0] hash] ^ [(DelaunayPoint*)[self.points objectAtIndex:1] hash]; 54 | 55 | } 56 | 57 | - (NSString *)description 58 | { 59 | return [NSString stringWithFormat:@"%@ -> %@", self.points[0], self.points[1]]; 60 | } 61 | 62 | - (DelaunayTriangle *)neighborOf:(DelaunayTriangle *)triangle 63 | { 64 | // if (![self.triangles containsObject:triangle]) 65 | // { 66 | // NSLog(@"ASKED FOR THE NEIGHBOR OF A TRIANGLE THROUGH AN EDGE THAT DOESN'T BORDER THAT TRIANGLE!"); 67 | // return nil; 68 | // } 69 | 70 | // There should only ever be 2 triangles in self.triangles 71 | for (DelaunayTriangle *edgeTriangle in self.triangles) 72 | { 73 | if (edgeTriangle != triangle) 74 | return edgeTriangle; 75 | } 76 | return nil; 77 | } 78 | 79 | - (DelaunayPoint *)otherPoint:(DelaunayPoint *)point 80 | { 81 | if ( [[self.points objectAtIndex:0] isEqual: point] ) 82 | return [self.points objectAtIndex:1]; 83 | else if ( [[self.points objectAtIndex:1] isEqual: point] ) 84 | return [self.points objectAtIndex:0]; 85 | else 86 | { 87 | NSLog(@"ASKED FOR THE OTHER POINT WITH A POINT THAT IS NOT IN THIS EDGE"); 88 | return nil; 89 | } 90 | } 91 | 92 | - (BOOL)pointOnLeft:(DelaunayPoint*)point withStartPoint:(DelaunayPoint *)startPoint 93 | { 94 | if (![self.points containsObject:startPoint]) 95 | { 96 | NSLog(@"ASKED IF POINT ON LEFT WITH A START POINT THAT IS NOT IN THIS EDGE"); 97 | return NO; 98 | } 99 | 100 | DelaunayPoint *p0 = [self.points objectAtIndex:0]; 101 | DelaunayPoint *p1 = [self.points objectAtIndex:1]; 102 | 103 | float check[3][3] = { 104 | {p0.x, p0.y, 1}, 105 | {p1.x, p1.y, 1}, 106 | {point.x, point.y, 1} 107 | }; 108 | 109 | float det = [self determinant:check]; 110 | 111 | if (startPoint == p0) 112 | return det <= 0; 113 | else 114 | return det >= 0; 115 | } 116 | 117 | - (DelaunayTriangle *)sharedTriangleWithEdge:(DelaunayEdge *)otherEdge 118 | { 119 | NSMutableSet *sharedTriangles = [self.triangles mutableCopy]; 120 | 121 | [sharedTriangles intersectSet:otherEdge.triangles]; 122 | 123 | if ([sharedTriangles count] == 0) 124 | { 125 | NSLog(@"ASKED FOR THE SHARED TRIANGLE WITH AN EDGE THAT DOESN'T SHARE ANY TRIANGLES WITH THIS EDGE"); 126 | return nil; 127 | } 128 | if ([sharedTriangles count] > 1) 129 | { 130 | NSLog(@"SOMEHOW THIS EDGE SHARES MORE THAN ONE TRIANGLE WITH THE OTHER EDGE?!"); 131 | return nil; 132 | } 133 | return [sharedTriangles anyObject]; 134 | } 135 | 136 | - (float) determinant:(float[3][3])matrix 137 | { 138 | float a = matrix[0][0]; 139 | float b = matrix[0][1]; 140 | float c = matrix[0][2]; 141 | float d = matrix[1][0]; 142 | float e = matrix[1][1]; 143 | float f = matrix[1][2]; 144 | float g = matrix[2][0]; 145 | float h = matrix[2][1]; 146 | float i = matrix[2][2]; 147 | 148 | return (a * e * i - 149 | a * f * h - 150 | b * d * i + 151 | b * f * g + 152 | c * d * h - 153 | c * e * g); 154 | } 155 | 156 | - (float)length 157 | { 158 | if (cachedLength) 159 | return cachedLength; 160 | 161 | DelaunayPoint *p1 = [self.points objectAtIndex:0]; 162 | DelaunayPoint *p2 = [self.points objectAtIndex:1]; 163 | cachedLength = sqrtf(powf(p1.x - p2.x, 2) + powf(p1.y - p2.y, 2)); 164 | return cachedLength; 165 | } 166 | 167 | @end 168 | -------------------------------------------------------------------------------- /Edgy/DelaunayTriangle.m: -------------------------------------------------------------------------------- 1 | // 2 | // DelaunayTriangle.m 3 | // DelaunayTest 4 | // 5 | // Created by Mike Rotondo on 7/17/11. 6 | // Copyright 2011 Stanford. All rights reserved. 7 | // 8 | 9 | #import "DelaunayTriangle.h" 10 | #import "DelaunayTriangulation.h" 11 | #import "DelaunayEdge.h" 12 | #import "DelaunayPoint.h" 13 | 14 | 15 | @interface DelaunayTriangle () 16 | 17 | @property (nonatomic, strong) NSArray *edges; 18 | 19 | @end 20 | 21 | @implementation DelaunayTriangle 22 | { 23 | NSArray *_pointsCache; 24 | NSArray *_edges; 25 | UIColor *color; 26 | } 27 | @synthesize startPoint; 28 | @synthesize color; 29 | @synthesize edges = _edges; 30 | 31 | // If color is nil, a random color will be chosen 32 | + (DelaunayTriangle *) triangleWithEdges:(NSArray *)edges andStartPoint:(DelaunayPoint *)startPoint andColor:(UIColor *)color 33 | { 34 | DelaunayTriangle *triangle = [[self alloc] init]; 35 | triangle.edges = edges; 36 | 37 | for (DelaunayEdge *edge in edges) 38 | { 39 | [edge.triangles addObject:triangle]; 40 | } 41 | 42 | triangle.startPoint = startPoint; 43 | 44 | 45 | // if ( nil == color ) 46 | // { 47 | // color = [UIColor colorWithRed:(float)rand() / RAND_MAX 48 | // green:(float)rand() / RAND_MAX 49 | // blue:(float)rand() / RAND_MAX 50 | // alpha:1.0]; 51 | // } 52 | triangle.color = color; 53 | 54 | return triangle; 55 | } 56 | 57 | - (id)init 58 | { 59 | self = [super init]; 60 | if (self) { 61 | } 62 | return self; 63 | } 64 | 65 | - (NSString *)description 66 | { 67 | NSMutableString *desc = [@"" mutableCopy]; 68 | DelaunayPoint *edgeStartPoint = self.startPoint; 69 | for (DelaunayEdge *edge in self.edges) 70 | { 71 | [desc appendFormat:@"%@ (%@ -> %@)\n", edge, edgeStartPoint, [edge otherPoint:edgeStartPoint]]; 72 | edgeStartPoint = [edge otherPoint:edgeStartPoint]; 73 | } 74 | return desc; 75 | } 76 | 77 | //- (BOOL)isEqual:(id)object 78 | //{ 79 | // if ([object isKindOfClass:[self class]]) 80 | // { 81 | // DelaunayTriangle *otherTriangle = object; 82 | // return ([(DelaunayEdge *)[self.edges objectAtIndex:0] isEqual:(DelaunayEdge *)[otherTriangle.edges objectAtIndex:0]] && 83 | // [(DelaunayEdge *)[self.edges objectAtIndex:1] isEqual:(DelaunayEdge *)[otherTriangle.edges objectAtIndex:1]] && 84 | // [(DelaunayEdge *)[self.edges objectAtIndex:2] isEqual:(DelaunayEdge *)[otherTriangle.edges objectAtIndex:2]]); 85 | // } 86 | // return NO; 87 | //} 88 | //- (NSUInteger)hash 89 | //{ 90 | // // I'm assuming that xor is a good "unique combination" operator here. Hopefully that assumption holds up. 91 | // return ([(DelaunayEdge *)[self.edges objectAtIndex:0] hash] ^ 92 | // [(DelaunayEdge *)[self.edges objectAtIndex:1] hash] ^ 93 | // [(DelaunayEdge *)[self.edges objectAtIndex:2] hash]); 94 | //} 95 | 96 | - (BOOL)containsPoint:(DelaunayPoint *)point 97 | { 98 | DelaunayPoint *edgeStartPoint = self.startPoint; 99 | for (DelaunayEdge *edge in self.edges) 100 | { 101 | if (![edge pointOnLeft:point withStartPoint:edgeStartPoint]) 102 | return NO; 103 | edgeStartPoint = [edge otherPoint:edgeStartPoint]; 104 | } 105 | return YES; 106 | } 107 | 108 | - (CGPoint)circumcenter 109 | { 110 | DelaunayPoint *p1 = [self startPointOfEdge:[self.edges objectAtIndex:0]]; 111 | DelaunayPoint *p2 = [self startPointOfEdge:[self.edges objectAtIndex:1]]; 112 | DelaunayPoint *p3 = [self startPointOfEdge:[self.edges objectAtIndex:2]]; 113 | 114 | CGPoint midpoint1 = CGPointMake((p1.x + p2.x) / 2.0, (p1.y + p2.y) / 2.0); 115 | float m1 = (p2.y - p1.y) / (p2.x - p1.x); 116 | float perpendicularM1 = -1 / m1; 117 | float c1 = -perpendicularM1 * midpoint1.x + midpoint1.y; 118 | 119 | CGPoint midpoint2 = CGPointMake((p2.x + p3.x) / 2.0, (p2.y + p3.y) / 2.0); 120 | float m2 = (p3.y - p2.y) / (p3.x - p2.x); 121 | float perpendicularM2 = -1 / m2; 122 | float c2 = -perpendicularM2 * midpoint2.x + midpoint2.y; 123 | 124 | CGPoint midpoint3 = CGPointMake((p3.x + p1.x) / 2.0, (p3.y + p1.y) / 2.0); 125 | float m3 = (p1.y - p3.y) / (p1.x - p3.x); 126 | float perpendicularM3 = -1 / m3; 127 | float c3 = -perpendicularM3 * midpoint3.x + midpoint3.y; 128 | 129 | if (m1 == 0) 130 | { 131 | perpendicularM1 = perpendicularM3; 132 | c1 = c3; 133 | } 134 | else if (m2 == 0) 135 | { 136 | perpendicularM2 = perpendicularM3; 137 | c2 = c3; 138 | } 139 | 140 | float circumcenterX = (c2 - c1) / (perpendicularM1 - perpendicularM2); 141 | float circumcenterY = perpendicularM1 * circumcenterX + c1; 142 | 143 | return CGPointMake(circumcenterX, circumcenterY); 144 | } 145 | 146 | - (BOOL)inFrameTriangleOfTriangulation:(DelaunayTriangulation *)triangulation 147 | { 148 | return [[NSSet setWithArray:self.points] intersectsSet:triangulation.frameTrianglePoints]; 149 | } 150 | 151 | - (NSArray *)points 152 | { 153 | if (_pointsCache) 154 | { 155 | return _pointsCache; 156 | } 157 | 158 | NSMutableArray *points = [NSMutableArray arrayWithCapacity:3]; 159 | DelaunayPoint *edgeStartPoint = self.startPoint; 160 | for (DelaunayEdge *edge in self.edges) 161 | { 162 | [points insertObject:edgeStartPoint atIndex:[points count]]; 163 | edgeStartPoint = [edge otherPoint:edgeStartPoint]; 164 | } 165 | _pointsCache = points; 166 | return points; 167 | } 168 | 169 | - (NSSet *)neighbors 170 | { 171 | NSMutableSet *neighbors = [NSMutableSet setWithCapacity:3]; 172 | for (DelaunayEdge *edge in self.edges) 173 | { 174 | DelaunayTriangle *neighbor = [edge neighborOf:self]; 175 | if (neighbor != nil) 176 | [neighbors addObject:neighbor]; 177 | } 178 | return neighbors; 179 | } 180 | 181 | - (DelaunayPoint *)pointNotInEdge:(DelaunayEdge *)edge 182 | { 183 | DelaunayPoint *p1 = [edge.points objectAtIndex:0]; 184 | DelaunayPoint *p2 = [edge.points objectAtIndex:1]; 185 | 186 | for ( DelaunayPoint *p in self.points ) 187 | { 188 | if ( ![p isEqual:p1] && ![p isEqual:p2] ) 189 | { 190 | return p; 191 | } 192 | } 193 | NSLog(@"ASKED FOR POINT NOT IN EDGE THAT IS NOT IN THIS TRIANGLE"); 194 | return nil; 195 | } 196 | 197 | - (DelaunayEdge *)edgeStartingWithPoint:(DelaunayPoint *)point 198 | { 199 | DelaunayPoint *edgeStartPoint = self.startPoint; 200 | for (DelaunayEdge *edge in self.edges) 201 | { 202 | if (edgeStartPoint == point) 203 | return edge; 204 | edgeStartPoint = [edge otherPoint:edgeStartPoint]; 205 | } 206 | NSLog(@"ASKED FOR THE EDGE STARTING WITH A POINT THAT IS NOT IN THIS TRIANGLE"); 207 | return nil; 208 | } 209 | - (DelaunayEdge *)edgeEndingWithPoint:(DelaunayPoint *)point 210 | { 211 | DelaunayPoint *edgeStartPoint = self.startPoint; 212 | for (DelaunayEdge *edge in self.edges) 213 | { 214 | if ([edge otherPoint:edgeStartPoint] == point) 215 | return edge; 216 | edgeStartPoint = [edge otherPoint:edgeStartPoint]; 217 | } 218 | NSLog(@"ASKED FOR THE EDGE ENDING WITH A POINT THAT IS NOT IN THIS TRIANGLE"); 219 | return nil; 220 | } 221 | 222 | - (DelaunayPoint *)startPointOfEdge:(DelaunayEdge *)edgeInQuestion 223 | { 224 | DelaunayPoint *edgeStartPoint = self.startPoint; 225 | for (DelaunayEdge *edge in self.edges) 226 | { 227 | if (edge == edgeInQuestion) 228 | { 229 | return edgeStartPoint; 230 | } 231 | edgeStartPoint = [edge otherPoint:edgeStartPoint]; 232 | } 233 | NSLog(@"ASKED FOR THE START POINT OF EDGE THAT IS NOT IN THIS TRIANGLE"); 234 | return nil; 235 | } 236 | - (DelaunayPoint *)endPointOfEdge:(DelaunayEdge *)edgeInQuestion 237 | { 238 | DelaunayPoint *edgeStartPoint = self.startPoint; 239 | for (DelaunayEdge *edge in self.edges) 240 | { 241 | if (edge == edgeInQuestion) 242 | return [edge otherPoint:edgeStartPoint]; 243 | edgeStartPoint = [edge otherPoint:edgeStartPoint]; 244 | } 245 | NSLog(@"ASKED FOR THE END POINT OF EDGE THAT IS NOT IN THIS TRIANGLE"); 246 | return nil; 247 | } 248 | 249 | - (void)drawInContext:(CGContextRef)ctx 250 | { 251 | DelaunayPoint *edgeStartPoint = self.startPoint; 252 | CGContextMoveToPoint(ctx, edgeStartPoint.x, edgeStartPoint.y); 253 | for (DelaunayEdge *edge in self.edges) 254 | { 255 | DelaunayPoint *p2 = [edge otherPoint:edgeStartPoint]; 256 | edgeStartPoint = p2; 257 | 258 | CGContextAddLineToPoint(ctx, p2.x, p2.y); 259 | } 260 | CGContextAddLineToPoint(ctx, edgeStartPoint.x, edgeStartPoint.y); 261 | } 262 | 263 | 264 | @end 265 | -------------------------------------------------------------------------------- /DelaunayTest/en.lproj/MainWindow.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 800 5 | 10K540 6 | 1306 7 | 1038.36 8 | 461.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 301 12 | 13 | 14 | YES 15 | IBUIWindow 16 | IBUICustomObject 17 | IBUIViewController 18 | IBProxyObject 19 | 20 | 21 | YES 22 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 23 | 24 | 25 | YES 26 | 27 | YES 28 | 29 | 30 | 31 | 32 | YES 33 | 34 | IBFilesOwner 35 | IBIPadFramework 36 | 37 | 38 | IBFirstResponder 39 | IBIPadFramework 40 | 41 | 42 | 43 | 292 44 | {768, 1024} 45 | 46 | 47 | 48 | 49 | 1 50 | MSAxIDEAA 51 | 52 | NO 53 | NO 54 | IBIPadFramework 55 | YES 56 | 57 | 58 | IBIPadFramework 59 | 60 | 61 | DelaunayTestViewController 62 | 63 | 2 64 | 65 | 66 | 1 67 | 1 68 | 69 | IBIPadFramework 70 | NO 71 | 72 | 73 | 74 | 75 | YES 76 | 77 | 78 | viewController 79 | 80 | 81 | 82 | 8 83 | 84 | 85 | 86 | delegate 87 | 88 | 89 | 90 | 9 91 | 92 | 93 | 94 | window 95 | 96 | 97 | 98 | 10 99 | 100 | 101 | 102 | 103 | YES 104 | 105 | 0 106 | 107 | 108 | 109 | 110 | 111 | -1 112 | 113 | 114 | File's Owner 115 | 116 | 117 | -2 118 | 119 | 120 | 121 | 122 | 2 123 | 124 | 125 | YES 126 | 127 | 128 | 129 | 130 | 6 131 | 132 | 133 | DelaunayTest App Delegate 134 | 135 | 136 | 7 137 | 138 | 139 | 140 | 141 | 142 | 143 | YES 144 | 145 | YES 146 | -1.CustomClassName 147 | -2.CustomClassName 148 | 2.IBEditorWindowLastContentRect 149 | 2.IBPluginDependency 150 | 6.CustomClassName 151 | 6.IBPluginDependency 152 | 7.CustomClassName 153 | 7.IBEditorWindowLastContentRect 154 | 7.IBPluginDependency 155 | 156 | 157 | YES 158 | UIApplication 159 | UIResponder 160 | {{200, 57}, {783, 799}} 161 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 162 | DelaunayTestAppDelegate 163 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 164 | DelaunayTestViewController 165 | {{512, 351}, {320, 480}} 166 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 167 | 168 | 169 | 170 | YES 171 | 172 | 173 | 174 | 175 | 176 | YES 177 | 178 | 179 | 180 | 181 | 12 182 | 183 | 184 | 185 | YES 186 | 187 | DelaunayTestAppDelegate 188 | NSObject 189 | 190 | YES 191 | 192 | YES 193 | viewController 194 | window 195 | 196 | 197 | YES 198 | DelaunayTestViewController 199 | UIWindow 200 | 201 | 202 | 203 | YES 204 | 205 | YES 206 | viewController 207 | window 208 | 209 | 210 | YES 211 | 212 | viewController 213 | DelaunayTestViewController 214 | 215 | 216 | window 217 | UIWindow 218 | 219 | 220 | 221 | 222 | IBProjectSource 223 | ./Classes/DelaunayTestAppDelegate.h 224 | 225 | 226 | 227 | DelaunayTestViewController 228 | UIViewController 229 | 230 | toggleInterpolation: 231 | UISwitch 232 | 233 | 234 | toggleInterpolation: 235 | 236 | toggleInterpolation: 237 | UISwitch 238 | 239 | 240 | 241 | IBProjectSource 242 | ./Classes/DelaunayTestViewController.h 243 | 244 | 245 | 246 | 247 | 0 248 | IBIPadFramework 249 | 250 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 251 | 252 | 253 | 254 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 255 | 256 | 257 | YES 258 | 3 259 | 301 260 | 261 | 262 | -------------------------------------------------------------------------------- /DelaunayTest/en.lproj/DelaunayTestViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1552 5 | 13A476u 6 | 3084 7 | 1238.11 8 | 678.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 2083 12 | 13 | 14 | YES 15 | IBProxyObject 16 | IBUILabel 17 | IBUISwitch 18 | IBUIView 19 | 20 | 21 | YES 22 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 23 | 24 | 25 | PluginDependencyRecalculationVersion 26 | 27 | 28 | 29 | YES 30 | 31 | IBFilesOwner 32 | IBIPadFramework 33 | 34 | 35 | IBFirstResponder 36 | IBIPadFramework 37 | 38 | 39 | 40 | 274 41 | 42 | YES 43 | 44 | 45 | 269 46 | {{387, 957}, {94, 27}} 47 | 48 | 49 | 50 | NO 51 | IBIPadFramework 52 | 0 53 | 0 54 | 55 | 56 | 57 | 269 58 | {{288, 960}, {91, 21}} 59 | 60 | 61 | 62 | NO 63 | YES 64 | 7 65 | NO 66 | IBIPadFramework 67 | Interpolate 68 | 69 | 1 70 | MC45MDE5NjA3OTAyIDAuOTAxOTYwNzkwMiAwLjkwMTk2MDc5MDIAA 71 | 72 | 73 | 1 74 | 10 75 | 2 76 | 77 | Helvetica 78 | Helvetica 79 | 0 80 | 17 81 | 82 | 83 | Helvetica 84 | 17 85 | 16 86 | 87 | 88 | 89 | {{0, 20}, {768, 1004}} 90 | 91 | 92 | 93 | 94 | 3 95 | MQA 96 | 97 | 2 98 | 99 | 100 | 101 | 2 102 | 103 | IBIPadFramework 104 | 105 | 106 | 107 | 108 | YES 109 | 110 | 111 | view 112 | 113 | 114 | 115 | 3 116 | 117 | 118 | 119 | interpaderpSwitch 120 | 121 | 122 | 123 | 7 124 | 125 | 126 | 127 | toggleInterpolation: 128 | 129 | 130 | 13 131 | 132 | 6 133 | 134 | 135 | 136 | 137 | YES 138 | 139 | 0 140 | 141 | YES 142 | 143 | 144 | 145 | 146 | 147 | -1 148 | 149 | 150 | File's Owner 151 | 152 | 153 | -2 154 | 155 | 156 | 157 | 158 | 2 159 | 160 | 161 | YES 162 | 163 | 164 | 165 | 166 | 167 | 168 | 4 169 | 170 | 171 | 172 | 173 | 5 174 | 175 | 176 | 177 | 178 | 179 | 180 | YES 181 | 182 | YES 183 | -1.CustomClassName 184 | -1.IBPluginDependency 185 | -2.CustomClassName 186 | -2.IBPluginDependency 187 | 2.CustomClassName 188 | 2.IBPluginDependency 189 | 4.IBPluginDependency 190 | 5.IBPluginDependency 191 | 192 | 193 | YES 194 | DelaunayTestViewController 195 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 196 | UIResponder 197 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 198 | DelaunayView 199 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 200 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 201 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 202 | 203 | 204 | 205 | YES 206 | 207 | 208 | 209 | 210 | 211 | YES 212 | 213 | 214 | 215 | 216 | 7 217 | 218 | 219 | 220 | YES 221 | 222 | DelaunayTestViewController 223 | UIViewController 224 | 225 | toggleInterpolation: 226 | UISwitch 227 | 228 | 229 | toggleInterpolation: 230 | 231 | toggleInterpolation: 232 | UISwitch 233 | 234 | 235 | 236 | interpaderpSwitch 237 | UISwitch 238 | 239 | 240 | interpaderpSwitch 241 | 242 | interpaderpSwitch 243 | UISwitch 244 | 245 | 246 | 247 | IBProjectSource 248 | ./Classes/DelaunayTestViewController.h 249 | 250 | 251 | 252 | DelaunayView 253 | UIView 254 | 255 | IBProjectSource 256 | ./Classes/DelaunayView.h 257 | 258 | 259 | 260 | 261 | 0 262 | IBIPadFramework 263 | 264 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 265 | 266 | 267 | 268 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 269 | 270 | 271 | YES 272 | 3 273 | 2083 274 | 275 | 276 | -------------------------------------------------------------------------------- /Edgy/DelaunayTriangulation.m: -------------------------------------------------------------------------------- 1 | // 2 | // DelaunayTriangulation.m 3 | // DelaunayTest 4 | // 5 | // Created by Mike Rotondo on 7/17/11. 6 | // Copyright 2011 Stanford. All rights reserved. 7 | // 8 | 9 | #import "DelaunayTriangulation.h" 10 | #import "DelaunayPoint.h" 11 | #import "DelaunayEdge.h" 12 | #import "DelaunayTriangle.h" 13 | #import "VoronoiCell.h" 14 | 15 | @interface DelaunayTriangulation () 16 | 17 | - (void)removeTriangle:(DelaunayTriangle *)triangle; 18 | 19 | @end 20 | 21 | @implementation DelaunayTriangulation 22 | @synthesize points; 23 | @synthesize edges; 24 | @synthesize triangles; 25 | @synthesize frameTrianglePoints; 26 | 27 | + (DelaunayTriangulation *)triangulation 28 | { 29 | return [DelaunayTriangulation triangulationWithSize:CGSizeMake(20000, 20000)]; 30 | } 31 | 32 | + (DelaunayTriangulation *)triangulationWithSize:(CGSize)size 33 | { 34 | return [DelaunayTriangulation triangulationWithRect:CGRectMake(0, 0, size.width, size.height)]; 35 | } 36 | 37 | + (DelaunayTriangulation *)triangulationWithRect:(CGRect)rect 38 | { 39 | DelaunayTriangulation *dt = [[self alloc] init]; 40 | 41 | // ADD FRAME TRIANGLE 42 | float w = rect.size.width; 43 | float h = rect.size.height; 44 | float x = rect.origin.x; 45 | float y = rect.origin.y; 46 | 47 | DelaunayPoint *p1 = [DelaunayPoint pointAtX:x andY:y]; 48 | DelaunayPoint *p2 = [DelaunayPoint pointAtX:x andY:h * 2]; 49 | DelaunayPoint *p3 = [DelaunayPoint pointAtX:w * 2 andY:y]; 50 | 51 | DelaunayEdge *e1 = [DelaunayEdge edgeWithPoints:@[p1, p2]]; 52 | DelaunayEdge *e2 = [DelaunayEdge edgeWithPoints:@[p2, p3]]; 53 | DelaunayEdge *e3 = [DelaunayEdge edgeWithPoints:@[p3, p1]]; 54 | 55 | DelaunayTriangle *triangle = [DelaunayTriangle triangleWithEdges:@[e1, e2, e3] andStartPoint:p1 andColor:nil]; 56 | dt.frameTrianglePoints = [NSSet setWithObjects:p1, p2, p3, nil]; 57 | 58 | dt.triangles = [NSMutableSet setWithObject:triangle]; 59 | dt.edges = [NSMutableSet setWithObjects:e1, e2, e3, nil]; 60 | dt.points = [NSMutableSet setWithObjects:p1, p2, p3, nil]; 61 | 62 | return dt; 63 | } 64 | 65 | - (id)copyWithZone:(NSZone *)zone 66 | { 67 | DelaunayTriangulation *dt = [[DelaunayTriangulation alloc] init]; 68 | 69 | NSMutableSet *triangleCopies = [NSMutableSet setWithCapacity: [self.triangles count]]; 70 | NSMutableSet *edgeCopies = [NSMutableSet setWithCapacity: [self.edges count]]; 71 | NSMutableSet *pointCopies = [NSMutableSet setWithCapacity: [self.points count]]; 72 | 73 | for (DelaunayPoint *point in self.points) 74 | { 75 | [pointCopies addObject:[point copy]]; 76 | } 77 | 78 | for (DelaunayEdge *edge in self.edges) 79 | { 80 | DelaunayPoint *p1 = [pointCopies member:[edge.points objectAtIndex:0]]; 81 | DelaunayPoint *p2 = [pointCopies member:[edge.points objectAtIndex:1]]; 82 | [edgeCopies addObject:[DelaunayEdge edgeWithPoints:@[p1, p2]]]; 83 | } 84 | 85 | for (DelaunayTriangle *triangle in self.triangles) 86 | { 87 | DelaunayEdge *e1 = [edgeCopies member:[triangle.edges objectAtIndex:0]]; 88 | DelaunayEdge *e2 = [edgeCopies member:[triangle.edges objectAtIndex:1]]; 89 | DelaunayEdge *e3 = [edgeCopies member:[triangle.edges objectAtIndex:2]]; 90 | DelaunayTriangle *triangleCopy = [DelaunayTriangle triangleWithEdges:@[e1, e2, e3] andStartPoint:[pointCopies member:triangle.startPoint] andColor:triangle.color]; 91 | [triangleCopies addObject:triangleCopy]; 92 | } 93 | 94 | dt.triangles = triangleCopies; 95 | dt.edges = edgeCopies; 96 | dt.points = pointCopies; 97 | NSMutableSet *frameTrianglePointsCopy = [NSMutableSet setWithCapacity:3]; 98 | for ( DelaunayPoint *frameTrianglePoint in self.frameTrianglePoints ) 99 | { 100 | [frameTrianglePointsCopy addObject:[pointCopies member:frameTrianglePoint]]; 101 | } 102 | dt.frameTrianglePoints = frameTrianglePointsCopy; 103 | 104 | return dt; 105 | } 106 | 107 | - (void)removeTriangle:(DelaunayTriangle *)triangle 108 | { 109 | for (DelaunayEdge *edge in triangle.edges) 110 | { 111 | [edge.triangles removeObject:triangle]; 112 | } 113 | [self.triangles removeObject:triangle]; 114 | } 115 | 116 | - (void)removeEdge:(DelaunayEdge *)edge 117 | { 118 | assert([edge.triangles count] == 0); 119 | for (DelaunayPoint *point in edge.points) 120 | { 121 | [point.edges removeObject:edge]; 122 | } 123 | [self.edges removeObject:edge]; 124 | } 125 | 126 | - (BOOL)addPoint:(DelaunayPoint *)newPoint withColor:(UIColor *)color 127 | { 128 | // TODO(mrotondo): Mirror the points into the 8 surrounding regions to fix up interpolation around the edges. 129 | DelaunayTriangle * triangle = [self triangleContainingPoint:newPoint]; 130 | if (triangle != nil) 131 | { 132 | [self.points addObject:newPoint]; 133 | 134 | [self removeTriangle:triangle]; 135 | 136 | DelaunayEdge *e1 = [triangle.edges objectAtIndex:0]; 137 | DelaunayEdge *e2 = [triangle.edges objectAtIndex:1]; 138 | DelaunayEdge *e3 = [triangle.edges objectAtIndex:2]; 139 | 140 | DelaunayPoint *edgeStartPoint = triangle.startPoint; 141 | DelaunayEdge *new1 = [DelaunayEdge edgeWithPoints:@[edgeStartPoint, newPoint]]; 142 | edgeStartPoint = [e1 otherPoint:edgeStartPoint]; 143 | DelaunayEdge *new2 = [DelaunayEdge edgeWithPoints:@[edgeStartPoint, newPoint]]; 144 | edgeStartPoint = [e2 otherPoint:edgeStartPoint]; 145 | DelaunayEdge *new3 = [DelaunayEdge edgeWithPoints:@[edgeStartPoint, newPoint]]; 146 | 147 | [self.edges addObject:new1]; 148 | [self.edges addObject:new2]; 149 | [self.edges addObject:new3]; 150 | 151 | // Use start point and counter-clockwise ordered edges to enforce counter-clockwiseness in point-containment checking 152 | DelaunayTriangle * e1Triangle = [DelaunayTriangle triangleWithEdges:@[new1, e1, new2] 153 | andStartPoint:newPoint 154 | andColor:color]; 155 | DelaunayTriangle * e2Triangle = [DelaunayTriangle triangleWithEdges:@[new2, e2, new3] 156 | andStartPoint:newPoint 157 | andColor:color]; 158 | DelaunayTriangle * e3Triangle = [DelaunayTriangle triangleWithEdges:@[new3, e3, new1] 159 | andStartPoint:newPoint 160 | andColor:color]; 161 | 162 | [self.triangles addObject:e1Triangle]; 163 | [self.triangles addObject:e2Triangle]; 164 | [self.triangles addObject:e3Triangle]; 165 | 166 | [self enforceDelaunayProperty]; 167 | // [self enforceDelaunayPropertyStartingWithTriangles:@[e1Triangle, e2Triangle, e3Triangle]]; 168 | 169 | return YES; 170 | } 171 | return NO; 172 | } 173 | 174 | - (DelaunayTriangle *)triangleContainingPoint:(DelaunayPoint *)point 175 | { 176 | for (DelaunayTriangle* triangle in self.triangles) 177 | { 178 | if ([triangle containsPoint:point]) 179 | { 180 | return triangle; 181 | } 182 | } 183 | return nil; 184 | } 185 | 186 | //- (void)enforceDelaunayPropertyStartingWithTriangles:(NSArray *)initialTriangles 187 | //{ 188 | // NSMutableSet *trianglesToCheck = [NSMutableSet setWithArray:initialTriangles]; 189 | // 190 | // while ([trianglesToCheck count]) 191 | // { 192 | // // Flip all non-Delaunay edges 193 | // DelaunayTriangle *triangle = [trianglesToCheck anyObject]; 194 | // [trianglesToCheck removeObject:triangle]; 195 | // 196 | //// NSLog(@"Looking at triangle %@ (there are %d left)", triangle, [trianglesToCheck count]); 197 | // if (![self.triangles containsObject:triangle]) 198 | // { 199 | // NSLog(@"This is not in self.triangles!"); 200 | // } 201 | // 202 | // CGPoint circumcenter = [triangle circumcenter]; 203 | // 204 | // float radius = sqrtf(powf(triangle.startPoint.x - circumcenter.x, 2) + powf(triangle.startPoint.y - circumcenter.y, 2)); 205 | // 206 | // for (DelaunayEdge *sharedEdge in triangle.edges) 207 | // { 208 | // DelaunayTriangle *neighborTriangle = [sharedEdge neighborOf:triangle]; 209 | // if (neighborTriangle != nil) 210 | // { 211 | //// NSLog(@"Looking at neighbor %@ via edge %@", neighborTriangle, sharedEdge); 212 | // if (![self.triangles containsObject:neighborTriangle]) 213 | // { 214 | // NSLog(@"THIS IS NOT IN SELF.TRIANGLES"); 215 | // } 216 | // if (![self.edges containsObject:sharedEdge]) 217 | // { 218 | // NSLog(@"THIS IS NOT IN SELF.EDGES"); 219 | // } 220 | // 221 | // // Find the non-shared point in the other triangle 222 | // DelaunayPoint *ourNonSharedPoint = [triangle pointNotInEdge:sharedEdge]; 223 | // DelaunayPoint *theirNonSharedPoint = [neighborTriangle pointNotInEdge:sharedEdge]; 224 | // if (sqrtf(powf(theirNonSharedPoint.x - circumcenter.x, 2) + powf(theirNonSharedPoint.y - circumcenter.y, 2)) < radius ) 225 | // { 226 | // NSLog(@"Flipping!!!!!!!!!!!!!!"); 227 | // 228 | //// NSLog(@"NOPE"); 229 | //// continue; 230 | // 231 | // // If the non-shared point is within the circumcircle of this triangle, flip to share the other two points 232 | // [self removeTriangle:triangle]; 233 | // [self removeTriangle:neighborTriangle]; 234 | // [trianglesToCheck removeObject:triangle]; 235 | // [trianglesToCheck removeObject:neighborTriangle]; 236 | // 237 | // // Get the edges before & after the shared edge in the triangle 238 | // DelaunayEdge *beforeEdge = [triangle edgeStartingWithPoint:ourNonSharedPoint]; 239 | // DelaunayEdge *afterEdge = [triangle edgeEndingWithPoint:ourNonSharedPoint]; 240 | // 241 | // DelaunayEdge *newEdge = [DelaunayEdge edgeWithPoints:[NSArray arrayWithObjects:theirNonSharedPoint, ourNonSharedPoint, nil]]; 242 | // [self.edges addObject:newEdge]; 243 | // 244 | // // Get the edges before & after the shared edge in the neighbor triangle 245 | // DelaunayEdge *neighborBeforeEdge = [neighborTriangle edgeStartingWithPoint:theirNonSharedPoint]; 246 | // DelaunayEdge *neighborAfterEdge = [neighborTriangle edgeEndingWithPoint:theirNonSharedPoint]; 247 | // 248 | // DelaunayTriangle *newTriangle1 = [DelaunayTriangle triangleWithEdges:[NSArray arrayWithObjects:newEdge, beforeEdge, neighborAfterEdge, nil] 249 | // andStartPoint:theirNonSharedPoint 250 | // andColor:triangle.color]; 251 | // 252 | // NSLog(@"SANITY CHECK:\n%@", newTriangle1); 253 | // 254 | // DelaunayTriangle *newTriangle2 = [DelaunayTriangle triangleWithEdges:[NSArray arrayWithObjects:neighborBeforeEdge, afterEdge, newEdge, nil] 255 | // andStartPoint:theirNonSharedPoint 256 | // andColor:neighborTriangle.color]; 257 | // 258 | // 259 | // NSLog(@"SANITY CHECK:\n%@", newTriangle2); 260 | // 261 | // [self.triangles addObject:newTriangle1]; 262 | // [self.triangles addObject:newTriangle2]; 263 | // 264 | // [trianglesToCheck addObject:newTriangle1]; 265 | // [trianglesToCheck addObject:newTriangle2]; 266 | // [trianglesToCheck unionSet:[newTriangle1 neighbors]]; 267 | // [trianglesToCheck unionSet:[newTriangle2 neighbors]]; 268 | // } 269 | // } 270 | // } 271 | // } 272 | //} 273 | 274 | - (void)enforceDelaunayProperty 275 | { 276 | bool hadToFlip; 277 | 278 | do { 279 | hadToFlip = NO; 280 | 281 | NSMutableSet *trianglesToRemove = [NSMutableSet set]; 282 | NSMutableSet *edgesToRemove = [NSMutableSet set]; 283 | NSMutableSet *trianglesToAdd = [NSMutableSet set]; 284 | 285 | // Flip all non-Delaunay edges 286 | for (DelaunayTriangle *triangle in self.triangles) 287 | { 288 | CGPoint circumcenter = [triangle circumcenter]; 289 | 290 | float radius = sqrtf(powf(triangle.startPoint.x - circumcenter.x, 2) + powf(triangle.startPoint.y - circumcenter.y, 2)); 291 | 292 | for (DelaunayEdge *sharedEdge in triangle.edges) 293 | { 294 | DelaunayTriangle *neighborTriangle = [sharedEdge neighborOf:triangle]; 295 | if (neighborTriangle != nil) 296 | { 297 | // Find the non-shared point in the other triangle 298 | DelaunayPoint *ourNonSharedPoint = [triangle pointNotInEdge:sharedEdge]; 299 | DelaunayPoint *theirNonSharedPoint = [neighborTriangle pointNotInEdge:sharedEdge]; 300 | if (sqrtf(powf(theirNonSharedPoint.x - circumcenter.x, 2) + powf(theirNonSharedPoint.y - circumcenter.y, 2)) < radius ) 301 | { 302 | // If the non-shared point is within the circumcircle of this triangle, flip to share the other two points 303 | [trianglesToRemove addObject:triangle]; 304 | [trianglesToRemove addObject:neighborTriangle]; 305 | [edgesToRemove addObject:sharedEdge]; 306 | 307 | // Get the edges before & after the shared edge in the triangle 308 | DelaunayEdge *beforeEdge = [triangle edgeStartingWithPoint:ourNonSharedPoint]; 309 | DelaunayEdge *afterEdge = [triangle edgeEndingWithPoint:ourNonSharedPoint]; 310 | 311 | DelaunayEdge *newEdge = [DelaunayEdge edgeWithPoints:@[theirNonSharedPoint, ourNonSharedPoint]]; 312 | [self.edges addObject:newEdge]; 313 | 314 | // Get the edges before & after the shared edge in the neighbor triangle 315 | DelaunayEdge *neighborBeforeEdge = [neighborTriangle edgeStartingWithPoint:theirNonSharedPoint]; 316 | DelaunayEdge *neighborAfterEdge = [neighborTriangle edgeEndingWithPoint:theirNonSharedPoint]; 317 | 318 | DelaunayTriangle *newTriangle1 = [DelaunayTriangle triangleWithEdges:@[newEdge, beforeEdge, neighborAfterEdge] 319 | andStartPoint:theirNonSharedPoint 320 | andColor:triangle.color]; 321 | 322 | DelaunayTriangle *newTriangle2 = [DelaunayTriangle triangleWithEdges:@[neighborBeforeEdge, afterEdge, newEdge] 323 | andStartPoint:theirNonSharedPoint 324 | andColor:neighborTriangle.color]; 325 | 326 | [trianglesToAdd addObject:newTriangle1]; 327 | [trianglesToAdd addObject:newTriangle2]; 328 | // [self removeEdge:sharedEdge]; 329 | hadToFlip = YES; 330 | break; 331 | } 332 | } 333 | } 334 | if (hadToFlip) 335 | { 336 | break; 337 | } 338 | } 339 | 340 | for (DelaunayTriangle* triangleToRemove in trianglesToRemove) 341 | { 342 | [self removeTriangle:triangleToRemove]; 343 | } 344 | for (DelaunayEdge *edgeToRemove in edgesToRemove) 345 | { 346 | [self removeEdge:edgeToRemove]; 347 | } 348 | for (DelaunayTriangle* triangleToAdd in trianglesToAdd) 349 | { 350 | [self.triangles addObject:triangleToAdd]; 351 | } 352 | } while (hadToFlip); 353 | } 354 | 355 | - (NSDictionary*)voronoiCells 356 | { 357 | NSMutableDictionary *cells = [NSMutableDictionary dictionary]; 358 | for (DelaunayPoint *point in self.points) 359 | { 360 | // Don't add voronoi cells at the frame triangle points 361 | if ([self.frameTrianglePoints containsObject:point]) 362 | continue; 363 | 364 | NSArray *pointEdges = [point counterClockwiseEdges]; 365 | NSMutableArray *nodes = [NSMutableArray arrayWithCapacity:[pointEdges count]]; 366 | DelaunayEdge *prevEdge = [pointEdges lastObject]; 367 | for (DelaunayEdge *edge in pointEdges) 368 | { 369 | DelaunayTriangle *sharedTriangle = [edge sharedTriangleWithEdge:prevEdge]; 370 | [nodes addObject:[NSValue valueWithCGPoint:[sharedTriangle circumcenter]]]; 371 | prevEdge = edge; 372 | } 373 | //[cells addObject:[VoronoiCell voronoiCellAtSite:point withNodes:nodes]]; 374 | [cells setObject:[VoronoiCell voronoiCellAtSite:point withNodes:nodes] forKey:point.idNumber]; 375 | } 376 | return cells; 377 | } 378 | 379 | - (void)interpolateWeightsWithPoint:(DelaunayPoint *)point 380 | { 381 | DelaunayTriangulation *testTriangulation = [self copy];//[[self copy] autorelease]; 382 | BOOL added = [testTriangulation addPoint:point withColor:nil]; 383 | // TODO(mrotondo): Special-case touches right on top of existing points here. 384 | if (added) 385 | { 386 | NSDictionary *voronoiCells = [self voronoiCells]; 387 | // TODO(mrotondo): Interpolate by adding and removing a point instead of copying the whole triangulation 388 | NSDictionary *testVoronoiCells = [testTriangulation voronoiCells]; 389 | float fractionSum = 0.0; 390 | NSMutableDictionary *fractions = [NSMutableDictionary dictionaryWithCapacity:[voronoiCells count]]; 391 | for ( NSNumber *pointIDNumber in [voronoiCells keyEnumerator] ) 392 | { 393 | VoronoiCell *cell = [voronoiCells objectForKey:pointIDNumber]; 394 | VoronoiCell *testCell = [testVoronoiCells objectForKey:pointIDNumber]; 395 | float fractionalChange = 0.0; 396 | if ( [cell area] > 0.0 ) 397 | fractionalChange = 1.0 - MAX(MIN([testCell area] / [cell area], 1.0), 0.0); 398 | fractionSum += fractionalChange; 399 | [fractions setObject:[NSNumber numberWithFloat:fractionalChange] forKey:pointIDNumber]; 400 | } 401 | if (fractionSum > 0.0) 402 | { 403 | for ( NSNumber *pointIDNumber in [voronoiCells keyEnumerator] ) 404 | { 405 | VoronoiCell *cell = [voronoiCells objectForKey:pointIDNumber]; 406 | NSNumber *fractionalChange = [fractions objectForKey:pointIDNumber]; 407 | cell.site.contribution = [fractionalChange floatValue] / fractionSum; 408 | } 409 | } 410 | } 411 | } 412 | 413 | @end 414 | -------------------------------------------------------------------------------- /Edgy.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | D508BB7E17714D5600D36144 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D5E1767813D367E0009A2894 /* Foundation.framework */; }; 11 | D508BB7F17714D5600D36144 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D5E1767A13D367E0009A2894 /* CoreGraphics.framework */; }; 12 | D508BB8017714D5600D36144 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D5E1767613D367E0009A2894 /* UIKit.framework */; }; 13 | D508BB8617714D5600D36144 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = D508BB8417714D5600D36144 /* InfoPlist.strings */; }; 14 | D508BB8817714D5600D36144 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = D508BB8717714D5600D36144 /* main.m */; }; 15 | D508BB8C17714D5600D36144 /* EDAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D508BB8B17714D5600D36144 /* EDAppDelegate.m */; }; 16 | D508BB8F17714D5600D36144 /* Main_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D508BB8D17714D5600D36144 /* Main_iPhone.storyboard */; }; 17 | D508BB9217714D5600D36144 /* Main_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D508BB9017714D5600D36144 /* Main_iPad.storyboard */; }; 18 | D508BB9517714D5600D36144 /* EDViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D508BB9417714D5600D36144 /* EDViewController.m */; }; 19 | D508BB9717714D5600D36144 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D508BB9617714D5600D36144 /* Images.xcassets */; }; 20 | D508BB9E17714D5600D36144 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D508BB9D17714D5600D36144 /* XCTest.framework */; }; 21 | D508BB9F17714D5600D36144 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D5E1767813D367E0009A2894 /* Foundation.framework */; }; 22 | D508BBA017714D5600D36144 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D5E1767613D367E0009A2894 /* UIKit.framework */; }; 23 | D508BBA817714D5600D36144 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = D508BBA617714D5600D36144 /* InfoPlist.strings */; }; 24 | D508BBAA17714D5600D36144 /* Edgy_DemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D508BBA917714D5600D36144 /* Edgy_DemoTests.m */; }; 25 | D508BBB117714E1600D36144 /* libEdgy iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D5A55A1013EE19130001ADF7 /* libEdgy iOS.a */; }; 26 | D508BBB417714FD100D36144 /* EDDiagnosticView.m in Sources */ = {isa = PBXBuildFile; fileRef = D508BBB317714FD100D36144 /* EDDiagnosticView.m */; }; 27 | D590C4461527BBC6007248F7 /* DelaunayEdge.h in Headers */ = {isa = PBXBuildFile; fileRef = D590C43C1527BBC6007248F7 /* DelaunayEdge.h */; }; 28 | D590C4471527BBC6007248F7 /* DelaunayEdge.m in Sources */ = {isa = PBXBuildFile; fileRef = D590C43D1527BBC6007248F7 /* DelaunayEdge.m */; }; 29 | D590C4481527BBC6007248F7 /* DelaunayPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = D590C43E1527BBC6007248F7 /* DelaunayPoint.h */; }; 30 | D590C4491527BBC6007248F7 /* DelaunayPoint.m in Sources */ = {isa = PBXBuildFile; fileRef = D590C43F1527BBC6007248F7 /* DelaunayPoint.m */; }; 31 | D590C44A1527BBC6007248F7 /* DelaunayTriangle.h in Headers */ = {isa = PBXBuildFile; fileRef = D590C4401527BBC6007248F7 /* DelaunayTriangle.h */; }; 32 | D590C44B1527BBC6007248F7 /* DelaunayTriangle.m in Sources */ = {isa = PBXBuildFile; fileRef = D590C4411527BBC6007248F7 /* DelaunayTriangle.m */; }; 33 | D590C44C1527BBC6007248F7 /* DelaunayTriangulation.h in Headers */ = {isa = PBXBuildFile; fileRef = D590C4421527BBC6007248F7 /* DelaunayTriangulation.h */; }; 34 | D590C44D1527BBC6007248F7 /* DelaunayTriangulation.m in Sources */ = {isa = PBXBuildFile; fileRef = D590C4431527BBC6007248F7 /* DelaunayTriangulation.m */; }; 35 | D590C44E1527BBC6007248F7 /* VoronoiCell.h in Headers */ = {isa = PBXBuildFile; fileRef = D590C4441527BBC6007248F7 /* VoronoiCell.h */; }; 36 | D590C44F1527BBC6007248F7 /* VoronoiCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D590C4451527BBC6007248F7 /* VoronoiCell.m */; }; 37 | D590C4501527BC06007248F7 /* libEdgy iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D5A55A1013EE19130001ADF7 /* libEdgy iOS.a */; }; 38 | D5A55A1113EE19130001ADF7 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D5E1767813D367E0009A2894 /* Foundation.framework */; }; 39 | D5E1767713D367E0009A2894 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D5E1767613D367E0009A2894 /* UIKit.framework */; }; 40 | D5E1767913D367E0009A2894 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D5E1767813D367E0009A2894 /* Foundation.framework */; }; 41 | D5E1767B13D367E0009A2894 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D5E1767A13D367E0009A2894 /* CoreGraphics.framework */; }; 42 | D5E1768113D367E0009A2894 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = D5E1767F13D367E0009A2894 /* InfoPlist.strings */; }; 43 | D5E1768413D367E0009A2894 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = D5E1768313D367E0009A2894 /* main.m */; }; 44 | D5E1768713D367E0009A2894 /* DelaunayTestAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D5E1768613D367E0009A2894 /* DelaunayTestAppDelegate.m */; }; 45 | D5E1768A13D367E0009A2894 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = D5E1768813D367E0009A2894 /* MainWindow.xib */; }; 46 | D5E1768D13D367E0009A2894 /* DelaunayTestViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D5E1768C13D367E0009A2894 /* DelaunayTestViewController.m */; }; 47 | D5E1769013D367E0009A2894 /* DelaunayTestViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = D5E1768E13D367E0009A2894 /* DelaunayTestViewController.xib */; }; 48 | D5E1769813D36805009A2894 /* DelaunayView.m in Sources */ = {isa = PBXBuildFile; fileRef = D5E1769713D36805009A2894 /* DelaunayView.m */; }; 49 | D5E176A313D4DFE9009A2894 /* todo in Resources */ = {isa = PBXBuildFile; fileRef = D5E176A213D4DFE9009A2894 /* todo */; }; 50 | D5E8109B13EE267300C137FF /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D5E1767613D367E0009A2894 /* UIKit.framework */; }; 51 | D5E8109C13EE267300C137FF /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D5E1767A13D367E0009A2894 /* CoreGraphics.framework */; }; 52 | /* End PBXBuildFile section */ 53 | 54 | /* Begin PBXContainerItemProxy section */ 55 | D508BBA117714D5600D36144 /* PBXContainerItemProxy */ = { 56 | isa = PBXContainerItemProxy; 57 | containerPortal = D5E1766913D367E0009A2894 /* Project object */; 58 | proxyType = 1; 59 | remoteGlobalIDString = D508BB7C17714D5500D36144; 60 | remoteInfo = "Edgy Demo"; 61 | }; 62 | D590C43A1527BB04007248F7 /* PBXContainerItemProxy */ = { 63 | isa = PBXContainerItemProxy; 64 | containerPortal = D5E1766913D367E0009A2894 /* Project object */; 65 | proxyType = 1; 66 | remoteGlobalIDString = D5A55A0F13EE19130001ADF7; 67 | remoteInfo = Edgy; 68 | }; 69 | /* End PBXContainerItemProxy section */ 70 | 71 | /* Begin PBXFileReference section */ 72 | D508BB7D17714D5500D36144 /* Edgy Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Edgy Demo.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 73 | D508BB8317714D5600D36144 /* Edgy Demo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Edgy Demo-Info.plist"; sourceTree = ""; }; 74 | D508BB8517714D5600D36144 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 75 | D508BB8717714D5600D36144 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 76 | D508BB8917714D5600D36144 /* Edgy Demo-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Edgy Demo-Prefix.pch"; sourceTree = ""; }; 77 | D508BB8A17714D5600D36144 /* EDAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EDAppDelegate.h; sourceTree = ""; }; 78 | D508BB8B17714D5600D36144 /* EDAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EDAppDelegate.m; sourceTree = ""; }; 79 | D508BB8E17714D5600D36144 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_iPhone.storyboard; sourceTree = ""; }; 80 | D508BB9117714D5600D36144 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_iPad.storyboard; sourceTree = ""; }; 81 | D508BB9317714D5600D36144 /* EDViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EDViewController.h; sourceTree = ""; }; 82 | D508BB9417714D5600D36144 /* EDViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EDViewController.m; sourceTree = ""; }; 83 | D508BB9617714D5600D36144 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 84 | D508BB9C17714D5600D36144 /* Edgy DemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Edgy DemoTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 85 | D508BB9D17714D5600D36144 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 86 | D508BBA517714D5600D36144 /* Edgy DemoTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Edgy DemoTests-Info.plist"; sourceTree = ""; }; 87 | D508BBA717714D5600D36144 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 88 | D508BBA917714D5600D36144 /* Edgy_DemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Edgy_DemoTests.m; sourceTree = ""; }; 89 | D508BBB217714FD100D36144 /* EDDiagnosticView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EDDiagnosticView.h; sourceTree = ""; }; 90 | D508BBB317714FD100D36144 /* EDDiagnosticView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EDDiagnosticView.m; sourceTree = ""; }; 91 | D590C43C1527BBC6007248F7 /* DelaunayEdge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DelaunayEdge.h; sourceTree = ""; }; 92 | D590C43D1527BBC6007248F7 /* DelaunayEdge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DelaunayEdge.m; sourceTree = ""; }; 93 | D590C43E1527BBC6007248F7 /* DelaunayPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DelaunayPoint.h; sourceTree = ""; }; 94 | D590C43F1527BBC6007248F7 /* DelaunayPoint.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DelaunayPoint.m; sourceTree = ""; }; 95 | D590C4401527BBC6007248F7 /* DelaunayTriangle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DelaunayTriangle.h; sourceTree = ""; }; 96 | D590C4411527BBC6007248F7 /* DelaunayTriangle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DelaunayTriangle.m; sourceTree = ""; }; 97 | D590C4421527BBC6007248F7 /* DelaunayTriangulation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DelaunayTriangulation.h; sourceTree = ""; }; 98 | D590C4431527BBC6007248F7 /* DelaunayTriangulation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DelaunayTriangulation.m; sourceTree = ""; }; 99 | D590C4441527BBC6007248F7 /* VoronoiCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VoronoiCell.h; sourceTree = ""; }; 100 | D590C4451527BBC6007248F7 /* VoronoiCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VoronoiCell.m; sourceTree = ""; }; 101 | D5A55A1013EE19130001ADF7 /* libEdgy iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libEdgy iOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 102 | D5A55A1413EE19130001ADF7 /* Edgy-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Edgy-Prefix.pch"; sourceTree = ""; }; 103 | D5E1767213D367E0009A2894 /* DelaunayTest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DelaunayTest.app; sourceTree = BUILT_PRODUCTS_DIR; }; 104 | D5E1767613D367E0009A2894 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 105 | D5E1767813D367E0009A2894 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 106 | D5E1767A13D367E0009A2894 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 107 | D5E1767E13D367E0009A2894 /* DelaunayTest-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "DelaunayTest-Info.plist"; sourceTree = ""; }; 108 | D5E1768013D367E0009A2894 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 109 | D5E1768213D367E0009A2894 /* DelaunayTest-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "DelaunayTest-Prefix.pch"; sourceTree = ""; }; 110 | D5E1768313D367E0009A2894 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 111 | D5E1768513D367E0009A2894 /* DelaunayTestAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DelaunayTestAppDelegate.h; sourceTree = ""; }; 112 | D5E1768613D367E0009A2894 /* DelaunayTestAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DelaunayTestAppDelegate.m; sourceTree = ""; }; 113 | D5E1768913D367E0009A2894 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainWindow.xib; sourceTree = ""; }; 114 | D5E1768B13D367E0009A2894 /* DelaunayTestViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DelaunayTestViewController.h; sourceTree = ""; }; 115 | D5E1768C13D367E0009A2894 /* DelaunayTestViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DelaunayTestViewController.m; sourceTree = ""; }; 116 | D5E1768F13D367E0009A2894 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/DelaunayTestViewController.xib; sourceTree = ""; }; 117 | D5E1769613D36805009A2894 /* DelaunayView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DelaunayView.h; sourceTree = ""; }; 118 | D5E1769713D36805009A2894 /* DelaunayView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DelaunayView.m; sourceTree = ""; }; 119 | D5E176A213D4DFE9009A2894 /* todo */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = todo; sourceTree = ""; }; 120 | /* End PBXFileReference section */ 121 | 122 | /* Begin PBXFrameworksBuildPhase section */ 123 | D508BB7A17714D5500D36144 /* Frameworks */ = { 124 | isa = PBXFrameworksBuildPhase; 125 | buildActionMask = 2147483647; 126 | files = ( 127 | D508BBB117714E1600D36144 /* libEdgy iOS.a in Frameworks */, 128 | D508BB7F17714D5600D36144 /* CoreGraphics.framework in Frameworks */, 129 | D508BB8017714D5600D36144 /* UIKit.framework in Frameworks */, 130 | D508BB7E17714D5600D36144 /* Foundation.framework in Frameworks */, 131 | ); 132 | runOnlyForDeploymentPostprocessing = 0; 133 | }; 134 | D508BB9917714D5600D36144 /* Frameworks */ = { 135 | isa = PBXFrameworksBuildPhase; 136 | buildActionMask = 2147483647; 137 | files = ( 138 | D508BB9E17714D5600D36144 /* XCTest.framework in Frameworks */, 139 | D508BBA017714D5600D36144 /* UIKit.framework in Frameworks */, 140 | D508BB9F17714D5600D36144 /* Foundation.framework in Frameworks */, 141 | ); 142 | runOnlyForDeploymentPostprocessing = 0; 143 | }; 144 | D5A55A0D13EE19130001ADF7 /* Frameworks */ = { 145 | isa = PBXFrameworksBuildPhase; 146 | buildActionMask = 2147483647; 147 | files = ( 148 | D5A55A1113EE19130001ADF7 /* Foundation.framework in Frameworks */, 149 | D5E8109B13EE267300C137FF /* UIKit.framework in Frameworks */, 150 | D5E8109C13EE267300C137FF /* CoreGraphics.framework in Frameworks */, 151 | ); 152 | runOnlyForDeploymentPostprocessing = 0; 153 | }; 154 | D5E1766F13D367E0009A2894 /* Frameworks */ = { 155 | isa = PBXFrameworksBuildPhase; 156 | buildActionMask = 2147483647; 157 | files = ( 158 | D590C4501527BC06007248F7 /* libEdgy iOS.a in Frameworks */, 159 | D5E1767713D367E0009A2894 /* UIKit.framework in Frameworks */, 160 | D5E1767913D367E0009A2894 /* Foundation.framework in Frameworks */, 161 | D5E1767B13D367E0009A2894 /* CoreGraphics.framework in Frameworks */, 162 | ); 163 | runOnlyForDeploymentPostprocessing = 0; 164 | }; 165 | /* End PBXFrameworksBuildPhase section */ 166 | 167 | /* Begin PBXGroup section */ 168 | D508BB8117714D5600D36144 /* Edgy Demo */ = { 169 | isa = PBXGroup; 170 | children = ( 171 | D508BB8A17714D5600D36144 /* EDAppDelegate.h */, 172 | D508BB8B17714D5600D36144 /* EDAppDelegate.m */, 173 | D508BB8D17714D5600D36144 /* Main_iPhone.storyboard */, 174 | D508BB9017714D5600D36144 /* Main_iPad.storyboard */, 175 | D508BB9317714D5600D36144 /* EDViewController.h */, 176 | D508BB9417714D5600D36144 /* EDViewController.m */, 177 | D508BB9617714D5600D36144 /* Images.xcassets */, 178 | D508BB8217714D5600D36144 /* Supporting Files */, 179 | D508BBB217714FD100D36144 /* EDDiagnosticView.h */, 180 | D508BBB317714FD100D36144 /* EDDiagnosticView.m */, 181 | ); 182 | path = "Edgy Demo"; 183 | sourceTree = ""; 184 | }; 185 | D508BB8217714D5600D36144 /* Supporting Files */ = { 186 | isa = PBXGroup; 187 | children = ( 188 | D508BB8317714D5600D36144 /* Edgy Demo-Info.plist */, 189 | D508BB8417714D5600D36144 /* InfoPlist.strings */, 190 | D508BB8717714D5600D36144 /* main.m */, 191 | D508BB8917714D5600D36144 /* Edgy Demo-Prefix.pch */, 192 | ); 193 | name = "Supporting Files"; 194 | sourceTree = ""; 195 | }; 196 | D508BBA317714D5600D36144 /* Edgy DemoTests */ = { 197 | isa = PBXGroup; 198 | children = ( 199 | D508BBA917714D5600D36144 /* Edgy_DemoTests.m */, 200 | D508BBA417714D5600D36144 /* Supporting Files */, 201 | ); 202 | path = "Edgy DemoTests"; 203 | sourceTree = ""; 204 | }; 205 | D508BBA417714D5600D36144 /* Supporting Files */ = { 206 | isa = PBXGroup; 207 | children = ( 208 | D508BBA517714D5600D36144 /* Edgy DemoTests-Info.plist */, 209 | D508BBA617714D5600D36144 /* InfoPlist.strings */, 210 | ); 211 | name = "Supporting Files"; 212 | sourceTree = ""; 213 | }; 214 | D5A55A1213EE19130001ADF7 /* Edgy */ = { 215 | isa = PBXGroup; 216 | children = ( 217 | D590C43C1527BBC6007248F7 /* DelaunayEdge.h */, 218 | D590C43D1527BBC6007248F7 /* DelaunayEdge.m */, 219 | D590C43E1527BBC6007248F7 /* DelaunayPoint.h */, 220 | D590C43F1527BBC6007248F7 /* DelaunayPoint.m */, 221 | D590C4401527BBC6007248F7 /* DelaunayTriangle.h */, 222 | D590C4411527BBC6007248F7 /* DelaunayTriangle.m */, 223 | D590C4421527BBC6007248F7 /* DelaunayTriangulation.h */, 224 | D590C4431527BBC6007248F7 /* DelaunayTriangulation.m */, 225 | D590C4441527BBC6007248F7 /* VoronoiCell.h */, 226 | D590C4451527BBC6007248F7 /* VoronoiCell.m */, 227 | D5A55A1313EE19130001ADF7 /* Supporting Files */, 228 | ); 229 | path = Edgy; 230 | sourceTree = ""; 231 | }; 232 | D5A55A1313EE19130001ADF7 /* Supporting Files */ = { 233 | isa = PBXGroup; 234 | children = ( 235 | D5A55A1413EE19130001ADF7 /* Edgy-Prefix.pch */, 236 | ); 237 | name = "Supporting Files"; 238 | sourceTree = ""; 239 | }; 240 | D5E1766713D367E0009A2894 = { 241 | isa = PBXGroup; 242 | children = ( 243 | D508BB8117714D5600D36144 /* Edgy Demo */, 244 | D5E1767C13D367E0009A2894 /* DelaunayTest */, 245 | D5A55A1213EE19130001ADF7 /* Edgy */, 246 | D508BBA317714D5600D36144 /* Edgy DemoTests */, 247 | D5E1767513D367E0009A2894 /* Frameworks */, 248 | D5E1767313D367E0009A2894 /* Products */, 249 | ); 250 | sourceTree = ""; 251 | }; 252 | D5E1767313D367E0009A2894 /* Products */ = { 253 | isa = PBXGroup; 254 | children = ( 255 | D5E1767213D367E0009A2894 /* DelaunayTest.app */, 256 | D5A55A1013EE19130001ADF7 /* libEdgy iOS.a */, 257 | D508BB7D17714D5500D36144 /* Edgy Demo.app */, 258 | D508BB9C17714D5600D36144 /* Edgy DemoTests.xctest */, 259 | ); 260 | name = Products; 261 | sourceTree = ""; 262 | }; 263 | D5E1767513D367E0009A2894 /* Frameworks */ = { 264 | isa = PBXGroup; 265 | children = ( 266 | D5E1767613D367E0009A2894 /* UIKit.framework */, 267 | D5E1767813D367E0009A2894 /* Foundation.framework */, 268 | D5E1767A13D367E0009A2894 /* CoreGraphics.framework */, 269 | D508BB9D17714D5600D36144 /* XCTest.framework */, 270 | ); 271 | name = Frameworks; 272 | sourceTree = ""; 273 | }; 274 | D5E1767C13D367E0009A2894 /* DelaunayTest */ = { 275 | isa = PBXGroup; 276 | children = ( 277 | D5E1768513D367E0009A2894 /* DelaunayTestAppDelegate.h */, 278 | D5E1768613D367E0009A2894 /* DelaunayTestAppDelegate.m */, 279 | D5E1768813D367E0009A2894 /* MainWindow.xib */, 280 | D5E1768B13D367E0009A2894 /* DelaunayTestViewController.h */, 281 | D5E1768C13D367E0009A2894 /* DelaunayTestViewController.m */, 282 | D5E1768E13D367E0009A2894 /* DelaunayTestViewController.xib */, 283 | D5E1769613D36805009A2894 /* DelaunayView.h */, 284 | D5E1769713D36805009A2894 /* DelaunayView.m */, 285 | D5E1767D13D367E0009A2894 /* Supporting Files */, 286 | D5E176A213D4DFE9009A2894 /* todo */, 287 | ); 288 | path = DelaunayTest; 289 | sourceTree = ""; 290 | }; 291 | D5E1767D13D367E0009A2894 /* Supporting Files */ = { 292 | isa = PBXGroup; 293 | children = ( 294 | D5E1767E13D367E0009A2894 /* DelaunayTest-Info.plist */, 295 | D5E1767F13D367E0009A2894 /* InfoPlist.strings */, 296 | D5E1768213D367E0009A2894 /* DelaunayTest-Prefix.pch */, 297 | D5E1768313D367E0009A2894 /* main.m */, 298 | ); 299 | name = "Supporting Files"; 300 | sourceTree = ""; 301 | }; 302 | /* End PBXGroup section */ 303 | 304 | /* Begin PBXHeadersBuildPhase section */ 305 | D5A55A0E13EE19130001ADF7 /* Headers */ = { 306 | isa = PBXHeadersBuildPhase; 307 | buildActionMask = 2147483647; 308 | files = ( 309 | D590C4461527BBC6007248F7 /* DelaunayEdge.h in Headers */, 310 | D590C4481527BBC6007248F7 /* DelaunayPoint.h in Headers */, 311 | D590C44A1527BBC6007248F7 /* DelaunayTriangle.h in Headers */, 312 | D590C44C1527BBC6007248F7 /* DelaunayTriangulation.h in Headers */, 313 | D590C44E1527BBC6007248F7 /* VoronoiCell.h in Headers */, 314 | ); 315 | runOnlyForDeploymentPostprocessing = 0; 316 | }; 317 | /* End PBXHeadersBuildPhase section */ 318 | 319 | /* Begin PBXNativeTarget section */ 320 | D508BB7C17714D5500D36144 /* Edgy Demo */ = { 321 | isa = PBXNativeTarget; 322 | buildConfigurationList = D508BBAF17714D5600D36144 /* Build configuration list for PBXNativeTarget "Edgy Demo" */; 323 | buildPhases = ( 324 | D508BB7917714D5500D36144 /* Sources */, 325 | D508BB7A17714D5500D36144 /* Frameworks */, 326 | D508BB7B17714D5500D36144 /* Resources */, 327 | ); 328 | buildRules = ( 329 | ); 330 | dependencies = ( 331 | ); 332 | name = "Edgy Demo"; 333 | productName = "Edgy Demo"; 334 | productReference = D508BB7D17714D5500D36144 /* Edgy Demo.app */; 335 | productType = "com.apple.product-type.application"; 336 | }; 337 | D508BB9B17714D5600D36144 /* Edgy DemoTests */ = { 338 | isa = PBXNativeTarget; 339 | buildConfigurationList = D508BBB017714D5600D36144 /* Build configuration list for PBXNativeTarget "Edgy DemoTests" */; 340 | buildPhases = ( 341 | D508BB9817714D5600D36144 /* Sources */, 342 | D508BB9917714D5600D36144 /* Frameworks */, 343 | D508BB9A17714D5600D36144 /* Resources */, 344 | ); 345 | buildRules = ( 346 | ); 347 | dependencies = ( 348 | D508BBA217714D5600D36144 /* PBXTargetDependency */, 349 | ); 350 | name = "Edgy DemoTests"; 351 | productName = "Edgy DemoTests"; 352 | productReference = D508BB9C17714D5600D36144 /* Edgy DemoTests.xctest */; 353 | productType = "com.apple.product-type.bundle.unit-test"; 354 | }; 355 | D5A55A0F13EE19130001ADF7 /* Edgy iOS */ = { 356 | isa = PBXNativeTarget; 357 | buildConfigurationList = D5A55A1713EE19130001ADF7 /* Build configuration list for PBXNativeTarget "Edgy iOS" */; 358 | buildPhases = ( 359 | D5A55A0C13EE19130001ADF7 /* Sources */, 360 | D5A55A0D13EE19130001ADF7 /* Frameworks */, 361 | D5A55A0E13EE19130001ADF7 /* Headers */, 362 | ); 363 | buildRules = ( 364 | ); 365 | dependencies = ( 366 | ); 367 | name = "Edgy iOS"; 368 | productName = Edgy; 369 | productReference = D5A55A1013EE19130001ADF7 /* libEdgy iOS.a */; 370 | productType = "com.apple.product-type.library.static"; 371 | }; 372 | D5E1767113D367E0009A2894 /* DelaunayTest */ = { 373 | isa = PBXNativeTarget; 374 | buildConfigurationList = D5E1769313D367E0009A2894 /* Build configuration list for PBXNativeTarget "DelaunayTest" */; 375 | buildPhases = ( 376 | D5E1766E13D367E0009A2894 /* Sources */, 377 | D5E1766F13D367E0009A2894 /* Frameworks */, 378 | D5E1767013D367E0009A2894 /* Resources */, 379 | ); 380 | buildRules = ( 381 | ); 382 | dependencies = ( 383 | D590C43B1527BB04007248F7 /* PBXTargetDependency */, 384 | ); 385 | name = DelaunayTest; 386 | productName = DelaunayTest; 387 | productReference = D5E1767213D367E0009A2894 /* DelaunayTest.app */; 388 | productType = "com.apple.product-type.application"; 389 | }; 390 | /* End PBXNativeTarget section */ 391 | 392 | /* Begin PBXProject section */ 393 | D5E1766913D367E0009A2894 /* Project object */ = { 394 | isa = PBXProject; 395 | attributes = { 396 | LastUpgradeCheck = 0430; 397 | ORGANIZATIONNAME = Stanford; 398 | TargetAttributes = { 399 | D508BB9B17714D5600D36144 = { 400 | TestTargetID = D5E1767113D367E0009A2894; 401 | }; 402 | }; 403 | }; 404 | buildConfigurationList = D5E1766C13D367E0009A2894 /* Build configuration list for PBXProject "Edgy" */; 405 | compatibilityVersion = "Xcode 3.2"; 406 | developmentRegion = English; 407 | hasScannedForEncodings = 0; 408 | knownRegions = ( 409 | en, 410 | Base, 411 | ); 412 | mainGroup = D5E1766713D367E0009A2894; 413 | productRefGroup = D5E1767313D367E0009A2894 /* Products */; 414 | projectDirPath = ""; 415 | projectRoot = ""; 416 | targets = ( 417 | D5E1767113D367E0009A2894 /* DelaunayTest */, 418 | D508BB7C17714D5500D36144 /* Edgy Demo */, 419 | D5A55A0F13EE19130001ADF7 /* Edgy iOS */, 420 | D508BB9B17714D5600D36144 /* Edgy DemoTests */, 421 | ); 422 | }; 423 | /* End PBXProject section */ 424 | 425 | /* Begin PBXResourcesBuildPhase section */ 426 | D508BB7B17714D5500D36144 /* Resources */ = { 427 | isa = PBXResourcesBuildPhase; 428 | buildActionMask = 2147483647; 429 | files = ( 430 | D508BB9217714D5600D36144 /* Main_iPad.storyboard in Resources */, 431 | D508BB9717714D5600D36144 /* Images.xcassets in Resources */, 432 | D508BB8F17714D5600D36144 /* Main_iPhone.storyboard in Resources */, 433 | D508BB8617714D5600D36144 /* InfoPlist.strings in Resources */, 434 | ); 435 | runOnlyForDeploymentPostprocessing = 0; 436 | }; 437 | D508BB9A17714D5600D36144 /* Resources */ = { 438 | isa = PBXResourcesBuildPhase; 439 | buildActionMask = 2147483647; 440 | files = ( 441 | D508BBA817714D5600D36144 /* InfoPlist.strings in Resources */, 442 | ); 443 | runOnlyForDeploymentPostprocessing = 0; 444 | }; 445 | D5E1767013D367E0009A2894 /* Resources */ = { 446 | isa = PBXResourcesBuildPhase; 447 | buildActionMask = 2147483647; 448 | files = ( 449 | D5E1768113D367E0009A2894 /* InfoPlist.strings in Resources */, 450 | D5E1768A13D367E0009A2894 /* MainWindow.xib in Resources */, 451 | D5E1769013D367E0009A2894 /* DelaunayTestViewController.xib in Resources */, 452 | D5E176A313D4DFE9009A2894 /* todo in Resources */, 453 | ); 454 | runOnlyForDeploymentPostprocessing = 0; 455 | }; 456 | /* End PBXResourcesBuildPhase section */ 457 | 458 | /* Begin PBXSourcesBuildPhase section */ 459 | D508BB7917714D5500D36144 /* Sources */ = { 460 | isa = PBXSourcesBuildPhase; 461 | buildActionMask = 2147483647; 462 | files = ( 463 | D508BB9517714D5600D36144 /* EDViewController.m in Sources */, 464 | D508BB8817714D5600D36144 /* main.m in Sources */, 465 | D508BBB417714FD100D36144 /* EDDiagnosticView.m in Sources */, 466 | D508BB8C17714D5600D36144 /* EDAppDelegate.m in Sources */, 467 | ); 468 | runOnlyForDeploymentPostprocessing = 0; 469 | }; 470 | D508BB9817714D5600D36144 /* Sources */ = { 471 | isa = PBXSourcesBuildPhase; 472 | buildActionMask = 2147483647; 473 | files = ( 474 | D508BBAA17714D5600D36144 /* Edgy_DemoTests.m in Sources */, 475 | ); 476 | runOnlyForDeploymentPostprocessing = 0; 477 | }; 478 | D5A55A0C13EE19130001ADF7 /* Sources */ = { 479 | isa = PBXSourcesBuildPhase; 480 | buildActionMask = 2147483647; 481 | files = ( 482 | D590C4471527BBC6007248F7 /* DelaunayEdge.m in Sources */, 483 | D590C4491527BBC6007248F7 /* DelaunayPoint.m in Sources */, 484 | D590C44B1527BBC6007248F7 /* DelaunayTriangle.m in Sources */, 485 | D590C44D1527BBC6007248F7 /* DelaunayTriangulation.m in Sources */, 486 | D590C44F1527BBC6007248F7 /* VoronoiCell.m in Sources */, 487 | ); 488 | runOnlyForDeploymentPostprocessing = 0; 489 | }; 490 | D5E1766E13D367E0009A2894 /* Sources */ = { 491 | isa = PBXSourcesBuildPhase; 492 | buildActionMask = 2147483647; 493 | files = ( 494 | D5E1768413D367E0009A2894 /* main.m in Sources */, 495 | D5E1768713D367E0009A2894 /* DelaunayTestAppDelegate.m in Sources */, 496 | D5E1768D13D367E0009A2894 /* DelaunayTestViewController.m in Sources */, 497 | D5E1769813D36805009A2894 /* DelaunayView.m in Sources */, 498 | ); 499 | runOnlyForDeploymentPostprocessing = 0; 500 | }; 501 | /* End PBXSourcesBuildPhase section */ 502 | 503 | /* Begin PBXTargetDependency section */ 504 | D508BBA217714D5600D36144 /* PBXTargetDependency */ = { 505 | isa = PBXTargetDependency; 506 | target = D508BB7C17714D5500D36144 /* Edgy Demo */; 507 | targetProxy = D508BBA117714D5600D36144 /* PBXContainerItemProxy */; 508 | }; 509 | D590C43B1527BB04007248F7 /* PBXTargetDependency */ = { 510 | isa = PBXTargetDependency; 511 | target = D5A55A0F13EE19130001ADF7 /* Edgy iOS */; 512 | targetProxy = D590C43A1527BB04007248F7 /* PBXContainerItemProxy */; 513 | }; 514 | /* End PBXTargetDependency section */ 515 | 516 | /* Begin PBXVariantGroup section */ 517 | D508BB8417714D5600D36144 /* InfoPlist.strings */ = { 518 | isa = PBXVariantGroup; 519 | children = ( 520 | D508BB8517714D5600D36144 /* en */, 521 | ); 522 | name = InfoPlist.strings; 523 | sourceTree = ""; 524 | }; 525 | D508BB8D17714D5600D36144 /* Main_iPhone.storyboard */ = { 526 | isa = PBXVariantGroup; 527 | children = ( 528 | D508BB8E17714D5600D36144 /* Base */, 529 | ); 530 | name = Main_iPhone.storyboard; 531 | sourceTree = ""; 532 | }; 533 | D508BB9017714D5600D36144 /* Main_iPad.storyboard */ = { 534 | isa = PBXVariantGroup; 535 | children = ( 536 | D508BB9117714D5600D36144 /* Base */, 537 | ); 538 | name = Main_iPad.storyboard; 539 | sourceTree = ""; 540 | }; 541 | D508BBA617714D5600D36144 /* InfoPlist.strings */ = { 542 | isa = PBXVariantGroup; 543 | children = ( 544 | D508BBA717714D5600D36144 /* en */, 545 | ); 546 | name = InfoPlist.strings; 547 | sourceTree = ""; 548 | }; 549 | D5E1767F13D367E0009A2894 /* InfoPlist.strings */ = { 550 | isa = PBXVariantGroup; 551 | children = ( 552 | D5E1768013D367E0009A2894 /* en */, 553 | ); 554 | name = InfoPlist.strings; 555 | sourceTree = ""; 556 | }; 557 | D5E1768813D367E0009A2894 /* MainWindow.xib */ = { 558 | isa = PBXVariantGroup; 559 | children = ( 560 | D5E1768913D367E0009A2894 /* en */, 561 | ); 562 | name = MainWindow.xib; 563 | sourceTree = ""; 564 | }; 565 | D5E1768E13D367E0009A2894 /* DelaunayTestViewController.xib */ = { 566 | isa = PBXVariantGroup; 567 | children = ( 568 | D5E1768F13D367E0009A2894 /* en */, 569 | ); 570 | name = DelaunayTestViewController.xib; 571 | sourceTree = ""; 572 | }; 573 | /* End PBXVariantGroup section */ 574 | 575 | /* Begin XCBuildConfiguration section */ 576 | D508BBAB17714D5600D36144 /* Debug */ = { 577 | isa = XCBuildConfiguration; 578 | buildSettings = { 579 | ALWAYS_SEARCH_USER_PATHS = NO; 580 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 581 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 582 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 583 | CLANG_CXX_LIBRARY = "libc++"; 584 | CLANG_ENABLE_MODULES = YES; 585 | CLANG_ENABLE_OBJC_ARC = YES; 586 | CLANG_WARN_BOOL_CONVERSION = YES; 587 | CLANG_WARN_CONSTANT_CONVERSION = YES; 588 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 589 | CLANG_WARN_EMPTY_BODY = YES; 590 | CLANG_WARN_ENUM_CONVERSION = YES; 591 | CLANG_WARN_INT_CONVERSION = YES; 592 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 593 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 594 | COPY_PHASE_STRIP = NO; 595 | GCC_DYNAMIC_NO_PIC = NO; 596 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 597 | GCC_PREFIX_HEADER = "Edgy Demo/Edgy Demo-Prefix.pch"; 598 | GCC_PREPROCESSOR_DEFINITIONS = ( 599 | "DEBUG=1", 600 | "$(inherited)", 601 | ); 602 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 603 | GCC_WARN_UNDECLARED_SELECTOR = YES; 604 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 605 | GCC_WARN_UNUSED_FUNCTION = YES; 606 | INFOPLIST_FILE = "Edgy Demo/Edgy Demo-Info.plist"; 607 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 608 | PRODUCT_NAME = "$(TARGET_NAME)"; 609 | WRAPPER_EXTENSION = app; 610 | }; 611 | name = Debug; 612 | }; 613 | D508BBAC17714D5600D36144 /* Release */ = { 614 | isa = XCBuildConfiguration; 615 | buildSettings = { 616 | ALWAYS_SEARCH_USER_PATHS = NO; 617 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 618 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 619 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 620 | CLANG_CXX_LIBRARY = "libc++"; 621 | CLANG_ENABLE_MODULES = YES; 622 | CLANG_ENABLE_OBJC_ARC = YES; 623 | CLANG_WARN_BOOL_CONVERSION = YES; 624 | CLANG_WARN_CONSTANT_CONVERSION = YES; 625 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 626 | CLANG_WARN_EMPTY_BODY = YES; 627 | CLANG_WARN_ENUM_CONVERSION = YES; 628 | CLANG_WARN_INT_CONVERSION = YES; 629 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 630 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 631 | COPY_PHASE_STRIP = YES; 632 | ENABLE_NS_ASSERTIONS = NO; 633 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 634 | GCC_PREFIX_HEADER = "Edgy Demo/Edgy Demo-Prefix.pch"; 635 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 636 | GCC_WARN_UNDECLARED_SELECTOR = YES; 637 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 638 | GCC_WARN_UNUSED_FUNCTION = YES; 639 | INFOPLIST_FILE = "Edgy Demo/Edgy Demo-Info.plist"; 640 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 641 | PRODUCT_NAME = "$(TARGET_NAME)"; 642 | VALIDATE_PRODUCT = YES; 643 | WRAPPER_EXTENSION = app; 644 | }; 645 | name = Release; 646 | }; 647 | D508BBAD17714D5600D36144 /* Debug */ = { 648 | isa = XCBuildConfiguration; 649 | buildSettings = { 650 | ALWAYS_SEARCH_USER_PATHS = NO; 651 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/DelaunayTest.app/DelaunayTest"; 652 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 653 | CLANG_CXX_LIBRARY = "libc++"; 654 | CLANG_ENABLE_MODULES = YES; 655 | CLANG_ENABLE_OBJC_ARC = YES; 656 | CLANG_WARN_BOOL_CONVERSION = YES; 657 | CLANG_WARN_CONSTANT_CONVERSION = YES; 658 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 659 | CLANG_WARN_EMPTY_BODY = YES; 660 | CLANG_WARN_ENUM_CONVERSION = YES; 661 | CLANG_WARN_INT_CONVERSION = YES; 662 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 663 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 664 | COPY_PHASE_STRIP = NO; 665 | FRAMEWORK_SEARCH_PATHS = ( 666 | "$(SDKROOT)/Developer/Library/Frameworks", 667 | "$(inherited)", 668 | "$(SYSTEM_APPS_DIR)/Xcode5-DP.app/Contents/Developer/Library/Frameworks", 669 | ); 670 | GCC_DYNAMIC_NO_PIC = NO; 671 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 672 | GCC_PREFIX_HEADER = "Edgy Demo/Edgy Demo-Prefix.pch"; 673 | GCC_PREPROCESSOR_DEFINITIONS = ( 674 | "DEBUG=1", 675 | "$(inherited)", 676 | ); 677 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 678 | GCC_WARN_UNDECLARED_SELECTOR = YES; 679 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 680 | GCC_WARN_UNUSED_FUNCTION = YES; 681 | INFOPLIST_FILE = "Edgy DemoTests/Edgy DemoTests-Info.plist"; 682 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 683 | ONLY_ACTIVE_ARCH = YES; 684 | PRODUCT_NAME = "$(TARGET_NAME)"; 685 | TEST_HOST = "$(BUNDLE_LOADER)"; 686 | WRAPPER_EXTENSION = xctest; 687 | }; 688 | name = Debug; 689 | }; 690 | D508BBAE17714D5600D36144 /* Release */ = { 691 | isa = XCBuildConfiguration; 692 | buildSettings = { 693 | ALWAYS_SEARCH_USER_PATHS = NO; 694 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/DelaunayTest.app/DelaunayTest"; 695 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 696 | CLANG_CXX_LIBRARY = "libc++"; 697 | CLANG_ENABLE_MODULES = YES; 698 | CLANG_ENABLE_OBJC_ARC = YES; 699 | CLANG_WARN_BOOL_CONVERSION = YES; 700 | CLANG_WARN_CONSTANT_CONVERSION = YES; 701 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 702 | CLANG_WARN_EMPTY_BODY = YES; 703 | CLANG_WARN_ENUM_CONVERSION = YES; 704 | CLANG_WARN_INT_CONVERSION = YES; 705 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 706 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 707 | COPY_PHASE_STRIP = YES; 708 | ENABLE_NS_ASSERTIONS = NO; 709 | FRAMEWORK_SEARCH_PATHS = ( 710 | "$(SDKROOT)/Developer/Library/Frameworks", 711 | "$(inherited)", 712 | "$(SYSTEM_APPS_DIR)/Xcode5-DP.app/Contents/Developer/Library/Frameworks", 713 | ); 714 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 715 | GCC_PREFIX_HEADER = "Edgy Demo/Edgy Demo-Prefix.pch"; 716 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 717 | GCC_WARN_UNDECLARED_SELECTOR = YES; 718 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 719 | GCC_WARN_UNUSED_FUNCTION = YES; 720 | INFOPLIST_FILE = "Edgy DemoTests/Edgy DemoTests-Info.plist"; 721 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 722 | PRODUCT_NAME = "$(TARGET_NAME)"; 723 | TEST_HOST = "$(BUNDLE_LOADER)"; 724 | VALIDATE_PRODUCT = YES; 725 | WRAPPER_EXTENSION = xctest; 726 | }; 727 | name = Release; 728 | }; 729 | D5A55A1513EE19130001ADF7 /* Debug */ = { 730 | isa = XCBuildConfiguration; 731 | buildSettings = { 732 | ALWAYS_SEARCH_USER_PATHS = NO; 733 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 734 | CLANG_ENABLE_OBJC_ARC = YES; 735 | DSTROOT = /tmp/Edgy.dst; 736 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 737 | GCC_PREFIX_HEADER = "Edgy/Edgy-Prefix.pch"; 738 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 739 | OTHER_LDFLAGS = "-ObjC"; 740 | PRODUCT_NAME = "$(TARGET_NAME)"; 741 | SDKROOT = iphoneos; 742 | }; 743 | name = Debug; 744 | }; 745 | D5A55A1613EE19130001ADF7 /* Release */ = { 746 | isa = XCBuildConfiguration; 747 | buildSettings = { 748 | ALWAYS_SEARCH_USER_PATHS = NO; 749 | ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; 750 | CLANG_ENABLE_OBJC_ARC = YES; 751 | DSTROOT = /tmp/Edgy.dst; 752 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 753 | GCC_PREFIX_HEADER = "Edgy/Edgy-Prefix.pch"; 754 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 755 | OTHER_LDFLAGS = "-ObjC"; 756 | PRODUCT_NAME = "$(TARGET_NAME)"; 757 | SDKROOT = iphoneos; 758 | }; 759 | name = Release; 760 | }; 761 | D5E1769113D367E0009A2894 /* Debug */ = { 762 | isa = XCBuildConfiguration; 763 | buildSettings = { 764 | ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; 765 | CLANG_ENABLE_OBJC_ARC = YES; 766 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 767 | GCC_C_LANGUAGE_STANDARD = gnu99; 768 | GCC_OPTIMIZATION_LEVEL = 0; 769 | GCC_PREPROCESSOR_DEFINITIONS = DEBUG; 770 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 771 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 772 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 773 | GCC_WARN_UNUSED_VARIABLE = YES; 774 | IPHONEOS_DEPLOYMENT_TARGET = 5.1; 775 | SDKROOT = iphoneos; 776 | TARGETED_DEVICE_FAMILY = "1,2"; 777 | }; 778 | name = Debug; 779 | }; 780 | D5E1769213D367E0009A2894 /* Release */ = { 781 | isa = XCBuildConfiguration; 782 | buildSettings = { 783 | ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; 784 | CLANG_ENABLE_OBJC_ARC = YES; 785 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 786 | GCC_C_LANGUAGE_STANDARD = gnu99; 787 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 788 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 789 | GCC_WARN_UNUSED_VARIABLE = YES; 790 | IPHONEOS_DEPLOYMENT_TARGET = 5.1; 791 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 792 | SDKROOT = iphoneos; 793 | TARGETED_DEVICE_FAMILY = "1,2"; 794 | }; 795 | name = Release; 796 | }; 797 | D5E1769413D367E0009A2894 /* Debug */ = { 798 | isa = XCBuildConfiguration; 799 | buildSettings = { 800 | ALWAYS_SEARCH_USER_PATHS = NO; 801 | COPY_PHASE_STRIP = NO; 802 | GCC_DYNAMIC_NO_PIC = NO; 803 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 804 | GCC_PREFIX_HEADER = "DelaunayTest/DelaunayTest-Prefix.pch"; 805 | HEADER_SEARCH_PATHS = Edgy/; 806 | INFOPLIST_FILE = "DelaunayTest/DelaunayTest-Info.plist"; 807 | PRODUCT_NAME = "$(TARGET_NAME)"; 808 | WRAPPER_EXTENSION = app; 809 | }; 810 | name = Debug; 811 | }; 812 | D5E1769513D367E0009A2894 /* Release */ = { 813 | isa = XCBuildConfiguration; 814 | buildSettings = { 815 | ALWAYS_SEARCH_USER_PATHS = NO; 816 | COPY_PHASE_STRIP = YES; 817 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 818 | GCC_PREFIX_HEADER = "DelaunayTest/DelaunayTest-Prefix.pch"; 819 | HEADER_SEARCH_PATHS = Edgy/; 820 | INFOPLIST_FILE = "DelaunayTest/DelaunayTest-Info.plist"; 821 | PRODUCT_NAME = "$(TARGET_NAME)"; 822 | VALIDATE_PRODUCT = YES; 823 | WRAPPER_EXTENSION = app; 824 | }; 825 | name = Release; 826 | }; 827 | /* End XCBuildConfiguration section */ 828 | 829 | /* Begin XCConfigurationList section */ 830 | D508BBAF17714D5600D36144 /* Build configuration list for PBXNativeTarget "Edgy Demo" */ = { 831 | isa = XCConfigurationList; 832 | buildConfigurations = ( 833 | D508BBAB17714D5600D36144 /* Debug */, 834 | D508BBAC17714D5600D36144 /* Release */, 835 | ); 836 | defaultConfigurationIsVisible = 0; 837 | defaultConfigurationName = Release; 838 | }; 839 | D508BBB017714D5600D36144 /* Build configuration list for PBXNativeTarget "Edgy DemoTests" */ = { 840 | isa = XCConfigurationList; 841 | buildConfigurations = ( 842 | D508BBAD17714D5600D36144 /* Debug */, 843 | D508BBAE17714D5600D36144 /* Release */, 844 | ); 845 | defaultConfigurationIsVisible = 0; 846 | defaultConfigurationName = Release; 847 | }; 848 | D5A55A1713EE19130001ADF7 /* Build configuration list for PBXNativeTarget "Edgy iOS" */ = { 849 | isa = XCConfigurationList; 850 | buildConfigurations = ( 851 | D5A55A1513EE19130001ADF7 /* Debug */, 852 | D5A55A1613EE19130001ADF7 /* Release */, 853 | ); 854 | defaultConfigurationIsVisible = 0; 855 | defaultConfigurationName = Release; 856 | }; 857 | D5E1766C13D367E0009A2894 /* Build configuration list for PBXProject "Edgy" */ = { 858 | isa = XCConfigurationList; 859 | buildConfigurations = ( 860 | D5E1769113D367E0009A2894 /* Debug */, 861 | D5E1769213D367E0009A2894 /* Release */, 862 | ); 863 | defaultConfigurationIsVisible = 0; 864 | defaultConfigurationName = Release; 865 | }; 866 | D5E1769313D367E0009A2894 /* Build configuration list for PBXNativeTarget "DelaunayTest" */ = { 867 | isa = XCConfigurationList; 868 | buildConfigurations = ( 869 | D5E1769413D367E0009A2894 /* Debug */, 870 | D5E1769513D367E0009A2894 /* Release */, 871 | ); 872 | defaultConfigurationIsVisible = 0; 873 | defaultConfigurationName = Release; 874 | }; 875 | /* End XCConfigurationList section */ 876 | }; 877 | rootObject = D5E1766913D367E0009A2894 /* Project object */; 878 | } 879 | --------------------------------------------------------------------------------