Creates a
Point
and initializes its x, y, and z-coordinates to 0.
CURR_Y
, [const real z = CURR_Z
]])Creates a
Point
and initializes its x, y, and z-coordinates to the values of the arguments x, y, and z. The arguments y and z are optional. If they are not specified, the values ofCURR_Y
andCURR_Z
are used. They are 0 by default, but can be changed by the user. This can be convenient, if all of thePoints
being drawn in a particular section of a program have the same z or y and z values.
CURR_Y
, [const real z = CURR_Z
]])Corresponds to the constructor above, but is used for resetting the coordinates of an existing
Point
.
Creates a
Point
and copies the values for its x, y, and z-coordinates from p.
Corresponds to the copy constructor above, but is used for resetting the coordinates of an existing
Point
. This function exists purely as a convenience; the operatoroperator=()
(see Point Reference; Operators) performs exactly the same function.
Pseudo-constructors for dynamic allocation of
Points
. They create aPoint
on the free store and allocate memory for it usingnew(Point)
. They return a pointer to the newPoint
.If p is a non-zero pointer or a reference, the new
Point
will be a copy of p. If the new object is not meant to be a copy of an existing one, ‘0’ must be passed tocreate_new<Point>()
as its argument. See Dynamic Allocation of Shapes, for more information.One use for
create_new<Point>
is in the constructors forclasses
of objects that can contain a variable number ofPoints
, such asPath
andPolygon
. Another use is in the drawing and filling functions, where objects are copied and the copies put onto aPicture
.Programmers who dynamically allocate
Points
must ensure that they are deallocated properly usingdelete
!