Skip to content

Commit

Permalink
First Github release
Browse files Browse the repository at this point in the history
  • Loading branch information
palle-k committed Feb 7, 2016
1 parent 27da291 commit 7b948d6
Show file tree
Hide file tree
Showing 27 changed files with 1,424 additions and 883 deletions.
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## Build generated
build/
DerivedData/

## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/

## Other
*.moved-aside
*.xccheckout
*.xcscmblueprint
165 changes: 19 additions & 146 deletions Mandelbrot2.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 18 additions & 1 deletion Mandelbrot2/AnimationSetupViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,24 @@
// Mandelbrot2
//
// Created by Palle Klewitz on 07.08.15.
// Copyright © 2015 Palle Klewitz. All rights reserved.
// Copyright © 2015 - 2016 Palle Klewitz.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is furnished
// to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
// IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//

@import Cocoa;
Expand Down
34 changes: 24 additions & 10 deletions Mandelbrot2/AnimationSetupViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,24 @@
// Mandelbrot2
//
// Created by Palle Klewitz on 07.08.15.
// Copyright © 2015 Palle Klewitz. All rights reserved.
// Copyright © 2015 - 2016 Palle Klewitz.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is furnished
// to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
// IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//

#import "AnimationSetupViewController.h"
Expand Down Expand Up @@ -46,7 +63,7 @@ - (void)viewDidLoad

- (IBAction)renderButtonClicked:(id)sender
{
/*NSSavePanel *savePanel = [[NSSavePanel alloc] init];
NSSavePanel *savePanel = [[NSSavePanel alloc] init];
savePanel.title = @"Save Animation";
savePanel.showsHiddenFiles = NO;
savePanel.canCreateDirectories = YES;
Expand All @@ -57,13 +74,12 @@ - (IBAction)renderButtonClicked:(id)sender
{
if (result == NSModalResponseOK)
{
_renderer = [[MandelbrotRenderer alloc] init];
_renderer.delegate = self;
_renderer.targetFile = [NSURL URLWithString:@"file:///Users/Palle/Desktop/mandelbrotanim.mov"];
[self startRendering];
}
}];*/
_renderer = [[MandelbrotRenderer alloc] init];
_renderer.delegate = self;
_renderer.targetFile = [NSURL URLWithString:@"file:///Users/Palle/Desktop/mandelbrotanim.mov"];
[self startRendering];
}];
}

- (void) startRendering
Expand All @@ -77,8 +93,6 @@ - (void) startRendering
NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
formatter.numberStyle = NSNumberFormatterDecimalStyle;

NSLog(@"startX: %f", [formatter numberFromString:_txtStartPositionX.stringValue].doubleValue);

_renderer.startX = [formatter numberFromString:_txtStartPositionX.stringValue].doubleValue;
_renderer.startY = [formatter numberFromString:_txtStartPositionY.stringValue].doubleValue;
_renderer.startZoom = [formatter numberFromString:_txtStartZoom.stringValue].doubleValue;
Expand Down
35 changes: 34 additions & 1 deletion Mandelbrot2/AppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,46 @@
// Mandelbrot2
//
// Created by Palle Klewitz on 16.08.14.
// Copyright (c) 2014 Palle Klewitz. All rights reserved.
// Copyright (c) 2014 - 2016 Palle Klewitz.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is furnished
// to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
// IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//

@import Cocoa;
@class MandelbrotRenderViewController;

#define CreateAnimationWindow @"CreateAnimationWindow"
#define MandelbrotRenderWindow @"MandelbrotRenderWindow"
#define MandelbrotControlPanel @"MandelbrotControlPanel"

@interface AppDelegate : NSObject <NSApplicationDelegate>

@property (nonatomic, strong) NSWindowController *mandelbrotRenderWindow;
@property (nonatomic, strong) NSWindowController *mandelbrotControlPanel;
@property (nonatomic, strong) NSWindowController *mandelbrotAnimationWindow;
@property (nonatomic, weak) MandelbrotRenderViewController *mainViewController;
@property (weak) IBOutlet NSMenuItem *miIterationBasedColoring;
@property (weak) IBOutlet NSMenuItem *miZeroPointBasedColoring;
@property (weak) IBOutlet NSMenuItem *miCombinedColoring;
@property (weak) IBOutlet NSMenuItem *miLinearColoring;
@property (weak) IBOutlet NSMenuItem *miLogarithmicColoring;
@property (weak) IBOutlet NSMenuItem *miInverseColoring;
@property (weak) IBOutlet NSMenuItem *miRootColoring;

