Class DCplxTrans (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. A complex transformation provides a superset of the simple transformation. In many applications, a complex transformation computes floating-point coordinates to minimize rounding effects. This version can transform floating-point coordinate objects.
Method Overview
[const] bool !=( DCplxTrans )Description: Inequality test
[const] DCplxTrans *( DCplxTrans t )Description: Multiplication (concatenation) of transformations The * operator returns self*t ("t is applied before this transformation").
[const] bool <( DCplxTrans )Description: A sorting criterion
[const] bool ==( DCplxTrans )Description: Equality test
[const] double angleDescription: 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.
angle=( double a )Description: Write accessor for the angle
assign( DCplxTrans 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] double ctrans( double 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.
destroyDescription: 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 destroyedDescription: 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 DPoint dispDescription: Accessor to the point
disp=( DPoint u )Description: Write accessor to the point
[const] DCplxTrans dupDescription: Creates a copy of self.
[static] DCplxTrans from_itrans( CplxTrans int_trans )Description: Conversion constructor from an integer coordinate transformation
DCplxTrans invertDescription: In-place inversion Inverts the transformation and replaces this transformation by the inverted one.
[const] DCplxTrans invertedDescription: Inversion 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 m0Description: Angle/mirror code for the "mirrored at the x-axis" transformation
[static] int m135Description: Angle/mirror code for the "mirrored at the 135 degree axis" transformation
[static] int m45Description: Angle/mirror code for the "mirrored at the 45 degree axis" transformation
[static] int m90Description: Angle/mirror code for the "mirrored at the y (90 degree) axis" transformation
[const] double magDescription: Read accessor to the magnification
mag=( double m )Description: Write accessor to the 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.
[static] DCplxTrans new( DTrans t, double m )
|
f: | The rotation/mirror code (r0 .. m135 constants) |
Description: Constructor from a magnification
Creates a magnifying transformation without displacement and rotation given the magnification m.
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 |
Description: Angle/mirror code for the "unrotated" transformation
Description: Angle/mirror code for the "rotated by 180 degree counterclockwise" transformation
Description: Angle/mirror code for the "rotated by 270 degree counterclockwise" transformation
Description: Angle/mirror code for the "rotated by 90 degree counterclockwise" transformation
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.
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.
Description: String conversion
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 |