Laxkit  0.0.7.1
Public Member Functions | Protected Attributes
Laxkit::Affine Class Reference
Inheritance diagram for Laxkit::Affine:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 Affine (const double *m)
 If mm==NULL, set identity.
 Affine (const Affine &m)
 Affine (double xx, double xy, double yx, double yy, double tx, double ty)
Affineoperator= (Affine const &m)
Affineoperator*= (Affine const &m)
Affine operator* (Affine const m)
virtual void set (Affine a)
virtual void setIdentity ()
virtual bool isIdentity ()
virtual void setRotation (double angle)
virtual void setScale (double sx, double sy)
virtual void setBasis (flatpoint o, flatpoint x, flatpoint y)
virtual void setBasics (double x, double y, double sx, double sy, double angle, double shear)
virtual void getBasics (double *x, double *y, double *sx, double *sy, double *angle, double *shear)
virtual void Translate (flatvector d)
virtual void Rotate (double angle)
virtual void Rotate (double angle, flatpoint around_point)
virtual void RotatePointed (flatpoint anchor1, flatpoint anchor2, flatpoint newanchor2)
virtual void RotateScale (flatpoint anchor1, flatpoint anchor2, flatpoint newanchor2)
 Rotate and scale so that anchor1 stays fixed, but anchor2 is shifted to newanchor2.
virtual void Stretch (flatpoint anchor1, flatpoint anchor2, flatpoint newanchor2)
virtual void AnchorShear (flatpoint anchor1, flatpoint anchor2, flatpoint anchor3, flatpoint newanchor3)
 Transform so that anchor1 and 2 stay fixed, but anchor3 is shifted to newanchor3.
virtual void Scale (double s)
virtual void Scale (flatpoint o, double s)
 Scale around point o.
virtual void Scale (flatpoint o, double sx, double sy)
virtual void Scale (flatpoint anchor1, flatpoint anchor2, flatpoint newanchor2)
 Scale as if you move anchor2 to newanchor2, while anchor1 stays the same.
virtual void FlipH ()
virtual void FlipV ()
virtual void Flip (flatpoint f1, flatpoint f2)
 Flip across the axis of f1 to f2.
virtual void Multiply (Affine &m)
 this=this*m
virtual void PreMultiply (Affine &m)
 this=m*this
virtual Affine Inversion ()
 Return a new matrix that is the inverse of this, if possible.
virtual void Invert ()
 Make this the inverse of whatever it is.
virtual flatpoint transformPoint (flatpoint p)
virtual flatpoint transformPointInverse (flatpoint p)
virtual flatpoint transformVector (flatpoint p)
 Apply the transfrom, but ignore this's translation component.
virtual const double * m () const
virtual void m (const double *mm)
virtual void m (double xx, double xy, double yx, double yy, double tx, double ty)
virtual double m (int c)
virtual void m (int c, double v)
virtual void Unshear (int preserve_x, int normalize)
 Clear shearing and unequal scaling. Null vectors stay null vectors.
virtual void Normalize ()
 Make x and y both be unit vectors, but point in the same direction as before.
virtual flatpoint origin ()
virtual void origin (flatpoint o)
virtual flatpoint xaxis ()
virtual void xaxis (flatpoint x)
virtual flatpoint yaxis ()
virtual void yaxis (flatpoint y)

Protected Attributes

double _m [6]

Member Function Documentation

void Laxkit::Affine::AnchorShear ( flatpoint  anchor1,
flatpoint  anchor2,
flatpoint  anchor3,
flatpoint  newanchor3 
)
virtual

Transform so that anchor1 and 2 stay fixed, but anchor3 is shifted to newanchor3.

Points are in this->parent space.

References Laxkit::transform_copy(), Laxkit::transform_from_basis(), Laxkit::transform_invert(), and Laxkit::transform_mult().

void Laxkit::Affine::Rotate ( double  angle,
flatpoint  around_point 
)
virtual

This basically translates around_point to origin, rotates, then translates back.

References Laxkit::transform_copy(), and Laxkit::transform_mult().

void Laxkit::Affine::setRotation ( double  angle)
virtual

Does not affect origin. Only sets rotation of axes.

void Laxkit::Affine::Stretch ( flatpoint  anchor1,
flatpoint  anchor2,
flatpoint  newanchor2 
)
virtual

Scale and shear such that a random point off of (anchor2-anchor1) stays the same distance from the new vector (newanchor2-anchor1).

Basically, RotateScale() with the specified anchors. Then, AnchorShear() with anchor1,newanchor2 as stationary points

References norm(), flatvector::normalize(), and transpose().

void Laxkit::Affine::Unshear ( int  preserve_x,
int  normalize 
)
virtual

Clear shearing and unequal scaling. Null vectors stay null vectors.

Set the x and y axis to the same length, and at right angle to each other. If preserve_x==0, then preserve the x axis, else preserve y.

Calls xaxis(transpose(xaxis())) or yaxis(-transpose(yaxis())).

If normalize!=0, then make vectors be of unit length.

References norm(), and transpose().


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

Mon Feb 17 2014 11:53:00, Laxkit