DrawKit
Vector and illustration framework for Mac OS X
|
This category provides some basic methods for supporting interactive editing of a NSBezierPath object. More...
Class Methods | |
(void) | + colineariseVertex:cpA:cpB: |
(NSPoint) | + colinearPointForPoint:centrePoint: |
(NSPoint) | + colinearPointForPoint:centrePoint:radius: |
(NSInteger) | + point:inNSPointArray:count:tolerance: |
(NSInteger) | + point:inNSPointArray:count:tolerance:reverse: |
(void) | + setConstraintAngle: |
This category provides some basic methods for supporting interactive editing of a NSBezierPath object.
This category provides some basic methods for supporting interactive editing of a NSBezierPath object. This can be more tricky than it looks because control points are often not edited in isolation - they often crosslink to other control points (such as when two curveto segments are joined and a colinear handle is needed).
These methods allow you to refer to any individual control point in the object using a unique partcode. These methods will hit detect all control points, giving the partcode, and then get and set that point.
The moveControlPointPartcode:toPoint:colinear: is a high-level call that will handle most editing tasks in a simple to use way. It optionally maintains colinearity across curve joins, and knows how to maintain closed loops properly.
- (NSSet*) allBoundingBoxes |
- (NSBezierPath*) bezierPathByRemovingElementAtIndex: | (NSInteger) | indx |
- (NSBezierPath*) bezierPathByRemovingTrailingElements: | (NSInteger) | numToRemove |
- (NSBezierPath*) bezierPathByStrippingRedundantElements |
- (NSUInteger) checksum |
+ (void) colineariseVertex: | (NSPoint) | inPoints[3] | |
cpA: | (NSPoint *) | outCPA | |
cpB: | (NSPoint *) | outCPB | |
+ (NSPoint) colinearPointForPoint: | (NSPoint) | p | |
centrePoint: | (NSPoint) | q | |
+ (NSPoint) colinearPointForPoint: | (NSPoint) | p | |
centrePoint: | (NSPoint) | q | |
radius: | (CGFloat) | r | |
- (NSPoint) controlPointForPartcode: | (NSInteger) | pc |
- (NSBezierPath*) deleteControlPointForPartcode: | (NSInteger) | pc |
- (void) drawElementsBoundingBoxes |
- (NSInteger) elementHitByPoint: | (NSPoint) | p | |
tolerance: | (CGFloat) | tol | |
tValue: | (CGFloat *) | t | |
nearestPoint: | (NSPoint *) | npp | |
- (NSBezierPathElement) elementTypeForPartcode: | (NSInteger) | pc |
- (void) getPathMoveToCount: | (NSInteger *) | mtc | |
lineToCount: | (NSInteger *) | ltc | |
curveToCount: | (NSInteger *) | ctc | |
closePathCount: | (NSInteger *) | cpc | |
Counts the number of elements of each type in the path.
Pass NULL for any values you are not interested in
mtc,ltc,ctc,cpc | pointers to integers that receive the counts for each element type |
- (NSBezierPath*) insertControlPointAtPoint: | (NSPoint) | p | |
tolerance: | (CGFloat) | tol | |
type: | (NSInteger) | controlPointType | |
- (BOOL) isPathClosed |
- (void) moveControlPointPartcode: | (NSInteger) | pc | |
toPoint: | (NSPoint) | p | |
colinear: | (BOOL) | colin | |
coradial: | (BOOL) | corad | |
constrainAngle: | (BOOL) | acon | |
- (NSPoint) nearestPointToPoint: | (NSPoint) | p | |
tolerance: | (CGFloat) | tol | |
- (NSInteger) partcodeForLastPoint |
- (NSInteger) partcodeHitByPoint: | (NSPoint) | p | |
tolerance: | (CGFloat) | t | |
prioritiseOnPathPoints: | (BOOL) | onpPriority | |
- (NSInteger) partcodeHitByPoint: | (NSPoint) | p | |
tolerance: | (CGFloat) | t | |
startingFromElement: | (NSInteger) | startElement | |
- (NSInteger) partcodeHitByPoint: | (NSPoint) | p | |
tolerance: | (CGFloat) | t | |
startingFromElement: | (NSInteger) | startElement | |
prioritiseOnPathPoints: | (BOOL) | onpPriority | |
+ (NSInteger) point: | (NSPoint) | p | |
inNSPointArray: | (NSPoint *) | array | |
count: | (NSInteger) | count | |
tolerance: | (CGFloat) | t | |
+ (NSInteger) point: | (NSPoint) | p | |
inNSPointArray: | (NSPoint *) | array | |
count: | (NSInteger) | count | |
tolerance: | (CGFloat) | t | |
reverse: | (BOOL) | reverse | |
- (NSPoint) referencePointForConstrainedPartcode: | (NSInteger) | pc |
+ (void) setConstraintAngle: | (CGFloat) | radians |
- (void) setControlPoint: | (NSPoint) | p | |
forPartcode: | (NSInteger) | pc | |