DrawKit
Vector and illustration framework for Mac OS X
Instance Methods | List of all members
DKDrawableShape(Utilities) Category Reference

Instance Methods

(NSBezierPath *) - path:withFinalSize:offsetBy:fromPartcode:
 Transforms a path to the final size and position relative to a partcode. More...
 
(NSBezierPath *) - pathWithFinalSize:offsetBy:fromPartcode:
 Return a rectangular path offset from a given partcode. More...
 
(NSBezierPath *) - pathWithRelativePosition:finalSize:
 Return a rectangular path with given relative origin but absolute final size. More...
 
(NSBezierPath *) - pathWithRelativeRect:
 Return a rectangular path with given size and origin. More...
 
(NSPoint) - pointForRelativeLocation:
 Convert a point from relative coordinates to absolute coordinates. More...
 

Detailed Description

Author
Contributions from the community; see CONTRIBUTORS.md
Date
2005-2015

Method Documentation

- (NSBezierPath*) path: (NSBezierPath *)  inPath
withFinalSize: (NSSize)  size
offsetBy: (NSPoint)  offset
fromPartcode: (NSInteger pc 

Transforms a path to the final size and position relative to a partcode.

The resulting path is positioned at a fixed offset and size relative to a partcode (a corner, say) in such a way that the object's size and angle set the positioning and orientation of the path but not its actual size. This is useful for adding an adornment to the shape that is unscaled by the object, such as the text indicator shown by DKTextShape

Parameters
paththe path to transform
sizethe final desired size of the rectangle
offsetan offset in absolute units from the nominated partcode position
pcthe partcode that the path is positioned relative to
Returns
the transformed path

Extends class DKDrawableShape.

- (NSBezierPath*) pathWithFinalSize: (NSSize)  size
offsetBy: (NSPoint)  offset
fromPartcode: (NSInteger pc 

Return a rectangular path offset from a given partcode.

The resulting path is positioned at a fixed offset and size relative to a partcode (a corner, say) in such a way that the object's size and angle set the positioning and orientation of the path but not its actual size. This is useful for adding an adornment to the shape that is unscaled by the object, such as the text indicator shown by DKTextShape

Parameters
sizethe final desired size of the rectangle
offsetan offset in absolute units from the nominated partcode position
pcthe partcode that the path is positioned relative to
Returns
a rectangular path transformed to the current true size, position and angle of the shape

Extends class DKDrawableShape.

- (NSBezierPath*) pathWithRelativePosition: (NSPoint)  relLoc
finalSize: (NSSize)  size 

Return a rectangular path with given relative origin but absolute final size.

Not affected by the object's current offset. By specifying a final size the resulting path can represent a fixed-sized region independent of the object's current size.

Parameters
relLoca point expressed relative to the unit square
sizethe final desired size o fthe rectangle
Returns
a rectangular path transformed to the current true size, position and angle of the shape

Extends class DKDrawableShape.

- (NSBezierPath*) pathWithRelativeRect: (NSRect relRect

Return a rectangular path with given size and origin.

Not affected by the object's current offset

Parameters
relRecta rectangle expressed relative to the unit square
Returns
a rectangular path transformed to the current true size, position and angle of the shape

Extends class DKDrawableShape.

- (NSPoint) pointForRelativeLocation: (NSPoint)  relLoc

Convert a point from relative coordinates to absolute coordinates.

Not affected by the object's current offset

Parameters
relLoca point expressed relative to the unit square
Returns
the absolute point taking into account scale, position and angle

Extends class DKDrawableShape.