Ignore:
Timestamp:
2013-01-22T23:39:39+01:00 (12 years ago)
Author:
malcolmh
Message:

save

Location:
applications/editors/josm/plugins/smed2/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/smed2/src/s57/S57val.java

    r29175 r29207  
    659659                Status.put(StsSTS.STS_PERM, new S57enum(1, "permanent")); Status.put(StsSTS.STS_OCAS, new S57enum(2, "occasional")); Status.put(StsSTS.STS_RCMD, new S57enum(3, "recommended"));
    660660                Status.put(StsSTS.STS_NIUS, new S57enum(4, "not_in_use")); Status.put(StsSTS.STS_IMTT, new S57enum(5, "intermittent")); Status.put(StsSTS.STS_RESV, new S57enum(6, "reserved"));
    661                 Status.put(StsSTS.STS_TEMP, new S57enum(7, "tempory")); Status.put(StsSTS.STS_PRIV, new S57enum(8, "private")); Status.put(StsSTS.STS_MAND, new S57enum(9, "mandatory"));
     661                Status.put(StsSTS.STS_TEMP, new S57enum(7, "temporary")); Status.put(StsSTS.STS_PRIV, new S57enum(8, "private")); Status.put(StsSTS.STS_MAND, new S57enum(9, "mandatory"));
    662662                Status.put(StsSTS.STS_EXTD, new S57enum(11, "extinguished")); Status.put(StsSTS.STS_ILLD, new S57enum(12, "illuminated")); Status.put(StsSTS.STS_HIST, new S57enum(13, "historic"));
    663663                Status.put(StsSTS.STS_PBLC, new S57enum(14, "public")); Status.put(StsSTS.STS_SYNC, new S57enum(15, "synchronised")); Status.put(StsSTS.STS_WCHD, new S57enum(16, "watched"));
  • applications/editors/josm/plugins/smed2/src/seamap/Renderer.java

    r29206 r29207  
    211211                                                                        double s = prev.distance(next);
    212212                                                                        double p = curr.distance(prev);
    213                                                                         if (p > 0) {
     213                                                                        if ((s > 0) && (p > 0)) {
    214214                                                                                double n = curr.distance(next);
    215                                                                                 double beta = Math.acos((s * s + p * p - n * n) / 2 / s / p);
    216                                                                                 double gamma = Math.asin(p / len * Math.sin(beta));
    217                                                                                 double alpha = Math.PI - beta - gamma;
    218                                                                                 rem = len * Math.sin(alpha) / Math.sin(beta);
     215                                                                                double theta = Math.acos((s * s + p * p - n * n) / 2 / s / p);
     216                                                                                double phi = Math.asin(p / len * Math.sin(theta));
     217                                                                                rem = len * Math.sin(Math.PI - theta - phi) / Math.sin(theta);
    219218                                                                        }
    220219                                                                        succ = new Point2D.Double(prev.getX() + (rem * Math.cos(angle)), prev.getY() + (rem * Math.sin(angle)));
     
    225224                                                                if (!gap) {
    226225                                                                        Symbols.drawSymbol(g2, symbol, sScale, curr.getX(), curr.getY(),
    227                                                                                         new Delta(Handle.BC, AffineTransform.getRotateInstance(Math.atan2(succ.getY() - curr.getY(), succ.getX() - curr.getX())+Math.toRadians(90))), null);
     226                                                                                        new Delta(Handle.BC, AffineTransform.getRotateInstance(Math.atan2((succ.getY() - curr.getY()), (succ.getX() - curr.getX()) + Math.toRadians(90)))), null);
    228227                                                                }
    229228                                                                if (space > 0) gap = !gap;
Note: See TracChangeset for help on using the changeset viewer.