Class ICplxTrans (version 0.18)

Description: A complex transformation

A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitary angle and a displacement. This version can transform integer-coordinate objects into the same, which may involve rounding and can be inexact.

This class has been introduced in version 0.18.

Class overview

Index

Method Overview

[static] ICplxTrans from_dtrans( DCplxTrans dbl_trans )Conversion constructor from a floating-point transformation
[static] ICplxTrans from_trans( CplxTrans trans )Conversion constructor from an exact complex transformation
[static] ICplxTrans newCreates a unit transformation
[static] ICplxTrans new( int f )Conversion constructor from a fixpoint transformation
[static] ICplxTrans new( double m )Constructor from a magnification
[static] ICplxTrans new( Trans t, double m )Constructor from a simple transformation and a magnification
[static] ICplxTrans new( Trans t )Constructor from a simple transformation alone
[static] ICplxTrans new( double mag, double rot, bool mirrx, Point u )The standard constructor using magnification, angle, mirror flag and displacement
[const] ICplxTrans invertedInversion
ICplxTrans invertIn-place inversion
[const] int ctrans( int d )The transformation of a distance
[const] Point trans( Point p )The transformation of a point
[const] ICplxTrans *( ICplxTrans t )Multiplication (concatenation) of transformations
[const] bool <( ICplxTrans )A sorting criterion
[const] bool ==( ICplxTrans )Equality test
[const] bool !=( ICplxTrans )Inequality test
[const] string to_sString conversion
[const] const ref Point dispAccessor to the point
disp=( Point u )Write accessor to the point
[const] int rotReturn the respective rotation code if possible
[const] bool is_mirror?Accessor to the mirror flag
mirror=( bool m )Write accessor to the mirror flag
[const] bool is_unity?Test, whether this is a unit transformation
[const] bool is_ortho?Test, if the transformation is an orthogonal transformation
[const] Trans s_transExtract the simple transformation part
[const] double angleRead accessor for the angle
angle=( double a )Write accessor for the angle
[const] double magRead accessor to the magnification
[const] bool is_mag?Test, if the transformation is a magnifying one
mag=( double m )Write accessor to the magnification
[static] int r0Angle/mirror code for the "unrotated" transformation
[static] int r90Angle/mirror code for the "rotated by 90 degree counterclockwise" transformation
[static] int r180Angle/mirror code for the "rotated by 180 degree counterclockwise" transformation
[static] int r270Angle/mirror code for the "rotated by 270 degree counterclockwise" transformation
[static] int m0Angle/mirror code for the "mirrored at the x-axis" transformation
[static] int m45Angle/mirror code for the "mirrored at the 45 degree axis" transformation
[static] int m90Angle/mirror code for the "mirrored at the y (90 degree) axis" transformation
[static] int m135Angle/mirror code for the "mirrored at the 135 degree axis" transformation
assign( ICplxTrans other )Assign the contents of another object to self
[const] ICplxTrans dupCreates a copy of self.
destroyExplicitly destroy the object
[const] bool destroyedTell, if the object was destroyed

[const] bool !=( ICplxTrans )

Description: Inequality test

[const] ICplxTrans *( ICplxTrans t )

Description: Multiplication (concatenation) of transformations

The * operator returns self*t ("t is applied before this transformation").

t:The transformation to apply before
returns:The modified transformation

[const] bool <( ICplxTrans )

Description: A sorting criterion

[const] bool ==( ICplxTrans )

Description: Equality test

[const] double angle

Description: Read accessor for the angle

To check, if the transformation represents a rotation by a angle that is a multiple of 90 degree, use this predicate.

returns:The rotation angle this transformation provides in degree units (0..360 deg).

angle=( double a )

Description: Write accessor for the angle

a:The new angle

assign( ICplxTrans other )

Description: Assign the contents of another object to self

This method assigns the contents of another object to self. This is a deep copy that does not only copy the reference but the actual content.

[const] int ctrans( int d )

Description: The transformation of a distance

The "ctrans" method transforms the given distance. e = t(d). For the simple transformations, there is no magnification and no modification of the distance therefore.

d:The distance to transform
returns:The transformed distance

destroy

Description: Explicitly destroy the object

Explicitly destroy the object on C++ side if it was owned by the Ruby interpreter. Subsequent access to this object will throw an exception. If the object is not owned by Ruby, this method will do nothing.

[const] bool destroyed

