API  0.9.7
 All Classes Files Functions Variables Macros Groups Pages
CPBezierPath Class Reference

#import <CPBezierPath.h>

+ Inheritance diagram for CPBezierPath:

Instance Methods

(void) - addClip
 
(void) - appendBezierPath:
 
(void) - appendBezierPathWithArcFromPoint:toPoint:radius:
 
(void) - appendBezierPathWithOvalInRect:
 
(void) - appendBezierPathWithPoints:count:
 
(void) - appendBezierPathWithRect:
 
(void) - appendBezierPathWithRoundedRect:xRadius:yRadius:
 
(CGRect) - bounds
 
(void) - closePath
 
(CGRect) - controlPointBounds
 
(CGPoint) - currentPoint
 
(void) - curveToPoint:controlPoint1:controlPoint2:
 
(unsigned) - elementCount
 
(void) - fill
 
(void) - getLineDash:count:phase:
 
(void) - getLineDash:phase:
 
(id) - init
 
(BOOL) - isEmpty
 
(void) - lineToPoint:
 
(float) - lineWidth
 
(void) - moveToPoint:
 
(void) - removeAllPoints
 
(void) - setClip
 
(void) - setLineDash:count:phase:
 
(void) - setLineDash:phase:
 
(void) - setLineWidth:
 
(void) - stroke
 

Class Methods

