On 1 Dec 2009, at 05:27, Jonathan Dann wrote:
> Just use NSPointerArray...
Just as is the case with an array of NSValue objects, NSPointerArray doesn't
help here -- it makes no guarantees about how the objects will be arranged in
memory, and NSBezierPath needs them to be
contiguous.
Just use NSPointerArray:
@implementation NSPointerFunctions (Additions)
static NSUInteger _PointerFunctionsCGPointStructSize(const void *item)
{
return sizeof(CGPoint);
}
+ (NSPointerFunctions *)pointerFunctionsForCGPoint;
{
NSPointerFunctions *aPointerFunctions = [NSPointerFunct
On 28 Nov 2009, at 15:12, Henry McGilton (Boulevardier) wrote:
> Another possible approach is simply use a NSMutableArray full of NSValue
> objects that contain
> the NSPoint structures . . .
I don't believe that'll work - storing everything in NSValue objects will end
up scattering the actual N
On Nov 28, 2009, at 2:50 PM, Quincey Morris wrote:
> On Nov 27, 2009, at 14:58, Shane wrote:
>
>> I think I'm understanding this in part ...
>>
>> // *.h
>> NSMutableData *pointData;
>> NSPointArray *points;
>>
>> // *.m
>> pointData = [[NSMutableData alloc] init];
>>
>> .
On Nov 27, 2009, at 14:58, Shane wrote:
> I think I'm understanding this in part ...
>
> // *.h
> NSMutableData *pointData;
> NSPointArray *points;
>
> // *.m
> pointData = [[NSMutableData alloc] init];
>
> ...
>
> NSPoint point = NSMakePoint([iters floatValue], [
On 28/11/2009, at 10:37 AM, Shane wrote:
>> Why not just accumulate the points directly into NSBezierPath? It can be
>> thought of as an array of points in a sense. Unless there's a compelling
>> need to have the points themselves available in addition to the bezier path,
>> just cut out the m
> Why not just accumulate the points directly into NSBezierPath? It can be
> thought of as an array of points in a sense. Unless there's a compelling need
> to have the points themselves available in addition to the bezier path, just
> cut out the middle man (and it's not difficult to retrieve t
On 28/11/2009, at 7:46 AM, Shane wrote:
> I don't know how large my NSPointArray size needs to be so I'd like to
> know how I would dynamically allocate NSPoints to populate an
> NSPointArray? I think I can do it with NSMutableArray, but
> NSBezierPath takes an NSPointArray (which is what my end
>
> The easiest way (and Objective-C-ish way) is to use a NSMutableData object
> with the NSPointArray as its data. Whenever you want to add points, just
> resize the NSMutableData object to 'sizeof (NSPoint)' * total number of
> points, and use '(NSPointArray) [data mutableBytes]' as a pointer
On Nov 27, 2009, at 12:46, Shane wrote:
> I don't know how large my NSPointArray size needs to be so I'd like to
> know how I would dynamically allocate NSPoints to populate an
> NSPointArray? I think I can do it with NSMutableArray, but
> NSBezierPath takes an NSPointArray (which is what my end r
I don't know how large my NSPointArray size needs to be so I'd like to
know how I would dynamically allocate NSPoints to populate an
NSPointArray? I think I can do it with NSMutableArray, but
NSBezierPath takes an NSPointArray (which is what my end result is for
the points) and it just seems cleane
11 matches
Mail list logo