Description: Tell, if the object was destroyed

This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

[const] const ref Point disp

Description: Accessor to the point

disp=( Point u )

Description: Write accessor to the point

u:The new displacement

[const] ICplxTrans dup

Description: Creates a copy of self.

[static] ICplxTrans from_dtrans( DCplxTrans dbl_trans )

Description: Conversion constructor from a floating-point transformation

[static] ICplxTrans from_trans( CplxTrans trans )

Description: Conversion constructor from an exact complex transformation

ICplxTrans invert

Description: In-place inversion

Inverts the transformation and replaces this transformation by the inverted one.

returns:The inverted transformation

[const] ICplxTrans inverted

Description: Inversion

Returns the inverted transformation

returns:The inverted transformation

[const] bool is_mag?

Description: Test, if the transformation is a magnifying one

This is the recommended test for checking if the transformation represents a magnification.

[const] bool is_mirror?

Description: Accessor to the mirror flag

[const] bool is_ortho?

Description: Test, if the transformation is an orthogonal transformation

If the rotation is by a multiple of 90 degree, this method will return true.

[const] bool is_unity?

Description: Test, whether this is a unit transformation

[static] int m0

Description: Angle/mirror code for the "mirrored at the x-axis" transformation

[static] int m135

Description: Angle/mirror code for the "mirrored at the 135 degree axis" transformation

[static] int m45

Description: Angle/mirror code for the "mirrored at the 45 degree axis" transformation

[static] int m90

Description: Angle/mirror code for the "mirrored at the y (90 degree) axis" transformation

[const] double mag

Description: Read accessor to the magnification

mag=( double m )

Description: Write accessor to the magnification

m:The new magnification

mirror=( bool m )

Description: Write accessor to the mirror flag

"mirroring" describes a reflection at the x-axis which is included in the transformation prior to rotation.

m:The new mirror flag

[static] ICplxTrans new( double m )
synonym: [static] ICplxTrans new_m( double m )

Description: Constructor from a magnification

Creates a magnifying transformation without displacement and rotation given the magnification m.

[static] ICplxTrans new( Trans t, double m )
synonym: [static] ICplxTrans new_tm( Trans t, double m )

Description: Constructor from a simple transformation and a magnification

Creates a magnifying transformation from a simple transformation and a magnification.

[static] ICplxTrans new

Description: Creates a unit transformation

[static] ICplxTrans new( int f )
synonym: [static] ICplxTrans new_f( int f )

Description: Conversion constructor from a fixpoint transformation

This constructor will create a transformation with a fixpoint transformation but no displacement.

f:The rotation/mirror code (r0 .. m135 constants)

[static] ICplxTrans new( double mag, double rot, bool mirrx, Point u )
synonym: [static] ICplxTrans new_mrmu( double mag, double rot, bool mirrx, Point u )

Description: The standard constructor using magnification, angle, mirror flag and displacement

The sequence of operations is: magnification, mirroring at x axis, rotation, application of displacement.

mag:The magnification
rot:The rotation angle in units of degree
mirrx:True, if mirrored at x axis
u:The displacement

[static] ICplxTrans new( Trans t )
synonym: [static] ICplxTrans new_t( Trans t )

Description: Constructor from a simple transformation alone

Creates a magnifying transformation from a simple transformation and a magnification of 1.0.

[static] int r0

Description: Angle/mirror code for the "unrotated" transformation

[static] int r180

Description: Angle/mirror code for the "rotated by 180 degree counterclockwise" transformation

[static] int r270

Description: Angle/mirror code for the "rotated by 270 degree counterclockwise" transformation

[static] int r90

Description: Angle/mirror code for the "rotated by 90 degree counterclockwise" transformation

[const] int rot

Description: Return the respective rotation code if possible

If this transformation is orthogonal (is_ortho () == true), then this method will return the corresponding fixpoint transformation, not taking into account magnification and displacement. If the transformation is not orthogonal, the result reflects the quadrant the rotation goes into with the guarantee to reproduce the correct quadrant in the exact case.

[const] Trans s_trans

Description: Extract the simple transformation part

The simple transformation part does not reflect magnification not arbitrary angles. On the angle contribution up to a multiple of 90 degree is reflected.

[const] string to_s

Description: String conversion

[const] Point trans( Point p )

Description: The transformation of a point

The "trans" method transforms the given point. q = t(p)

p:The point to transform
returns:The transformed point