package shape;
import java.awt.geom.*;
import util.*;
import util.Util;

public class PathSegment{
    public int id=-1;
    public Point2D startP=null;
    public Point2D endP=null;
    public boolean closed=false;
    public boolean reversed=false;
    public boolean passed=false;
    
    public PathSegment(int id, Point2D startP, Point2D endP){
        this.id=id;
        this.startP=startP;
        this.endP=endP;
    }
    
    public String toString(){
        Point2D startPoint=this.startP;
        Point2D endPoint=this.endP;
        if(this.reversed){
            startPoint=this.endP;
            endPoint=this.startP;
        }
        String str="id="+id+", closed="+closed+", reversed="+reversed+
                ", passed="+passed+", start="+Util.Pt(startPoint)+", end="+Util.Pt(endPoint);
        return str;
    }
    public String toShortString(){
        Point2D startPoint=this.startP;
        Point2D endPoint=this.endP;
        if(this.reversed){
            startPoint=this.endP;
            endPoint=this.startP;
        }
        String str="id="+id+", closed="+closed+", reversed="+reversed+
                ", passed="+passed;
        return str;
    }
} //End of Segment class

