Notation used in Ruby API documentation

**Module**: db

**Description**: A complex transformation

- Public constructors
- Public methods
- Public static methods and constants
- Deprecated methods (protected, public, static, non-static and constructors)
- Detailed description

A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitrary angle and a displacement. This is also the order, the operations are applied. This version can transform floating point coordinate objects into integer coordinate objects, which may involve rounding and can be inexact.

Complex transformations are extensions of the simple transformation classes (Trans in that case) and behave similar.

Transformations can be used to transform points or other objects. Transformations can be combined with the '*' operator to form the transformation which is equivalent to applying the second and then the first. Here is some code:

# Create a transformation that applies a magnification of 1.5, a rotation by 90 degree # and displacement of 10 in x and 20 units in y direction: t = RBA::VCplxTrans::new(1.5, 90, false, 10, 20) t.to_s # r90 *1.5 10,20 # compute the inverse: t.inverted.to_s # r270 *0.666666667 -13,7 # Combine with another displacement (applied after that): (RBA::VCplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25 # Transform a point: t.trans(RBA::DPoint::new(100, 200)).to_s # -290,170

The VCplxTrans type is the inverse transformation of the CplxTrans transformation and vice versa.Transformations of VCplxTrans type can be concatenated (operator *) with either itself or with transformations of compatible input or output type. This means, the operator VCplxTrans * CplxTrans is allowed (output types of CplxTrans and input of VCplxTrans are identical) while VCplxTrans * ICplxTrans is not.

This class has been introduced in version 0.25.

See The Database API for more details about the database objects.

new VCplxTrans ptr | new | (const DCplxTrans trans) | Creates a floating-point coordinate transformation from another coordinate flavour |

new VCplxTrans ptr | new | (const CplxTrans trans) | Creates a floating-point coordinate transformation from another coordinate flavour |

new VCplxTrans ptr | new | (const ICplxTrans trans) | Creates a floating-point coordinate transformation from another coordinate flavour |

new VCplxTrans ptr | new | Creates a unit transformation | |

new VCplxTrans ptr | new | (const VCplxTrans c, double m = 1, const Vector u = 0,0) | Creates a transformation from another transformation plus a magnification and displacement |

new VCplxTrans ptr | new | (const VCplxTrans c, double m, double x, double y) | Creates a transformation from another transformation plus a magnification and displacement |

new VCplxTrans ptr | new | (int x, int y) | Creates a transformation from a x and y displacement |

new VCplxTrans ptr | new | (double m) | Creates a transformation from a magnification |

new VCplxTrans ptr | new | (const DTrans t, double m) | Creates a transformation from a simple transformation and a magnification |

new VCplxTrans ptr | new | (const DTrans t) | Creates a transformation from a simple transformation alone |

new VCplxTrans ptr | new | (const Vector u) | Creates a transformation from a displacement |

new VCplxTrans ptr | new | (double mag, double rot, bool mirrx, const Vector u) | Creates a transformation using magnification, angle, mirror flag and displacement |

new VCplxTrans ptr | new | (double mag, double rot, bool mirrx, int x, int y) | Creates a transformation using magnification, angle, mirror flag and displacement |

[const] | bool | != | (const VCplxTrans other) | Tests for inequality |

[const] | VCplxTrans | * | (const DCplxTrans t) | Multiplication (concatenation) of transformations |

[const] | ICplxTrans | * | (const CplxTrans t) | Multiplication (concatenation) of transformations |

[const] | Point | * | (const DPoint p) | Transforms a point |

[const] | Vector | * | (const DVector p) | Transforms a vector |

[const] | Box | * | (const DBox box) | Transforms a box |

[const] | Edge | * | (const DEdge edge) | Transforms an edge |

[const] | Polygon | * | (const DPolygon polygon) | Transforms a polygon |

[const] | Path | * | (const DPath path) | Transforms a path |

[const] | Text | * | (const DText text) | Transforms a text |

[const] | VCplxTrans | * | (const VCplxTrans t) | Returns the concatenated transformation |

[const] | bool | < | (const VCplxTrans other) | Provides a 'less' criterion for sorting |

[const] | bool | == | (const VCplxTrans other) | Tests for equality |

void | _create | Ensures the C++ object is created | ||

void | _destroy | Explicitly destroys the object | ||

[const] | bool | _destroyed? | Returns a value indicating whether the object was already destroyed | |

[const] | bool | _is_const_object? | Returns a value indicating whether the reference is a const reference | |

void | _manage | Marks the object as managed by the script side. | ||

void | _unmanage | Marks the object as no longer owned by the script side. | ||

[const] | double | angle | Gets the angle | |

void | angle= | (double a) | Sets the angle | |

void | assign | (const VCplxTrans other) | Assigns another object to self | |

[const] | unsigned int | ctrans | (double d) | Transforms a distance |

[const] | Vector | disp | Gets the displacement | |

void | disp= | (const Vector u) | Sets the displacement | |

[const] | new VCplxTrans ptr | dup | Creates a copy of self | |

[const] | unsigned long | hash | Computes a hash value | |

