DrawKit
Vector and illustration framework for Mac OS X
|
Some handy methods for implementing various kinds of object duplications. More...
Instance Methods | |
(NSArray *) | - autoPolarDuplicate:centre: |
Automatically polar duplicates object to fit a circle exactly. More... | |
(NSArray *) | - concentricDuplicate:centre:numberOfCopies:insetBy: |
Duplicates one or more objects concentrically around a common centre. More... | |
(NSArray *) | - linearDuplicate:offset:numberOfCopies: |
Duplicates one or more objects linearly. More... | |
(NSArray *) | - polarDuplicate:centre:numberOfCopies:incrementAngle:rotateCopies: |
Duplicates one or more objects radially around a common centre. More... | |
Some handy methods for implementing various kinds of object duplications.
Some handy methods for implementing various kinds of object duplications.
- (NSArray*) autoPolarDuplicate: | (DKDrawableObject *) | object | |
centre: | (NSPoint) | centre | |
Automatically polar duplicates object to fit a circle exactly.
This computes the increment angle and number of copies needed to fit the object exactly into a circle. The angle is that subtended by the object's logical bounds at the centre. The radius will be adjusted outwards as necessary so that an integral number of copies fit a complete circle.
object | a single opject to be copied |
centre | the centre around which the object is located |
Extends class DKObjectDrawingLayer.
- (NSArray*) concentricDuplicate: | (NSArray *) | objectsToDuplicate | |
centre: | (NSPoint) | centre | |
numberOfCopies: | (NSInteger) | nCopies | |
insetBy: | (CGFloat) | inset | |
Duplicates one or more objects concentrically around a common centre.
Objects in the result are obtained by copying the objects in the original list, and so will have the same types, styles, etc. While this works with paths, it works best with shapes or groups, because paths don't implement setSize: and their location is at their top, left.
objectsToDuplicate | a list of DKDrawableObjects which will be copied |
centre | the location of the centre around which the copies are arranged |
numberOfCopies | how many copies to make |
insetBy | the amount each copy is inset or outset (-ve) by |
Extends class DKObjectDrawingLayer.
- (NSArray*) linearDuplicate: | (NSArray *) | objectsToDuplicate | |
offset: | (NSSize) | offset | |
numberOfCopies: | (NSInteger) | nCopies | |
Duplicates one or more objects linearly.
Objects in the result are obtained by copying the objects in the original list, and so will have the same types, styles, etc.
objectsToDuplicate | a list of DKDrawableObjects which will be copied |
offset | each copy is offset this much from the last |
numberOfCopies | how many copies to make |
Extends class DKObjectDrawingLayer.
- (NSArray*) polarDuplicate: | (NSArray *) | objectsToDuplicate | |
centre: | (NSPoint) | centre | |
numberOfCopies: | (NSInteger) | nCopies | |
incrementAngle: | (CGFloat) | incRadians | |
rotateCopies: | (BOOL) | rotCopies | |
Duplicates one or more objects radially around a common centre.
Objects in the result are obtained by copying the objects in the original list, and so will have the same types, styles, etc.
objectsToDuplicate | a list of DKDrawableObjects which will be copied |
centre | the location of the centre around which the copies are arranged |
numberOfCopies | how many copies to make |
incrementAngle | the angle in radians between each copy |
rotateCopies | YES to rotate the copies so that they lie on the radial, NO to keep them at their original rotation |
Extends class DKObjectDrawingLayer.