forked from geodmms/xdgnjobs

?? ?
2008-05-15 0acf7a49b2da4dd1873d64012ba360eaf51754f4
xdgnjobs/ximple-dgnio/src/main/java/com/ximple/io/dgn7/LineStringElement.java
@@ -2,9 +2,13 @@
//~--- non-JDK imports --------------------------------------------------------
import org.apache.log4j.Logger;
import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.geom.GeometryFactory;
import com.ximple.util.DgnUtility;
/**
 * LineStringElement
@@ -15,6 +19,8 @@
 */
public class LineStringElement extends Element implements GeometryConverter
{
    private static final Logger logger = Logger.getLogger(LineStringElement.class);
    public LineStringElement(byte[] raw)
    {
        super(raw);
@@ -67,7 +73,7 @@
            Coordinate p1 = vset[i - 1];
            Coordinate p2 = vset[i];
            result += Utility.getLength(p1.x, p1.y, p2.x, p2.y);
            result += DgnUtility.getLength(p1.x, p1.y, p2.x, p2.y);
        }
        return result;
@@ -106,12 +112,12 @@
        x += (int) (raw[20 + (4 * index)] & 0x0000ffff);
        return Utility.converUnitToCoord(x);
        return DgnUtility.converUnitToCoord(x);
    }
    protected void setX(int index, double dx)
    {
        int newVal = Utility.converCoordToUnit(dx);
        int newVal = DgnUtility.converCoordToUnit(dx);
        raw[19 + (4 * index)] = (short) (newVal >> 16 & 0x0000ffff);
        raw[20 + (4 * index)] = (short) (newVal & 0x0000ffff);
@@ -128,12 +134,12 @@
        y = y + (int) (raw[22 + (4 * index)] & 0x0000ffff);
        return Utility.converUnitToCoord(y);
        return DgnUtility.converUnitToCoord(y);
    }
    protected void setY(int index, double dy)
    {
        int newVal = Utility.converCoordToUnit(dy);
        int newVal = DgnUtility.converCoordToUnit(dy);
        raw[21 + (4 * index)] = (short) ((newVal >> 16) & 0x0000ffff);
        raw[22 + (4 * index)] = (short) (newVal & 0x0000ffff);