VCplxTrans | invert | Inverts the transformation (in place) | ||

[const] | CplxTrans | inverted | Returns the inverted transformation | |

[const] | bool | is_complex? | Returns true if the transformation is a complex one | |

[const] | bool | is_mag? | Tests, if the transformation is a magnifying one | |

[const] | bool | is_mirror? | Gets the mirror flag | |

[const] | bool | is_ortho? | Tests, if the transformation is an orthogonal transformation | |

[const] | bool | is_unity? | Tests, whether this is a unit transformation | |

[const] | double | mag | Gets the magnification | |

void | mag= | (double m) | Sets the magnification | |

void | mirror= | (bool m) | Sets the mirror flag | |

[const] | int | rot | Returns the respective simple transformation equivalent rotation code if possible | |

[const] | DTrans | s_trans | Extracts the simple transformation part | |

[const] | DCplxTrans | to_itrans | (double dbu = 1) | Converts the transformation to another transformation with floating-point output coordinates |

[const] | string | to_s | String conversion | |

[const] | ICplxTrans | to_trans | Converts the transformation to another transformation with integer input coordinates | |

[const] | CplxTrans | to_vtrans | (double dbu = 1) | Converts the transformation to another transformation with integer input and floating-point output coordinates |

[const] | Point | trans | (const DPoint p) | Transforms a point |

[const] | Vector | trans | (const DVector p) | Transforms a vector |

[const] | Box | trans | (const DBox box) | Transforms a box |

[const] | Edge | trans | (const DEdge edge) | Transforms an edge |

[const] | Polygon | trans | (const DPolygon polygon) | Transforms a polygon |

[const] | Path | trans | (const DPath path) | Transforms a path |

[const] | Text | trans | (const DText text) | Transforms a text |

VCplxTrans | M0 | A constant giving "mirrored at the x-axis" transformation | ||

VCplxTrans | M135 | A constant giving "mirrored at the 135 degree axis" transformation | ||

VCplxTrans | M45 | A constant giving "mirrored at the 45 degree axis" transformation | ||

VCplxTrans | M90 | A constant giving "mirrored at the y (90 degree) axis" transformation | ||

VCplxTrans | R0 | A constant giving "unrotated" (unit) transformation | ||

VCplxTrans | R180 | A constant giving "rotated by 180 degree counterclockwise" transformation | ||

VCplxTrans | R270 | A constant giving "rotated by 270 degree counterclockwise" transformation | ||

VCplxTrans | R90 | A constant giving "rotated by 90 degree counterclockwise" transformation | ||

new VCplxTrans ptr | from_s | (string s) | Creates an object from a string |

void | create | Use of this method is deprecated. Use _create instead | ||

void | destroy | Use of this method is deprecated. Use _destroy instead | ||

[const] | bool | destroyed? | Use of this method is deprecated. Use _destroyed? instead | |

[const] | bool | is_const_object? | Use of this method is deprecated. Use _is_const_object? instead |

## != |
| |||||||||

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

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

The "trans" method or the * operator transforms the given point. q = t(p) The * operator has been introduced in version 0.25. | ||||||||||

The "trans" method or the * operator transforms the given vector. w = t(v) Vector transformation has been introduced in version 0.25. | ||||||||||

't*box' or 't.trans(box)' is equivalent to box.transformed(t). This convenience method has been introduced in version 0.25. | ||||||||||

't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). This convenience method has been introduced in version 0.25. | ||||||||||

't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). This convenience method has been introduced in version 0.25. | ||||||||||

't*path' or 't.trans(path)' is equivalent to path.transformed(t). This convenience method has been introduced in version 0.25. | ||||||||||

't*text' or 't.trans(text)' is equivalent to text.transformed(t). This convenience method has been introduced in version 0.25. | ||||||||||

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

## < |
This method is provided to implement a sorting order. The definition of 'less' is opaque and might change in future versions. | |||||||||

## == |
| |||||||||

## M0 |
The previous integer constant has been turned into a transformation in version 0.25. | |||||||||

## M135 |
The previous integer constant has been turned into a transformation in version 0.25. | |||||||||

## M45 |
The previous integer constant has been turned into a transformation in version 0.25. | |||||||||

## M90 |
The previous integer constant has been turned into a transformation in version 0.25. | |||||||||

## R0 |
The previous integer constant has been turned into a transformation in version 0.25. | |||||||||

## R180 |
The previous integer constant has been turned into a transformation in version 0.25. | |||||||||

## R270 |
The previous integer constant has been turned into a transformation in version 0.25. | |||||||||

## R90 |
The previous integer constant has been turned into a transformation in version 0.25. | |||||||||

## _create |
Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. | |||||||||

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

## _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. | |||||||||

## _is_const_object? |
This method returns true, if self is a const reference. In that case, only const methods may be called on self. | |||||||||

## _manage |
After calling this method on an object, the script side will be responsible for the management of the object. This method may be called if an object is returned from a C++ function and the object is known not to be owned by any C++ instance. If necessary, the script side may delete the object if the script's reference is no longer required. Usually it's not required to call this method. It has been introduced in version 0.24. | |||||||||

