A transformation including angle and scale among others used for placing components. More...
| strans( ) | |
| strans(strans trans ) | |
| strans(string transString ) | |
| void | clearMirror_x() |
| double | getAngle() |
| bool | getMirror_x() |
| double | getScale() |
| void | reset() |
| void | rotate(double angle) |
| void | scale(double value) |
| void | setMirror_x() |
| void | toggleMirror_x() |
A strans is the placement transform used on cell references, text, and schematic components: rotation in degrees, a scale factor, and an optional mirror about the x axis. After cell addCellref, getTrans and setTrans on element read and write that transform. sheet addPlacement takes the same type when dropping a component. You can construct identity, copy another strans, or parse a short string such as R180 or MR90 (R is rotation, M means mirror about x). rotate and scale accumulate on the current values; reset returns identity (no rotation, scale 1, no mirror). It is a value type: build it, then pass it into the element or placement.
Example:
cell *myCell = layout->drawing->findCell("noname");
if (myCell == NULL)
return 0;
point p;
p.set(100, 200);
element *e = layout->drawing->currentCell->addCellref(myCell, p);
strans trans;
trans.rotate(180);
e->setTrans(trans);
Creates an identity transformation (no rotation, scale 1, no mirror).
Creates a transformation with copied data from trans.
Creates a transformation from a string. Examples: MR90, R180, or R0. An empty string also creates a R0 transformation. R is the rotation in degrees; if M is present, the transform mirrors about the x axis.
Clears the mirror about the x axis.
Returns: the rotation angle of the transformation, in degrees.
Returns: true if the transformation includes mirroring about the x axis, otherwise false.
Returns: the scale factor of the transformation.
Resets the transformation to identity.
Adds angle degrees of rotation to the transformation.
Multiplies the current scale by value.
Sets the mirror about the x axis.
Toggles the mirror about the x axis.