public class Segment extends ConvexObject implements java.lang.Comparable<Segment>
Modifier and Type | Field and Description |
---|---|
protected double[] |
clip |
protected boolean |
is2D |
protected java.util.List<ConvexObject> |
segmentOn |
protected G2DStroke |
stroke |
Constructor and Description |
---|
Segment(Vector3d[] vertices,
java.awt.Color[] colors) |
Segment(Vector3d[] vertices,
java.awt.Color[] colors,
G2DStroke stroke,
boolean is2D) |
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)
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(G2DStroke stroke) |
java.lang.String |
toString() |
addArea, areCoplanar, check, check2DIntersection, check2DTrueIntersection, drawAreas
getClip, getColorsBarycenter, getNormal, getPrecedence, getProjectedContour, getProjectedPolyLine, getProvidedNormal, isBehind, isBehind, isDegenerate, isEqual, isGreaterOrEqual, isLowerOrEqual, isMonochromatic, isNanOrInf, isNanOrInf, isNegativeOrNull, isNull, isPlanar, isPositiveOrNull, makeClip, minmax2D, minmax3D, resetDefaultPrecedence, setNormal, setPrecedence
protected G2DStroke stroke
protected java.util.List<ConvexObject> segmentOn
protected boolean is2D
protected double[] clip
public Segment(Vector3d[] vertices, java.awt.Color[] colors, G2DStroke stroke, boolean is2D) throws InvalidPolygonException
InvalidPolygonException
public Segment(Vector3d[] vertices, java.awt.Color[] colors) throws InvalidPolygonException
InvalidPolygonException
public void setStroke(G2DStroke 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 interface Clippable
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