Revision 28

View differences:

trunk/libraries/libCq CMS for java.old/src/org/cresques/px/dxf/DxfPolyline.java
31 31
	Vector pts = null;
32 32
	GeneralPath gp = null;
33 33
	int flags = 0;
34
	boolean closed = false;
34 35
	
35 36
	public DxfPolyline(Projection proj, DxfLayer layer) {
36 37
		super(proj, layer);
......
92 93
			}
93 94
			//pt = pt1;
94 95
		}
95
		//gp.closePath();
96
		if (closed) {
97
			//gp.closePath();			
98
		}
96 99
	}
97 100
	
98 101
	/**
......
128 131
		newGP();
129 132
		return (GeneralPath) gp.clone();
130 133
	}
134
	
135
	public int getFlags() {
136
		return flags;
137
	}
138

  
131 139
}
trunk/libraries/libCq CMS for java.old/src/org/cresques/px/dxf/DxfEntityMaker.java
30 30
	
31 31
    double xtruX=0.0, xtruY=0.0, xtruZ=1.0;
32 32
    //double x=Double.NaN, y=Double.NaN, z=Double.NaN;
33
    
34
    int polylineFlag = 0;
35
    Point2D firstPt = new Point2D.Double();
33 36
	
34 37
	public DxfEntityMaker (Projection proj) {
35 38
		this.proj = proj;
......
57 60
			y = grp.getDataAsDouble(20);
58 61
		if (grp.hasCode(30))
59 62
			z = grp.getDataAsDouble(30);*/
63
		if (grp.hasCode(62))
64
			entity.dxfColor = grp.getDataAsInt(62);
65
		if (grp.hasCode(70))
66
			entity.flags = grp.getDataAsInt(70);
60 67
		if (grp.hasCode(210))
61 68
			xtruX = grp.getDataAsDouble(210);
62 69
		if (grp.hasCode(220))
63 70
			xtruY = grp.getDataAsDouble(220);
64 71
		if (grp.hasCode(230))
65 72
			xtruZ = grp.getDataAsDouble(230);
66
		if (grp.hasCode(62))
67
			entity.dxfColor = grp.getDataAsInt(62);
68
		if (grp.hasCode(70))
69
			entity.flags = grp.getDataAsInt(70);
73
		// compruebo flags
74
		if ((entity.flags & 0x01) == 0x01) {
75
			entity.closed = true;
76
		}
70 77
		lastEntity = entity;
71 78
	}
72 79
	public void endSeq() throws Exception {
......
91 98
		//System.out.println(x+","+y);
92 99
		Point2D pt = proj.createPoint( x, y);
93 100
		((DxfPolyline) lastEntity).add(pt);
101
		
102
		if (((DxfPolyline)lastEntity).pts.size() == 1) {
103
			firstPt = pt;
104
		}
105
		
94 106
	}
95 107
	public void createLwPolyline(DxfGroupVector grp) throws Exception {
96 108
		double x = 0.0, y = 0.0, elev=0.0;

Also available in: Unified diff