Package org.graphstream.ui.geom
Class Point3
java.lang.Object
org.graphstream.ui.geom.Point2
org.graphstream.ui.geom.Point3
- All Implemented Interfaces:
Serializable
public class Point3 extends Point2 implements Serializable
3D point.
A Point3 is a 3D location in an affine space described by three values along
the X, the Y and the Z axis. Note the difference with Vector3 wich is defined
as an array and ensures that the three coordinates X, Y and Z are consecutive
in memory. Here there are three separate attributes. Further, a point has no
vector arithmetic bound to it (to points cannot be added, this would have no
mathematical meaning).
- Since:
- 19990829
- Version:
- 0.1
- Author:
- Antoine Dutot
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description static Point3NULL_POINT3Specific point at (0,0,0).doublezZ axis value. -
Constructor Summary
Constructors Constructor Description Point3()New 3D point at(0,0,0).Point3(double[] data)Point3(double x, double y)New 3D point at (x,y,0).Point3(double x, double y, double z)New 3D point at(x,y,z).Point3(float[] data)Point3(int start, double[] data)Point3(int start, float[] data)Point3(Point3 other)New copy of other.Point3(Vector3 vec) -
Method Summary
Modifier and Type Method Description voidcopy(Point3 other)Make this a copy of other.voidcopy(Vector3 vec)doubledistance(double x, double y, double z)Distance between this and point (x,y,z).doubledistance(Point3 other)Distance between this andother.booleanequals(Object o)inthashCode()Point3interpolate(Point3 other, double factor)Create a new point linear interpolation of this andother.booleanisZero()Are all components to zero?.voidmove(double dx, double dy, double dz)Move of given vector(dx,dy,dz).voidmove(Point3 p)Move of given pointp.voidmove(Vector3 d)Move of given vector d.voidmoveTo(double x, double y, double z)Move to absolute position (x,y,z).voidmoveZ(double dz)Move in depth of dz.voidscale(double scalar)Scale by a given scalar.voidscale(double sx, double sy, double sz)Scale of factor (sx,sy,sz).voidscale(Point3 s)Scale by factor s.voidscale(Vector3 s)Scale by factor s.voidset(double x, double y, double z)Like #moveTo().voidsetZ(double z)Change only depth at absolute coordinate z.voidswap(Point3 other)Exchange the values of this and other.StringtoString()
-
Field Details
-
z
public double zZ axis value. -
NULL_POINT3
Specific point at (0,0,0).
-
-
Constructor Details
-
Point3
public Point3()New 3D point at(0,0,0). -
Point3
public Point3(double x, double y)New 3D point at (x,y,0). -
Point3
public Point3(double x, double y, double z)New 3D point at(x,y,z). -
Point3
New copy of other. -
Point3
-
Point3
public Point3(float[] data) -
Point3
public Point3(double[] data) -
Point3
public Point3(int start, float[] data) -
Point3
public Point3(int start, double[] data)
-
-
Method Details
-
isZero
public boolean isZero()Are all components to zero?. -
interpolate
Create a new point linear interpolation of this andother. The new point is located between this andotheriffactoris between 0 and 1 (0 yields this point, 1 yields theotherpoint). -
distance
Distance between this andother. -
distance
public double distance(double x, double y, double z)Distance between this and point (x,y,z). -
copy
Make this a copy of other. -
copy
-
set
public void set(double x, double y, double z)Like #moveTo(). -
moveTo
public void moveTo(double x, double y, double z)Move to absolute position (x,y,z). -
move
public void move(double dx, double dy, double dz)Move of given vector(dx,dy,dz). -
move
Move of given pointp. -
move
Move of given vector d. -
moveZ
public void moveZ(double dz)Move in depth of dz. -
scale
public void scale(double sx, double sy, double sz)Scale of factor (sx,sy,sz). -
scale
Scale by factor s. -
scale
Scale by factor s. -
scale
public void scale(double scalar)Scale by a given scalar.- Parameters:
scalar- The multiplier.
-
setZ
public void setZ(double z)Change only depth at absolute coordinate z. -
swap
Exchange the values of this and other. -
toString
-
equals
-
hashCode
public int hashCode()
-