Statistics
| Revision:

svn-gvsig-desktop / branches / v02_desarrollo / libraries / libCq CMS for java.old / src / org / cresques / px / dxf / DxfLwPolyline.java @ 1607

History | View | Annotate | Download (1.57 KB)

1
/*
2
 * Created on 04-may-2004
3
 */
4
package org.cresques.px.dxf;
5

    
6
import java.awt.geom.Point2D;
7
import java.util.Iterator;
8
import java.util.Vector;
9

    
10
import org.cresques.cts.IProjection;
11
import org.cresques.io.DxfGroup;
12

    
13
/**
14
 * @author "Luis W. Sevilla" <sevilla_lui@gva.es>
15
 * jmorell: Escritura de LwPolylines en formato DXF2000 con arcos.
16
 */
17
public class DxfLwPolyline extends DxfPolyline {
18
        public DxfLwPolyline(IProjection proj, DxfLayer layer) {
19
                super(proj, layer);
20
        }
21
        /**
22
         * jmorell: Escritura de LwPolylines en formato DXF2000 con arcos.
23
         */
24
        public String toDxfString() {
25
                StringBuffer sb = null;
26
                sb = new StringBuffer( DxfGroup.toString(0, "LWPOLYLINE") );
27
                sb.append( DxfGroup.toString(5, getHandle()) );
28
                sb.append( DxfGroup.toString(100, "AcDbEntity") );
29
                sb.append( DxfGroup.toString(8, layer.getName()) );
30
                sb.append( DxfGroup.toString(62, dxfColor) );
31
                sb.append( DxfGroup.toString(100, "AcDbPolyline") );
32
                sb.append( DxfGroup.toString(70, flags) );
33
                sb.append( DxfGroup.toString(90, pts.size()) );
34
                Point2D pt = null;
35
                double bulge;
36
                Vector bulges = getBulges();
37
                /*Iterator iter = pts.iterator();
38
                while (iter.hasNext()) {
39
                        pt = (Point2D) iter.next();
40
                        sb.append( DxfGroup.toString(10, pt.getX(), 6) );
41
                        sb.append( DxfGroup.toString(20, pt.getY(), 6) );
42
                }*/
43
                for (int i=0;i<pts.size();i++) {
44
                        pt = (Point2D)pts.get(i);
45
                        bulge = ((Double)bulges.get(i)).doubleValue();
46
                        sb.append( DxfGroup.toString(10, pt.getX(), 6) );
47
                        sb.append( DxfGroup.toString(20, pt.getY(), 6) );
48
                        sb.append( DxfGroup.toString(42, bulge, 6) );
49
                }
50
                return sb.toString();
51
        }
52
}