Package mgui.geometry
Class LineSegment2D
java.lang.Object
mgui.geometry.Shape2D
mgui.geometry.LineSegment2D
public class LineSegment2D extends Shape2D
Represents a line segment in R2.
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
-
Nested Class Summary
Nested classes/interfaces inherited from interface mgui.interfaces.xml.XMLObject
XMLObject.XMLEncoding, XMLObject.XMLType
-
Field Summary
-
Constructor Summary
Constructors Constructor Description LineSegment2D()
LineSegment2D(org.jogamp.vecmath.Point2f thisPt1, org.jogamp.vecmath.Point2f thisPt2)
-
Method Summary
Modifier and Type Method Description Vector2D
asVector()
java.lang.Object
clone()
float
getLength()
float
getProximity(org.jogamp.vecmath.Point2f thisPt)
org.jogamp.vecmath.Point2f
getProximityPoint(org.jogamp.vecmath.Point2f thisPt)
org.jogamp.vecmath.Point2f
getVertex(int i)
java.util.ArrayList<org.jogamp.vecmath.Point2f>
getVertices()
void
setVertices(java.util.ArrayList<org.jogamp.vecmath.Point2f> vertices)
Methods inherited from class mgui.geometry.Shape2D
contains, getBounds, getCenterPt, getCoords, getDTD, getLocalName, getShortXML, getSize, getVertices, getXML, getXML, getXMLSchema, handleXMLElementEnd, handleXMLElementStart, handleXMLString, setCoords, setVertices, transform, transform, writeXML, writeXML, writeXML
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
pt1
public org.jogamp.vecmath.Point2f pt1 -
pt2
public org.jogamp.vecmath.Point2f pt2
-
-
Constructor Details
-
LineSegment2D
public LineSegment2D() -
LineSegment2D
public LineSegment2D(org.jogamp.vecmath.Point2f thisPt1, org.jogamp.vecmath.Point2f thisPt2)
-
-
Method Details
-
clone
public java.lang.Object clone() -
getVertices
public java.util.ArrayList<org.jogamp.vecmath.Point2f> getVertices()- Specified by:
getVertices
in classShape2D
-
setVertices
public void setVertices(java.util.ArrayList<org.jogamp.vecmath.Point2f> vertices)- Specified by:
setVertices
in classShape2D
-
getVertex
public org.jogamp.vecmath.Point2f getVertex(int i) -
getLength
public float getLength() -
getProximityPoint
public org.jogamp.vecmath.Point2f getProximityPoint(org.jogamp.vecmath.Point2f thisPt)- Overrides:
getProximityPoint
in classShape2D
-
getProximity
public float getProximity(org.jogamp.vecmath.Point2f thisPt)- Overrides:
getProximity
in classShape2D
-
asVector
-