|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Point
Point stores and manipulates xyz triples representing 3 space points.
Field Summary | |
double |
X
Holds the X component |
double |
Y
Holds the Y component |
double |
Z
Holds the Z component |
Constructor Summary | |
Point()
Create a new point and set it to zero |
|
Point(double x,
double y,
double z)
Create a new point with the given x,y and z values |
|
Point(Point p)
Create a new point by copying an existing point |
Method Summary | |
static void |
add(Point pd,
Point p,
Vector v)
Static function that write addition of a point by adding a vector to a given destiation point |
static Point |
add(Point p,
Vector v)
Static function create a new point by adding a vector to a point. |
void |
add(Vector v)
Add the given offset vector to this point |
void |
copy(Point p)
Copy an existing point to this point |
boolean |
equals(Point p)
Test if two points are equal |
void |
print(SceneWriter os)
Print a human readable version of the point definition to the given destination |
void |
read(SceneReader is)
Read the point from the given source |
void |
set(double x,
double y,
double z)
Set this point to the given x,y and z values |
java.lang.String |
toString()
|
void |
write(SceneWriter os)
Write the point to the given destination |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public double X
public double Y
public double Z
Constructor Detail |
public Point()
public Point(double x, double y, double z)
x
- the x valuey
- the y valuez
- the z valuepublic Point(Point p)
Method Detail |
public void set(double x, double y, double z)
x
- the x valuey
- the y valuez
- the z valuepublic void copy(Point p)
public void add(Vector v)
v
- the vector to addpublic boolean equals(Point p)
public static Point add(Point p, Vector v)
p
- the original pointv
- the vector offset
public static void add(Point pd, Point p, Vector v)
pd
- the destination pointp
- the original pointv
- the vector offsetpublic void read(SceneReader is) throws java.io.IOException, java.lang.NumberFormatException
is
- the source to read from
java.io.IOException
- if the light can not be read
java.io.NumberFormatException
- if there a number format error is encountered
java.lang.NumberFormatException
public void write(SceneWriter os) throws java.io.IOException
os
- the destination to write to
java.io.IOException
- if the write fails.public void print(SceneWriter os) throws java.io.IOException
os
- the destination to write to
java.io.IOException
- if the write fails.public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |