root / branches / v02_desarrollo / libraries / libCq CMS for java.old / src / org / cresques / px / dxf / DxfFeatureMaker.java @ 227
History | View | Annotate | Download (64.6 KB)
1 |
package org.cresques.px.dxf; |
---|---|
2 |
|
3 |
import org.cresques.cts.ICoordTrans; |
4 |
import org.cresques.cts.IProjection; |
5 |
import org.cresques.geo.Point3D; |
6 |
import org.cresques.geo.Projected; |
7 |
import org.cresques.geo.ViewPortData; |
8 |
import org.cresques.io.DxfFile; |
9 |
import org.cresques.io.DxfGroup; |
10 |
import org.cresques.io.DxfGroupVector; |
11 |
import org.cresques.px.Extent; |
12 |
import org.cresques.px.IObjList; |
13 |
import org.cresques.px.gml.Feature; |
14 |
import org.cresques.px.gml.FeatureCollection; |
15 |
import org.cresques.px.gml.InsPoint; |
16 |
import org.cresques.px.gml.LineString; |
17 |
import org.cresques.px.gml.Point; |
18 |
import org.cresques.px.gml.Polygon; |
19 |
import java.util.Iterator; |
20 |
import java.util.Vector; |
21 |
import java.awt.Graphics2D; |
22 |
import java.awt.geom.GeneralPath; |
23 |
import java.awt.geom.Point2D; |
24 |
|
25 |
public class DxfFeatureMaker implements DxfFile.EntityFactory, Projected { |
26 |
IProjection proj = null;
|
27 |
//Feature lastFeature = null;
|
28 |
Feature lastFeaBordes = null;
|
29 |
Feature lastFeaFondos = null;
|
30 |
boolean isDoubleFeatured = false; |
31 |
FeatureCollection features = null;
|
32 |
double bulge = 0.0; |
33 |
double xtruX=0.0, xtruY=0.0, xtruZ=1.0; |
34 |
int polylineFlag = 0; |
35 |
Point2D firstPt = new Point2D.Double(); |
36 |
Point2D ptAnterior = null; |
37 |
|
38 |
boolean addingToBlock = false; |
39 |
int iterator = 0; |
40 |
FeatureCollection blk = null;
|
41 |
Vector blkList = null; |
42 |
DxfTable layers = null;
|
43 |
|
44 |
private Vector faces = null; |
45 |
private boolean hasFaces = false; |
46 |
private int facesIterador = 1; |
47 |
private Point2D facesFirstPoint = null; |
48 |
|
49 |
public DxfFeatureMaker(IProjection proj) {
|
50 |
this.proj = proj;
|
51 |
layers = new DxfTable();
|
52 |
features = new FeatureCollection(proj);
|
53 |
blkList = new Vector(); |
54 |
} |
55 |
|
56 |
public void setAddingToBlock(boolean a) { addingToBlock = a; } |
57 |
|
58 |
public void createLayer(DxfGroupVector v) throws Exception { |
59 |
int color = v.getDataAsInt(62); |
60 |
DxfLayer layer = new DxfLayer(v.getDataAsString(2), Math.abs(v.getDataAsInt(62))); |
61 |
if (color < 0) { |
62 |
layer.isOff = true;
|
63 |
} |
64 |
layer.lType = v.getDataAsString(6);
|
65 |
layer.setFlags(v.getDataAsInt(70));
|
66 |
// compruebo flags
|
67 |
if ((layer.flags & 0x01) == 0x01) { |
68 |
layer.frozen = true;
|
69 |
} |
70 |
if ((layer.flags & 0x02) == 0x02) { |
71 |
layer.frozen = true;
|
72 |
} |
73 |
System.out.println("LAYER color="+layer.getColor()); |
74 |
|
75 |
layers.add(layer); |
76 |
} |
77 |
|
78 |
public void createPolyline(DxfGroupVector grp) throws Exception { |
79 |
LineString lineString = new LineString();
|
80 |
Polygon polygon = new Polygon(); |
81 |
//Feature feature= new Feature();
|
82 |
Feature feaBordes= new Feature();
|
83 |
Feature feaFondos= new Feature();
|
84 |
double x = 0.0, y = 0.0, z = 0.0; |
85 |
int flags = 0; |
86 |
|
87 |
//feature.setProp("dxfEntity", "Polyline");
|
88 |
feaBordes.setProp("dxfEntity", "Polyline"); |
89 |
feaFondos.setProp("dxfEntity", "Polyline"); |
90 |
if (grp.hasCode(8)) { |
91 |
//feature.setProp("layer", grp.getDataAsString(8));
|
92 |
feaBordes.setProp("layer", grp.getDataAsString(8)); |
93 |
feaFondos.setProp("layer", grp.getDataAsString(8)); |
94 |
} |
95 |
if (grp.hasCode(39)) { |
96 |
Double doub = new Double(grp.getDataAsDouble(39)); |
97 |
String string = doub.toString();
|
98 |
//feature.setProp("thickness", string);
|
99 |
feaBordes.setProp("thickness", string);
|
100 |
feaFondos.setProp("thickness", string);
|
101 |
} else {
|
102 |
Double doub = new Double(0.0); |
103 |
//feature.setProp("thickness", doub.toString());
|
104 |
feaBordes.setProp("thickness", doub.toString());
|
105 |
feaFondos.setProp("thickness", doub.toString());
|
106 |
} |
107 |
if (grp.hasCode(62)) { |
108 |
Integer integer = new Integer(grp.getDataAsInt(62)); |
109 |
String string = integer.toString();
|
110 |
//feature.setProp("color", string);
|
111 |
feaBordes.setProp("color", string);
|
112 |
feaFondos.setProp("color", string);
|
113 |
feaBordes.setProp("colorByLayer", "false"); |
114 |
feaFondos.setProp("colorByLayer", "false"); |
115 |
} else {
|
116 |
DxfLayer layer = (DxfLayer)layers.getByName(grp.getDataAsString(8));
|
117 |
int clr = layer.colorNumber;
|
118 |
Integer integer = new Integer(clr); |
119 |
String string = integer.toString();
|
120 |
//feature.setProp("color", string);
|
121 |
feaBordes.setProp("color", string);
|
122 |
feaFondos.setProp("color", string);
|
123 |
feaBordes.setProp("colorByLayer", "true"); |
124 |
feaFondos.setProp("colorByLayer", "true"); |
125 |
} |
126 |
if (grp.hasCode(10)) |
127 |
x = grp.getDataAsDouble(10);
|
128 |
if (grp.hasCode(20)) |
129 |
y = grp.getDataAsDouble(20);
|
130 |
if (grp.hasCode(30)) { |
131 |
z = grp.getDataAsDouble(30);
|
132 |
Double doub = new Double(z); |
133 |
String string = doub.toString();
|
134 |
//feature.setProp("elevation", string);
|
135 |
feaBordes.setProp("elevation", string);
|
136 |
feaFondos.setProp("elevation", string);
|
137 |
} else {
|
138 |
Double doub = new Double(0.0); |
139 |
//feature.setProp("elevation", doub.toString());
|
140 |
feaBordes.setProp("elevation", doub.toString());
|
141 |
feaFondos.setProp("elevation", doub.toString());
|
142 |
} |
143 |
if (grp.hasCode(70)) |
144 |
flags = grp.getDataAsInt(70);
|
145 |
if (grp.hasCode(210)) |
146 |
xtruX = grp.getDataAsDouble(210);
|
147 |
if (grp.hasCode(220)) |
148 |
xtruY = grp.getDataAsDouble(220);
|
149 |
if (grp.hasCode(230)) |
150 |
xtruZ = grp.getDataAsDouble(230);
|
151 |
if ((flags & 0x01) == 0x01 || (flags & 0x40) == 0x40) { |
152 |
feaBordes.setGeometry(lineString); |
153 |
feaFondos.setGeometry(polygon); |
154 |
lastFeaBordes = feaBordes; |
155 |
lastFeaFondos = feaFondos; |
156 |
isDoubleFeatured = true;
|
157 |
} else if ((flags & 0x01) == 0x00) { |
158 |
feaBordes.setGeometry(lineString); |
159 |
lastFeaBordes = feaBordes; |
160 |
isDoubleFeatured = false;
|
161 |
} else {
|
162 |
System.out.println("Detectada una Polyline Flag que no corresponde"); |
163 |
System.out.println("a una Polyline corriente, ni a una Closed Polyline"); |
164 |
} |
165 |
} |
166 |
|
167 |
public void endSeq() throws Exception { |
168 |
if (isDoubleFeatured) {
|
169 |
if (lastFeaBordes.getGeometry() instanceof LineString) { |
170 |
Feature feaBordes = lastFeaBordes; |
171 |
Feature feaFondos = lastFeaFondos; |
172 |
LineString lineString = (LineString)feaBordes.getGeometry(); |
173 |
Polygon polygon = (Polygon)feaFondos.getGeometry(); |
174 |
lineString.add(firstPt); |
175 |
// 041103: linea anulada porque hay pol?gonos en los que al final
|
176 |
// a?ade el (0,0). Parece que a?adimos el punto inicial
|
177 |
// del pol?gono una vez pero parece que el pol?gono, por
|
178 |
// el hecho de ser pol?gono, ya se a?ade el punto inicial
|
179 |
// al final, con lo que estamos duplicando el punto inicial
|
180 |
// del pol?gono al final del mismo.
|
181 |
//polygon.add(firstPt);
|
182 |
if (bulge!=0) { |
183 |
bulge = 0.0;
|
184 |
} |
185 |
|
186 |
if (hasFaces) {
|
187 |
//System.out.println("Sabe que es un poligono.");
|
188 |
//System.out.println("POLYLINE: caras=" +faces.size()+", puntos="+ lineString.pointNr());
|
189 |
LineString ls1 = new LineString();
|
190 |
Polygon pl1 = new Polygon(); |
191 |
LineString ls2 = new LineString();
|
192 |
Polygon pl2 = new Polygon(); |
193 |
LineString ls = new LineString();
|
194 |
Polygon pl = new Polygon(); |
195 |
int [] face; |
196 |
int i0, i1;
|
197 |
Iterator iter = faces.iterator();
|
198 |
while (iter.hasNext()) {
|
199 |
face = (int []) iter.next(); |
200 |
i0 = face[3];
|
201 |
for (int i=0; i<4; i++) { |
202 |
i1 = face[i]; |
203 |
if (i0 > 0) { |
204 |
if ((facesIterador%2)!=0) { |
205 |
//System.out.println("endSeq(): hasFaces = " + hasFaces);
|
206 |
ls1.add((Point2D)lineString.get(i0-1)); |
207 |
pl1.add((Point2D)polygon.get(i0-1)); |
208 |
//ls1.add((Point2D)lineString.get(Math.abs(i1)-1));
|
209 |
//pl1.add((Point2D)polygon.get(Math.abs(i1)-1));
|
210 |
} else {
|
211 |
ls2.add((Point2D)lineString.get(i0-1)); |
212 |
pl2.add((Point2D)polygon.get(i0-1)); |
213 |
//ls2.add((Point2D)lineString.get(Math.abs(i1)-1));
|
214 |
//pl2.add((Point2D)polygon.get(Math.abs(i1)-1));
|
215 |
} |
216 |
facesIterador = facesIterador + 1;
|
217 |
} |
218 |
i0 = i1; |
219 |
} |
220 |
} |
221 |
facesFirstPoint = new Point2D.Double(ls1.get(0).getX(), ls1.get(0).getY()); |
222 |
for (int i=0;i<ls1.pointNr();i++) { |
223 |
ls.add(ls1.get(i)); |
224 |
pl.add(pl1.get(i)); |
225 |
} |
226 |
for (int i=ls2.pointNr()-1;i>0;i--) { |
227 |
ls.add(ls2.get(i)); |
228 |
pl.add(pl2.get(i)); |
229 |
} |
230 |
ls.add(facesFirstPoint); |
231 |
pl.add(facesFirstPoint); |
232 |
lastFeaBordes.setGeometry(ls); |
233 |
lastFeaFondos.setGeometry(pl); |
234 |
} else {
|
235 |
lastFeaBordes.setGeometry(lineString); |
236 |
lastFeaFondos.setGeometry(polygon); |
237 |
} |
238 |
|
239 |
if (addingToBlock == false) { |
240 |
features.add(lastFeaBordes); |
241 |
features.add(lastFeaFondos); |
242 |
} else {
|
243 |
blk.add(lastFeaBordes); |
244 |
blk.add(lastFeaFondos); |
245 |
} |
246 |
lastFeaBordes = null;
|
247 |
lastFeaFondos = null;
|
248 |
} else {
|
249 |
// Se trata de un SEQEND despues de un ATTRIB
|
250 |
} |
251 |
} else {
|
252 |
if (lastFeaBordes.getGeometry() instanceof LineString) { |
253 |
Feature feaBordes = lastFeaBordes; |
254 |
LineString lineString = (LineString)feaBordes.getGeometry(); |
255 |
if (bulge!=0) { |
256 |
bulge = 0.0;
|
257 |
} |
258 |
|
259 |
if (hasFaces) {
|
260 |
//System.out.println("POLYLINE: caras=" +faces.size()+", puntos="+ lineString.pointNr());
|
261 |
LineString ls1 = new LineString();
|
262 |
LineString ls2 = new LineString();
|
263 |
LineString ls = new LineString();
|
264 |
int [] face; |
265 |
int i0, i1;
|
266 |
Iterator iter = faces.iterator();
|
267 |
while (iter.hasNext()) {
|
268 |
face = (int []) iter.next(); |
269 |
i0 = face[3];
|
270 |
for (int i=0; i<4; i++) { |
271 |
i1 = face[i]; |
272 |
if (i0 > 0) { |
273 |
if ((facesIterador%2)!=0) { |
274 |
ls1.add((Point2D)lineString.get(i0-1)); |
275 |
//ls.add((Point2D)lineString.get(Math.abs(i1)-1));
|
276 |
} else {
|
277 |
ls2.add((Point2D)lineString.get(i0-1)); |
278 |
//ls.add((Point2D)lineString.get(Math.abs(i1)-1));
|
279 |
} |
280 |
facesIterador = facesIterador + 1;
|
281 |
} |
282 |
i0 = i1; |
283 |
} |
284 |
} |
285 |
facesFirstPoint = new Point2D.Double(ls1.get(0).getX(), ls1.get(0).getY()); |
286 |
for (int i=0;i<ls1.pointNr();i++) { |
287 |
ls.add(ls1.get(i)); |
288 |
} |
289 |
for (int i=ls2.pointNr()-1;i>0;i--) { |
290 |
ls.add(ls2.get(i)); |
291 |
} |
292 |
ls.add(facesFirstPoint); |
293 |
lastFeaBordes.setGeometry(ls); |
294 |
} else {
|
295 |
lastFeaBordes.setGeometry(lineString); |
296 |
} |
297 |
|
298 |
if (addingToBlock == false) { |
299 |
features.add(lastFeaBordes); |
300 |
} else {
|
301 |
blk.add(lastFeaBordes); |
302 |
} |
303 |
lastFeaBordes = null;
|
304 |
} else {
|
305 |
// Se trata de un SEQEND despues de un ATTRIB
|
306 |
} |
307 |
} |
308 |
xtruX = 0.0;
|
309 |
xtruY = 0.0;
|
310 |
xtruZ = 1.0;
|
311 |
bulge = 0.0;
|
312 |
isDoubleFeatured = false;
|
313 |
hasFaces = false;
|
314 |
facesIterador = 1;
|
315 |
} |
316 |
|
317 |
public void addVertex(DxfGroupVector grp) throws Exception { |
318 |
double x = 0.0, y = 0.0, z = 0.0; |
319 |
int vFlags = 0; |
320 |
if (isDoubleFeatured) {
|
321 |
Feature feaBordes = lastFeaBordes; |
322 |
Feature feaFondos = lastFeaFondos; |
323 |
LineString lineString = (LineString)feaBordes.getGeometry(); |
324 |
Polygon polygon = (Polygon)feaFondos.getGeometry(); |
325 |
if (grp.hasCode(8)) { |
326 |
feaBordes.setProp("layer", grp.getDataAsString(8)); |
327 |
feaFondos.setProp("layer", grp.getDataAsString(8)); |
328 |
} |
329 |
if (grp.hasCode(70)) { |
330 |
vFlags = grp.getDataAsInt(70);
|
331 |
} |
332 |
x = grp.getDataAsDouble(10);
|
333 |
y = grp.getDataAsDouble(20);
|
334 |
if (grp.hasCode(30)) { |
335 |
z = grp.getDataAsDouble(30);
|
336 |
} |
337 |
Point3D point_in = new Point3D(x, y, z);
|
338 |
Point3D xtru = new Point3D(xtruX, xtruY, xtruZ);
|
339 |
Point2D point_out = DxfCalXtru.CalculateXtru(point_in, xtru);
|
340 |
x = point_out.getX(); |
341 |
y = point_out.getY(); |
342 |
//System.out.println("addVertex(): vFlags = " + vFlags);
|
343 |
if ((vFlags & 0x80) == 0x80 && (vFlags & 0x40) == 0) { |
344 |
int [] face = {0,0,0,0}; |
345 |
face[0] = grp.getDataAsInt(71); |
346 |
face[1] = grp.getDataAsInt(72); |
347 |
face[2] = grp.getDataAsInt(73); |
348 |
face[3] = grp.getDataAsInt(74); |
349 |
addFace(face); |
350 |
} else if ((vFlags & 0x10) == 0x10) { |
351 |
// Son vertices que se trataran cuando se implementen
|
352 |
// los splines. En principio no se hace nada con ellos.
|
353 |
} else {
|
354 |
Point2D pt = proj.createPoint( x, y);
|
355 |
lineString.add(pt); |
356 |
polygon.add(pt); |
357 |
if (lineString.pointNr() == 1) { |
358 |
firstPt = pt; |
359 |
} |
360 |
if (bulge == 0.0) { |
361 |
if (grp.hasCode(42)) { |
362 |
bulge = grp.getDataAsDouble(42);
|
363 |
} else { bulge = 0.0; } |
364 |
} else {
|
365 |
double bulge_aux = 0.0; |
366 |
if (grp.hasCode(42)) { |
367 |
bulge_aux = grp.getDataAsDouble(42);
|
368 |
} else { bulge_aux = 0.0; } |
369 |
//int cnt = lineString.pointNr();
|
370 |
//System.out.println("addVertex(): lineString.pointNr() = " + lineString.pointNr());
|
371 |
lineString.remove(lineString.pointNr()-1);
|
372 |
lineString.remove(lineString.pointNr()-1);
|
373 |
//System.out.println("addVertex(): polygon.pointNr() = " + polygon.pointNr());
|
374 |
polygon.remove(polygon.pointNr()-1);
|
375 |
polygon.remove(polygon.pointNr()-1);
|
376 |
Vector arc = createArc(ptAnterior, pt, bulge);
|
377 |
if (bulge>0) { |
378 |
for (int i=0; i<arc.size(); i++) { |
379 |
Point2D ptAux = new Point2D.Double(); |
380 |
ptAux = proj.createPoint(((Point2D)arc.get(i)).getX(), ((Point2D)arc.get(i)).getY()); |
381 |
lineString.add(ptAux); |
382 |
polygon.add(ptAux); |
383 |
if (lineString.pointNr() == 1) firstPt = ptAux; |
384 |
} |
385 |
} else {
|
386 |
for (int i=arc.size()-1; i>=0; i--) { |
387 |
Point2D ptAux = new Point2D.Double(); |
388 |
ptAux = proj.createPoint(((Point2D)arc.get(i)).getX(), ((Point2D)arc.get(i)).getY()); |
389 |
lineString.add(ptAux); |
390 |
polygon.add(ptAux); |
391 |
if (lineString.pointNr() == 1 || polygon.pointNr() == 1) firstPt = ptAux; |
392 |
} |
393 |
} |
394 |
bulge = bulge_aux; |
395 |
} |
396 |
ptAnterior = pt; |
397 |
} |
398 |
} else {
|
399 |
Feature feaBordes = lastFeaBordes; |
400 |
LineString lineString = (LineString)feaBordes.getGeometry(); |
401 |
if (grp.hasCode(8)) |
402 |
feaBordes.setProp("layer", grp.getDataAsString(8)); |
403 |
if (grp.hasCode(70)) { |
404 |
vFlags = grp.getDataAsInt(70);
|
405 |
} |
406 |
x = grp.getDataAsDouble(10);
|
407 |
y = grp.getDataAsDouble(20);
|
408 |
if (grp.hasCode(30)) { |
409 |
z = grp.getDataAsDouble(30);
|
410 |
} |
411 |
Point3D point_in = new Point3D(x, y, z);
|
412 |
Point3D xtru = new Point3D(xtruX, xtruY, xtruZ);
|
413 |
Point2D point_out = DxfCalXtru.CalculateXtru(point_in, xtru);
|
414 |
x = point_out.getX(); |
415 |
y = point_out.getY(); |
416 |
if ((vFlags & 0x80) == 0x80 && (vFlags & 0x40) == 0) { |
417 |
int [] face = {0,0,0,0}; |
418 |
face[0] = grp.getDataAsInt(71); |
419 |
face[1] = grp.getDataAsInt(72); |
420 |
face[2] = grp.getDataAsInt(73); |
421 |
face[3] = grp.getDataAsInt(74); |
422 |
addFace(face); |
423 |
} else if ((vFlags & 16) == 16) { |
424 |
// no se hace nada.
|
425 |
} else {
|
426 |
Point2D pt = proj.createPoint( x, y);
|
427 |
lineString.add(pt); |
428 |
//System.out.println("addVertex: pt = " + pt);
|
429 |
if (lineString.pointNr() == 1) { |
430 |
firstPt = pt; |
431 |
//System.out.println("addVertex(Primer pto de la lineString, firstPt=pt): firstPt = " + firstPt);
|
432 |
} |
433 |
if (bulge == 0.0) { |
434 |
if (grp.hasCode(42)) { |
435 |
bulge = grp.getDataAsDouble(42);
|
436 |
} else { bulge = 0.0; } |
437 |
//System.out.println("addVertex: El vertice anterior tenia bulge=0.0");
|
438 |
} else {
|
439 |
//System.out.println("addVertex: El vertice anterior tiene bulge = " + bulge);
|
440 |
double bulge_aux = 0.0; |
441 |
if (grp.hasCode(42)) { |
442 |
bulge_aux = grp.getDataAsDouble(42);
|
443 |
} else { bulge_aux = 0.0; } |
444 |
//int cnt = lineString.pointNr();
|
445 |
//System.out.println("addVertex: El vertice anterior tenia bulge. Se va a crear el");
|
446 |
//System.out.println("addVertex: arco del ptAnterior al ptActual.");
|
447 |
//System.out.println("addVertex: ptAnterior = " + ptAnterior + ", ptActual = " + pt);
|
448 |
// Borro los puntos inicio y final del arco.
|
449 |
lineString.remove(lineString.pointNr()-1);
|
450 |
lineString.remove(lineString.pointNr()-1);
|
451 |
Vector arc = createArc(ptAnterior, pt, bulge);
|
452 |
if (bulge>0) { |
453 |
for (int i=0; i<arc.size(); i++) { |
454 |
Point2D ptAux = new Point2D.Double(); |
455 |
ptAux = proj.createPoint(((Point2D)arc.get(i)).getX(), ((Point2D)arc.get(i)).getY()); |
456 |
lineString.add(ptAux); |
457 |
if (lineString.pointNr() == 1) firstPt = ptAux; |
458 |
} |
459 |
} else {
|
460 |
for (int i=arc.size()-1; i>=0; i--) { |
461 |
Point2D ptAux = new Point2D.Double(); |
462 |
ptAux = proj.createPoint(((Point2D)arc.get(i)).getX(), ((Point2D)arc.get(i)).getY()); |
463 |
lineString.add(ptAux); |
464 |
if (lineString.pointNr() == 1) firstPt = ptAux; |
465 |
} |
466 |
} |
467 |
bulge = bulge_aux; |
468 |
} |
469 |
ptAnterior = pt; |
470 |
} |
471 |
} |
472 |
} |
473 |
|
474 |
public void createLwPolyline(DxfGroupVector grp) throws Exception { |
475 |
double x = 0.0, y = 0.0; |
476 |
double elev = 0.0; |
477 |
DxfGroup g = null;
|
478 |
LineString lineString = new LineString();
|
479 |
Polygon polygon = new Polygon(); |
480 |
//Geometry geometria;
|
481 |
//Feature feature= new Feature();
|
482 |
Feature feaBordes= new Feature();
|
483 |
Feature feaFondos= new Feature();
|
484 |
int flags = 0; |
485 |
|
486 |
//feature.setProp("dxfEntity", "LwPolyline");
|
487 |
feaBordes.setProp("dxfEntity", "LwPolyline"); |
488 |
feaFondos.setProp("dxfEntity", "LwPolyline"); |
489 |
if (grp.hasCode(8)) |
490 |
//feature.setProp("layer", grp.getDataAsString(8));
|
491 |
feaBordes.setProp("layer", grp.getDataAsString(8)); |
492 |
feaFondos.setProp("layer", grp.getDataAsString(8)); |
493 |
if (grp.hasCode(38)) { |
494 |
elev = grp.getDataAsDouble(38);
|
495 |
Double doub = new Double(elev); |
496 |
String string = doub.toString();
|
497 |
//feature.setProp("elevation", string);
|
498 |
feaBordes.setProp("elevation", string);
|
499 |
feaFondos.setProp("elevation", string);
|
500 |
} else {
|
501 |
Double doub = new Double(0.0); |
502 |
//feature.setProp("elevation", doub.toString());
|
503 |
feaBordes.setProp("elevation", doub.toString());
|
504 |
feaFondos.setProp("elevation", doub.toString());
|
505 |
} |
506 |
if (grp.hasCode(39)) { |
507 |
Double doub = new Double(grp.getDataAsDouble(39)); |
508 |
String string = doub.toString();
|
509 |
//feature.setProp("thickness", string);
|
510 |
feaBordes.setProp("thickness", string);
|
511 |
feaFondos.setProp("thickness", string);
|
512 |
} else {
|
513 |
Double doub = new Double(0.0); |
514 |
//feature.setProp("thickness", doub.toString());
|
515 |
feaBordes.setProp("thickness", doub.toString());
|
516 |
feaFondos.setProp("thickness", doub.toString());
|
517 |
} |
518 |
if (grp.hasCode(62)) { |
519 |
Integer integer = new Integer(grp.getDataAsInt(62)); |
520 |
String string = integer.toString();
|
521 |
//feature.setProp("color", string);
|
522 |
feaBordes.setProp("color", string);
|
523 |
feaFondos.setProp("color", string);
|
524 |
feaBordes.setProp("colorByLayer", "false"); |
525 |
feaFondos.setProp("colorByLayer", "false"); |
526 |
} else {
|
527 |
DxfLayer layer = (DxfLayer)layers.getByName(grp.getDataAsString(8));
|
528 |
int clr = layer.colorNumber;
|
529 |
Integer integer = new Integer(clr); |
530 |
String string = integer.toString();
|
531 |
//feature.setProp("color", string);
|
532 |
feaBordes.setProp("color", string);
|
533 |
feaFondos.setProp("color", string);
|
534 |
feaBordes.setProp("colorByLayer", "true"); |
535 |
feaFondos.setProp("colorByLayer", "true"); |
536 |
} |
537 |
if (grp.hasCode(70)) |
538 |
flags = grp.getDataAsInt(70);
|
539 |
if ((flags & 0x01) == 0x01) { |
540 |
//geometria = new Polygon();
|
541 |
feaBordes.setGeometry(lineString); |
542 |
feaFondos.setGeometry(polygon); |
543 |
isDoubleFeatured = true;
|
544 |
} else {
|
545 |
//geometria = new LineString();
|
546 |
feaBordes.setGeometry(lineString); |
547 |
isDoubleFeatured = false;
|
548 |
} |
549 |
|
550 |
int j = 0; |
551 |
double firstX = 0.0; |
552 |
double firstY = 0.0; |
553 |
for (int i=0; i<grp.size(); i++) { |
554 |
g = (DxfGroup) grp.get(i); |
555 |
if (g.getCode() == 10) { |
556 |
j++; |
557 |
x = ((Double) g.getData()).doubleValue();
|
558 |
} else if (g.getCode() == 20) { |
559 |
y = ((Double) g.getData()).doubleValue();
|
560 |
//if (y <= 1.0) throw new Exception("Y == "+y);
|
561 |
//lineString.add( proj.createPoint( x, y ) );
|
562 |
//polygon.add( proj.createPoint( x, y ) );
|
563 |
//geometria.add( proj.createPoint( x, y ) );
|
564 |
lineString.add( proj.createPoint( x, y ) ); |
565 |
if (isDoubleFeatured) polygon.add( proj.createPoint( x, y ) );
|
566 |
if (j == 1) { |
567 |
firstX = x; |
568 |
firstY = y; |
569 |
} |
570 |
x = 0.0; y = 0.0; |
571 |
} |
572 |
} |
573 |
if (isDoubleFeatured) {
|
574 |
//geometria.add(proj.createPoint(firstX, firstY));
|
575 |
lineString.add(proj.createPoint(firstX, firstY)); |
576 |
polygon.add(proj.createPoint(firstX, firstY)); |
577 |
} |
578 |
|
579 |
lastFeaBordes = feaBordes; |
580 |
if (isDoubleFeatured) lastFeaFondos = feaFondos;
|
581 |
//features.add(feature);
|
582 |
if (addingToBlock == false) { |
583 |
features.add(feaBordes); |
584 |
if (isDoubleFeatured) features.add(feaFondos);
|
585 |
} else {
|
586 |
//System.out.println("createLwPolyline(): A?adimos una lwpolilinea al bloque " + iterator);
|
587 |
blk.add(feaBordes); |
588 |
if (isDoubleFeatured) blk.add(feaFondos);
|
589 |
} |
590 |
isDoubleFeatured = false;
|
591 |
} |
592 |
|
593 |
public void createLine(DxfGroupVector grp) throws Exception { |
594 |
double x = 0.0, y = 0.0, z1 = 0.0, z2 = 0.0; |
595 |
double elev = 0.0; |
596 |
DxfGroup g = null;
|
597 |
Point2D pt1 = null, pt2 = null; |
598 |
LineString lineString = new LineString();
|
599 |
Feature feature = new Feature();
|
600 |
|
601 |
feature.setProp("dxfEntity", "Line"); |
602 |
if (grp.hasCode(8)) |
603 |
feature.setProp("layer", grp.getDataAsString(8)); |
604 |
if (grp.hasCode(39)) { |
605 |
Double doub = new Double(grp.getDataAsDouble(39)); |
606 |
String string = doub.toString();
|
607 |
feature.setProp("thickness", string);
|
608 |
} else {
|
609 |
Double doub = new Double(0.0); |
610 |
feature.setProp("thickness", doub.toString());
|
611 |
} |
612 |
if (grp.hasCode(62)) { |
613 |
Integer integer = new Integer(grp.getDataAsInt(62)); |
614 |
String string = integer.toString();
|
615 |
feature.setProp("color", string);
|
616 |
feature.setProp("colorByLayer", "false"); |
617 |
} else {
|
618 |
DxfLayer layer = (DxfLayer)layers.getByName(grp.getDataAsString(8));
|
619 |
int clr = layer.colorNumber;
|
620 |
Integer integer = new Integer(clr); |
621 |
String string = integer.toString();
|
622 |
feature.setProp("color", string);
|
623 |
feature.setProp("colorByLayer", "true"); |
624 |
} |
625 |
x = grp.getDataAsDouble(10);
|
626 |
y = grp.getDataAsDouble(20);
|
627 |
if (grp.hasCode(30)) { |
628 |
z1 = grp.getDataAsDouble(30);
|
629 |
elev = z1; |
630 |
Double doub = new Double(elev); |
631 |
String string = doub.toString();
|
632 |
feature.setProp("elevation", string);
|
633 |
} |
634 |
pt1 = proj.createPoint(x, y); |
635 |
x = grp.getDataAsDouble(11);
|
636 |
y = grp.getDataAsDouble(21);
|
637 |
if (grp.hasCode(31)) { |
638 |
z2 = grp.getDataAsDouble(31);
|
639 |
} else {
|
640 |
// Cuando no se especifican z para las lineas se asume que la
|
641 |
// z es cero.
|
642 |
Double doub = new Double(0.0); |
643 |
feature.setProp("elevation", doub.toString());
|
644 |
} |
645 |
pt2 = proj.createPoint(x, y); |
646 |
if (grp.hasCode(210)) |
647 |
xtruX = grp.getDataAsDouble(210);
|
648 |
if (grp.hasCode(220)) |
649 |
xtruY = grp.getDataAsDouble(220);
|
650 |
if (grp.hasCode(230)) |
651 |
xtruZ = grp.getDataAsDouble(230);
|
652 |
Point3D point_in1 = new Point3D(pt1.getX(), pt1.getY(), z1);
|
653 |
Point3D point_in2 = new Point3D(pt2.getX(), pt2.getY(), z2);
|
654 |
Point3D xtru = new Point3D(xtruX, xtruY, xtruZ);
|
655 |
Point2D point_out1 = DxfCalXtru.CalculateXtru(point_in1, xtru);
|
656 |
Point2D point_out2 = DxfCalXtru.CalculateXtru(point_in2, xtru);
|
657 |
pt1.setLocation(point_out1); |
658 |
pt2.setLocation(point_out2); |
659 |
lineString.add(pt1); |
660 |
lineString.add(pt2); |
661 |
|
662 |
feature.setGeometry(lineString); |
663 |
//features.add(feature);
|
664 |
if (addingToBlock == false) { |
665 |
//System.out.println("createLine(): A?adimos una linea a la lista de entidades");
|
666 |
features.add(feature); |
667 |
} else {
|
668 |
//System.out.println("createLine(): A?adimos una linea al bloque " + iterator);
|
669 |
blk.add(feature); |
670 |
} |
671 |
} |
672 |
|
673 |
/* (non-Javadoc)
|
674 |
* @see org.cresques.io.DxfFile.EntityFactory#createText(org.cresques.io.DxfGroupVector)
|
675 |
*/
|
676 |
public void createText(DxfGroupVector grp) throws Exception { |
677 |
double x = 0.0, y = 0.0, z = 0.0, h= 0.0, rot= 0.0; |
678 |
DxfGroup g = null;
|
679 |
Point2D pt1 = null, pt2 = null; |
680 |
Point2D pt = null; |
681 |
Point point = new Point(); |
682 |
|
683 |
point.isText = true;
|
684 |
|
685 |
Feature feature = new Feature();
|
686 |
|
687 |
feature.setProp("dxfEntity", "Text"); |
688 |
if (grp.hasCode(8)) |
689 |
feature.setProp("layer", grp.getDataAsString(8)); |
690 |
if (grp.hasCode(39)) { |
691 |
Double doub = new Double(grp.getDataAsDouble(39)); |
692 |
String string = doub.toString();
|
693 |
feature.setProp("thickness", string);
|
694 |
} else {
|
695 |
Double doub = new Double(0.0); |
696 |
feature.setProp("thickness", doub.toString());
|
697 |
} |
698 |
if (grp.hasCode(62)) { |
699 |
Integer integer = new Integer(grp.getDataAsInt(62)); |
700 |
String string = integer.toString();
|
701 |
feature.setProp("color", string);
|
702 |
feature.setProp("colorByLayer", "false"); |
703 |
} else {
|
704 |
DxfLayer layer = (DxfLayer)layers.getByName(grp.getDataAsString(8));
|
705 |
int clr = layer.colorNumber;
|
706 |
Integer integer = new Integer(clr); |
707 |
String string = integer.toString();
|
708 |
feature.setProp("color", string);
|
709 |
feature.setProp("colorByLayer", "true"); |
710 |
} |
711 |
if (grp.hasCode(1)) { |
712 |
String strAux1 = grp.getDataAsString(1); |
713 |
strAux1 = DxfConvTexts.ConvertText(strAux1); |
714 |
feature.setProp("text", strAux1);
|
715 |
} else {
|
716 |
feature.setProp("text", "No Text Code"); |
717 |
} |
718 |
if (grp.hasCode(40)) { |
719 |
Double heightD = new Double(grp.getDataAsDouble(40)); |
720 |
String heightS = heightD.toString();
|
721 |
feature.setProp("textHeight", heightS);
|
722 |
} else {
|
723 |
feature.setProp("textHeight", "20.0"); |
724 |
} |
725 |
if (grp.hasCode(50)) { |
726 |
Double rotD = new Double(grp.getDataAsDouble(50)); |
727 |
String rotS = rotD.toString();
|
728 |
feature.setProp("textRotation", rotS);
|
729 |
//System.out.println("rotS = " + rotS);
|
730 |
} else {
|
731 |
feature.setProp("textRotation", "0.0"); |
732 |
} |
733 |
x = grp.getDataAsDouble(10);
|
734 |
y = grp.getDataAsDouble(20);
|
735 |
if (grp.hasCode(30)){ |
736 |
z = grp.getDataAsDouble(30);
|
737 |
Double doub = new Double(z); |
738 |
String string = doub.toString();
|
739 |
feature.setProp("elevation", string);
|
740 |
} else {
|
741 |
Double doub = new Double(0.0); |
742 |
feature.setProp("elevation", doub.toString());
|
743 |
} |
744 |
if (grp.hasCode(210)) |
745 |
xtruX = grp.getDataAsDouble(210);
|
746 |
if (grp.hasCode(220)) |
747 |
xtruY = grp.getDataAsDouble(220);
|
748 |
if (grp.hasCode(230)) |
749 |
xtruZ = grp.getDataAsDouble(230);
|
750 |
Point3D point_in = new Point3D(x, y, z);
|
751 |
Point3D xtru = new Point3D(xtruX, xtruY, xtruZ);
|
752 |
Point2D point_out = DxfCalXtru.CalculateXtru(point_in, xtru);
|
753 |
x = point_out.getX(); |
754 |
y = point_out.getY(); |
755 |
//entity.setPt1(proj.createPoint(x, y));
|
756 |
//point.add(proj.createPoint(x, y));
|
757 |
//lineText.add(proj.createPoint(x, y));
|
758 |
/*if (grp.hasCode(11)) {
|
759 |
x = grp.getDataAsDouble(11);
|
760 |
y = grp.getDataAsDouble(21);
|
761 |
//entity.setPt2(proj.createPoint(x, y));
|
762 |
lineText.add(proj.createPoint(x, y));
|
763 |
}
|
764 |
entity.h = grp.getDataAsDouble(40);
|
765 |
if (grp.hasCode(50))
|
766 |
entity.rot = grp.getDataAsDouble(50);
|
767 |
if (grp.hasCode(62))
|
768 |
entity.dxfColor = grp.getDataAsInt(62);
|
769 |
if (grp.hasCode(72))
|
770 |
entity.align = grp.getDataAsInt(72);*/
|
771 |
point.add(new Point2D.Double(x, y)); |
772 |
feature.setGeometry(point); |
773 |
//entities.add(entity);
|
774 |
//features.add(feature);
|
775 |
if (addingToBlock == false) { |
776 |
features.add(feature); |
777 |
} else {
|
778 |
//System.out.println("createText(): A?adimos un text al bloque " + iterator);
|
779 |
blk.add(feature); |
780 |
} |
781 |
} |
782 |
|
783 |
public void createMText(DxfGroupVector grp) throws Exception { |
784 |
double x = 0.0, y = 0.0, z = 0.0, h= 0.0, rot= 0.0; |
785 |
DxfGroup g = null;
|
786 |
Point2D pt1 = null, pt2 = null; |
787 |
Point2D pt = null; |
788 |
Point point = new Point(); |
789 |
|
790 |
point.isText = true;
|
791 |
|
792 |
Feature feature = new Feature();
|
793 |
|
794 |
feature.setProp("dxfEntity", "Text"); |
795 |
if (grp.hasCode(8)) |
796 |
feature.setProp("layer", grp.getDataAsString(8)); |
797 |
if (grp.hasCode(39)) { |
798 |
Double doub = new Double(grp.getDataAsDouble(39)); |
799 |
String string = doub.toString();
|
800 |
feature.setProp("thickness", string);
|
801 |
} else {
|
802 |
Double doub = new Double(0.0); |
803 |
feature.setProp("thickness", doub.toString());
|
804 |
} |
805 |
if (grp.hasCode(62)) { |
806 |
Integer integer = new Integer(grp.getDataAsInt(62)); |
807 |
String string = integer.toString();
|
808 |
feature.setProp("color", string);
|
809 |
feature.setProp("colorByLayer", "false"); |
810 |
} else {
|
811 |
DxfLayer layer = (DxfLayer)layers.getByName(grp.getDataAsString(8));
|
812 |
int clr = layer.colorNumber;
|
813 |
Integer integer = new Integer(clr); |
814 |
String string = integer.toString();
|
815 |
feature.setProp("color", string);
|
816 |
feature.setProp("colorByLayer", "true"); |
817 |
} |
818 |
if (grp.hasCode(1)) { |
819 |
String strAux1 = grp.getDataAsString(1); |
820 |
strAux1 = DxfConvTexts.ConvertText(strAux1); |
821 |
feature.setProp("text", strAux1);
|
822 |
} else {
|
823 |
feature.setProp("text", "No Text Code"); |
824 |
} |
825 |
if (grp.hasCode(40)) { |
826 |
Double heightD = new Double(grp.getDataAsDouble(40)); |
827 |
String heightS = heightD.toString();
|
828 |
feature.setProp("textHeight", heightS);
|
829 |
} else {
|
830 |
feature.setProp("textHeight", "20.0"); |
831 |
} |
832 |
if (grp.hasCode(50)) { |
833 |
Double rotD = new Double(grp.getDataAsDouble(50)); |
834 |
String rotS = rotD.toString();
|
835 |
feature.setProp("textRotation", rotS);
|
836 |
//System.out.println("rotS = " + rotS);
|
837 |
} else {
|
838 |
feature.setProp("textRotation", "0.0"); |
839 |
} |
840 |
if (grp.hasCode(71)) { |
841 |
int attachPoint = grp.getDataAsInt(71); |
842 |
if (attachPoint == 1) { |
843 |
} else if (attachPoint == 2) { |
844 |
} else if (attachPoint == 3) { |
845 |
} else if (attachPoint == 4) { |
846 |
} else if (attachPoint == 5) { |
847 |
} else if (attachPoint == 6) { |
848 |
} else if (attachPoint == 7) { |
849 |
} else if (attachPoint == 8) { |
850 |
} else if (attachPoint == 9) { |
851 |
} |
852 |
} |
853 |
if (grp.hasCode(72)) { |
854 |
int drawDirection = grp.getDataAsInt(71); |
855 |
if (drawDirection == 1) { |
856 |
} else if (drawDirection == 3) { |
857 |
} else if (drawDirection == 5) { |
858 |
} |
859 |
} |
860 |
if (grp.hasCode(73)) { |
861 |
int spacingStyle = grp.getDataAsInt(71); |
862 |
if (spacingStyle == 1) { |
863 |
} else if (spacingStyle == 2) { |
864 |
} |
865 |
} |
866 |
x = grp.getDataAsDouble(10);
|
867 |
y = grp.getDataAsDouble(20);
|
868 |
if (grp.hasCode(30)){ |
869 |
z = grp.getDataAsDouble(30);
|
870 |
Double doub = new Double(z); |
871 |
String string = doub.toString();
|
872 |
feature.setProp("elevation", string);
|
873 |
} else {
|
874 |
Double doub = new Double(0.0); |
875 |
feature.setProp("elevation", doub.toString());
|
876 |
} |
877 |
if (grp.hasCode(210)) |
878 |
xtruX = grp.getDataAsDouble(210);
|
879 |
if (grp.hasCode(220)) |
880 |
xtruY = grp.getDataAsDouble(220);
|
881 |
if (grp.hasCode(230)) |
882 |
xtruZ = grp.getDataAsDouble(230);
|
883 |
Point3D point_in = new Point3D(x, y, z);
|
884 |
Point3D xtru = new Point3D(xtruX, xtruY, xtruZ);
|
885 |
Point2D point_out = DxfCalXtru.CalculateXtru(point_in, xtru);
|
886 |
x = point_out.getX(); |
887 |
y = point_out.getY(); |
888 |
point.add(new Point2D.Double(x, y)); |
889 |
feature.setGeometry(point); |
890 |
//entities.add(entity);
|
891 |
//features.add(feature);
|
892 |
if (addingToBlock == false) { |
893 |
features.add(feature); |
894 |
} else {
|
895 |
//System.out.println("createText(): A?adimos un text al bloque " + iterator);
|
896 |
blk.add(feature); |
897 |
} |
898 |
} |
899 |
|
900 |
public void createPoint(DxfGroupVector grp) throws Exception { |
901 |
double x = 0.0, y = 0.0, z = 0.0; |
902 |
DxfGroup g = null;
|
903 |
Point2D pt = null; |
904 |
Point point = new Point(); |
905 |
Feature feature = new Feature();
|
906 |
|
907 |
feature.setProp("dxfEntity", "Point"); |
908 |
if (grp.hasCode(8)) |
909 |
feature.setProp("layer", grp.getDataAsString(8)); |
910 |
if (grp.hasCode(39)) { |
911 |
Double doub = new Double(grp.getDataAsDouble(39)); |
912 |
String string = doub.toString();
|
913 |
feature.setProp("thickness", string);
|
914 |
} else {
|
915 |
Double doub = new Double(0.0); |
916 |
feature.setProp("thickness", doub.toString());
|
917 |
} |
918 |
if (grp.hasCode(62)) { |
919 |
Integer integer = new Integer(grp.getDataAsInt(62)); |
920 |
String string = integer.toString();
|
921 |
feature.setProp("color", string);
|
922 |
feature.setProp("colorByLayer", "false"); |
923 |
} else {
|
924 |
DxfLayer layer = (DxfLayer)layers.getByName(grp.getDataAsString(8));
|
925 |
int clr = layer.colorNumber;
|
926 |
Integer integer = new Integer(clr); |
927 |
String string = integer.toString();
|
928 |
feature.setProp("color", string);
|
929 |
feature.setProp("colorByLayer", "true"); |
930 |
} |
931 |
x = grp.getDataAsDouble(10);
|
932 |
y = grp.getDataAsDouble(20);
|
933 |
if (grp.hasCode(30)) { |
934 |
z = grp.getDataAsDouble(30);
|
935 |
Double doub = new Double(z); |
936 |
String string = doub.toString();
|
937 |
feature.setProp("elevation", string);
|
938 |
} else {
|
939 |
Double doub = new Double(0.0); |
940 |
feature.setProp("elevation", doub.toString());
|
941 |
} |
942 |
if (grp.hasCode(210)) |
943 |
xtruX = grp.getDataAsDouble(210);
|
944 |
if (grp.hasCode(220)) |
945 |
xtruY = grp.getDataAsDouble(220);
|
946 |
if (grp.hasCode(230)) |
947 |
xtruZ = grp.getDataAsDouble(230);
|
948 |
Point3D point_in = new Point3D(x, y, z);
|
949 |
Point3D xtru = new Point3D(xtruX, xtruY, xtruZ);
|
950 |
Point2D point_out = DxfCalXtru.CalculateXtru(point_in, xtru);
|
951 |
x = point_out.getX(); |
952 |
y = point_out.getY(); |
953 |
point.add(new Point2D.Double(x, y)); |
954 |
|
955 |
feature.setGeometry(point); |
956 |
//features.add(feature);
|
957 |
if (addingToBlock == false) { |
958 |
features.add(feature); |
959 |
} else {
|
960 |
//System.out.println("createPoint(): A?adimos un punto al bloque " + iterator);
|
961 |
blk.add(feature); |
962 |
} |
963 |
} |
964 |
|
965 |
public void createCircle(DxfGroupVector grp) throws Exception { |
966 |
double x = 0.0, y = 0.0, z = 0.0; |
967 |
double r = 0.0; |
968 |
DxfGroup g = null;
|
969 |
LineString lineString = new LineString();
|
970 |
Polygon polygon = new Polygon(); |
971 |
Feature feaBordes = new Feature();
|
972 |
Feature feaFondos = new Feature();
|
973 |
|
974 |
feaBordes.setProp("dxfEntity", "Circle"); |
975 |
feaFondos.setProp("dxfEntity", "Circle"); |
976 |
if (grp.hasCode(8)) |
977 |
feaBordes.setProp("layer", grp.getDataAsString(8)); |
978 |
feaFondos.setProp("layer", grp.getDataAsString(8)); |
979 |
if (grp.hasCode(39)) { |
980 |
Double doub = new Double(grp.getDataAsDouble(39)); |
981 |
String string = doub.toString();
|
982 |
feaBordes.setProp("thickness", string);
|
983 |
feaFondos.setProp("thickness", string);
|
984 |
} else {
|
985 |
Double doub = new Double(0.0); |
986 |
feaBordes.setProp("thickness", doub.toString());
|
987 |
feaFondos.setProp("thickness", doub.toString());
|
988 |
} |
989 |
if (grp.hasCode(62)) { |
990 |
Integer integer = new Integer(grp.getDataAsInt(62)); |
991 |
String string = integer.toString();
|
992 |
feaBordes.setProp("color", string);
|
993 |
feaFondos.setProp("color", string);
|
994 |
feaBordes.setProp("colorByLayer", "false"); |
995 |
feaFondos.setProp("colorByLayer", "false"); |
996 |
} else {
|
997 |
DxfLayer layer = (DxfLayer)layers.getByName(grp.getDataAsString(8));
|
998 |
int clr = layer.colorNumber;
|
999 |
Integer integer = new Integer(clr); |
1000 |
String string = integer.toString();
|
1001 |
feaBordes.setProp("color", string);
|
1002 |
feaFondos.setProp("color", string);
|
1003 |
feaBordes.setProp("colorByLayer", "true"); |
1004 |
feaFondos.setProp("colorByLayer", "true"); |
1005 |
} |
1006 |
x = grp.getDataAsDouble(10);
|
1007 |
y = grp.getDataAsDouble(20);
|
1008 |
if (grp.hasCode(30)) { |
1009 |
z = grp.getDataAsDouble(30);
|
1010 |
Double doub = new Double(z); |
1011 |
String string = doub.toString();
|
1012 |
feaBordes.setProp("elevation", string);
|
1013 |
feaFondos.setProp("elevation", string);
|
1014 |
} else {
|
1015 |
Double doub = new Double(0.0); |
1016 |
feaBordes.setProp("elevation", doub.toString());
|
1017 |
feaFondos.setProp("elevation", doub.toString());
|
1018 |
} |
1019 |
if (grp.hasCode(40)) r = grp.getDataAsDouble(40); |
1020 |
if (grp.hasCode(210)) |
1021 |
xtruX = grp.getDataAsDouble(210);
|
1022 |
if (grp.hasCode(220)) |
1023 |
xtruY = grp.getDataAsDouble(220);
|
1024 |
if (grp.hasCode(230)) |
1025 |
xtruZ = grp.getDataAsDouble(230);
|
1026 |
Point3D point_in = new Point3D(x, y, z);
|
1027 |
Point3D xtru = new Point3D(xtruX, xtruY, xtruZ);
|
1028 |
Point2D point_out = DxfCalXtru.CalculateXtru(point_in, xtru);
|
1029 |
x = point_out.getX(); |
1030 |
y = point_out.getY(); |
1031 |
|
1032 |
Point2D center = proj.createPoint( x, y);
|
1033 |
Point2D[] pts = new Point2D[360]; |
1034 |
int angulo = 0; |
1035 |
for (angulo=0; angulo<360; angulo++) { |
1036 |
pts[angulo] = new Point2D.Double(center.getX(), center.getY()); |
1037 |
pts[angulo].setLocation(pts[angulo].getX() + r * Math.sin(angulo*Math.PI/(double)180.0), pts[angulo].getY() + r * Math.cos(angulo*Math.PI/(double)180.0)); |
1038 |
if (pts.length == 1) { |
1039 |
firstPt = pts[angulo]; |
1040 |
} |
1041 |
} |
1042 |
for (int i=0; i<pts.length; i++) { |
1043 |
lineString.add(pts[i]); |
1044 |
polygon.add(pts[i]); |
1045 |
} |
1046 |
|
1047 |
feaBordes.setGeometry(lineString); |
1048 |
feaFondos.setGeometry(polygon); |
1049 |
//features.add(feature);
|
1050 |
if (addingToBlock == false) { |
1051 |
//System.out.println("createCircle(): A?ade un circulo a la lista de entidades");
|
1052 |
features.add(feaBordes); |
1053 |
features.add(feaFondos); |
1054 |
} else {
|
1055 |
//System.out.println("createCircle(): A?adimos un circulo al bloque " + iterator);
|
1056 |
blk.add(feaBordes); |
1057 |
blk.add(feaFondos); |
1058 |
} |
1059 |
} |
1060 |
|
1061 |
public void createArc(DxfGroupVector grp) throws Exception { |
1062 |
double x = 0.0, y = 0.0, z = 0.0; |
1063 |
double r = 0.0, empieza = 0.0, acaba = 0.0; |
1064 |
DxfGroup g = null;
|
1065 |
LineString lineString = new LineString();
|
1066 |
Feature feature = new Feature();
|
1067 |
|
1068 |
feature.setProp("dxfEntity", "Arc"); |
1069 |
if (grp.hasCode(8)) |
1070 |
feature.setProp("layer", grp.getDataAsString(8)); |
1071 |
if (grp.hasCode(39)) { |
1072 |
Double doub = new Double(grp.getDataAsDouble(39)); |
1073 |
String string = doub.toString();
|
1074 |
feature.setProp("thickness", string);
|
1075 |
} else {
|
1076 |
Double doub = new Double(0.0); |
1077 |
feature.setProp("thickness", doub.toString());
|
1078 |
} |
1079 |
if (grp.hasCode(62)) { |
1080 |
Integer integer = new Integer(grp.getDataAsInt(62)); |
1081 |
String string = integer.toString();
|
1082 |
feature.setProp("color", string);
|
1083 |
feature.setProp("colorByLayer", "false"); |
1084 |
} else {
|
1085 |
DxfLayer layer = (DxfLayer)layers.getByName(grp.getDataAsString(8));
|
1086 |
int clr = layer.colorNumber;
|
1087 |
Integer integer = new Integer(clr); |
1088 |
String string = integer.toString();
|
1089 |
feature.setProp("color", string);
|
1090 |
feature.setProp("colorByLayer", "true"); |
1091 |
} |
1092 |
x = grp.getDataAsDouble(10);
|
1093 |
y = grp.getDataAsDouble(20);
|
1094 |
if (grp.hasCode(30)) { |
1095 |
z = grp.getDataAsDouble(30);
|
1096 |
Double doub = new Double(z); |
1097 |
String string = doub.toString();
|
1098 |
feature.setProp("elevation", string);
|
1099 |
} else {
|
1100 |
Double doub = new Double(0.0); |
1101 |
feature.setProp("elevation", doub.toString());
|
1102 |
} |
1103 |
if (grp.hasCode(40)) r = grp.getDataAsDouble(40); |
1104 |
if (grp.hasCode(50)) empieza = grp.getDataAsDouble(50); |
1105 |
if (grp.hasCode(51)) acaba = grp.getDataAsDouble(51); |
1106 |
if (grp.hasCode(210)) |
1107 |
xtruX = grp.getDataAsDouble(210);
|
1108 |
if (grp.hasCode(220)) |
1109 |
xtruY = grp.getDataAsDouble(220);
|
1110 |
if (grp.hasCode(230)) |
1111 |
xtruZ = grp.getDataAsDouble(230);
|
1112 |
Point3D point_in = new Point3D(x, y, z);
|
1113 |
Point3D xtru = new Point3D(xtruX, xtruY, xtruZ);
|
1114 |
Point2D point_out = DxfCalXtru.CalculateXtru(point_in, xtru);
|
1115 |
x = point_out.getX(); |
1116 |
y = point_out.getY(); |
1117 |
|
1118 |
Point2D center = proj.createPoint( x, y);
|
1119 |
//System.out.println("empieza = " + empieza + ", acaba = " + acaba);
|
1120 |
int iempieza = (int)empieza; |
1121 |
int iacaba = (int)acaba; |
1122 |
//System.out.println("iempieza = " + iempieza + ", iacaba = " + iacaba);
|
1123 |
double angulo = 0; |
1124 |
Point2D[] pts = null; |
1125 |
if (empieza <= acaba) {
|
1126 |
pts = new Point2D[(iacaba-iempieza)+2]; |
1127 |
angulo = empieza; |
1128 |
pts[0] = new Point2D.Double(center.getX() + r * Math.cos(angulo*Math.PI/(double)180.0), center.getY() + r * Math.sin(angulo*Math.PI/(double)180.0)); |
1129 |
for (int i=1; i<=(iacaba-iempieza)+1; i++) { |
1130 |
angulo = (double)(iempieza+i);
|
1131 |
pts[i] = new Point2D.Double(center.getX() + r * Math.cos(angulo*Math.PI/(double)180.0), center.getY() + r * Math.sin(angulo*Math.PI/(double)180.0)); |
1132 |
} |
1133 |
angulo = acaba; |
1134 |
pts[(iacaba-iempieza)+1] = new Point2D.Double(center.getX() + r * Math.cos(angulo*Math.PI/(double)180.0), center.getY() + r * Math.sin(angulo*Math.PI/(double)180.0)); |
1135 |
} else {
|
1136 |
pts = new Point2D[(360-iempieza)+iacaba+2]; |
1137 |
angulo = empieza; |
1138 |
//System.out.println("pts[0] = " + pts[0] + ", center = " + center + ", angulo = " + angulo);
|
1139 |
pts[0] = new Point2D.Double(center.getX() + r * Math.cos(angulo*Math.PI/(double)180.0), center.getY() + r * Math.sin(angulo*Math.PI/(double)180.0)); |
1140 |
for (int i=1; i<=(360-iempieza); i++) { |
1141 |
angulo = (double)(iempieza+i);
|
1142 |
pts[i] = new Point2D.Double(center.getX() + r * Math.cos(angulo*Math.PI/(double)180.0), center.getY() + r * Math.sin(angulo*Math.PI/(double)180.0)); |
1143 |
} |
1144 |
for (int i=(360-iempieza)+1; i<=(360-iempieza)+iacaba; i++) { |
1145 |
angulo = (double)(i-(360-iempieza)); |
1146 |
pts[i] = new Point2D.Double(center.getX() + r * Math.cos(angulo*Math.PI/(double)180.0), center.getY() + r * Math.sin(angulo*Math.PI/(double)180.0)); |
1147 |
} |
1148 |
angulo = acaba; |
1149 |
pts[(360-iempieza)+iacaba+1] = new Point2D.Double(center.getX() + r * Math.cos(angulo*Math.PI/(double)180.0), center.getY() + r * Math.sin(angulo*Math.PI/(double)180.0)); |
1150 |
} |
1151 |
for (int i=0; i<pts.length; i++) { |
1152 |
lineString.add(pts[i]); |
1153 |
} |
1154 |
|
1155 |
feature.setGeometry(lineString); |
1156 |
//features.add(feature);
|
1157 |
if (addingToBlock == false) { |
1158 |
features.add(feature); |
1159 |
} else {
|
1160 |
//System.out.println("createArc(): A?adimos un arco al bloque " + iterator);
|
1161 |
blk.add(feature); |
1162 |
} |
1163 |
} |
1164 |
|
1165 |
public void createInsert(DxfGroupVector grp) throws Exception { |
1166 |
double x = 0.0, y = 0.0, z = 0.0; |
1167 |
DxfGroup g = null;
|
1168 |
Point2D pt = new Point2D.Double(0.0, 0.0); |
1169 |
Point2D scaleFactor = new Point2D.Double(1.0, 1.0); |
1170 |
double rotAngle = 0.0; |
1171 |
String blockName = ""; |
1172 |
|
1173 |
InsPoint insert = new InsPoint();
|
1174 |
Feature feature = new Feature();
|
1175 |
Point secondGeom = new Point(); |
1176 |
Feature secondFeat = new Feature();
|
1177 |
|
1178 |
feature.setProp("dxfEntity", "Insert"); |
1179 |
secondFeat.setProp("dxfEntity", "Insert"); |
1180 |
if (grp.hasCode(2)) { |
1181 |
blockName = grp.getDataAsString(2);
|
1182 |
//feature.setProp("blockName", blockName);
|
1183 |
insert.setBlockName(blockName); |
1184 |
} |
1185 |
if (grp.hasCode(8)) { |
1186 |
feature.setProp("layer", grp.getDataAsString(8)); |
1187 |
secondFeat.setProp("layer", grp.getDataAsString(8)); |
1188 |
} |
1189 |
|
1190 |
Double doub = new Double(0.0); |
1191 |
secondFeat.setProp("thickness", doub.toString());
|
1192 |
|
1193 |
if (grp.hasCode(62)) { |
1194 |
Integer integer = new Integer(grp.getDataAsInt(62)); |
1195 |
String string = integer.toString();
|
1196 |
feature.setProp("color", string);
|
1197 |
secondFeat.setProp("color", string);
|
1198 |
feature.setProp("colorByLayer", "false"); |
1199 |
secondFeat.setProp("colorByLayer", "false"); |
1200 |
} else {
|
1201 |
DxfLayer layer = (DxfLayer)layers.getByName(grp.getDataAsString(8));
|
1202 |
int clr = layer.colorNumber;
|
1203 |
Integer integer = new Integer(clr); |
1204 |
String string = integer.toString();
|
1205 |
feature.setProp("color", string);
|
1206 |
secondFeat.setProp("color", string);
|
1207 |
feature.setProp("colorByLayer", "true"); |
1208 |
secondFeat.setProp("colorByLayer", "true"); |
1209 |
} |
1210 |
if (grp.hasCode(10)) x = grp.getDataAsDouble(10); |
1211 |
if (grp.hasCode(20)) y = grp.getDataAsDouble(20); |
1212 |
if (grp.hasCode(30)) { |
1213 |
z = grp.getDataAsDouble(30);
|
1214 |
Double doubz = new Double(z); |
1215 |
String string = doubz.toString();
|
1216 |
feature.setProp("elevation", string);
|
1217 |
secondFeat.setProp("elevation", string);
|
1218 |
} else {
|
1219 |
Double elev = new Double(z); |
1220 |
//feature.setProp("elevation", doub.toString());
|
1221 |
feature.setProp("elevation", elev.toString());
|
1222 |
secondFeat.setProp("elevation", elev.toString());
|
1223 |
} |
1224 |
if (grp.hasCode(41)) { |
1225 |
scaleFactor.setLocation(grp.getDataAsDouble(41), scaleFactor.getY());
|
1226 |
//Double scaleFactorX = new Double(scaleFactor.getX());
|
1227 |
//feature.setProp("scaleFactorX", scaleFactorX.toString());
|
1228 |
insert.setScaleFactor(scaleFactor); |
1229 |
} else {
|
1230 |
//Double scaleFactorX = new Double(scaleFactor.getX());
|
1231 |
//feature.setProp("scaleFactorX", scaleFactorX.toString());
|
1232 |
insert.setScaleFactor(scaleFactor); |
1233 |
} |
1234 |
if (grp.hasCode(42)) { |
1235 |
scaleFactor.setLocation(scaleFactor.getX(), grp.getDataAsDouble(42));
|
1236 |
//Double scaleFactorY = new Double(scaleFactor.getY());
|
1237 |
//feature.setProp("scaleFactorY", scaleFactorY.toString());
|
1238 |
insert.setScaleFactor(scaleFactor); |
1239 |
} else {
|
1240 |
//Double scaleFactorY = new Double(scaleFactor.getY());
|
1241 |
//feature.setProp("scaleFactorY", scaleFactorY.toString());
|
1242 |
insert.setScaleFactor(scaleFactor); |
1243 |
} |
1244 |
if (grp.hasCode(43)) { |
1245 |
// TODO La coordenada z
|
1246 |
} |
1247 |
if (grp.hasCode(50)) { |
1248 |
rotAngle = grp.getDataAsDouble(50);
|
1249 |
//Double objRotAngle = new Double(rotAngle);
|
1250 |
//feature.setProp("rotAngle", objRotAngle.toString());
|
1251 |
insert.setRotAngle(rotAngle); |
1252 |
} |
1253 |
if (grp.hasCode(210)) |
1254 |
xtruX = grp.getDataAsDouble(210);
|
1255 |
if (grp.hasCode(220)) |
1256 |
xtruY = grp.getDataAsDouble(220);
|
1257 |
if (grp.hasCode(230)) |
1258 |
xtruZ = grp.getDataAsDouble(230);
|
1259 |
Point3D point_in = new Point3D(x, y, z);
|
1260 |
Point3D xtru = new Point3D(xtruX, xtruY, xtruZ);
|
1261 |
Point2D point_out = DxfCalXtru.CalculateXtru(point_in, xtru);
|
1262 |
x = point_out.getX(); |
1263 |
y = point_out.getY(); |
1264 |
|
1265 |
insert.setBlkList(blkList); |
1266 |
|
1267 |
insert.encuentraBloque(blockName); |
1268 |
|
1269 |
insert.add(new Point2D.Double(x, y)); |
1270 |
secondGeom.add(new Point2D.Double(x, y)); |
1271 |
|
1272 |
feature.setGeometry(insert); |
1273 |
secondFeat.setGeometry(secondGeom); |
1274 |
|
1275 |
if (insert.getBlockFound()==true) gestionaInsert(feature); |
1276 |
|
1277 |
if (addingToBlock == false) { |
1278 |
features.add(secondFeat); |
1279 |
} |
1280 |
if (addingToBlock == true/* && insert.getBlockFound() == true*/) { |
1281 |
//System.out.println("createInsert(): A?adimos un insert al bloque " + iterator);
|
1282 |
blk.add(feature); |
1283 |
} |
1284 |
} |
1285 |
|
1286 |
public void createSolid(DxfGroupVector grp) throws Exception { |
1287 |
double x = 0.0, y = 0.0, z1 = 0.0, z2 = 0.0, z3 = 0.0, z4 = 0.0; |
1288 |
DxfGroup g = null;
|
1289 |
//Point2D pt1 = null, pt2 = null, pt3 = null, pt4 = null;
|
1290 |
Point2D[] pts = new Point2D[4]; |
1291 |
//DxfLayer layer = (DxfLayer) layers.getByName(grp.getDataAsString(8));
|
1292 |
|
1293 |
LineString lineString = new LineString();
|
1294 |
Polygon polygon = new Polygon(); |
1295 |
Feature feaBordes = new Feature();
|
1296 |
Feature feaFondos = new Feature();
|
1297 |
double elev = 0; |
1298 |
|
1299 |
feaBordes.setProp("dxfEntity", "Solid"); |
1300 |
feaFondos.setProp("dxfEntity", "Solid"); |
1301 |
if (grp.hasCode(8)) |
1302 |
feaBordes.setProp("layer", grp.getDataAsString(8)); |
1303 |
feaFondos.setProp("layer", grp.getDataAsString(8)); |
1304 |
x = grp.getDataAsDouble(10);
|
1305 |
y = grp.getDataAsDouble(20);
|
1306 |
if (grp.hasCode(30)) { |
1307 |
z1 = grp.getDataAsDouble(30);
|
1308 |
elev = z1; |
1309 |
Double doub = new Double(elev); |
1310 |
String string = doub.toString();
|
1311 |
feaBordes.setProp("elevation", string);
|
1312 |
feaFondos.setProp("elevation", string);
|
1313 |
} else {
|
1314 |
Double doub = new Double(0.0); |
1315 |
feaBordes.setProp("elevation", doub.toString());
|
1316 |
feaFondos.setProp("elevation", doub.toString());
|
1317 |
} |
1318 |
pts[0] = proj.createPoint(x, y);
|
1319 |
x = grp.getDataAsDouble(11);
|
1320 |
y = grp.getDataAsDouble(21);
|
1321 |
if (grp.hasCode(31)) z2 = grp.getDataAsDouble(31); |
1322 |
pts[1] = proj.createPoint(x, y);
|
1323 |
x = grp.getDataAsDouble(12);
|
1324 |
y = grp.getDataAsDouble(22);
|
1325 |
if (grp.hasCode(32)) z3 = grp.getDataAsDouble(32); |
1326 |
pts[2] = proj.createPoint(x, y);
|
1327 |
x = grp.getDataAsDouble(13);
|
1328 |
y = grp.getDataAsDouble(23);
|
1329 |
if (grp.hasCode(33)) z2 = grp.getDataAsDouble(33); |
1330 |
pts[3] = proj.createPoint(x, y);
|
1331 |
if (grp.hasCode(39)) { |
1332 |
Double doub = new Double(grp.getDataAsDouble(39)); |
1333 |
String string = doub.toString();
|
1334 |
feaBordes.setProp("thickness", string);
|
1335 |
feaFondos.setProp("thickness", string);
|
1336 |
} else {
|
1337 |
Double doub = new Double(0.0); |
1338 |
feaBordes.setProp("thickness", doub.toString());
|
1339 |
feaFondos.setProp("thickness", doub.toString());
|
1340 |
} |
1341 |
if (grp.hasCode(62)) { |
1342 |
Integer integer = new Integer(grp.getDataAsInt(62)); |
1343 |
String string = integer.toString();
|
1344 |
feaBordes.setProp("color", string);
|
1345 |
feaFondos.setProp("color", string);
|
1346 |
feaBordes.setProp("colorByLayer", "false"); |
1347 |
feaFondos.setProp("colorByLayer", "false"); |
1348 |
} else {
|
1349 |
DxfLayer layer = (DxfLayer)layers.getByName(grp.getDataAsString(8));
|
1350 |
int clr = layer.colorNumber;
|
1351 |
Integer integer = new Integer(clr); |
1352 |
String string = integer.toString();
|
1353 |
feaBordes.setProp("color", string);
|
1354 |
feaFondos.setProp("color", string);
|
1355 |
feaBordes.setProp("colorByLayer", "true"); |
1356 |
feaFondos.setProp("colorByLayer", "true"); |
1357 |
} |
1358 |
if (grp.hasCode(210)) |
1359 |
xtruX = grp.getDataAsDouble(210);
|
1360 |
if (grp.hasCode(220)) |
1361 |
xtruY = grp.getDataAsDouble(220);
|
1362 |
if (grp.hasCode(230)) |
1363 |
xtruZ = grp.getDataAsDouble(230);
|
1364 |
Point3D point_in1 = new Point3D(pts[0].getX(), pts[0].getY(), z1); |
1365 |
Point3D point_in2 = new Point3D(pts[1].getX(), pts[1].getY(), z2); |
1366 |
Point3D point_in3 = new Point3D(pts[2].getX(), pts[2].getY(), z3); |
1367 |
Point3D point_in4 = new Point3D(pts[3].getX(), pts[3].getY(), z4); |
1368 |
Point3D xtru = new Point3D(xtruX, xtruY, xtruZ);
|
1369 |
Point2D point_out1 = DxfCalXtru.CalculateXtru(point_in1, xtru);
|
1370 |
Point2D point_out2 = DxfCalXtru.CalculateXtru(point_in2, xtru);
|
1371 |
Point2D point_out3 = DxfCalXtru.CalculateXtru(point_in3, xtru);
|
1372 |
Point2D point_out4 = DxfCalXtru.CalculateXtru(point_in4, xtru);
|
1373 |
pts[0].setLocation(point_out1);
|
1374 |
pts[1].setLocation(point_out2);
|
1375 |
pts[2].setLocation(point_out3);
|
1376 |
pts[3].setLocation(point_out4);
|
1377 |
|
1378 |
Point2D aux = pts[2]; |
1379 |
pts[2] = pts[3]; |
1380 |
pts[3] = aux;
|
1381 |
|
1382 |
for (int i=0; i<pts.length; i++) { |
1383 |
lineString.add(pts[i]); |
1384 |
polygon.add(pts[i]); |
1385 |
} |
1386 |
|
1387 |
// Para cerrarlos.
|
1388 |
lineString.add(pts[0]);
|
1389 |
polygon.add(pts[0]);
|
1390 |
|
1391 |
feaBordes.setGeometry(lineString); |
1392 |
feaFondos.setGeometry(polygon); |
1393 |
//features.add(feature);
|
1394 |
if (addingToBlock == false) { |
1395 |
//System.out.println("createSolid(): A?ade un solid a la lista de entidades");
|
1396 |
features.add(feaBordes); |
1397 |
features.add(feaFondos); |
1398 |
} else {
|
1399 |
//System.out.println("createSolid(): A?adimos un circulo al bloque " + iterator);
|
1400 |
blk.add(feaBordes); |
1401 |
blk.add(feaFondos); |
1402 |
} |
1403 |
} |
1404 |
|
1405 |
public void createSpline(DxfGroupVector grp) throws Exception { |
1406 |
double x = 0.0, y = 0.0, z = 0.0, elev = 0.0; |
1407 |
//double elev = 0.0;
|
1408 |
DxfGroup g = null;
|
1409 |
LineString lineString = new LineString();
|
1410 |
Polygon polygon = new Polygon(); |
1411 |
//Geometry geometria;
|
1412 |
//Feature feature= new Feature();
|
1413 |
Feature feaBordes= new Feature();
|
1414 |
Feature feaFondos= new Feature();
|
1415 |
int flags = 0; |
1416 |
|
1417 |
//feature.setProp("dxfEntity", "LwPolyline");
|
1418 |
feaBordes.setProp("dxfEntity", "Spline"); |
1419 |
feaFondos.setProp("dxfEntity", "Spline"); |
1420 |
if (grp.hasCode(8)) { |
1421 |
//feature.setProp("layer", grp.getDataAsString(8));
|
1422 |
feaBordes.setProp("layer", grp.getDataAsString(8)); |
1423 |
feaFondos.setProp("layer", grp.getDataAsString(8)); |
1424 |
} |
1425 |
if (grp.hasCode(39)) { |
1426 |
Double doub = new Double(grp.getDataAsDouble(39)); |
1427 |
String string = doub.toString();
|
1428 |
//feature.setProp("thickness", string);
|
1429 |
feaBordes.setProp("thickness", string);
|
1430 |
feaFondos.setProp("thickness", string);
|
1431 |
} else {
|
1432 |
Double doub = new Double(0.0); |
1433 |
//feature.setProp("thickness", doub.toString());
|
1434 |
feaBordes.setProp("thickness", doub.toString());
|
1435 |
feaFondos.setProp("thickness", doub.toString());
|
1436 |
} |
1437 |
if (grp.hasCode(62)) { |
1438 |
Integer integer = new Integer(grp.getDataAsInt(62)); |
1439 |
String string = integer.toString();
|
1440 |
//feature.setProp("color", string);
|
1441 |
feaBordes.setProp("color", string);
|
1442 |
feaFondos.setProp("color", string);
|
1443 |
feaBordes.setProp("colorByLayer", "false"); |
1444 |
feaFondos.setProp("colorByLayer", "false"); |
1445 |
} else {
|
1446 |
DxfLayer layer = (DxfLayer)layers.getByName(grp.getDataAsString(8));
|
1447 |
int clr = layer.colorNumber;
|
1448 |
Integer integer = new Integer(clr); |
1449 |
String string = integer.toString();
|
1450 |
//feature.setProp("color", string);
|
1451 |
feaBordes.setProp("color", string);
|
1452 |
feaFondos.setProp("color", string);
|
1453 |
feaBordes.setProp("colorByLayer", "true"); |
1454 |
feaFondos.setProp("colorByLayer", "true"); |
1455 |
} |
1456 |
if (grp.hasCode(70)) |
1457 |
flags = grp.getDataAsInt(70);
|
1458 |
if ((flags & 0x01) == 0x01) { |
1459 |
//geometria = new Polygon();
|
1460 |
feaBordes.setGeometry(lineString); |
1461 |
feaFondos.setGeometry(polygon); |
1462 |
isDoubleFeatured = true;
|
1463 |
} else {
|
1464 |
//geometria = new LineString();
|
1465 |
feaBordes.setGeometry(lineString); |
1466 |
isDoubleFeatured = false;
|
1467 |
} |
1468 |
|
1469 |
int j = 0; |
1470 |
double firstX = 0.0; |
1471 |
double firstY = 0.0; |
1472 |
double firstZ = 0.0; |
1473 |
for (int i=0; i<grp.size(); i++) { |
1474 |
g = (DxfGroup) grp.get(i); |
1475 |
if (g.getCode() == 10) { |
1476 |
j++; |
1477 |
x = ((Double) g.getData()).doubleValue();
|
1478 |
} else if (g.getCode() == 20) { |
1479 |
y = ((Double) g.getData()).doubleValue();
|
1480 |
//if (y <= 1.0) throw new Exception("Y == "+y);
|
1481 |
//lineString.add( proj.createPoint( x, y ) );
|
1482 |
//polygon.add( proj.createPoint( x, y ) );
|
1483 |
//geometria.add( proj.createPoint( x, y ) );
|
1484 |
} else if (g.getCode() == 30) { |
1485 |
z = ((Double) g.getData()).doubleValue();
|
1486 |
// OJO --> proj.createPoint no acepta ptos con 3 coordenadas,
|
1487 |
// ni gvSIG en esta fase de desarrollo.
|
1488 |
lineString.add(proj.createPoint(x, y)); |
1489 |
if (isDoubleFeatured) polygon.add( proj.createPoint( x, y ) );
|
1490 |
if (j == 1) { |
1491 |
firstX = x; |
1492 |
firstY = y; |
1493 |
firstZ = z; |
1494 |
} |
1495 |
elev = z; |
1496 |
x = 0.0; y = 0.0; z = 0.0; |
1497 |
} |
1498 |
} |
1499 |
|
1500 |
Double doub = new Double(elev); |
1501 |
String string = doub.toString();
|
1502 |
//feature.setProp("elevation", string);
|
1503 |
feaBordes.setProp("elevation", string);
|
1504 |
feaFondos.setProp("elevation", string);
|
1505 |
|
1506 |
if (isDoubleFeatured) {
|
1507 |
//geometria.add(proj.createPoint(firstX, firstY));
|
1508 |
lineString.add(proj.createPoint(firstX, firstY)); |
1509 |
polygon.add(proj.createPoint(firstX, firstY)); |
1510 |
} |
1511 |
|
1512 |
lastFeaBordes = feaBordes; |
1513 |
if (isDoubleFeatured) lastFeaFondos = feaFondos;
|
1514 |
//features.add(feature);
|
1515 |
if (addingToBlock == false) { |
1516 |
features.add(feaBordes); |
1517 |
if (isDoubleFeatured) features.add(feaFondos);
|
1518 |
} else {
|
1519 |
//System.out.println("createLwPolyline(): A?adimos una lwpolilinea al bloque " + iterator);
|
1520 |
blk.add(feaBordes); |
1521 |
if (isDoubleFeatured) blk.add(feaFondos);
|
1522 |
} |
1523 |
isDoubleFeatured = false;
|
1524 |
} |
1525 |
public void createAttdef(DxfGroupVector grp) throws Exception { |
1526 |
// TODO
|
1527 |
} |
1528 |
public void createAttrib(DxfGroupVector grp) throws Exception { |
1529 |
// TODO
|
1530 |
Feature attFeature = new Feature();
|
1531 |
lastFeaBordes = attFeature; |
1532 |
lastFeaBordes.setGeometry(new Point()); |
1533 |
} |
1534 |
|
1535 |
public void createBlock(DxfGroupVector grp) throws Exception { |
1536 |
//DxfLayer layer = (DxfLayer) layers.getByName(grp.getDataAsString(8));
|
1537 |
blk = new FeatureCollection(proj);
|
1538 |
|
1539 |
Point2D basePoint = new Point2D.Double(); |
1540 |
String blockName = ""; |
1541 |
//System.out.println("createBlock(): Creamos nuevo bloque, el bloque " + iterator);
|
1542 |
|
1543 |
addingToBlock = true;
|
1544 |
//System.out.println("createBlock(): A?adimos el bloque " + iterator + " a la lista de bloques");
|
1545 |
blkList.add(iterator, blk); |
1546 |
|
1547 |
//System.out.println("createBlock(): Rellenamos la informacion del bloque " + iterator);
|
1548 |
|
1549 |
if (grp.hasCode(8)) |
1550 |
blk.setProp("layer", grp.getDataAsString(8)); |
1551 |
if (grp.hasCode(62)) { |
1552 |
Integer integer = new Integer(grp.getDataAsInt(62)); |
1553 |
String string = integer.toString();
|
1554 |
blk.setProp("color", string);
|
1555 |
blk.setProp("colorByLayer", "false"); |
1556 |
} else {
|
1557 |
DxfLayer layer = (DxfLayer)layers.getByName(grp.getDataAsString(8));
|
1558 |
int clr = layer.colorNumber;
|
1559 |
Integer integer = new Integer(clr); |
1560 |
String string = integer.toString();
|
1561 |
blk.setProp("color", string);
|
1562 |
blk.setProp("colorByLayer", "true"); |
1563 |
} |
1564 |
|
1565 |
if (grp.hasCode(1)) { |
1566 |
blockName = grp.getDataAsString(1);
|
1567 |
//blk.setBlkName(blockName);
|
1568 |
blk.setProp("blockName", blockName);
|
1569 |
} |
1570 |
if (grp.hasCode(2)) { |
1571 |
blockName = grp.getDataAsString(2);
|
1572 |
//blk.setBlkName(blockName);
|
1573 |
blk.setProp("blockName", blockName);
|
1574 |
} |
1575 |
// 041001: Anulado porque provoca que no se visualizen bloques de la
|
1576 |
// leyenda en m54643.dxf.
|
1577 |
/*if (grp.hasCode(3)) {
|
1578 |
blockName = grp.getDataAsString(3);
|
1579 |
//blk.setBlkName(blockName);
|
1580 |
blk.setProp("blockName", blockName);
|
1581 |
}*/
|
1582 |
if (grp.hasCode(10)) { |
1583 |
//basePoint.setLocation(grp.getDataAsDouble(10), basePoint.getY());
|
1584 |
//blk.setBPoint(basePoint);
|
1585 |
Double basePointX = new Double(grp.getDataAsDouble(10)); |
1586 |
blk.setProp("basePointX", basePointX.toString());
|
1587 |
} |
1588 |
if (grp.hasCode(20)) { |
1589 |
//basePoint.setLocation(basePoint.getX(), grp.getDataAsDouble(20));
|
1590 |
//blk.setBPoint(basePoint);
|
1591 |
Double basePointY = new Double(grp.getDataAsDouble(20)); |
1592 |
blk.setProp("basePointY", basePointY.toString());
|
1593 |
} |
1594 |
if (grp.hasCode(30)) { |
1595 |
//basePoint.setLocation(basePoint.getZ(), grp.getDataAsDouble(30));
|
1596 |
//blk.setBPoint(basePoint);
|
1597 |
Double basePointZ = new Double(grp.getDataAsDouble(30)); |
1598 |
blk.setProp("basePointZ", basePointZ.toString());
|
1599 |
} |
1600 |
if (grp.hasCode(70)) { |
1601 |
//blk.flags = grp.getDataAsInt(70);
|
1602 |
Integer blockFlags = new Integer(grp.getDataAsInt(70)); |
1603 |
blk.setProp("blockFlags", blockFlags.toString());
|
1604 |
// 041103: Hoy por hoy esto no lo utilizamos.
|
1605 |
} |
1606 |
} |
1607 |
|
1608 |
public void endBlk(DxfGroupVector grp) throws Exception { |
1609 |
//DxfLayer layer = (DxfLayer) layers.getByName(grp.getDataAsString(8));
|
1610 |
setAddingToBlock(false);
|
1611 |
iterator = iterator + 1;
|
1612 |
} |
1613 |
|
1614 |
public void testBlocks() { |
1615 |
//System.out.println("getBlkList() = " + getBlkList());
|
1616 |
Vector blkList = getBlkList();
|
1617 |
FeatureCollection block = null;
|
1618 |
Feature feature = null;
|
1619 |
InsPoint insert = null;
|
1620 |
Point2D point1 = new Point2D.Double(); |
1621 |
Point2D point2 = new Point2D.Double(); |
1622 |
//System.out.println("blkList = " + blkList);
|
1623 |
//System.out.println("blkList.size() = " + blkList.size());
|
1624 |
for (int i=0; i<blkList.size(); i++) { |
1625 |
//System.out.println("compruebaBloques(): Bloque " + i +" de " + blkList.size());
|
1626 |
block = (FeatureCollection) blkList.get(i); |
1627 |
int aux = block.size();
|
1628 |
for (int j=0; j<aux; j++) { |
1629 |
feature = (Feature)block.get(j); |
1630 |
//if (feature.getGeometry() instanceof InsPoint && feature.getProp("isAnInsert") == "true") {
|
1631 |
if (feature.getGeometry() instanceof InsPoint) { |
1632 |
insert = (InsPoint)feature.getGeometry(); |
1633 |
String nomBlock = insert.getBlockName();
|
1634 |
//System.out.println("compruebaBloques(): Bloque = " + i + ", elemento = " + j + ", inserta el bloque = " + nomBlock);
|
1635 |
//System.out.println("compruebaBloques(): insert.get(0) = " + insert.get(0));
|
1636 |
//System.out.println("compruebaBloques(): feature.getProp(rotAngle) = " + insert.getRotAngle());
|
1637 |
//System.out.println("compruebaBloques(): insert.getScaleFactor() = " + insert.getScaleFactor());
|
1638 |
//if (feature.getProp("blockFound") == "false") {
|
1639 |
if (insert.getBlockFound() == false) { |
1640 |
//System.out.println("compruebaBloques(): Ahora se ocupa del DxfInsert " + nomBlock);
|
1641 |
insert.encuentraBloque(nomBlock); |
1642 |
//gestionaInsert(feature);
|
1643 |
//block.add(feature);
|
1644 |
} |
1645 |
|
1646 |
} |
1647 |
} |
1648 |
} |
1649 |
} |
1650 |
|
1651 |
private void gestionaInsert(Feature feature) { |
1652 |
Feature feature2 = null;
|
1653 |
Point point = null; |
1654 |
LineString lineString = null;
|
1655 |
Polygon polygon = null; |
1656 |
InsPoint insert = new InsPoint();
|
1657 |
insert = (InsPoint)feature.getGeometry(); |
1658 |
double bPointX = 0.0; |
1659 |
double bPointY = 0.0; |
1660 |
//if (insert.getBlockFound() == true) {
|
1661 |
bPointX = Double.parseDouble(insert.getBlock().getProp("basePointX")); |
1662 |
bPointY = Double.parseDouble(insert.getBlock().getProp("basePointY")); |
1663 |
//}
|
1664 |
double sFactorX = insert.getScaleFactor().getX();
|
1665 |
double sFactorY = insert.getScaleFactor().getY();
|
1666 |
double rAngleGra = insert.getRotAngle();
|
1667 |
double rAngleRad = rAngleGra*Math.PI/180.0; |
1668 |
InsPoint insert2 = null;
|
1669 |
|
1670 |
for (int i=0; i<insert.getBlock().size(); i++) { |
1671 |
//System.out.println("gestionaInserts: insert.getBlock().features.size() = " + insert.getBlock().size());
|
1672 |
feature2 = (Feature)insert.getBlock().get(i); |
1673 |
|
1674 |
// Para que los elementos dentro del bloque tengan la misma layer
|
1675 |
// y color que el insert al que corresponden.
|
1676 |
// Segun la especificacion del formato DXF de Autodesk, la layer
|
1677 |
// de las entities dentro de un bloque es la del bloque. La
|
1678 |
// layer especifica para estos elementos en la defincion del
|
1679 |
// bloque se ignora.
|
1680 |
//System.out.println("gestionaInsert(): layer = " + feature2.getProp("layer"));
|
1681 |
if ((feature2.getProp("colorByLayer").equals("false") || feature2.getProp("layer").equals("0")) && !feature.getProp("layer").equals("0")) { |
1682 |
feature2.setProp("color", feature.getProp("color")); |
1683 |
} |
1684 |
feature2.setProp("layer", feature.getProp("layer")); |
1685 |
|
1686 |
Point2D point1 = new Point2D.Double(); |
1687 |
Point2D point11 = new Point2D.Double(); |
1688 |
Point2D pointAux = null; |
1689 |
|
1690 |
if (feature2.getGeometry() instanceof InsPoint){ |
1691 |
|
1692 |
//System.out.println("gestionaInsert(): Encuentra bloques dentro de bloques");
|
1693 |
|
1694 |
insert2 = (InsPoint)feature2.getGeometry(); |
1695 |
point1 = insert2.get(0);
|
1696 |
|
1697 |
pointAux = new Point2D.Double(point1.getX() - bPointX, point1.getY() - bPointY); |
1698 |
double laX = insert.get(0).getX() + ((pointAux.getX()*sFactorX)*Math.cos(rAngleRad) + (pointAux.getY()*sFactorY)*(-1)*Math.sin(rAngleRad)); |
1699 |
double laY = insert.get(0).getY() + ((pointAux.getX()*sFactorX)*Math.sin(rAngleRad) + (pointAux.getY()*sFactorY)*Math.cos(rAngleRad)); |
1700 |
point11.setLocation(laX, laY); |
1701 |
InsPoint insert3 = new InsPoint();
|
1702 |
|
1703 |
insert3.add(point11); |
1704 |
|
1705 |
insert3.setBlkList(insert2.getBlkList()); |
1706 |
insert3.setBlock(insert2.getBlock()); |
1707 |
insert3.setBlockName(insert2.getBlockName()); |
1708 |
insert3.setRotAngle(insert2.getRotAngle()); |
1709 |
Point2D newScale = new Point2D.Double(insert2.getScaleFactor().getX() * sFactorX, insert2.getScaleFactor().getY() * sFactorY); |
1710 |
insert3.setScaleFactor(newScale); |
1711 |
|
1712 |
Feature feature3 = new Feature();
|
1713 |
feature3.setProp("layer", feature2.getProp("layer")); |
1714 |
feature3.setProp("color", feature2.getProp("color")); |
1715 |
feature3.setProp("dxfEntity", feature2.getProp("dxfEntity")); |
1716 |
feature3.setProp("elevation", feature2.getProp("elevation")); |
1717 |
feature3.setGeometry(insert3); |
1718 |
|
1719 |
gestionaInsert(feature3); |
1720 |
} else if (feature2.getGeometry() instanceof LineString) { |
1721 |
lineString = (LineString)feature2.getGeometry(); |
1722 |
LineString lineString2 = new LineString();
|
1723 |
Point2D[] points = new Point2D[lineString.pointNr()]; |
1724 |
Point2D[] pointss = new Point2D[lineString.pointNr()]; |
1725 |
for (int j=0; j<lineString.pointNr(); j++) { |
1726 |
points[j] = (Point2D)lineString.get(j);
|
1727 |
pointss[j] = new Point2D.Double(); |
1728 |
|
1729 |
pointAux = new Point2D.Double(points[j].getX() - bPointX, points[j].getY() - bPointY); |
1730 |
double laX = insert.get(0).getX() + ((pointAux.getX()*sFactorX)*Math.cos(rAngleRad) + (pointAux.getY()*sFactorY)*(-1)*Math.sin(rAngleRad)); |
1731 |
double laY = insert.get(0).getY() + ((pointAux.getX()*sFactorX)*Math.sin(rAngleRad) + (pointAux.getY()*sFactorY)*Math.cos(rAngleRad)); |
1732 |
pointss[j].setLocation(laX, laY); |
1733 |
lineString2.add(pointss[j]); |
1734 |
} |
1735 |
|
1736 |
Feature feature3 = new Feature();
|
1737 |
feature3.setProp("layer", feature2.getProp("layer")); |
1738 |
feature3.setProp("color", feature2.getProp("color")); |
1739 |
feature3.setProp("dxfEntity", feature2.getProp("dxfEntity")); |
1740 |
feature3.setProp("elevation", feature2.getProp("elevation")); |
1741 |
feature3.setProp("thickness", feature2.getProp("thickness")); |
1742 |
feature3.setGeometry(lineString2); |
1743 |
|
1744 |
if (addingToBlock == false) { |
1745 |
features.add(feature3); |
1746 |
} |
1747 |
} else if (feature2.getGeometry() instanceof Polygon) { |
1748 |
polygon = (Polygon)feature2.getGeometry();
|
1749 |
Polygon polygon2 = new Polygon(); |
1750 |
Point2D[] points = new Point2D[polygon.pointNr()]; |
1751 |
Point2D[] pointss = new Point2D[polygon.pointNr()]; |
1752 |
for (int j=0; j<polygon.pointNr(); j++) { |
1753 |
points[j] = (Point2D)polygon.get(j);
|
1754 |
pointss[j] = new Point2D.Double(); |
1755 |
|
1756 |
points[j].setLocation(points[j].getX() - bPointX, points[j].getY() - bPointY); |
1757 |
double laX = insert.get(0).getX() + ((points[j].getX()*sFactorX)*Math.cos(rAngleRad) + (points[j].getY()*sFactorY)*(-1)*Math.sin(rAngleRad)); |
1758 |
double laY = insert.get(0).getY() + ((points[j].getX()*sFactorX)*Math.sin(rAngleRad) + (points[j].getY()*sFactorY)*Math.cos(rAngleRad)); |
1759 |
pointss[j].setLocation(laX, laY); |
1760 |
polygon2.add(pointss[j]); |
1761 |
} |
1762 |
|
1763 |
Feature feature3 = new Feature();
|
1764 |
feature3.setProp("layer", feature2.getProp("layer")); |
1765 |
feature3.setProp("color", feature2.getProp("color")); |
1766 |
feature3.setProp("dxfEntity", feature2.getProp("dxfEntity")); |
1767 |
feature3.setProp("elevation", feature2.getProp("elevation")); |
1768 |
feature3.setProp("thickness", feature2.getProp("thickness")); |
1769 |
feature3.setGeometry(polygon2); |
1770 |
|
1771 |
if (addingToBlock == false) { |
1772 |
features.add(feature3); |
1773 |
} |
1774 |
} else if (feature2.getGeometry() instanceof Point) { |
1775 |
point = (Point)feature2.getGeometry();
|
1776 |
point1 = point.get(0);
|
1777 |
|
1778 |
pointAux = new Point2D.Double(point1.getX() - bPointX, point1.getY() - bPointY); |
1779 |
double laX = insert.get(0).getX() + ((pointAux.getX()*sFactorX)*Math.cos(rAngleRad) + (pointAux.getY()*sFactorY)*(-1)*Math.sin(rAngleRad)); |
1780 |
double laY = insert.get(0).getY() + ((pointAux.getX()*sFactorX)*Math.sin(rAngleRad) + (pointAux.getY()*sFactorY)*Math.cos(rAngleRad)); |
1781 |
point11.setLocation(laX, laY); |
1782 |
Point pointt = new Point(); |
1783 |
pointt.add(point11); |
1784 |
|
1785 |
Feature feature3 = new Feature();
|
1786 |
feature3.setProp("layer", feature2.getProp("layer")); |
1787 |
feature3.setProp("color", feature2.getProp("color")); |
1788 |
feature3.setProp("dxfEntity", feature2.getProp("dxfEntity")); |
1789 |
feature3.setProp("elevation", feature2.getProp("elevation")); |
1790 |
feature3.setProp("thickness", feature2.getProp("thickness")); |
1791 |
if (point.isText) {
|
1792 |
feature3.setProp("text", feature2.getProp("text")); |
1793 |
feature3.setProp("textHeight", feature2.getProp("textHeight")); |
1794 |
double auxR = Double.parseDouble(feature2.getProp("textRotation")); |
1795 |
//System.out.println("auxR = " + auxR);
|
1796 |
auxR = auxR + rAngleGra; |
1797 |
feature3.setProp("textRotation", Double.toString(auxR)); |
1798 |
//System.out.println("gestionaInsert(): feature3.getProp(textRotation) = " + feature3.getProp("textRotation"));
|
1799 |
pointt.isText = true;
|
1800 |
} |
1801 |
feature3.setGeometry(pointt); |
1802 |
|
1803 |
//if (addingToBlock == false) {
|
1804 |
features.add(feature3); |
1805 |
//}
|
1806 |
} else {
|
1807 |
System.out.println("gestionaInsert(): Encontrado elemento desconocido"); |
1808 |
} |
1809 |
} |
1810 |
} |
1811 |
|
1812 |
private void addFace(int [] face) { |
1813 |
hasFaces = true;
|
1814 |
if (faces == null) |
1815 |
faces = new Vector(); |
1816 |
faces.add(face); |
1817 |
} |
1818 |
|
1819 |
/* (non-Javadoc)
|
1820 |
* @see org.cresques.io.DxfFile.EntityFactory#getExtent()
|
1821 |
*/
|
1822 |
public Extent getExtent() {
|
1823 |
Feature feature = new Feature();
|
1824 |
Extent extent = new Extent();
|
1825 |
Iterator iter = features.iterator();
|
1826 |
while (iter.hasNext()) {
|
1827 |
feature = (Feature)iter.next(); |
1828 |
extent.add(feature.getExtent()); |
1829 |
} |
1830 |
return extent;
|
1831 |
} |
1832 |
|
1833 |
public void setProjection(IProjection p) { |
1834 |
proj = p; |
1835 |
} |
1836 |
|
1837 |
/* (non-Javadoc)
|
1838 |
* @see org.cresques.io.DxfFile.EntityFactory#reProject(org.cresques.geo.ReProjection)
|
1839 |
*/
|
1840 |
public void reProject(ICoordTrans rp) { |
1841 |
Feature feature = new Feature();
|
1842 |
Extent extent = new Extent();
|
1843 |
Iterator iter = features.iterator();
|
1844 |
while (iter.hasNext()) {
|
1845 |
feature = (Feature)iter.next(); |
1846 |
((Projected) feature).reProject(rp); |
1847 |
extent.add(feature.getExtent()); |
1848 |
} |
1849 |
setProjection(rp.getPDest()); |
1850 |
} |
1851 |
|
1852 |
/* (non-Javadoc)
|
1853 |
* @see org.cresques.geo.Projected#getProjection()
|
1854 |
*/
|
1855 |
public IProjection getProjection() {
|
1856 |
return proj;
|
1857 |
} |
1858 |
|
1859 |
public IObjList getObjects() { return features;} |
1860 |
|
1861 |
public void draw(Graphics2D g, ViewPortData vp) { |
1862 |
Iterator iter = features.iterator();
|
1863 |
Extent extent; |
1864 |
while (iter.hasNext()) {
|
1865 |
Feature feature = new Feature();
|
1866 |
feature = (Feature)iter.next(); |
1867 |
extent = feature.getExtent(); |
1868 |
if (vp.getExtent().minX()> extent.maxX()) continue; |
1869 |
if (vp.getExtent().minY()> extent.maxY()) continue; |
1870 |
if (vp.getExtent().maxX()< extent.minX()) continue; |
1871 |
if (vp.getExtent().maxY()< extent.minY()) continue; |
1872 |
//if (!feature.layer.frozen)
|
1873 |
feature.draw(g, vp); |
1874 |
} |
1875 |
} |
1876 |
|
1877 |
public static Vector createArc(Point2D coord1, Point2D coord2, double bulge) { |
1878 |
return new DxfCalArcs(coord1, coord2, bulge).getPoints(1); |
1879 |
} |
1880 |
|
1881 |
/* (non-Javadoc)
|
1882 |
* @see org.cresques.io.DxfFile.EntityFactory#getBlkList()
|
1883 |
*/
|
1884 |
public Vector getBlkList() { |
1885 |
return blkList;
|
1886 |
} |
1887 |
|
1888 |
/* (non-Javadoc)
|
1889 |
* @see org.cresques.io.DxfFile.EntityFactory#getDxfEntityList()
|
1890 |
*/
|
1891 |
public DxfEntityList getDxfEntityList() {
|
1892 |
// TODO Auto-generated method stub
|
1893 |
return null; |
1894 |
} |
1895 |
|
1896 |
/* (non-Javadoc)
|
1897 |
* @see org.cresques.io.DxfFile.EntityFactory#getBlk()
|
1898 |
*/
|
1899 |
public DxfBlock getBlk() {
|
1900 |
// TODO Auto-generated method stub
|
1901 |
return null; |
1902 |
} |
1903 |
|
1904 |
} |