Name

SPVM::Point3D - Point 3D

Usage

use Point3D;

my $point = Point3D->new;
my $point = Point3D->new_xyz(1, 2, 3);

$point->set_x(1);
$point->set_y(2);
$point->set_z(3);

my $x = $point->x;
my $y = $point->y;
my $y = $point->z;

my $point_string = $point->to_string;

Description

Point3D is a class for a point 3D.

Super Class

Point is the super class of Point3D.

Interfaces

Point3D inherits the interfaces of Point.

Class Methods

new

method new : Point3D ()

Create a new Point3D object.

new_xyz

method new_xyz : Point3D ($x : int, $y : int, $z : int)

Create a new Point3D object with x, y, and z.

Instance Methods

Point3D inherits the methods of Point, and implements the following methods.

z

method z : int ()

Get z field.

set_z

void set_z : int ($z : int)

Set x field.

to_string

method to_string : string ();

Convert the Point3D object to a string as the following.

(1,2,3)

cloneable_clone

method cloneable_clone : object ()

Clone a Point3D object by create a new Point3D object and x, y, z fields are copied to the new object.