Up

# NSAffineTransform.m

### Authors

Ovidiu Predescu (`ovidiu@net-community.com`)
Richard Frith-Macdonald (`richard@brainstorm.co.uk`)

> This class provides a way to perform affine transforms. It provides a matrix for transforming from one coordinate system to another.

Copyright: (C) 1996,1999 Free Software Foundation, Inc.

### Contents -

1. Software documentation for the NSAffineTransform class
2. Software documentation for the NSAffineTransform(GNUstep) category

# Software documentation for the NSAffineTransform class

## NSAffineTransform : NSObject

> Declared in:
>   AppKit/NSAffineTransform.h

> Conforms to:
>   NSCopying
>   NSCoding

Availability: OpenStep
Description forthcoming.

Instance Variables
Method summary

- -boundingRectFor:result:
- -concatenateWith:
- -concatenateWithMatrix:
- -deltaPointInMatrixSpace:
- -getMatrix:
- -inverse
- -isRotated
- -makeIdentityMatrix
- -pointInMatrixSpace:
- -rectInMatrixSpace:
- -rotationAngle
- -scaleTo::
- -setFrameOrigin:
- -setFrameRotation:
- -setMatrix:
- -sizeInMatrixSpace:
- -takeMatrixFromTransform:
- -translateToPoint:
- +transform
- -appendTransform:
- -concat
- -initWithTransform:
- -invert
- -prependTransform:
- -rotateByDegrees:
- -rotateByRadians:
- -scaleBy:
- -scaleXBy:yBy:
- -set
- -setTransformStruct:
- -transformBezierPath:
- -transformPoint:
- -transformSize:
- -transformStruct
- -translateXBy:yBy:

### transform

+ (NSAffineTransform*) transform;
Availability: OpenStep
Return an autoreleased instance of this class.

### appendTransform:

- (void) appendTransform: (NSAffineTransform*)aTransform;
Availability: OpenStep
Appends the transform matrix to the receiver. This is done by performing a matrix multiplication of the receiver with aTransform so that aTransform is the first transform applied to the user coordinate. The new matrix then replaces the receiver's matrix.

### concat

- (void) concat;
Availability: OpenStep
Concatenates the receiver's matrix with the one in the current graphics context.

### initWithTransform:

- (id) initWithTransform: (NSAffineTransform*)aTransform;
Availability: OpenStep
Initialize the receiever's instance with the instance represented by aTransform.

### invert

- (void) invert;
Availability: OpenStep
Calculates the inverse of the receiver's matrix and replaces the receiever's matrix with it.

### prependTransform:

- (void) prependTransform: (NSAffineTransform*)aTransform;
Availability: OpenStep
Prepends the transform matrix to the receiver. This is done by performing a matrix multiplication of the receiver with aTransform so that aTransform is the last transform applied to the user coordinate. The new matrix then replaces the receiver's matrix.

### rotateByDegrees:

- (void) rotateByDegrees: (float)angle;
Availability: OpenStep
Applies the rotation specified by angle in degrees. Points transformed with the transformation matrix of the receiver are rotated counter-clockwise by the number of degrees specified by angle.

### rotateByRadians:

- (void) rotateByRadians: (float)angleRad;
Availability: OpenStep
Applies the rotation specified by angle in radians. Points transformed with the transformation matrix of the receiver are rotated counter-clockwise by the number of radians specified by angle.

### scaleBy:

- (void) scaleBy: (float)scale;
Availability: OpenStep
Scales the transformation matrix of the reciever by the factor specified by scale.

### scaleXBy: yBy:

- (void) scaleXBy: (float)scaleX yBy: (float)scaleY;
Availability: OpenStep
Scales the X axis of the receiver's transformation matrix by scaleX and the Y axis of the transformation matrix by scaleY.

### set

- (void) set;
Availability: OpenStep
Get the currently active graphics context's transformation matrix and set it into the receiver.

### setTransformStruct:

- (void) setTransformStruct: (NSAffineTransformStruct)val;
Availability: OpenStep

Sets the structure which represents the matrix of the reciever. The struct is of the form:

{m11, m12, m21, m22, tX, tY}

### transformBezierPath:

- (NSBezierPath*) transformBezierPath: (NSBezierPath*)aPath;
Availability: OpenStep

Applies the receiver's transformation matrix to each point in the bezier path, then returns the result. The original bezier path is not modified.

### transformPoint:

- (NSPoint) transformPoint: (NSPoint)aPoint;
Availability: OpenStep
Transforms a single point based on the transformation matrix. Returns the resulting point.

### transformSize:

- (NSSize) transformSize: (NSSize)aSize;
Availability: OpenStep
Transforms the NSSize represented by aSize using the reciever's transformation matrix. Returns the resulting NSSize.

### transformStruct

- (NSAffineTransformStruct) transformStruct;
Availability: OpenStep

Returns the `NSAffineTransformStruct` structure which represents the matrix of the reciever. The struct is of the form:

{m11, m12, m21, m22, tX, tY}

### translateXBy: yBy:

- (void) translateXBy: (float)tranX yBy: (float)tranY;
Availability: OpenStep
Applies the translation specified by tranX and tranY to the receiver's matrix. Points transformed by the reciever's matrix after this operation will be shifted in position based on the specified translation.

## Instance Variables for NSAffineTransform Class

### matrix

@public NSAffineTransformStruct matrix;
Description forthcoming.

# Software documentation for the NSAffineTransform(GNUstep) category

## NSAffineTransform(GNUstep)

> Declared in:
>   AppKit/NSAffineTransform.h

Availability: Gui 0.0.0
Description forthcoming.
Method summary

- -boundingRectFor:result:
- -concatenateWith:
- -concatenateWithMatrix:
- -deltaPointInMatrixSpace:
- -getMatrix:
- -inverse
- -isRotated
- -makeIdentityMatrix
- -pointInMatrixSpace:
- -rectInMatrixSpace:
- -rotationAngle
- -scaleTo::
- -setFrameOrigin:
- -setFrameRotation:
- -setMatrix:
- -sizeInMatrixSpace:
- -takeMatrixFromTransform:
- -translateToPoint:

### boundingRectFor: result:

- (void) boundingRectFor: (NSRect)rect result: (NSRect*)newRect;
Availability: Gui 0.0.0
Description forthcoming.

### concatenateWith:

- (void) concatenateWith: (NSAffineTransform*)anotherMatrix;
Availability: Gui 0.0.0
Description forthcoming.

### concatenateWithMatrix:

- (void) concatenateWithMatrix: (const float[6])anotherMatrix;
Availability: Gui 0.0.0
Description forthcoming.

### deltaPointInMatrixSpace:

- (NSPoint) deltaPointInMatrixSpace: (NSPoint)point;
Availability: Gui 0.0.0
Description forthcoming.

### getMatrix:

- (void) getMatrix: (float[6])replace;
Availability: Gui 0.0.0
Description forthcoming.

### inverse

- (void) inverse;
Availability: Gui 0.0.0
Description forthcoming.

### isRotated

- (BOOL) isRotated;
Availability: Gui 0.0.0
Description forthcoming.

### makeIdentityMatrix

- (void) makeIdentityMatrix;
Availability: Gui 0.0.0
Description forthcoming.

### pointInMatrixSpace:

- (NSPoint) pointInMatrixSpace: (NSPoint)point;
Availability: Gui 0.0.0
Description forthcoming.

### rectInMatrixSpace:

- (NSRect) rectInMatrixSpace: (NSRect)rect;
Availability: Gui 0.0.0
Description forthcoming.

### rotationAngle

- (float) rotationAngle;
Availability: Gui 0.0.0
Description forthcoming.

### scaleTo: :

- (void) scaleTo: (float)sx : (float)sy;
Availability: Gui 0.0.0
Description forthcoming.

### setFrameOrigin:

- (void) setFrameOrigin: (NSPoint)point;
Availability: Gui 0.0.0
Description forthcoming.

### setFrameRotation:

- (void) setFrameRotation: (float)angle;
Availability: Gui 0.0.0
Description forthcoming.

### setMatrix:

- (void) setMatrix: (const float[6])replace;
Availability: Gui 0.0.0
Description forthcoming.

### sizeInMatrixSpace:

- (NSSize) sizeInMatrixSpace: (NSSize)size;
Availability: Gui 0.0.0
Description forthcoming.

### takeMatrixFromTransform:

- (void) takeMatrixFromTransform: (NSAffineTransform*)aTransform;
Availability: Gui 0.0.0
Description forthcoming.

### translateToPoint:

- (void) translateToPoint: (NSPoint)point;
Availability: Gui 0.0.0
Description forthcoming.

Up