//
//  gravityView.h
//  gravity
//
//  Created by Mike Mintz on 12/30/05.
//  Copyright (c) 2005, __MyCompanyName__. All rights reserved.
//

#import <ScreenSaver/ScreenSaver.h>
#import "Particle.h"

@interface gravityView : ScreenSaverView 
{
	IBOutlet id configSheet;
	
	IBOutlet id nParticlesField;
	IBOutlet id FPSField;
	IBOutlet id gravityCoefficientField;
	IBOutlet id electricCoefficientField;
	IBOutlet id maxSpeedField;
	IBOutlet id maxChargeField;
	IBOutlet id maxMassField;
	IBOutlet id maxInitialSpeedFractionField;
	IBOutlet id particleDensityField;
	IBOutlet id trailLengthField;
	IBOutlet id fractionalChargeField;
	IBOutlet id outlinedCirclesField;
	IBOutlet id particleAlphaField;
	IBOutlet id displayDynamicMassField;
	IBOutlet id edgesField;
	IBOutlet id relativisticField;

	NSSize size;
	NSMutableArray *particles;
	NSMutableArray *dirtyPaths;
	ScreenSaverDefaults *defaults;
	NSDictionary *originalDefaults;
	int nParticles;
	float maxSpeed;
	float maxCharge;
	float maxMass;
}
- (IBAction)cancelClick: (id)sender;
- (IBAction)okClick: (id)sender;
- (IBAction)resetClick: (id)sender;
- (void)loadConfig;

- (void)blankView;
- (void)blankPath: (NSBezierPath*)path;
- (void)initializeParticles;
- (float)radiusFromMass: (float)mass;
- (Particle*)randomNewParticle;
- (Particle*)newParticleWithPosition: (NSPoint)position withVelocity: (NSPoint)velocity withMass: (float)mass withCharge: (float)charge;
- (void)releaseParticles;
- (NSBezierPath*)drawParticle: (Particle*)p;

@end
