Drag[en]gine Script Module DragonScript Script API  1.0
Point3 Class Reference

Immutable 3-component integer point. More...

Inheritance diagram for Point3:

Public Member Functions

Constructors
Point3 new ()
 Create point with all components set to 0. More...
 
Point3 new (int x, int y, int z)
 Create point with components. More...
 
Point3 new (Point3 point)
 Create copy of a point. More...
 
Operators
Point3 operator- ()
 Point3 with each component negated. More...
 
Point3 operator+ (Point3 point)
 Sum of two points. More...
 
Point3 operator- (Point3 point)
 Difference between two points. More...
 
Point3 operator* (int scalar)
 Point3 with each component scaled by a value. More...
 
Point3 operator/ (int scalar)
 Point3 with each component divided by a value. More...
 
int operator* (Point3 point)
 Dot product of two points. More...
 
bool operator< (Point3 point)
 Check if each component of this point is smaller than another point. More...
 
bool operator<= (Point3 point)
 Check if each component of this point is smaller than or equal to another point. More...
 
bool operator> (Point3 point)
 Check if each component of this point is larger than another point. More...
 
bool operator>= (Point3 point)
 Check if each component of this point is larger than or equal to another point. More...
 

Management

int getX ()
 X component. More...
 
int getY ()
 Y component. More...
 
int getZ ()
 Z component. More...
 
float getLength ()
 Length. More...
 
Point3 smallest (Point3 p)
 Point3 with smallest components of this point and another point. More...
 
Point3 smallest (int x, int y, int z)
 Point3 with smallest components of this point and another point. More...
 
Point3 largest (Point3 point)
 Point3 with largest components of this point and another point. More...
 
Point3 largest (int x, int y, int z)
 Point3 with largest components of this point and another point. More...
 
bool isEqualTo (Point3 point)
 Point3s are equal. More...
 
bool isAtLeast (int value)
 Both components are larger than or equal to a value. More...
 
bool isAtMost (int value)
 Both components are smaller than or equal to a value. More...
 
Point3 compMultiply (Point3 point)
 Multiply with point component wise. More...
 
Point3 compDivide (Point3 point)
 Divide by point component wise. More...
 
void writeToFile (FileWriter writer)
 Write point to a file writer. More...
 
bool equals (Object other)
 Point3 is equal to another object. More...
 
int hashCode ()
 Hash code for use as dictionary keys. More...
 
String toString ()
 String representation of point. More...
 
static Point3 readFromFile (FileReader reader)
 Read point from a file reader. More...
 

Detailed Description

Immutable 3-component integer point.

This is a native class. It can not be subclassed.

Author
Roland Pl├╝ss
Version
1.0
Date
2015

Member Function Documentation

§ compDivide()

Point3 compDivide ( Point3  point)

Divide by point component wise.

Exceptions
EDivisionByZeroA component of point is 0.

§ compMultiply()

Point3 compMultiply ( Point3  point)

Multiply with point component wise.

§ equals()

bool equals ( Object  other)

Point3 is equal to another object.

Implements Object.equals(Object).

Returns
true if other is of type Point3 and components are equal.

§ getLength()

float getLength ( )

Length.

§ getX()

int getX ( )

X component.

§ getY()

int getY ( )

Y component.

§ getZ()

int getZ ( )

Z component.

§ hashCode()

int hashCode ( )

Hash code for use as dictionary keys.

Implements Object.hashCode().

§ isAtLeast()

bool isAtLeast ( int  value)

Both components are larger than or equal to a value.

§ isAtMost()

bool isAtMost ( int  value)

Both components are smaller than or equal to a value.

§ isEqualTo()

bool isEqualTo ( Point3  point)

Point3s are equal.

§ largest() [1/2]

Point3 largest ( Point3  point)

Point3 with largest components of this point and another point.

§ largest() [2/2]

Point3 largest ( int  x,
int  y,
int  z 
)

Point3 with largest components of this point and another point.

§ new() [1/3]

Point3 new ( )

Create point with all components set to 0.

§ new() [2/3]

Point3 new ( int  x,
int  y,
int  z 
)

Create point with components.

§ new() [3/3]

Point3 new ( Point3  point)

Create copy of a point.

§ operator*() [1/2]

Point3 operator* ( int  scalar)

Point3 with each component scaled by a value.

§ operator*() [2/2]

int operator* ( Point3  point)

Dot product of two points.

§ operator+()

Point3 operator+ ( Point3  point)

Sum of two points.

§ operator-() [1/2]

Point3 operator- ( )

Point3 with each component negated.

§ operator-() [2/2]

Point3 operator- ( Point3  point)

Difference between two points.

§ operator/()

Point3 operator/ ( int  scalar)

Point3 with each component divided by a value.

Exceptions
EDivisionByZeroscalar is 0.

§ operator<()

bool operator< ( Point3  point)

Check if each component of this point is smaller than another point.

§ operator<=()

bool operator<= ( Point3  point)

Check if each component of this point is smaller than or equal to another point.

§ operator>()

bool operator> ( Point3  point)

Check if each component of this point is larger than another point.

§ operator>=()

bool operator>= ( Point3  point)

Check if each component of this point is larger than or equal to another point.

§ readFromFile()

static Point3 readFromFile ( FileReader  reader)
static

Read point from a file reader.

§ smallest() [1/2]

Point3 smallest ( Point3  p)

Point3 with smallest components of this point and another point.

§ smallest() [2/2]

Point3 smallest ( int  x,
int  y,
int  z 
)

Point3 with smallest components of this point and another point.

§ toString()

String toString ( )

String representation of point.

Implements Object.toString()

§ writeToFile()

void writeToFile ( FileWriter  writer)

Write point to a file writer.


The documentation for this class was generated from the following file: