Class Segment

  • All Implemented Interfaces:
    java.lang.Comparable<Segment>

    public class Segment
    extends ConvexObject
    implements java.lang.Comparable<Segment>
    Author:
    Calixte DENIZET
    • Field Detail

      • stroke

        protected java.awt.Stroke stroke
      • segmentOn

        protected java.util.List<ConvexObject> segmentOn
    • 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 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.
      • 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