org.scilab.forge.scirenderer.implementation.g2d.motor
Class Segment
java.lang.Object
org.scilab.forge.scirenderer.implementation.g2d.motor.AbstractDrawable3DObject
org.scilab.forge.scirenderer.implementation.g2d.motor.ConvexObject
org.scilab.forge.scirenderer.implementation.g2d.motor.Segment
- All Implemented Interfaces:
- java.lang.Comparable<Segment>
public class Segment
- extends ConvexObject
- implements java.lang.Comparable<Segment>
- Author:
- Calixte DENIZET
Fields inherited from class org.scilab.forge.scirenderer.implementation.g2d.motor.AbstractDrawable3DObject |
bbox, colors, degenerated, is2d, marked, marked2, normal, nv0v1, precedence, PRECISION, v0, v0v1, v1, vertices, zindex |
Constructor Summary |
Segment(Vector3d[] vertices,
java.awt.Color[] colors)
|
Segment(Vector3d[] vertices,
java.awt.Color[] colors,
java.awt.Stroke stroke)
|
Methods inherited from class org.scilab.forge.scirenderer.implementation.g2d.motor.AbstractDrawable3DObject |
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 |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
stroke
protected java.awt.Stroke stroke
segmentOn
protected java.util.List<ConvexObject> segmentOn
Segment
public Segment(Vector3d[] vertices,
java.awt.Color[] colors,
java.awt.Stroke stroke)
throws InvalidPolygonException
- Throws:
InvalidPolygonException
Segment
public Segment(Vector3d[] vertices,
java.awt.Color[] colors)
throws InvalidPolygonException
- Throws:
InvalidPolygonException
setStroke
public void setStroke(java.awt.Stroke stroke)
getLength
public double getLength()
getLength
public static double getLength(Vector3d[] vertices)
addConvexObject
public void addConvexObject(ConvexObject co)
removeConvexObject
public void removeConvexObject(ConvexObject co)
replaceSegment
public void replaceSegment(java.util.List<Segment> segs)
isIn2D
public boolean isIn2D()
isInFront
public boolean isInFront()
compareTo
public int compareTo(Segment o)
- Specified by:
compareTo
in interface java.lang.Comparable<Segment>
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in class java.lang.Object
isBehind
public int isBehind(ConvexObject o)
- Description copied from class:
ConvexObject
- Check if o is behind this.
Take care: the algorithms used are for convex objects (typically tri-tri, seg-seg or tri-seg)
- Overrides:
isBehind
in class ConvexObject
- Returns:
- true if o is behind this
breakObject
public java.util.List<ConvexObject> breakObject(ConvexObject o)
- Description copied from class:
ConvexObject
- Abstract method
Break this ConvexObject against the ConvexObject o
- Specified by:
breakObject
in class ConvexObject
- Parameters:
o
- a ConvexObject
- Returns:
- a list of ConvexObject.
breakObject
public java.util.List<ConvexObject> breakObject(Vector4d v)
- Description copied from class:
ConvexObject
- Abstract method
Break this ConvexObject against a plane
- Specified by:
breakObject
in class ConvexObject
- Parameters:
v
- plane definition
- Returns:
- a list of ConvexObject.
breakObject
public java.util.List<Segment> breakObject(Vector3d p,
Vector3d u,
Vector3d n)
draw
public void draw(java.awt.Graphics2D g2d)
- Description copied from class:
AbstractDrawable3DObject
- Draw this object on a Graphics2D object
- Specified by:
draw
in class AbstractDrawable3DObject
- Parameters:
g2d
- the Graphics2d object where to draw
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object