RSS

(root)/iphone/common : 61 : Jigs/source/JigsawGenerator.h

« back to all changes in this revision

Viewing changes to Jigs/source/JigsawGenerator.h

Dömötör Gulyás
2010-01-18 09:03:51
Revision ID: dognotdog@gmail.com-20100118080351-ib2knxvk4w8ssw3h
made common a nested tree

Show diffs side-by-side

added added

removed removed

1
 
//
2
 
//  JigsawGenerator.h
3
 
//  JigsawGenerator
4
 
//
5
 
//  Created by DoG on 19.02.07.
6
 
//  Copyright 2007 Doemoetoer Gulyas. All rights reserved.
7
 
//
8
 
 
9
 
#import <Foundation/Foundation.h>
10
 
 
11
 
@class JigsawView;
12
 
@class SimplexNoise;
13
 
 
14
 
typedef struct JigGrid {
15
 
        float width, height;
16
 
        int xpoints;
17
 
        int ypoints;
18
 
        CGPoint** points;
19
 
        SimplexNoise* noisegen;
20
 
} JigGrid;
21
 
 
22
 
typedef struct JigSegment {
23
 
        CGPoint*        points;
24
 
        unsigned        count;
25
 
        float           xlen;
26
 
        int                     format;
27
 
        CGPathRef       bpath;
28
 
} JigSegment;
29
 
 
30
 
JigSegment      GetJigSegmentFromFile(NSString* path);
31
 
void            SplineSegmentToPiecewiseBezier(JigSegment* seg);
32
 
 
33
 
typedef struct JigCell {
34
 
        JigSegment              segments[4];
35
 
        CGPathRef               outline;
36
 
        CGPoint                 pos;
37
 
        CGPoint                 attachmentPoints[4];
38
 
        void*                   piece;
39
 
} JigCell;
40
 
 
41
 
typedef struct JigPieces {
42
 
        int hcells, vcells;
43
 
        JigCell** cells;
44
 
} JigPieces;
45
 
 
46
 
void FreeJigPieces(JigPieces pieces);
47
 
 
48
 
@interface JigsawGenerator : NSObject
49
 
{
50
 
        float   width, height;
51
 
        int hcells, vcells;
52
 
        int seed;
53
 
        float frequency;
54
 
        float distortion;
55
 
        int octaves;
56
 
        int noiseType;
57
 
        
58
 
        int roundEdgeCornerCoordsToInt;
59
 
        
60
 
 
61
 
        NSArray*                                edgeFiles;
62
 
        NSMutableDictionary*    enabledEdges;
63
 
        NSMutableDictionary*    smoothedEdges;
64
 
}
65
 
 
66
 
- (JigPieces) generateJigsaw;
67
 
 
68
 
- (CGSize) puzzleSize;
69
 
 
70
 
@property(assign) float width, height, frequency, distortion;
71
 
@property(assign) int hcells, vcells, seed, octaves, noiseType, roundEdgeCornerCoordsToInt;
72
 
@property(retain) NSArray* edgeFiles;
73
 
@property(retain) NSMutableDictionary* enabledEdges;
74
 
@property(retain) NSMutableDictionary* smoothedEdges;
75
 
@end

Loggerhead 1.17 is a web-based interface for Bazaar branches