Revision 1607 branches/v02_desarrollo/libraries/libCq CMS for java.old/src/org/cresques/px/dxf/DxfPolyline.java
DxfPolyline.java | ||
---|---|---|
21 | 21 |
|
22 | 22 |
/** |
23 | 23 |
* Polilynea de autocad |
24 |
* |
|
24 |
* jmorell: Implementaci?n extra de bulges necesaria para el piloto de CAD.
|
|
25 | 25 |
* @author "Luis W. Sevilla" <sevilla_lui@gva.es>* @author administrador |
26 | 26 |
*/ |
27 | 27 |
|
... | ... | |
33 | 33 |
int flags = 0; |
34 | 34 |
boolean closed = false; |
35 | 35 |
boolean hasFaces = false; |
36 |
private Vector bulges; |
|
36 | 37 |
|
37 | 38 |
public DxfPolyline(IProjection proj, DxfLayer layer) { |
38 | 39 |
super(proj, layer); |
39 | 40 |
extent = new Extent(); |
40 | 41 |
pts = new Vector(); |
42 |
bulges = new Vector(); |
|
41 | 43 |
} |
42 | 44 |
|
43 | 45 |
public void add(Point2D pt) { |
... | ... | |
45 | 47 |
extent.add(pt); |
46 | 48 |
} |
47 | 49 |
|
50 |
/** |
|
51 |
* 050301, jmorell: Soluci?n provisional para implementar la lectura de polil?neas |
|
52 |
* con arcos. |
|
53 |
* @param pt |
|
54 |
*/ |
|
55 |
public void addBulge(Double bulge) { |
|
56 |
bulges.add(bulge); |
|
57 |
} |
|
58 |
|
|
48 | 59 |
public void addFace(int [] face) { |
49 | 60 |
hasFaces = true; |
50 | 61 |
if (faces == null) |
... | ... | |
145 | 156 |
public String toDxfString() { |
146 | 157 |
StringBuffer sb = null; |
147 | 158 |
sb = new StringBuffer( DxfGroup.toString(0, "POLYLINE") ); |
159 |
sb.append( DxfGroup.toString(5, getHandle()) ); |
|
160 |
sb.append( DxfGroup.toString(100, "AcDbEntity") ); |
|
148 | 161 |
sb.append( DxfGroup.toString(8, layer.getName()) ); |
149 | 162 |
sb.append( DxfGroup.toString(62, dxfColor) ); |
163 |
sb.append( DxfGroup.toString(100, "AcDb2dPolyline") ); |
|
150 | 164 |
sb.append( DxfGroup.toString(70, flags) ); |
151 | 165 |
sb.append( DxfGroup.toString(66, 1) ); |
152 | 166 |
Point2D pt = null; |
153 | 167 |
Iterator iter = pts.iterator(); |
168 |
System.out.println("pts.size() = " + pts.size()); |
|
154 | 169 |
while (iter.hasNext()) { |
155 | 170 |
pt = (Point2D) iter.next(); |
156 | 171 |
sb.append( DxfGroup.toString(0, "VERTEX") ); |
172 |
sb.append( DxfGroup.toString(5, getHandle()) ); |
|
173 |
sb.append( DxfGroup.toString(100, "AcDbEntity") ); |
|
157 | 174 |
sb.append( DxfGroup.toString(8, layer.getName()) ); |
175 |
sb.append( DxfGroup.toString(100, "AcDbVertex") ); |
|
176 |
sb.append( DxfGroup.toString(100, "AcDb2dVertex") ); |
|
158 | 177 |
sb.append( DxfGroup.toString(10, pt.getX(), 6) ); |
159 | 178 |
sb.append( DxfGroup.toString(20, pt.getY(), 6) ); |
160 | 179 |
sb.append( DxfGroup.toString(30, 0.0, 6) ); |
161 | 180 |
} |
162 | 181 |
sb.append( DxfGroup.toString(0, "SEQEND") ); |
182 |
sb.append( DxfGroup.toString(5, getHandle()) ); |
|
183 |
sb.append( DxfGroup.toString(100, "AcDbEntity") ); |
|
163 | 184 |
sb.append( DxfGroup.toString(8, layer.getName()) ); |
164 | 185 |
return sb.toString(); |
165 | 186 |
} |
... | ... | |
181 | 202 |
return new DxfCalArcs(coord1, coord2, bulge).getPoints(1); |
182 | 203 |
} |
183 | 204 |
|
205 |
/** |
|
206 |
* @return Returns the pts. |
|
207 |
*/ |
|
208 |
public Vector getPts() { |
|
209 |
return pts; |
|
210 |
} |
|
211 |
/** |
|
212 |
* @param pts The pts to set. |
|
213 |
*/ |
|
214 |
public void setPts(Vector pts) { |
|
215 |
this.pts = pts; |
|
216 |
} |
|
217 |
/** |
|
218 |
* @return Returns the bulges. |
|
219 |
*/ |
|
220 |
public Vector getBulges() { |
|
221 |
return bulges; |
|
222 |
} |
|
223 |
/** |
|
224 |
* @param bulges The bulges to set. |
|
225 |
*/ |
|
226 |
public void setBulges(Vector bulges) { |
|
227 |
this.bulges = bulges; |
|
228 |
} |
|
184 | 229 |
} |
Also available in: Unified diff