DekGenius.com
[ Team LiB ] Previous Section Next Section

NSAffineTransform Mac OS X 10.0

This class is used to perform affine transform operations on NSBezierPath objects, as well as on NSSize, and NSPoint structures. An affine transform is an operation in which one coordinate system is mapped to another whereby the parallelism of lines is maintained, but not necessarily their length or angles.

NSAffineTransform has methods for performing several types of operations: rotation, scaling, and translation. These transforms are implemented in the methods scaleBy:, scaleXBy:yBy:, rotateByDegrees:, rotateByRadians:, and translateXBy:yBy:. Additionally, applications may define their own transformation matrices using the method setTransformStruct:. To apply a transform to an object we use transformBezierPath:, transformSize:, and transformPoint:.

figs/cocn_1504.gif

@interface NSAffineTransform : NSObject <NSCoding, NSCopying>
 // Initializers
   - (id)initWithTransform:(NSAffineTransform *)transform;
 // Accessor Methods
   - (void)setTransformStruct:(NSAffineTransformStruct)transformStruct;
   - (NSAffineTransformStruct)transformStruct;
 // Class Methods
   + (NSAffineTransform *)transform;
 // Instance Methods
   - (void)invert;
   - (void)concat;
   - (void)set;
   - (void)appendTransform:(NSAffineTransform *)transform;
   - (void)prependTransform:(NSAffineTransform *)transform;
   - (void)rotateByDegrees:(float)angle;
   - (void)rotateByRadians:(float)angle;
   - (void)scaleBy:(float)scale;
   - (void)scaleXBy:(float)scaleX yBy:(float)scaleY;
   - (NSBezierPath *)transformBezierPath:(NSBezierPath *)aPath;
   - (NSPoint)transformPoint:(NSPoint)aPoint;
   - (NSSize)transformSize:(NSSize)aSize;
   - (void)translateXBy:(float)deltaX yBy:(float)deltaY;
 // Methods Implementing NSCoding
   - (void)encodeWithCoder:(NSCoder *)aCoder;
   - (id)initWithCoder:(NSCoder *)aDecoder;
 // Methods Implementing NSCopying
   - (id)copyWithZone:(NSZone *)zone;

    [ Team LiB ] Previous Section Next Section