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
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<ConvexObject>
segmentOn
protected java.awt.Stroke
stroke
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addConvexObject(ConvexObject co)
java.util.List<ConvexObject>
breakObject(ConvexObject o)
Abstract method Break this ConvexObject against the ConvexObject ojava.util.List<Segment>
breakObject(Vector3d p, Vector3d u, Vector3d n)
java.util.List<ConvexObject>
breakObject(Vector4d v)
Abstract method Break this ConvexObject against a planeint
compareTo(Segment o)
void
draw(java.awt.Graphics2D g2d)
Draw this object on a Graphics2D objectboolean
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()
-
Methods inherited from class org.scilab.forge.scirenderer.implementation.g2d.motor.ConvexObject
addArea, areCoplanar, check, check2DIntersection, check2DTrueIntersection, drawAreas
-
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
-
-
-
-
Field Detail
-
stroke
protected java.awt.Stroke stroke
-
segmentOn
protected java.util.List<ConvexObject> segmentOn
-
-
Constructor Detail
-
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
-
-
Method Detail
-
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 interfacejava.lang.Comparable<Segment>
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.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 classConvexObject
- 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 classConvexObject
- 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 classConvexObject
- Parameters:
v
- plane definition- Returns:
- a list of ConvexObject.
-
draw
public void draw(java.awt.Graphics2D g2d)
Description copied from class:AbstractDrawable3DObject
Draw this object on a Graphics2D object- Specified by:
draw
in classAbstractDrawable3DObject
- Parameters:
g2d
- the Graphics2d object where to draw
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-