Glade Reference


transform64

The transform64 class contains functions to transform coordinates in subcells placed with offset, rotation and magnification.

It differs from the transform class in that internally it uses float64_t precision for the matrix elements, allowing any angle rotation and non-integer scaling. Note that all coordinates after transform are converted to integer database units; no grid snapping is performed.

All of this code is based on the fact that a point with coordinates x, y can be transformed by a transformation matrix T by:

[x', y', 1] = [x, y, 1]T

The transformation matrix for an offset (a,b) with no rotation or magnification can be described as:

 
          T = [ 1  0  0 ]
              [ 0  1  0 ]
              [ a  b  1 ]
      

Rotations are e.g.

         T90 = [ 0  1  0 ]
               [ -1 0  0 ]
               [ 0  0  1 ]
      

transform64 transform64::transform64(float64_t angle, Point &p, float scale)

Construct a transform with orientation angle, origin p and magnification scale . The orientation is specified in degrees.

 

transform64 transform64::transform64(float64_t angle, Point &p)

transform64::transform64(float64_t angle, int32_t x, int32_t y)

Construct a transform with orientation angle, origin p or x/y.The orientation is specified in degrees.

 

transform64 transform64::transform64(float64_t angle, int32_t x, int32_t y, float scale)

Construct a transform with orientation angle, origin p and magnification scale. The orientation is specified in degrees.

 

transform64 transform64::transform64(float64_t angle)

Construct a transform with orientation angle.

 

transform64 transform64::transform64()

Construct a transform with orientation R0.

 

transform64 transform64::invert()

Invert a transformation matrix

 

transform64::inverseTransformRect(Rect &box)

Transform a Rect by the inverse of the transformation matrix. Useful if you want to take a Rect and transform it into the coordinate space of an instance with a transform. For example if you want to find if any shapes in an instance overlap a search box for a top level cell, use the inverse transform of the search box on all the instance's shapes. This means doing just one transform of the search box rather than one transform for each shape in the instance.

 

<

transform64::inverseTransformPoint(Point &p)

trans.inverseTransformPoint(int32_t x, int32_t y)

Transform a Point by the inverse of the transformation matrix

 

transform64::transformRect(Rect &box)

Transform a Rect by the transformation matrix.

 

transform64::transformRect(Rect &box, Point &origin)

Transform a Rect by the transformation matrix about a point origin.

 

transform64::transformPoint(Point &p)

Transform a Point by the transformation matrix

 

transform64::transformPoint(Point &p, Point &origin)

Transform a point by the transformation matrix about a point origin.

 

transform64::transformPointList(Point *ptlist, int32_t size)

Transform an array of points of size size by the transformation matrix.

 

transform64::transformPointList(Point *ptlist, int32_t size, Point &origin)

Transform an array of points of size size by the transformation matrix about a point origin.

 

transform64::setOrigin(Point &p)

transform64::setOrigin(int32_t x, int32_t y)

Set the transformation origin.

 

Point transform64::getOrigin()

Get the transformation origin.

 

transform64::setMag(float scale)

Set the transformation matrix scale.

 

transform64::setOrient(float64_t angle)

Set the transformation angle. Any existing scale will be reset to 1.0

 

bool transform64::isXYSwapped()

Returns true if the transformation is such that the objects XY coordinates would be swapped, e,g. if the object is R90.

 

 

Contents|Index

Copyright © Peardrop Design 2024.