## _unmanage |
Calling this method will make this object no longer owned by the script's memory management. Instead, the object must be managed in some other way. Usually this method may be called if it is known that some C++ object holds and manages this object. Technically speaking, this method will turn the script's reference into a weak reference. After the script engine decides to delete the reference, the object itself will still exist. If the object is not managed otherwise, memory leaks will occur. Usually it's not required to call this method. It has been introduced in version 0.24. | |||||||||

## angle |
Note that the simple transformation returns the angle in units of 90 degree. Hence for a simple trans (i.e. Trans), a rotation angle of 180 degree delivers a value of 2 for the angle attribute. The complex transformation, supporting any rotation angle returns the angle in degree.
| |||||||||

## angle= |
See angle for a description of that attribute.
| |||||||||

## assign |
| |||||||||

## create |
Use of this method is deprecated. Use _create instead Use this method to ensure the C++ object is created, for example to ensure that resources are allocated. Usually C++ objects are created on demand and not necessarily when the script object is created. | |||||||||

## ctrans |
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. | |||||||||

## destroy |
Use of this method is deprecated. Use _destroy instead Explicitly destroys the object on C++ side if it was owned by the script interpreter. Subsequent access to this object will throw an exception. If the object is not owned by the script, this method will do nothing. | |||||||||

## destroyed? |
Use of this method is deprecated. Use _destroyed? instead 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. | |||||||||

## disp |
| |||||||||

## disp= |
| |||||||||

## dup |
| |||||||||

## from_s |
Creates the object from a string representation (as returned by to_s) This method has been added in version 0.23. | |||||||||

## hash |
Returns a hash value for the given transformation. This method enables transformations as hash keys. This method has been introduced in version 0.25.
| |||||||||

## invert |
Inverts the transformation and replaces this transformation by it's inverted one. | |||||||||

## inverted |
Returns the inverted transformation. This method does not modify the transformation. | |||||||||

## is_complex? |
If this predicate is false, the transformation can safely be converted to a simple transformation. Otherwise, this conversion will be lossy. The predicate value is equivalent to 'is_mag || !is_ortho'. This method has been introduced in version 0.27.5. | |||||||||

## is_const_object? |
Use of this method is deprecated. Use _is_const_object? instead This method returns true, if self is a const reference. In that case, only const methods may be called on self. | |||||||||

## is_mag? |
This is the recommended test for checking if the transformation represents a magnification. | |||||||||

## is_mirror? |
If this property is true, the transformation is composed of a mirroring at the x-axis followed by a rotation by the angle given by the angle property. | |||||||||

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

## is_unity? |
| |||||||||

## mag |
| |||||||||

## mag= |
| |||||||||

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

## new |
| |||||||||

| ||||||||||

| ||||||||||

| ||||||||||

Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. This variant has been introduced in version 0.25.
| ||||||||||

Creates a new transformation from a existing transformation. This constructor is provided for creating duplicates and backward compatibility since the constants are transformations now. It will copy the original transformation and add the given displacement. This variant has been introduced in version 0.25.
| ||||||||||

This constructor will create a transformation with the specified displacement but no rotation.
| ||||||||||

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

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

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

Creates a transformation with a displacement only. This method has been added in version 0.25.
| ||||||||||

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

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

## rot |
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. | |||||||||

## s_trans |
The simple transformation part does not reflect magnification or arbitrary angles. Rotation angles are rounded down to multiples of 90 degree. Magnification is fixed to 1.0. | |||||||||

## to_itrans |
The database unit can be specified to translate the integer coordinate displacement in database units to a floating-point displacement in micron units. The displacement's' coordinates will be multiplied with the database unit. This method has been introduced in version 0.25. | |||||||||

## to_s |
| |||||||||

## to_trans |
This method has been introduced in version 0.25. | |||||||||

## to_vtrans |
The database unit can be specified to translate the integer coordinate displacement in database units to an floating-point displacement in micron units. The displacement's' coordinates will be multiplied with the database unit. This method has been introduced in version 0.25. | |||||||||

## trans |
The "trans" method or the * operator transforms the given point. q = t(p) The * operator has been introduced in version 0.25. | |||||||||

The "trans" method or the * operator transforms the given vector. w = t(v) Vector transformation has been introduced in version 0.25. | ||||||||||

't*box' or 't.trans(box)' is equivalent to box.transformed(t). This convenience method has been introduced in version 0.25. | ||||||||||

't*edge' or 't.trans(edge)' is equivalent to edge.transformed(t). This convenience method has been introduced in version 0.25. | ||||||||||

't*polygon' or 't.trans(polygon)' is equivalent to polygon.transformed(t). This convenience method has been introduced in version 0.25. | ||||||||||

't*path' or 't.trans(path)' is equivalent to path.transformed(t). This convenience method has been introduced in version 0.25. | ||||||||||

't*text' or 't.trans(text)' is equivalent to text.transformed(t). This convenience method has been introduced in version 0.25. |