Class SegmentPoint3i
- java.lang.Object
-
- org.arakhne.afc.math.geometry.d3.i.AbstractShape3i<SegmentPoint3i>
-
- org.arakhne.afc.math.geometry.d3.i.SegmentPoint3i
-
- All Implemented Interfaces:
Serializable,Cloneable,Segment3ai<Shape3i<?>,SegmentPoint3i,PathElement3i,Point3i,Vector3i,RectangularPrism3i>,Shape3ai<Shape3i<?>,SegmentPoint3i,PathElement3i,Point3i,Vector3i,RectangularPrism3i>,Shape3i<SegmentPoint3i>,Shape3D<Shape3i<?>,SegmentPoint3i,PathIterator3ai<PathElement3i>,Point3i,Vector3i,RectangularPrism3i>,JsonableObject
public class SegmentPoint3i extends AbstractShape3i<SegmentPoint3i> implements Segment3ai<Shape3i<?>,SegmentPoint3i,PathElement3i,Point3i,Vector3i,RectangularPrism3i>
A 3D segment/line encapsulating points with 3 integer numbers.This segment is defined by its two extremities. It should not differ from the original Segment3i except from storage type.
- Since:
- 13.0
- Version:
- 17.0 2020-01-04 14:41:43
- Author:
- Thomas PIOTROWSKI, Stéphane GALLAND
- See Also:
- Serialized Form
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- mathgeom
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.arakhne.afc.math.geometry.d3.ai.Segment3ai
Segment3ai.AbstractSegmentPathIterator<IE extends PathElement3ai>, Segment3ai.BresenhamLineIterator<P extends Point3D<? super P,? super V>,V extends Vector3D<? super V,? super P>>, Segment3ai.SegmentPathIterator<IE extends PathElement3ai>, Segment3ai.TransformedSegmentPathIterator<IE extends PathElement3ai>
-
-
Constructor Summary
Constructors Constructor Description SegmentPoint3i()Construct an empty segment.SegmentPoint3i(int x1, int y1, int z1, int x2, int y2, int z2)Construct a segment with the two given points.SegmentPoint3i(Segment3ai<?,?,?,?,?,?> segment)Constructor by copy.SegmentPoint3i(Point3i p1, Point3i p2)Construct a segment with the two given points.SegmentPoint3i(SegmentPoint3i segment)Constructor by copy.SegmentPoint3i(Point3D<?,?> p1, Point3D<?,?> p2)Construct a segment with the two given points.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Shape3i<?>createTransformedShape(Transform3D transform)Apply the transformation to the shape and reply the result.Point3igetP1()Replies the first point.Point3igetP2()Replies the second point.intgetX1()Replies the X of the first point.intgetX2()Replies the X of the second point.intgetY1()Replies the Y of the first point.intgetY2()Replies the Y of the second point.intgetZ1()Replies the Z of the first point.intgetZ2()Replies the Z of the second point.inthashCode()voidset(int x1, int y1, int z1, int x2, int y2, int z2)Change the line.voidsetP1(int x, int y, int z)Change the first point.voidsetP1(Point3i point)Sets the first point of the segment.voidsetP2(int x, int y, int z)Change the second point.voidsetP2(Point3i point)Sets the second point of the segment.voidsetX1(int x)Change the X of the first point.voidsetX2(int x)Change the X of the second point.voidsetY1(int y)Change the Y of the first point.voidsetY2(int y)Change the Y of the second point.voidsetZ1(int z)Change the Z of the first point.voidsetZ2(int z)Change the Z of the second point.-
Methods inherited from class org.arakhne.afc.math.geometry.d3.i.AbstractShape3i
addShapeGeometryChangeListener, clone, equals, fireGeometryChange, getGeomFactory, removeShapeGeometryChangeListener, toJson, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.arakhne.afc.vmutil.json.JsonableObject
toJson
-
Methods inherited from interface org.arakhne.afc.math.geometry.d3.ai.Segment3ai
clear, clipToRectangle, contains, contains, equalsToShape, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getClosestPointTo, getDistanceL1, getDistanceLinf, getDistanceSquared, getFarthestPointTo, getPathIterator, getPointIterator, intersects, intersects, intersects, intersects, intersects, isEmpty, set, set, setP1, setP2, toBoundingBox, transform, translate
-
Methods inherited from interface org.arakhne.afc.math.geometry.d3.ai.Shape3ai
contains, contains, getClosestPointTo, getClosestPointTo, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getDistanceSquared, getGeomFactory, intersects, intersects, toBoundingBox, translate
-
Methods inherited from interface org.arakhne.afc.math.geometry.d3.Shape3D
clone, equalsToPathIterator, getDistance, getDistance, getPathIterator, operator_add, operator_and, operator_and, operator_minus, operator_multiply, operator_plus, operator_remove, operator_upTo
-
-
-
-
Constructor Detail
-
SegmentPoint3i
public SegmentPoint3i()
Construct an empty segment.
-
SegmentPoint3i
public SegmentPoint3i(Point3D<?,?> p1, Point3D<?,?> p2)
Construct a segment with the two given points.- Parameters:
p1- first point.p2- second point.
-
SegmentPoint3i
public SegmentPoint3i(Point3i p1, Point3i p2)
Construct a segment with the two given points.- Parameters:
p1- first point.p2- second point.
-
SegmentPoint3i
public SegmentPoint3i(Segment3ai<?,?,?,?,?,?> segment)
Constructor by copy.- Parameters:
segment- the segment to copy.
-
SegmentPoint3i
public SegmentPoint3i(SegmentPoint3i segment)
Constructor by copy.- Parameters:
segment- the segment to copy.
-
SegmentPoint3i
public SegmentPoint3i(int x1, int y1, int z1, int x2, int y2, int z2)Construct a segment with the two given points.- Parameters:
x1- x coordinate of the first point.y1- y coordinate of the first point.z1- z coordinate of the first point.x2- x coordinate of the second point.y2- y coordinate of the second point.z2- z coordinate of the second point.
-
-
Method Detail
-
hashCode
@Pure public int hashCode()
- Specified by:
hashCodein classAbstractShape3i<SegmentPoint3i>
-
createTransformedShape
@Pure public Shape3i<?> createTransformedShape(Transform3D transform)
Description copied from interface:Shape3DApply the transformation to the shape and reply the result. This function does not change the current shape.- Specified by:
createTransformedShapein interfaceShape3ai<Shape3i<?>,SegmentPoint3i,PathElement3i,Point3i,Vector3i,RectangularPrism3i>- Specified by:
createTransformedShapein interfaceShape3D<Shape3i<?>,SegmentPoint3i,PathIterator3ai<PathElement3i>,Point3i,Vector3i,RectangularPrism3i>- Parameters:
transform- is the transformation to apply to the shape.- Returns:
- the result of the transformation.
-
set
public void set(int x1, int y1, int z1, int x2, int y2, int z2)Description copied from interface:Segment3aiChange the line.- Specified by:
setin interfaceSegment3ai<Shape3i<?>,SegmentPoint3i,PathElement3i,Point3i,Vector3i,RectangularPrism3i>- Parameters:
x1- x coordinate of the first point.y1- y coordinate of the first point.z1- z coordinate of the first point.x2- x coordinate of the second point.y2- y coordinate of the second point.z2- z coordinate of the second point.
-
getX1
@Pure public int getX1()
Description copied from interface:Segment3aiReplies the X of the first point.- Specified by:
getX1in interfaceSegment3ai<Shape3i<?>,SegmentPoint3i,PathElement3i,Point3i,Vector3i,RectangularPrism3i>- Returns:
- the x of the first point.
-
setX1
public void setX1(int x)
Description copied from interface:Segment3aiChange the X of the first point.- Specified by:
setX1in interfaceSegment3ai<Shape3i<?>,SegmentPoint3i,PathElement3i,Point3i,Vector3i,RectangularPrism3i>- Parameters:
x- the x of the first point.
-
getY1
@Pure public int getY1()
Description copied from interface:Segment3aiReplies the Y of the first point.- Specified by:
getY1in interfaceSegment3ai<Shape3i<?>,SegmentPoint3i,PathElement3i,Point3i,Vector3i,RectangularPrism3i>- Returns:
- the y of the first point.
-
setY1
public void setY1(int y)
Description copied from interface:Segment3aiChange the Y of the first point.- Specified by:
setY1in interfaceSegment3ai<Shape3i<?>,SegmentPoint3i,PathElement3i,Point3i,Vector3i,RectangularPrism3i>- Parameters:
y- the y of the first point.
-
getZ1
@Pure public int getZ1()
Description copied from interface:Segment3aiReplies the Z of the first point.- Specified by:
getZ1in interfaceSegment3ai<Shape3i<?>,SegmentPoint3i,PathElement3i,Point3i,Vector3i,RectangularPrism3i>- Returns:
- the z of the first point.
-
setZ1
public void setZ1(int z)
Description copied from interface:Segment3aiChange the Z of the first point.- Specified by:
setZ1in interfaceSegment3ai<Shape3i<?>,SegmentPoint3i,PathElement3i,Point3i,Vector3i,RectangularPrism3i>- Parameters:
z- the z of the first point.
-
getX2
@Pure public int getX2()
Description copied from interface:Segment3aiReplies the X of the second point.- Specified by:
getX2in interfaceSegment3ai<Shape3i<?>,SegmentPoint3i,PathElement3i,Point3i,Vector3i,RectangularPrism3i>- Returns:
- the x of the second point.
-
setX2
public void setX2(int x)
Description copied from interface:Segment3aiChange the X of the second point.- Specified by:
setX2in interfaceSegment3ai<Shape3i<?>,SegmentPoint3i,PathElement3i,Point3i,Vector3i,RectangularPrism3i>- Parameters:
x- the x of the second point.
-
getY2
@Pure public int getY2()
Description copied from interface:Segment3aiReplies the Y of the second point.- Specified by:
getY2in interfaceSegment3ai<Shape3i<?>,SegmentPoint3i,PathElement3i,Point3i,Vector3i,RectangularPrism3i>- Returns:
- the y of the second point.
-
setY2
public void setY2(int y)
Description copied from interface:Segment3aiChange the Y of the second point.- Specified by:
setY2in interfaceSegment3ai<Shape3i<?>,SegmentPoint3i,PathElement3i,Point3i,Vector3i,RectangularPrism3i>- Parameters:
y- the y of the second point.
-
getZ2
@Pure public int getZ2()
Description copied from interface:Segment3aiReplies the Z of the second point.- Specified by:
getZ2in interfaceSegment3ai<Shape3i<?>,SegmentPoint3i,PathElement3i,Point3i,Vector3i,RectangularPrism3i>- Returns:
- the z of the second point.
-
setZ2
public void setZ2(int z)
Description copied from interface:Segment3aiChange the Z of the second point.- Specified by:
setZ2in interfaceSegment3ai<Shape3i<?>,SegmentPoint3i,PathElement3i,Point3i,Vector3i,RectangularPrism3i>- Parameters:
z- the z of the second point.
-
getP1
public Point3i getP1()
Description copied from interface:Segment3aiReplies the first point.- Specified by:
getP1in interfaceSegment3ai<Shape3i<?>,SegmentPoint3i,PathElement3i,Point3i,Vector3i,RectangularPrism3i>- Returns:
- the first point.
-
setP1
public void setP1(int x, int y, int z)Description copied from interface:Segment3aiChange the first point.- Specified by:
setP1in interfaceSegment3ai<Shape3i<?>,SegmentPoint3i,PathElement3i,Point3i,Vector3i,RectangularPrism3i>- Parameters:
x- x coordinate of the first point.y- y coordinate of the first point.z- z coordinate of the first point.
-
setP1
public void setP1(Point3i point)
Sets the first point of the segment.- Parameters:
point- the point to set.
-
getP2
public Point3i getP2()
Description copied from interface:Segment3aiReplies the second point.- Specified by:
getP2in interfaceSegment3ai<Shape3i<?>,SegmentPoint3i,PathElement3i,Point3i,Vector3i,RectangularPrism3i>- Returns:
- the second point.
-
setP2
public void setP2(int x, int y, int z)Description copied from interface:Segment3aiChange the second point.- Specified by:
setP2in interfaceSegment3ai<Shape3i<?>,SegmentPoint3i,PathElement3i,Point3i,Vector3i,RectangularPrism3i>- Parameters:
x- x coordinate the second point.y- y coordinate the second point.z- z coordinate the second point.
-
setP2
public void setP2(Point3i point)
Sets the second point of the segment.- Parameters:
point- the point to set.
-
-