Statistics
| Revision:

root / tags / v1_0_2_Build_898 / libraries / libCq CMS for java.old / src / org / cresques / px / dxf / DxfSpline.java @ 10513

History | View | Annotate | Download (2.31 KB)

1 90 jmorell
/*
2 2809 nacho
 * Cresques Mapping Suite. Graphic Library for constructing mapping applications.
3
 *
4
 * Copyright (C) 2004-5.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
19
 *
20
 * For more information, contact:
21
 *
22
 * cresques@gmail.com
23 90 jmorell
 */
24
package org.cresques.px.dxf;
25
26 2809 nacho
import org.cresques.geo.Projection;
27
28
import org.cresques.io.DxfGroup;
29
30 90 jmorell
import java.awt.geom.Point2D;
31 2809 nacho
32 90 jmorell
import java.util.Iterator;
33
34
35
/**
36 2809 nacho
 * Entidad SPLINE de un fichero DXF.
37 90 jmorell
 * @author "Luis W. Sevilla" <sevilla_lui@gva.es>
38
 */
39
public class DxfSpline extends DxfPolyline {
40 2809 nacho
41
    /**
42
     * Constructor de DxfSpline.
43
     * @param proj, proyecci?n cartogr?fica en la que se encuentra el DxfSpline.
44
     * @param layer, capa del DXF en la que se encuentra el DxfSpline.
45
     */
46
    public DxfSpline(Projection proj, DxfLayer layer) {
47
        super(proj, layer);
48
    }
49 90 jmorell
50 2809 nacho
    /* (non-Javadoc)
51
     * @see org.cresques.px.dxf.DxfEntity#toDxfFileString()
52
     */
53
    /**
54
     * Actualmente en desarrollo. Hay que terminarlo para que de verdad escriba un
55
     * DxfSpline.
56
     */
57
    public String toDxfString() {
58
        StringBuffer sb = null;
59
        sb = new StringBuffer(DxfGroup.toString(0, "LWPOLYLINE"));
60
        sb.append(DxfGroup.toString(8, layer.getName()));
61
        sb.append(DxfGroup.toString(62, dxfColor));
62
        sb.append(DxfGroup.toString(100, "AcDbPolyline"));
63
        sb.append(DxfGroup.toString(90, pts.size()));
64
65
        Point2D pt = null;
66
        Iterator iter = pts.iterator();
67
68
        while (iter.hasNext()) {
69
            pt = (Point2D) iter.next();
70
            sb.append(DxfGroup.toString(10, pt.getX(), 6));
71
            sb.append(DxfGroup.toString(20, pt.getY(), 6));
72
        }
73
74
        return sb.toString();
75
    }
76 90 jmorell
}