DrawKit
Vector and illustration framework for Mac OS X
|
This class provides a simple hatching fill for a path. More...
Instance Methods | |
(CGFloat) | - angle |
The angle of the hatching. More... | |
(CGFloat) | - angleInDegrees |
The angle of the hatching in degrees. More... | |
(BOOL) | - angleIsRelativeToObject |
(void) | - calcHatchInRect: |
(NSColor *) | - colour |
(DKStrokeDash *) | - dash |
(void) | - hatchPath: |
(void) | - hatchPath:objectAngle: |
Apply the hatching to the path with a given object angle. More... | |
(void) | - invalidateCache |
(CGFloat) | - leadIn |
(NSLineCapStyle) | - lineCapStyle |
(NSLineJoinStyle) | - lineJoinStyle |
(CGFloat) | - roughness |
(void) | - setAngle: |
Set the angle of the hatching. More... | |
(void) | - setAngleInDegrees: |
Set the angle of the hatching in degrees. More... | |
(void) | - setAngleIsRelativeToObject: |
(void) | - setAutoDash |
(void) | - setColour: |
(void) | - setDash: |
(void) | - setLeadIn: |
(void) | - setLineCapStyle: |
(void) | - setLineJoinStyle: |
(void) | - setRoughness: |
(void) | - setSpacing: |
(void) | - setWidth: |
(void) | - setWobblyness: |
(CGFloat) | - spacing |
(CGFloat) | - width |
(CGFloat) | - wobblyness |
Instance Methods inherited from DKRasterizer | |
(DKClippingOption) | - clipping |
Whether the rasterizer's effect is clipped to the path or not, and if so, which side. More... | |
(DKRastGroup *) | - container |
Returns the immediate container of this object, if owned by a group. More... | |
(BOOL) | - copyToPasteboard: |
(BOOL) | - enabled |
(BOOL) | - isValid |
(NSString *) | - label |
(NSString *) | - name |
(NSBezierPath *) | - renderingPathForObject: |
Returns the path to render given the object doing the rendering. More... | |
(void) | - setClipping: |
(void) | - setClippingWithoutNotifying: |
(void) | - setContainer: |
Sets the immediate container of this object. More... | |
(void) | - setEnabled: |
(void) | - setName: |
(NSString *) | - styleScript |
Instance Methods inherited from GCObservableObject | |
(NSString *) | - actionNameForKeyPath: |
(NSString *) | - actionNameForKeyPath:changeKind: |
(NSArray *) | - oldArrayValueForKeyPath: |
(void) | - registerActionNames |
(void) | - sendInitialValuesForAllPropertiesToObserver:context: |
(void) | - setActionName:forKeyPath: |
(BOOL) | - setUpKVOForObserver: |
(void) | - setUpObservables:forObserver: |
(BOOL) | - tearDownKVOForObserver: |
(void) | - tearDownObservables:forObserver: |
Instance Methods inherited from NSObject | |
(NSString *) | - address |
(DKStyleRegistry *) | - applicationWillReturnStyleRegistry |
(BOOL) | - canBeUsedWithSelectionTool |
(id) | - categoryManager:shouldReplaceObject:withObject: |
(Class) | - classForCoder |
(NSColor *) | - colorValue |
(NSColor *) | - colourValue |
(id) | - copy |
(void) | - dealloc |
(id) | - deepCopy |
(NSDictionary *) | - dimensionValuesForArrowStroke: |
(CGFloat) | - drawing:convertDistanceToExternalCoordinates: |
(NSPoint) | - drawing:convertLocationToExternalCoordinates: |
(void) | - drawing:didDrawRect:inView: |
(void) | - drawing:willDrawRect:inView: |
(NSString *) | - drawing:willReturnAbbreviationForUnit: |
(NSString *) | - drawing:willReturnFormattedCoordinateForDistance: |
(CGFloat) | - drawingWillReturnUnitToPointsConversonFactor: |
(void) | - finalize |
(NSString *) | - hexString |
(void) | - hotspot:didEndTrackingWithEvent:inView: |
(void) | - hotspot:isTrackingWithEvent:inView: |
(void) | - hotspot:willBeginTrackingWithEvent:inView: |
(NSData *) | - imageData |
(NSImage *) | - imageResourceNamed: |
(id) | - init |
(id) | - initWithExpression: |
(id) | - instantiateObjectWithShortName:parameters: |
(BOOL) | - isLiteralValue |
(void) | - layoutManager:willPlaceGlyphAtIndex:atLocation:pathAngle:yOffset: |
(void) | - menuItem:wasAddedForObject:inCategory: |
(BOOL) | - moveObjectTo:position:slope:userInfo: |
(id) | - mutableCopy |
(void) | - oneShotComplete |
(void) | - oneShotHasReached: |
(void) | - oneShotWillBegin |
(void) | - path:elementIndex:type:points:subPathIndex:subPathClosed:contextInfo: |
(id) | - placeLinkFromPoint:toPoint:onPath:linkNumber:userInfo: |
(id) | - placeObjectAtPoint:onPath:position:slope:userInfo: |
(NSPoint) | - point |
(NSPoint) | - pointForTextLayout |
(DKStyle *) | - registry:shouldReplaceStyle:withStyle: |
(NSBezierPath *) | - renderer:willRenderPath: |
(void) | - routeFinder:progressHasReached: |
(void) | - setValue:forNumericParameter: |
(NSString *) | - stringValue |
(CGFloat) | - taperFactorAtDistance:onPath:ofLength: |
(void) | - toolDidPerformUndoableAction: |
(void) | - toolWillPerformUndoableAction: |
(NSURL *) | - url |
Instance Methods inherited from <NSObject> | |
(NSString *) | - description |
(NSUInteger) | - hash |
(BOOL) | - isEqual: |
Instance Methods inherited from <NSKeyValueBindingCreation> | |
(void) | - bind:toObject:withKeyPath:options: |
(NSArray *) | - exposedBindings |
(NSDictionary *) | - infoForBinding: |
(NSArray *) | - optionDescriptionsForBinding: |
(void) | - unbind: |
(Class) | - valueClassForBinding: |
Instance Methods inherited from <DKRasterizer> | |
(NSSize) | - extraSpaceNeeded |
(BOOL) | - isFill |
(void) | - render: |
(void) | - renderPath: |
Instance Methods inherited from <NSCoding> | |
(void) | - encodeWithCoder: |
(id) | - initWithCoder: |
Instance Methods inherited from <NSCopying> | |
(id) | - copyWithZone: |
Class Methods | |
(DKHatching *) | + defaultHatching |
Return the default hatching. More... | |
(DKHatching *) | + hatchingWithDotDensity: |
Return a hatching which implements a dot pattern of given density. More... | |
(DKHatching *) | + hatchingWithDotPitch:diameter: |
Return a hatching which implements a dot pattern. More... | |
(DKHatching *) | + hatchingWithLineWidth:spacing:angle: |
Return a hatching with e basic parameters given. More... | |
Class Methods inherited from DKRasterizer | |
(DKRasterizer *) | + rasterizerFromPasteboard: |
Class Methods inherited from GCObservableObject | |
(NSString *) | + actionNameForKeyPath:objClass: |
(NSArray *) | + observableKeyPaths |
(void) | + registerActionName:forKeyPath:objClass: |
Class Methods inherited from NSObject | |
(id) | + alloc |
(Class) | + class |
(void) | + initialize |
(void) | + load |
(id) | + new |
Class Methods inherited from <NSKeyValueBindingCreation> | |
(void) | + exposeBinding: |
This class provides a simple hatching fill for a path.
This class provides a simple hatching fill for a path. It draws equally-spaced solid lines of a given thickness at a particular angle. Subclass for more sophisticated hatches.
Can be set as a fill style in a DKStyle object.
The hatch is cached in an NSBezierPath object based on the bounds of the path. If another path is hatched that is smaller than the cached size, it is not rebuilt. It is rebuilt if the angle or spacing changes or a bigger path is hatched. Linewidth also doesn't change the cache.
- (CGFloat) angle |
The angle of the hatching.
- (CGFloat) angleInDegrees |
The angle of the hatching in degrees.
- (BOOL) angleIsRelativeToObject |
- (void) calcHatchInRect: | (NSRect) | rect |
- (NSColor*) colour |
- (DKStrokeDash*) dash |
+ (DKHatching*) defaultHatching |
Return the default hatching.
Be sure to copy the object if you intend to change its parameters.
+ (DKHatching*) hatchingWithDotDensity: | (CGFloat) | density |
Return a hatching which implements a dot pattern of given density.
Dots have a diameter of 2.0 points, and are spaced according to density. If density = 1, dots touch (spacing = 2.0), 0.5 = dots have a spacing of 4.0, etc. A density of 0 is not allowed.
density | a density figure from 0 to 1 |
+ (DKHatching*) hatchingWithDotPitch: | (CGFloat) | pitch | |
diameter: | (CGFloat) | diameter | |
Return a hatching which implements a dot pattern.
The colour is set to black. The dot pattern is created using a dashed line at 45 degrees where the line and dash spacing is set to the dot pitch. The line width is the dot diameter and the rounded cap style is used. This is an efficient way to implement a dot pattern of a given density.
pitch | the spacing between the dots |
diameter | the dot diameter |
+ (DKHatching*) hatchingWithLineWidth: | (CGFloat) | w | |
spacing: | (CGFloat) | spacing | |
angle: | (CGFloat) | angle | |
Return a hatching with e basic parameters given.
The colour is set to black
w | the line width of the lines |
spacing | the line spacing |
angle | the overall angle in radians |
- (void) hatchPath: | (NSBezierPath *) | path |
- (void) hatchPath: | (NSBezierPath *) | path | |
objectAngle: | (CGFloat) | oa | |
Apply the hatching to the path with a given object angle.
path | the path to fill |
oa | the additional angle to apply, in radians |
- (void) invalidateCache |
- (CGFloat) leadIn |
- (NSLineCapStyle) lineCapStyle |
- (NSLineJoinStyle) lineJoinStyle |
- (CGFloat) roughness |
- (void) setAngle: | (CGFloat) | radians |
Set the angle of the hatching.
radians | the angle in radians |
- (void) setAngleInDegrees: | (CGFloat) | degs |
Set the angle of the hatching in degrees.
degs | the angle in degrees |
- (void) setAngleIsRelativeToObject: | (BOOL) | rel |
- (void) setAutoDash |
- (void) setColour: | (NSColor *) | colour |
- (void) setDash: | (DKStrokeDash *) | dash |
- (void) setLeadIn: | (CGFloat) | amount |
- (void) setLineCapStyle: | (NSLineCapStyle) | lcs |
- (void) setLineJoinStyle: | (NSLineJoinStyle) | ljs |
- (void) setRoughness: | (CGFloat) | amount |
- (void) setSpacing: | (CGFloat) | spacing |
- (void) setWidth: | (CGFloat) | width |
- (void) setWobblyness: | (CGFloat) | wobble |
- (CGFloat) spacing |
- (CGFloat) width |
- (CGFloat) wobblyness |