Creates a
Transform t
locally and callst.rotate(
x,
y,
z)
.t
is then applied to all of thePoints
onpoints
. The return value ist
.
Creates a
Transform t
locally and callst.scale(
x,
y,
z)
.t
is then applied to all of thePoints
onpoints
. The return value ist
.The
Points
on thePath
are scaled according to the arguments:Point pt[8]; pt[0] = (-1, -1); for (int i = 1; i < 8; ++i) { pt[i] = pt[0]; pt[i].rotate(0, 0, i * 45); } Path p("--", true, &pt[0], &pt[1], &pt[2], &pt[3], &pt[4], &pt[5], &pt[6], &pt[7], 0); p.draw(); p.scale(2, 2); p.draw();
![]()
Fig. 115.
Creates a
Transform t
locally and callst.shear(
xy,
xz,
yx,
yz,
zx,
zy)
.t
is then applied to all of thePoints
onpoints
. The return value ist
.Point p0; Point p1(1); Point p2(1, 1); Point p3(0, 1); Path q("--", true, &p0, &p1, &p2, &p3, 0); q.rotate(0, 45); q.shift(1); q.filldraw(black, light_gray); q.shear(1.5, 2, 2.5, 3, 3.5, 5); q.filldraw(black, light_gray);
![]()
Fig. 116.
Creates a
Transform t
locally and callst.shift(
x,
y,
z)
.t
is then applied to all of thePoints
onpoints
. The return value ist
.Shifts each of the
Points
on thePath
according to the arguments.default_focus.set(5, 10, -10, 0, 10, 10, 10); Point pt[6]; pt[0].set(-2, -2); pt[1].set(0, -3); pt[2].set(2, -2); pt[3].set(2, 2); pt[4].set(0, 3); pt[5].set(-2, 2); Path p("--", true, &pt[0], &pt[1], &pt[2], &pt[3], &pt[4], &pt[5], 0); p.draw(); p.shift(3, 3, 3); p.draw();
![]()
Fig. 117.
Creates a
Transform t
locally and callst.shift(
p)
.t
is then applied to all of thePoints
onpoints
. The return value ist
.This version of
shift()
uses the x, y, and z-coordinates of thePoint
p to shift thePath
.default_focus.set(5, 10, -10, 0, 10, 10, 10); Point pt[6]; pt[0].set(-2, -2); pt[1].set(0, -3); pt[2].set(2, -2); pt[3].set(2, 2); pt[4].set(0, 3); pt[5].set(-2, 2); Path p("--", true, &pt[0], &pt[1], &pt[2], &pt[3], &pt[4], &pt[5], 0); p.draw(); Point s(1, 1, 1); p.shift(s); p.draw();
![]()
Fig. 118.
Each of these functions calls the corresponding version of
Point::shift_times()
on all of thePoints
onpoints
. See Point Reference; Affine Transformations. The return value isvoid
, because there is no guarantee that all of thePoints
on aPath
will have identicaltransform
members (although it's likely).Please note that
shift_times()
will only have an effect on thePoints
on aPath
if it's called after a call toshift()
and before an operation is applied that causesPoint::apply_transform()
to be called.
Creates a
Transform t
locally and callst.rotate(
p0,
p1,
angle)
.t
is then applied to all of thePoints
onpoints
. The return value ist
.
If
p.is_linear()
returnstrue
, this function creates aTransform
t locally and calls t.rotate(
p,
angle)
.t
is then applied to all of thePoints
onpoints
. The return value ist
. Otherwise, it issues an error message and returnsINVALID_TRANSFORM
.