API reference - Class ICplxTransNotation used in Ruby API documentation Description: A complex transformation
A complex transformation provides magnification, mirroring at the x-axis, rotation by an arbitary angle and a displacement. This is also the order, the operations are applied. This version can transform integer-coordinate objects into the same, 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 magnication of 1.5, a rotation by 90 degree # and displacement of 10 in x and 20 units in y direction: t = RBA::ICplxTrans::new(1.5, 90, false, 10.0, 20.0) 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::ICplxTrans::new(5, 5) * t).to_s # r90 *1.5 15,25 # Transform a point: t.trans(RBA::Point::new(100, 200)).to_s # -290,170 This class has been introduced in version 0.18. See The Database API for more details about the database objects. Public constructors
Public methods
Public static methods and constants
Deprecated methods (protected, public, static, non-static and constructors)
Detailed description[const] bool !=(const ICplxTrans other)Description: Inequality test [const] ICplxTrans *(const ICplxTrans t)Description: Multiplication (concatenation) of transformations
The * operator returns self*t ("t is applied before this transformation"). [const] bool <(const ICplxTrans other)Description: A sorting criterion This method is provided to implement a sorting order. The definition of 'less' is opaque and might change in future versions. [const] bool ==(const ICplxTrans other)Description: Equality test [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 [static] int R0Description: Angle/mirror code for the "unrotated" transformation [static] int R180Description: Angle/mirror code for the "rotated by 180 degree counterclockwise" transformation [static] int R270Description: Angle/mirror code for the "rotated by 270 degree counterclockwise" transformation [static] int R90Description: Angle/mirror code for the "rotated by 90 degree counterclockwise" transformation void _createDescription: Ensures the C++ object is created 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. void _destroyDescription: Explicitly destroys the object 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. [const] bool _destroyed?Description: Returns a value indicating whether the object was already 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] bool _is_const_object?Description: Returns a value indicating whether the reference is a const reference This method returns true, if self is a const reference. In that case, only const methods may be called on self. void _manageDescription: Marks the object as managed by the script side. 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. void _unmanageDescription: Marks the object as no longer owned by the script side. 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. [const] double angleDescription: Gets the 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. Python specific notes:The object exposes a readable attribute 'angle'. This is the getter. void angle=(double a)Description: Sets the angle
See angle for a description of that attribute. Python specific notes:The object exposes a writable attribute 'angle'. This is the setter. void assign(const ICplxTrans other)Description: Assigns another object to self void createDescription: Ensures the C++ object is created Use of this method is deprecated. Use _create instead [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. void destroyDescription: Explicitly destroys the object Use of this method is deprecated. Use _destroy instead [const] bool destroyed?Description: Returns a value indicating whether the object was already destroyed Use of this method is deprecated. Use _destroyed? instead [const] Point dispDescription: Gets the displacement Python specific notes:The object exposes a readable attribute 'disp'. This is the getter. void disp=(const Point u)Description: Sets the displacement
Python specific notes:The object exposes a writable attribute 'disp'. This is the setter. [const] new ICplxTrans ptr dupDescription: Creates a copy of self [static] ICplxTrans from_dtrans(const DCplxTrans dbl_trans)Description: Conversion constructor from a floating-point transformation [static] new ICplxTrans ptr from_s(string s)Description: Creates an object from a string Creates the object from a string representation (as returned by to_s) This method has been added in version 0.23. [static] ICplxTrans from_trans(const CplxTrans trans)Description: Conversion constructor from an exact complex transformation ICplxTrans invertDescription: In-place inversion
Inverts the transformation and replaces this transformation by the inverted one. [const] ICplxTrans invertedDescription: Inversion
Returns the inverted transformation [const] bool is_const_object?Description: Returns a value indicating whether the reference is a const reference Use of this method is deprecated. Use _is_const_object? instead [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: Gets the mirror flag 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. [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 Use of this method is deprecated. Use M0 instead [static] int m135Description: Angle/mirror code for the "mirrored at the 135 degree axis" transformation Use of this method is deprecated. Use M135 instead [static] int m45Description: Angle/mirror code for the "mirrored at the 45 degree axis" transformation Use of this method is deprecated. Use M45 instead [static] int m90Description: Angle/mirror code for the "mirrored at the y (90 degree) axis" transformation Use of this method is deprecated. Use M90 instead [const] double magDescription: Gets the magnification Python specific notes:The object exposes a readable attribute 'mag'. This is the getter. void mag=(double m)Description: Sets the magnification
Python specific notes:The object exposes a writable attribute 'mag'. This is the setter. void mirror=(bool m)Description: Sets the mirror flag
"mirroring" describes a reflection at the x-axis which is included in the transformation prior to rotation. Python specific notes:The object exposes a writable attribute 'mirror'. This is the setter. [static] new ICplxTrans ptr newDescription: Creates a unit transformation Python specific notes:This method is the default initializer of the object [static] new ICplxTrans ptr new(int f)Description: Conversion constructor from a fixpoint transformation
This constructor will create a transformation with a fixpoint transformation but no displacement. Python specific notes:This method is the default initializer of the object [static] new ICplxTrans ptr new(int x,int y)Description: Constructor from a x and y displacement
This constructor will create a transformation with the specified displacement but no rotation. Python specific notes:This method is the default initializer of the object [static] new ICplxTrans ptr new(double m)Description: Constructor from a magnification Creates a magnifying transformation without displacement and rotation given the magnification m. Python specific notes:This method is the default initializer of the object [static] new ICplxTrans ptr new(const Trans t,double m)Description: Constructor from a simple transformation and a magnification Creates a magnifying transformation from a simple transformation and a magnification. Python specific notes:This method is the default initializer of the object [static] new ICplxTrans ptr new(const Trans t)Description: Constructor from a simple transformation alone Creates a magnifying transformation from a simple transformation and a magnification of 1.0. Python specific notes:This method is the default initializer of the object [static] new ICplxTrans ptr new(double mag,double rot,bool mirrx,const 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. Python specific notes:This method is the default initializer of the object [static] new ICplxTrans ptr new(double mag,double rot,bool mirrx,int x,int y)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. Python specific notes:This method is the default initializer of the object [static] new ICplxTrans ptr new_f(int f)Description: Conversion constructor from a fixpoint transformation
Use of this method is deprecated. Use new instead [static] new ICplxTrans ptr new_m(double m)Description: Constructor from a magnification Use of this method is deprecated. Use new instead [static] new ICplxTrans ptr new_mrmu(double mag,double rot,bool mirrx,const Point u)Description: The standard constructor using magnification, angle, mirror flag and displacement
Use of this method is deprecated. Use new instead [static] new ICplxTrans ptr new_mrmxy(double mag,double rot,bool mirrx,int x,int y)Description: The standard constructor using magnification, angle, mirror flag and displacement
Use of this method is deprecated. Use new instead [static] new ICplxTrans ptr new_t(const Trans t)Description: Constructor from a simple transformation alone Use of this method is deprecated. Use new instead [static] new ICplxTrans ptr new_tm(const Trans t,double m)Description: Constructor from a simple transformation and a magnification Use of this method is deprecated. Use new instead [static] new ICplxTrans ptr new_xy(int x,int y)Description: Constructor from a x and y displacement
Use of this method is deprecated. Use new instead [static] int r0Description: Angle/mirror code for the "unrotated" transformation Use of this method is deprecated. Use R0 instead [static] int r180Description: Angle/mirror code for the "rotated by 180 degree counterclockwise" transformation Use of this method is deprecated. Use R180 instead [static] int r270Description: Angle/mirror code for the "rotated by 270 degree counterclockwise" transformation Use of this method is deprecated. Use R270 instead [static] int r90Description: Angle/mirror code for the "rotated by 90 degree counterclockwise" transformation Use of this method is deprecated. Use R90 instead [const] int rotDescription: Returns the respective simple transformation equivalent 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. [const] Trans s_transDescription: Extract the simple transformation part 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. [const] string to_sDescription: String conversion Python specific notes:This method is also available as 'str(object)' [const] Point trans(const Point p)Description: The transformation of a point
The "trans" method transforms the given point. q = t(p) |