public class Segment extends ConvexObject implements java.lang.Comparable<Segment>
Modifier and Type | Field and Description |
---|---|
protected java.util.List<ConvexObject> |
segmentOn |
protected java.awt.Stroke |
stroke |
Constructor and Description |
---|
Segment(Vector3d[] vertices,
java.awt.Color[] colors) |
Segment(Vector3d[] vertices,
java.awt.Color[] colors,
java.awt.Stroke stroke) |
Modifier and Type | Method and Description |
---|---|
void |
addConvexObject(ConvexObject co) |
java.util.List<ConvexObject> |
breakObject(ConvexObject o)
Abstract method
Break this ConvexObject against the ConvexObject o
|
java.util.List<Segment> |
breakObject(Vector3d p,
Vector3d u,
Vector3d n) |
java.util.List<ConvexObject> |
breakObject(Vector4d v)
Abstract method
Break this ConvexObject against a plane
|
int |
compareTo(Segment o) |
void |
draw(java.awt.Graphics2D g2d)
Draw this object on a Graphics2D object
|
boolean |
equals(java.lang.Object o) |
double |
getLength() |
static double |
getLength(Vector3d[] vertices) |
int |
hashCode() |
int |
isBehind(ConvexObject o)
Check if o is behind this.
|
boolean |
isIn2D() |
boolean |
isInFront() |
void |
removeConvexObject(ConvexObject co) |
void |
replaceSegment(java.util.List<Segment> segs) |
void |
setStroke(java.awt.Stroke stroke) |
java.lang.String |
toString() |
addArea, areCoplanar, check, check2DIntersection, check2DTrueIntersection, drawAreas
getColorsBarycenter, getNormal, getPrecedence, getProjectedContour, getProjectedPolyLine, getProvidedNormal, is2D, isBehind, isBehind, isDegenerate, isEqual, isGreaterOrEqual, isLowerOrEqual, isMonochromatic, isNanOrInf, isNanOrInf, isNegativeOrNull, isNull, isPlanar, isPositiveOrNull, minmax2D, minmax3D, resetDefaultPrecedence, setNormal, setPrecedence
protected java.awt.Stroke stroke
protected java.util.List<ConvexObject> segmentOn
public Segment(Vector3d[] vertices, java.awt.Color[] colors, java.awt.Stroke stroke) throws InvalidPolygonException
InvalidPolygonException
public Segment(Vector3d[] vertices, java.awt.Color[] colors) throws InvalidPolygonException
InvalidPolygonException
public void setStroke(java.awt.Stroke stroke)
public double getLength()
public static double getLength(Vector3d[] vertices)
public void addConvexObject(ConvexObject co)
public void removeConvexObject(ConvexObject co)
public void replaceSegment(java.util.List<Segment> segs)
public boolean isIn2D()
public boolean isInFront()
public int compareTo(Segment o)
compareTo
in interface java.lang.Comparable<Segment>
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int isBehind(ConvexObject o)
ConvexObject
isBehind
in class ConvexObject
public java.util.List<ConvexObject> breakObject(ConvexObject o)
ConvexObject
breakObject
in class ConvexObject
o
- a ConvexObjectpublic java.util.List<ConvexObject> breakObject(Vector4d v)
ConvexObject
breakObject
in class ConvexObject
v
- plane definitionpublic void draw(java.awt.Graphics2D g2d)
AbstractDrawable3DObject
draw
in class AbstractDrawable3DObject
g2d
- the Graphics2d object where to drawpublic int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object