- (IBAction)resetZoom:(id)sender;
- (IBAction)zoomIn:(id)sender;
Expand All @@ -34,5 +62,10 @@

- (IBAction)showRenderView:(id)sender;
- (IBAction)showControlPanel:(id)sender;

- (IBAction)setColorMode:(NSMenuItem *)sender;
- (IBAction)setColorScale:(NSMenuItem *)sender;
- (IBAction)setSmoothColor:(NSMenuItem *)sender;

@end

111 changes: 109 additions & 2 deletions Mandelbrot2/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,29 @@
// Mandelbrot2
//
// Created by Palle Klewitz on 16.08.14.
// Copyright (c) 2014 Palle Klewitz. All rights reserved.
// Copyright (c) 2014 - 2016 Palle Klewitz.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is furnished
// to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
// IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//

#import "AppDelegate.h"
#import "MandelbrotRenderViewController.h"
#import "CLMandelbrotView.h"

@interface AppDelegate ()

Expand Down Expand Up @@ -88,12 +106,101 @@ - (IBAction)showRenderView:(id)sender
}
else
{

_mandelbrotRenderWindow = [[NSStoryboard storyboardWithName:@"Main" bundle:nil] instantiateInitialController];
}
}

- (IBAction)showControlPanel:(id)sender
{
[_mainViewController showControlPanel:sender];
}

- (IBAction)setColorMode:(NSMenuItem *)sender
{
if (sender == _miIterationBasedColoring)
{
_miZeroPointBasedColoring.state = NSOffState;
_miZeroPointBasedColoring.enabled = YES;
_miCombinedColoring.state = NSOffState;
_miCombinedColoring.enabled = YES;
_miIterationBasedColoring.enabled = NO;
_mainViewController.mandelbrotView.color_mode = 0;
}
else if (sender == _miZeroPointBasedColoring)
{
_miIterationBasedColoring.state = NSOffState;
_miIterationBasedColoring.enabled = YES;
_miCombinedColoring.state = NSOffState;
_miCombinedColoring.enabled = YES;
_miZeroPointBasedColoring.enabled = NO;
_mainViewController.mandelbrotView.color_mode = 1;
}
else
{
_miIterationBasedColoring.state = NSOffState;
_miIterationBasedColoring.enabled = YES;
_miZeroPointBasedColoring.state = NSOffState;
_miZeroPointBasedColoring.enabled = YES;
_miCombinedColoring.enabled = NO;
_mainViewController.mandelbrotView.color_mode = 2;
}
}

- (IBAction)setColorScale:(NSMenuItem *)sender
{
if (sender == _miLinearColoring)
{
_miLogarithmicColoring.state = NSOffState;
_miRootColoring.state = NSOffState;
_miInverseColoring.state = NSOffState;
_miLogarithmicColoring.enabled = YES;
_miRootColoring.enabled = YES;
_miInverseColoring.enabled = YES;
_mainViewController.mandelbrotView.color_scale = 0;
}
else if (sender == _miLogarithmicColoring)
{
_miLinearColoring.state = NSOffState;
_miRootColoring.state = NSOffState;
_miInverseColoring.state = NSOffState;
_miLinearColoring.enabled = YES;
_miRootColoring.enabled = YES;
_miInverseColoring.enabled = YES;
_mainViewController.mandelbrotView.color_scale = 1;

}
else if (sender == _miInverseColoring)
{
_miLinearColoring.state = NSOffState;
_miRootColoring.state = NSOffState;
_miLogarithmicColoring.state = NSOffState;
_miLinearColoring.enabled = YES;
_miRootColoring.enabled = YES;
_miLogarithmicColoring.enabled = YES;
_mainViewController.mandelbrotView.color_scale = 2;
}
else
{
_miLinearColoring.state = NSOffState;
_miInverseColoring.state = NSOffState;
_miLogarithmicColoring.state = NSOffState;
_miLinearColoring.enabled = YES;
_miInverseColoring.enabled = YES;
_miLogarithmicColoring.enabled = YES;
_mainViewController.mandelbrotView.color_scale = 3;
}
sender.state = NSOnState;
sender.enabled = NO;

}

- (IBAction)setSmoothColor:(NSMenuItem *)sender
{
if (sender.state == NSOnState)
sender.state = NSOffState;
else
sender.state = NSOnState;
_mainViewController.mandelbrotView.smooth_coloring = sender.state == NSOnState;
}

@end
Loading

0 comments on commit 7b948d6

Please sign in to comment.