-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSWPointSet.h
56 lines (39 loc) · 1.33 KB
/
SWPointSet.h
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
55
56
//
// SWPointSet.h
// This file is part of the "SWApplicationSupport" project, and is distributed under the MIT License.
//
// Created by Samuel Williams on 13/05/05.
// Copyright 2005 Samuel Williams. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#include "SWPoint.h"
@interface NSIndexSet (SWMathematicsOperatorsAddition)
- (NSIndexSet*) intersectWithIndexSet: (NSIndexSet*)set;
- (NSIndexSet*) unionWithIndexSet: (NSIndexSet*)set;
- (NSIndexSet*) invertWithinRange: (NSRange)range;
@end
@interface SWPointSet : NSObject {
NSMutableIndexSet *indexSet;
SWSize size;
}
+ (SWPoint) pointForIndex:(unsigned int)index withSize:(SWSize)size;
+ (unsigned int) indexForPoint:(SWPoint)point withSize:(SWSize)size;
/* Simple Constructor*/
+ (id) pointSetWithSize: (SWSize)size;
- (id) initWithSize:(SWSize)size;
- (NSIndexSet*) indexSet;
- (BOOL) containsPoint:(SWPoint)point;
- (SWPoint) pointForIndex:(unsigned int)index;
- (unsigned int) indexForPoint:(SWPoint)point;
- (SWPointSet*) intersectWithPointSet: (SWPointSet*)set;
- (SWPointSet*) subtractPointSet: (SWPointSet*)set;
- (SWPointSet*) unionWithPointSet: (SWPointSet*)set;
- (SWPointSet*) inversePointSet;
- (size_t) count;
@end
@interface SWMutablePointSet : SWPointSet {
}
- (void) addPoint:(SWPoint)point;
- (void) removePoint:(SWPoint)point;
- (NSMutableIndexSet*) indexSet;
@end