(CPBezierPath+ bezierPath
 
(CPBezierPath+ bezierPathWithOvalInRect:
 
(CPBezierPath+ bezierPathWithRect:
 
(CPBezierPath+ bezierPathWithRoundedRect:xRadius:yRadius:
 
(float) + defaultLineWidth
 
(void) + fillRect:
 
(void) + setDefaultLineWidth:
 
(void) + strokeLineFromPoint:toPoint:
 
(void) + strokeRect:
 

Detailed Description

A CPBezierPath allows you to create paths for drawing to the screen using a simpler API than CoreGraphics. Paths can form any shape, including regular polygons like squares and triangles; circles, arcs; or complex line segments.

A path can be stroked and filled using the relevant method. The currently active fill and stroke color will be used, which can be set by calling setFill: and setStroke: on any CPColor object (or set: for both).

Definition at line 2 of file CPBezierPath.h.

Method Documentation

- (void) addClip
implementation

Definition at line 361 of file CPBezierPath.j.

- (void) appendBezierPath: (CPBezierPath other
implementation

Append the contents of a CPBezierPath object.

Definition at line 348 of file CPBezierPath.j.

- (void) appendBezierPathWithArcFromPoint: (CGPoint)  fromPoint
toPoint: (CGPoint)  toPoint
radius: (float)  radius 
implementation

Definition at line 340 of file CPBezierPath.j.

- (void) appendBezierPathWithOvalInRect: (CGRect)  rect
implementation

Append an oval path; oval is drawn within the rectangular path.

Definition at line 327 of file CPBezierPath.j.

- (void) appendBezierPathWithPoints: (CPArray)  points
count: (unsigned)  count 
implementation

Append a series of line segments.

Definition at line 311 of file CPBezierPath.j.

- (void) appendBezierPathWithRect: (CGRect)  rect
implementation

Append a rectangular path.

Definition at line 319 of file CPBezierPath.j.

- (void) appendBezierPathWithRoundedRect: (CGRect)  rect
xRadius: (float)  xRadius
yRadius: (float)  yRadius 
implementation

Append a rounded rectangular path.

Definition at line 335 of file CPBezierPath.j.

+ (CPBezierPath) bezierPath
implementation

Create a new CPBezierPath object.

Definition at line 56 of file CPBezierPath.j.

+ (CPBezierPath) bezierPathWithOvalInRect: (CGRect)  aRect
implementation

Create a new CPBezierPath object initialized with an oval path drawn within a rectangular path.

Definition at line 64 of file CPBezierPath.j.

+ (CPBezierPath) bezierPathWithRect: (CGRect)  aRect
implementation

Create a new CPBezierPath object initialized with a rectangular path.

Definition at line 76 of file CPBezierPath.j.

+ (CPBezierPath) bezierPathWithRoundedRect: (CGRect)  aRect
xRadius: (float)  xRadius
yRadius: (float)  yRadius 
implementation

Definition at line 85 of file CPBezierPath.j.

- (CGRect) bounds
implementation

Definition at line 179 of file CPBezierPath.j.

- (void) closePath
implementation

Create a line segment between the first and last points in the subpath, closing it.

Definition at line 195 of file CPBezierPath.j.

- (CGRect) controlPointBounds
implementation

Definition at line 187 of file CPBezierPath.j.

- (CGPoint) currentPoint
implementation

Get the current point.

Definition at line 303 of file CPBezierPath.j.

- (void) curveToPoint: (CGPoint)  endPoint
controlPoint1: (CGPoint)  controlPoint1
controlPoint2: (CGPoint)  controlPoint2 
implementation

Add a cubic Bezier curve to the path.

Definition at line 174 of file CPBezierPath.j.

+ (float) defaultLineWidth
implementation

Get default line width.

Definition at line 97 of file CPBezierPath.j.

- (unsigned) elementCount
implementation

Get the total number of elements.

Definition at line 287 of file CPBezierPath.j.

- (void) fill
implementation

Fill the path with the current fill color.

Definition at line 217 of file CPBezierPath.j.

+ (void) fillRect: (CGRect)  aRect
implementation

Fill rectangular path with current fill color.

Definition at line 113 of file CPBezierPath.j.

- (void) getLineDash: (CPArrayRef)  patternRef
count: (NSInteger)  count
phase: (CGFloatRef)  phaseRef 
implementation

Cocoa compatibility.

Definition at line 232 of file CPBezierPath.j.

- (void) getLineDash: (CPArrayRef)  patternRef
phase: (CGFloatRef)  phaseRef 
implementation

Retrieve the line dash pattern and phase and write them into the provided references.

Definition at line 240 of file CPBezierPath.j.

- (id) init
implementation

Create a new CPBezierPath object using the default line width.

Definition at line 142 of file CPBezierPath.j.

- (BOOL) isEmpty
implementation

Check if receiver is empty, returns appropriate Boolean value.

Definition at line 295 of file CPBezierPath.j.

- (void) lineToPoint: (CGPoint)  point
implementation

Append a straight line to the path.

Definition at line 166 of file CPBezierPath.j.

- (float) lineWidth
implementation

Get the line width.

Definition at line 271 of file CPBezierPath.j.

- (void) moveToPoint: (CGPoint)  point
implementation

Moves the current point to another location.

Definition at line 158 of file CPBezierPath.j.

- (void) removeAllPoints
implementation

Remove all path elements; clears path.

Definition at line 356 of file CPBezierPath.j.

- (void) setClip
implementation

Definition at line 369 of file CPBezierPath.j.

+ (void) setDefaultLineWidth: (float)  width
implementation

Set default line width.

Definition at line 105 of file CPBezierPath.j.

- (void) setLineDash: (CPArray)  aPattern
count: (NSInteger)  count
phase: (CGFloat)  aPhase 
implementation

Cocoa compatibility.

Definition at line 251 of file CPBezierPath.j.

- (void) setLineDash: (CPArray)  aPattern
phase: (CGFloat)  aPhase 
implementation

Set stroke line dash pattern.

Parameters
aPatternan array of stroke-skip lengths such as [2, 2, 4, 4]
aPhaseamount of shift for the starting position of the first stroke

Definition at line 262 of file CPBezierPath.j.

- (void) setLineWidth: (float)  lineWidth
implementation

Set the line width.

Definition at line 279 of file CPBezierPath.j.

- (void) stroke
implementation

Draw a line along the path with the current stroke color and default drawing attributes.

Definition at line 203 of file CPBezierPath.j.

+ (void) strokeLineFromPoint: (CGPoint)  point1
toPoint: (CGPoint)  point2 
implementation

Using the current stroke color and default drawing attributes, strokes a line between two points.

Definition at line 129 of file CPBezierPath.j.

+ (void) strokeRect: (CGRect)  aRect
implementation

Using the current stroke color and default drawing attributes, strokes a counterclockwise path beginning at the rectangle's origin.

Definition at line 121 of file CPBezierPath.j.


The documentation for this class was generated from the following files: