svn-gvsig-desktop / trunk / libraries / libCq CMS for java.old / src / org / cresques / px / dxf / DxfFeatureMaker.java @ 142
History | View | Annotate | Download (48.9 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.Geometry; |
16 |
import org.cresques.px.gml.InsPoint; |
17 |
import org.cresques.px.gml.LineString; |
18 |
import org.cresques.px.gml.Point; |
19 |
import org.cresques.px.gml.Polygon; |
20 |
import java.util.Iterator; |
21 |
import java.util.Vector; |
22 |
import java.awt.Graphics2D; |
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 |
|
37 |
boolean addingToBlock = false; |
38 |
int iterator = 0; |
39 |
FeatureCollection blk = null;
|
40 |
Vector blkList = null; |
41 |
DxfTable layers = null;
|
42 |
|
43 |
public DxfFeatureMaker(IProjection proj) {
|
44 |
this.proj = proj;
|
45 |
layers = new DxfTable();
|
46 |
features = new FeatureCollection(proj);
|
47 |
blkList = new Vector(); |
48 |
} |
49 |
|
50 |
public void setAddingToBlock(boolean a) { addingToBlock = a; } |
51 |
|
52 |
public void createLayer(DxfGroupVector v) throws Exception { |
53 |
int color = v.getDataAsInt(62); |
54 |
DxfLayer layer = new DxfLayer(v.getDataAsString(2), Math.abs(v.getDataAsInt(62))); |
55 |
if (color < 0) { |
56 |
layer.isOff = true;
|
57 |
} |
58 |
layer.lType = v.getDataAsString(6);
|
59 |
layer.setFlags(v.getDataAsInt(70));
|
60 |
// compruebo flags
|
61 |
if ((layer.flags & 0x01) == 0x01) { |
62 |
layer.frozen = true;
|
63 |
} |
64 |
if ((layer.flags & 0x02) == 0x02) { |
65 |
layer.frozen = true;
|
66 |
} |
67 |
System.out.println("LAYER color="+layer.getColor()); |
68 |
|
69 |
layers.add(layer); |
70 |
} |
71 |
|
72 |
public void createPolyline(DxfGroupVector grp) throws Exception { |
73 |
LineString lineString = new LineString();
|
74 |
Polygon polygon = new Polygon(); |
75 |
//Feature feature= new Feature();
|
76 |
Feature feaBordes= new Feature();
|
77 |
Feature feaFondos= new Feature();
|
78 |
double x = 0.0, y = 0.0, z = 0.0; |
79 |
int flags = 0; |
80 |
|
81 |
//feature.setProp("dxfEntity", "Polyline");
|
82 |
feaBordes.setProp("dxfEntity", "Polyline"); |
83 |
feaFondos.setProp("dxfEntity", "Polyline"); |
84 |
if (grp.hasCode(8)) { |
85 |
//feature.setProp("layer", grp.getDataAsString(8));
|
86 |
feaBordes.setProp("layer", grp.getDataAsString(8)); |
87 |
feaFondos.setProp("layer", grp.getDataAsString(8)); |
88 |
} |
89 |
if (grp.hasCode(39)) { |
90 |
Double doub = new Double(grp.getDataAsDouble(39)); |
91 |
String string = doub.toString();
|
92 |
//feature.setProp("thickness", string);
|
93 |
feaBordes.setProp("thickness", string);
|
94 |
feaFondos.setProp("thickness", string);
|
95 |
} else {
|
96 |
Double doub = new Double(0.0); |
97 |
//feature.setProp("thickness", doub.toString());
|
98 |
feaBordes.setProp("thickness", doub.toString());
|
99 |
feaFondos.setProp("thickness", doub.toString());
|
100 |
} |
101 |
if (grp.hasCode(62)) { |
102 |
Integer integer = new Integer(grp.getDataAsInt(62)); |
103 |
String string = integer.toString();
|
104 |
//feature.setProp("color", string);
|
105 |
feaBordes.setProp("color", string);
|
106 |
feaFondos.setProp("color", string);
|
107 |
} else {
|
108 |
DxfLayer layer = (DxfLayer)layers.getByName(grp.getDataAsString(8));
|
109 |
int clr = layer.colorNumber;
|
110 |
Integer integer = new Integer(clr); |
111 |
String string = integer.toString();
|
112 |
//feature.setProp("color", string);
|
113 |
feaBordes.setProp("color", string);
|
114 |
feaFondos.setProp("color", string);
|
115 |
} |
116 |
if (grp.hasCode(10)) |
117 |
x = grp.getDataAsDouble(10);
|
118 |
if (grp.hasCode(20)) |
119 |
y = grp.getDataAsDouble(20);
|
120 |
if (grp.hasCode(30)) { |
121 |
z = grp.getDataAsDouble(30);
|
122 |
Double doub = new Double(z); |
123 |
String string = doub.toString();
|
124 |
//feature.setProp("elevation", string);
|
125 |
feaBordes.setProp("elevation", string);
|
126 |
feaFondos.setProp("elevation", string);
|
127 |
} |
128 |
if (grp.hasCode(70)) |
129 |
flags = grp.getDataAsInt(70);
|
130 |
if (grp.hasCode(210)) |
131 |
xtruX = grp.getDataAsDouble(210);
|
132 |
if (grp.hasCode(220)) |
133 |
xtruY = grp.getDataAsDouble(220);
|
134 |
if (grp.hasCode(230)) |
135 |
xtruZ = grp.getDataAsDouble(230);
|
136 |
if ((flags & 0x01) == 0x00) { |
137 |
feaBordes.setGeometry(lineString); |
138 |
lastFeaBordes = feaBordes; |
139 |
isDoubleFeatured = false;
|
140 |
} else if ((flags & 0x01) == 0x01) { |
141 |
feaBordes.setGeometry(lineString); |
142 |
feaFondos.setGeometry(polygon); |
143 |
lastFeaBordes = feaBordes; |
144 |
lastFeaFondos = feaFondos; |
145 |
isDoubleFeatured = true;
|
146 |
} else {
|
147 |
System.out.println("Detectada una Polyline Flag que no corresponde"); |
148 |
System.out.println("a una Polyline corriente, ni a una Closed Polyline"); |
149 |
} |
150 |
} |
151 |
|
152 |
public void endSeq() throws Exception { |
153 |
if (isDoubleFeatured) {
|
154 |
Feature feaBordes = lastFeaBordes; |
155 |
Feature feaFondos = lastFeaFondos; |
156 |
LineString lineString = (LineString)feaBordes.getGeometry(); |
157 |
Polygon polygon = (Polygon)feaFondos.getGeometry(); |
158 |
lineString.add(firstPt); |
159 |
polygon.add(firstPt); |
160 |
if (!(bulge==0)) { |
161 |
int cnt = lineString.pointNr();
|
162 |
Vector arc = createArc((Point2D)(lineString.get(cnt-2)), (Point2D)(lineString.get(cnt-1)), bulge); |
163 |
lineString.remove(cnt-1);
|
164 |
polygon.remove(cnt-1);
|
165 |
for (int i=0; i<arc.size(); i++) { |
166 |
Point2D pt = proj.createPoint(((Point2D)arc.get(i)).getX(), ((Point2D)arc.get(i)).getY()); |
167 |
lineString.add(pt); |
168 |
polygon.add(pt); |
169 |
if (lineString.pointNr() == 1) firstPt = pt; |
170 |
} |
171 |
bulge = 0.0;
|
172 |
} |
173 |
lastFeaBordes.setGeometry(lineString); |
174 |
lastFeaFondos.setGeometry(polygon); |
175 |
if (addingToBlock == false) { |
176 |
features.add(lastFeaBordes); |
177 |
features.add(lastFeaFondos); |
178 |
} else {
|
179 |
blk.add(lastFeaBordes); |
180 |
blk.add(lastFeaFondos); |
181 |
} |
182 |
lastFeaBordes = null;
|
183 |
lastFeaFondos = null;
|
184 |
} else {
|
185 |
Feature feaBordes = lastFeaBordes; |
186 |
LineString lineString = (LineString)feaBordes.getGeometry(); |
187 |
if (!(bulge==0)) { |
188 |
int cnt = lineString.pointNr();
|
189 |
Vector arc = createArc((Point2D)(lineString.get(cnt-2)), (Point2D)(lineString.get(cnt-1)), bulge); |
190 |
lineString.remove(cnt-1);
|
191 |
for (int i=0; i<arc.size(); i++) { |
192 |
Point2D pt = proj.createPoint(((Point2D)arc.get(i)).getX(), ((Point2D)arc.get(i)).getY()); |
193 |
lineString.add(pt); |
194 |
if (lineString.pointNr() == 1) firstPt = pt; |
195 |
} |
196 |
bulge = 0.0;
|
197 |
} |
198 |
lastFeaBordes.setGeometry(lineString); |
199 |
if (addingToBlock == false) { |
200 |
features.add(lastFeaBordes); |
201 |
} else {
|
202 |
blk.add(lastFeaBordes); |
203 |
} |
204 |
lastFeaBordes = null;
|
205 |
} |
206 |
xtruX = 0.0;
|
207 |
xtruY = 0.0;
|
208 |
xtruZ = 1.0;
|
209 |
bulge = 0.0;
|
210 |
isDoubleFeatured = false;
|
211 |
} |
212 |
|
213 |
public void addVertex(DxfGroupVector grp) throws Exception { |
214 |
double x = 0.0, y = 0.0, z = 0.0; |
215 |
if (isDoubleFeatured) {
|
216 |
Feature feaBordes = lastFeaBordes; |
217 |
Feature feaFondos = lastFeaFondos; |
218 |
LineString lineString = (LineString)feaBordes.getGeometry(); |
219 |
Polygon polygon = (Polygon)feaFondos.getGeometry(); |
220 |
if (grp.hasCode(8)) |
221 |
feaBordes.setProp("layer", grp.getDataAsString(8)); |
222 |
feaFondos.setProp("layer", grp.getDataAsString(8)); |
223 |
if (grp.hasCode(62)) { |
224 |
Integer integer = new Integer(grp.getDataAsInt(62)); |
225 |
String string = integer.toString();
|
226 |
feaBordes.setProp("color", string);
|
227 |
feaFondos.setProp("color", string);
|
228 |
} else {
|
229 |
DxfLayer layer = (DxfLayer)layers.getByName(grp.getDataAsString(8));
|
230 |
int clr = layer.colorNumber;
|
231 |
Integer integer = new Integer(clr); |
232 |
String string = integer.toString();
|
233 |
feaBordes.setProp("color", string);
|
234 |
feaFondos.setProp("color", string);
|
235 |
} |
236 |
x = grp.getDataAsDouble(10);
|
237 |
y = grp.getDataAsDouble(20);
|
238 |
if (grp.hasCode(30)) { |
239 |
z = grp.getDataAsDouble(30);
|
240 |
} |
241 |
Point3D point_in = new Point3D(x, y, z);
|
242 |
Point3D xtru = new Point3D(xtruX, xtruY, xtruZ);
|
243 |
Point2D point_out = DxfCalXtru.CalculateXtru(point_in, xtru);
|
244 |
x = point_out.getX(); |
245 |
y = point_out.getY(); |
246 |
Point2D pt = proj.createPoint( x, y);
|
247 |
lineString.add(pt); |
248 |
polygon.add(pt); |
249 |
if (lineString.pointNr() == 1) { |
250 |
firstPt = pt; |
251 |
} |
252 |
if (bulge == 0.0) { |
253 |
if (grp.hasCode(42)) { |
254 |
bulge = grp.getDataAsDouble(42);
|
255 |
} else { bulge = 0.0; } |
256 |
} else {
|
257 |
double bulge_aux = 0.0; |
258 |
if (grp.hasCode(42)) { |
259 |
bulge_aux = grp.getDataAsDouble(42);
|
260 |
} else { bulge_aux = 0.0; } |
261 |
int cnt = lineString.pointNr();
|
262 |
Vector arc = createArc((Point2D)(lineString.get(cnt-2)), (Point2D)(lineString.get(cnt-1)), bulge); |
263 |
lineString.remove(cnt-1);
|
264 |
polygon.remove(cnt-1);
|
265 |
for (int i=0; i<arc.size(); i++) { |
266 |
pt = proj.createPoint(((Point2D)arc.get(i)).getX(), ((Point2D)arc.get(i)).getY()); |
267 |
lineString.add(pt); |
268 |
polygon.add(pt); |
269 |
if (lineString.pointNr() == 1) firstPt = pt; |
270 |
} |
271 |
bulge = bulge_aux; |
272 |
} |
273 |
} else {
|
274 |
Feature feaBordes = lastFeaBordes; |
275 |
LineString lineString = (LineString)feaBordes.getGeometry(); |
276 |
if (grp.hasCode(8)) |
277 |
feaBordes.setProp("layer", grp.getDataAsString(8)); |
278 |
if (grp.hasCode(62)) { |
279 |
Integer integer = new Integer(grp.getDataAsInt(62)); |
280 |
String string = integer.toString();
|
281 |
feaBordes.setProp("color", string);
|
282 |
} else {
|
283 |
DxfLayer layer = (DxfLayer)layers.getByName(grp.getDataAsString(8));
|
284 |
int clr = layer.colorNumber;
|
285 |
Integer integer = new Integer(clr); |
286 |
String string = integer.toString();
|
287 |
feaBordes.setProp("color", string);
|
288 |
} |
289 |
x = grp.getDataAsDouble(10);
|
290 |
y = grp.getDataAsDouble(20);
|
291 |
if (grp.hasCode(30)) { |
292 |
z = grp.getDataAsDouble(30);
|
293 |
} |
294 |
Point3D point_in = new Point3D(x, y, z);
|
295 |
Point3D xtru = new Point3D(xtruX, xtruY, xtruZ);
|
296 |
Point2D point_out = DxfCalXtru.CalculateXtru(point_in, xtru);
|
297 |
x = point_out.getX(); |
298 |
y = point_out.getY(); |
299 |
Point2D pt = proj.createPoint( x, y);
|
300 |
lineString.add(pt); |
301 |
if (lineString.pointNr() == 1) { |
302 |
firstPt = pt; |
303 |
} |
304 |
if (bulge == 0.0) { |
305 |
if (grp.hasCode(42)) { |
306 |
bulge = grp.getDataAsDouble(42);
|
307 |
} else { bulge = 0.0; } |
308 |
} else {
|
309 |
double bulge_aux = 0.0; |
310 |
if (grp.hasCode(42)) { |
311 |
bulge_aux = grp.getDataAsDouble(42);
|
312 |
} else { bulge_aux = 0.0; } |
313 |
int cnt = lineString.pointNr();
|
314 |
Vector arc = createArc((Point2D)(lineString.get(cnt-2)), (Point2D)(lineString.get(cnt-1)), bulge); |
315 |
lineString.remove(cnt-1);
|
316 |
for (int i=0; i<arc.size(); i++) { |
317 |
pt = proj.createPoint(((Point2D)arc.get(i)).getX(), ((Point2D)arc.get(i)).getY()); |
318 |
lineString.add(pt); |
319 |
if (lineString.pointNr() == 1) firstPt = pt; |
320 |
} |
321 |
bulge = bulge_aux; |
322 |
} |
323 |
} |
324 |
} |
325 |
|
326 |
public void createLwPolyline(DxfGroupVector grp) throws Exception { |
327 |
double x = 0.0, y = 0.0; |
328 |
double elev = 0.0; |
329 |
DxfGroup g = null;
|
330 |
LineString lineString = new LineString();
|
331 |
Polygon polygon = new Polygon(); |
332 |
//Geometry geometria;
|
333 |
//Feature feature= new Feature();
|
334 |
Feature feaBordes= new Feature();
|
335 |
Feature feaFondos= new Feature();
|
336 |
int flags = 0; |
337 |
|
338 |
//feature.setProp("dxfEntity", "LwPolyline");
|
339 |
feaBordes.setProp("dxfEntity", "LwPolyline"); |
340 |
feaFondos.setProp("dxfEntity", "LwPolyline"); |
341 |
if (grp.hasCode(8)) |
342 |
//feature.setProp("layer", grp.getDataAsString(8));
|
343 |
feaBordes.setProp("layer", grp.getDataAsString(8)); |
344 |
feaFondos.setProp("layer", grp.getDataAsString(8)); |
345 |
if (grp.hasCode(38)) { |
346 |
elev = grp.getDataAsDouble(38);
|
347 |
Double doub = new Double(elev); |
348 |
String string = doub.toString();
|
349 |
//feature.setProp("elevation", string);
|
350 |
feaBordes.setProp("elevation", string);
|
351 |
feaFondos.setProp("elevation", string);
|
352 |
} else {
|
353 |
Double doub = new Double(0.0); |
354 |
//feature.setProp("elevation", doub.toString());
|
355 |
feaBordes.setProp("elevation", doub.toString());
|
356 |
feaFondos.setProp("elevation", doub.toString());
|
357 |
} |
358 |
if (grp.hasCode(39)) { |
359 |
Double doub = new Double(grp.getDataAsDouble(39)); |
360 |
String string = doub.toString();
|
361 |
//feature.setProp("thickness", string);
|
362 |
feaBordes.setProp("thickness", string);
|
363 |
feaFondos.setProp("thickness", string);
|
364 |
} else {
|
365 |
Double doub = new Double(0.0); |
366 |
//feature.setProp("thickness", doub.toString());
|
367 |
feaBordes.setProp("thickness", doub.toString());
|
368 |
feaFondos.setProp("thickness", doub.toString());
|
369 |
} |
370 |
if (grp.hasCode(62)) { |
371 |
Integer integer = new Integer(grp.getDataAsInt(62)); |
372 |
String string = integer.toString();
|
373 |
//feature.setProp("color", string);
|
374 |
feaBordes.setProp("color", string);
|
375 |
feaFondos.setProp("color", string);
|
376 |
} else {
|
377 |
DxfLayer layer = (DxfLayer)layers.getByName(grp.getDataAsString(8));
|
378 |
int clr = layer.colorNumber;
|
379 |
Integer integer = new Integer(clr); |
380 |
String string = integer.toString();
|
381 |
//feature.setProp("color", string);
|
382 |
feaBordes.setProp("color", string);
|
383 |
feaFondos.setProp("color", string);
|
384 |
} |
385 |
if (grp.hasCode(70)) |
386 |
flags = grp.getDataAsInt(70);
|
387 |
if ((flags & 0x01) == 0x01) { |
388 |
//geometria = new Polygon();
|
389 |
feaBordes.setGeometry(lineString); |
390 |
feaFondos.setGeometry(polygon); |
391 |
isDoubleFeatured = true;
|
392 |
} else {
|
393 |
//geometria = new LineString();
|
394 |
feaBordes.setGeometry(lineString); |
395 |
isDoubleFeatured = false;
|
396 |
} |
397 |
|
398 |
int j = 0; |
399 |
double firstX = 0.0; |
400 |
double firstY = 0.0; |
401 |
for (int i=0; i<grp.size(); i++) { |
402 |
g = (DxfGroup) grp.get(i); |
403 |
if (g.getCode() == 10) { |
404 |
j++; |
405 |
x = ((Double) g.getData()).doubleValue();
|
406 |
} else if (g.getCode() == 20) { |
407 |
y = ((Double) g.getData()).doubleValue();
|
408 |
//if (y <= 1.0) throw new Exception("Y == "+y);
|
409 |
//lineString.add( proj.createPoint( x, y ) );
|
410 |
//polygon.add( proj.createPoint( x, y ) );
|
411 |
//geometria.add( proj.createPoint( x, y ) );
|
412 |
lineString.add( proj.createPoint( x, y ) ); |
413 |
if (isDoubleFeatured) polygon.add( proj.createPoint( x, y ) );
|
414 |
if (j == 1) { |
415 |
firstX = x; |
416 |
firstY = y; |
417 |
} |
418 |
x = 0.0; y = 0.0; |
419 |
} |
420 |
} |
421 |
if (isDoubleFeatured) {
|
422 |
//geometria.add(proj.createPoint(firstX, firstY));
|
423 |
lineString.add(proj.createPoint(firstX, firstY)); |
424 |
polygon.add(proj.createPoint(firstX, firstY)); |
425 |
} |
426 |
|
427 |
lastFeaBordes = feaBordes; |
428 |
if (isDoubleFeatured) lastFeaFondos = feaFondos;
|
429 |
//features.add(feature);
|
430 |
if (addingToBlock == false) { |
431 |
features.add(feaBordes); |
432 |
if (isDoubleFeatured) features.add(feaFondos);
|
433 |
} else {
|
434 |
//System.out.println("createLwPolyline(): A?adimos una lwpolilinea al bloque " + iterator);
|
435 |
blk.add(feaBordes); |
436 |
if (isDoubleFeatured) blk.add(feaFondos);
|
437 |
} |
438 |
isDoubleFeatured = false;
|
439 |
} |
440 |
|
441 |
public void createLine(DxfGroupVector grp) throws Exception { |
442 |
double x = 0.0, y = 0.0, z1 = 0.0, z2 = 0.0; |
443 |
double elev = 0.0; |
444 |
DxfGroup g = null;
|
445 |
Point2D pt1 = null, pt2 = null; |
446 |
LineString lineString = new LineString();
|
447 |
Feature feature = new Feature();
|
448 |
|
449 |
feature.setProp("dxfEntity", "Line"); |
450 |
if (grp.hasCode(8)) |
451 |
feature.setProp("layer", grp.getDataAsString(8)); |
452 |
if (grp.hasCode(39)) { |
453 |
Double doub = new Double(grp.getDataAsDouble(39)); |
454 |
String string = doub.toString();
|
455 |
feature.setProp("thickness", string);
|
456 |
} else {
|
457 |
Double doub = new Double(0.0); |
458 |
feature.setProp("thickness", doub.toString());
|
459 |
} |
460 |
if (grp.hasCode(62)) { |
461 |
Integer integer = new Integer(grp.getDataAsInt(62)); |
462 |
String string = integer.toString();
|
463 |
feature.setProp("color", string);
|
464 |
} else {
|
465 |
DxfLayer layer = (DxfLayer)layers.getByName(grp.getDataAsString(8));
|
466 |
int clr = layer.colorNumber;
|
467 |
Integer integer = new Integer(clr); |
468 |
String string = integer.toString();
|
469 |
feature.setProp("color", string);
|
470 |
} |
471 |
x = grp.getDataAsDouble(10);
|
472 |
y = grp.getDataAsDouble(20);
|
473 |
if (grp.hasCode(30)) { |
474 |
z1 = grp.getDataAsDouble(30);
|
475 |
elev = z1; |
476 |
Double doub = new Double(elev); |
477 |
String string = doub.toString();
|
478 |
feature.setProp("elevation", string);
|
479 |
} |
480 |
pt1 = proj.createPoint(x, y); |
481 |
x = grp.getDataAsDouble(11);
|
482 |
y = grp.getDataAsDouble(21);
|
483 |
if (grp.hasCode(31)) { |
484 |
z2 = grp.getDataAsDouble(31);
|
485 |
} |
486 |
pt2 = proj.createPoint(x, y); |
487 |
if (grp.hasCode(210)) |
488 |
xtruX = grp.getDataAsDouble(210);
|
489 |
if (grp.hasCode(220)) |
490 |
xtruY = grp.getDataAsDouble(220);
|
491 |
if (grp.hasCode(230)) |
492 |
xtruZ = grp.getDataAsDouble(230);
|
493 |
Point3D point_in1 = new Point3D(pt1.getX(), pt1.getY(), z1);
|
494 |
Point3D point_in2 = new Point3D(pt2.getX(), pt2.getY(), z2);
|
495 |
Point3D xtru = new Point3D(xtruX, xtruY, xtruZ);
|
496 |
Point2D point_out1 = DxfCalXtru.CalculateXtru(point_in1, xtru);
|
497 |
Point2D point_out2 = DxfCalXtru.CalculateXtru(point_in2, xtru);
|
498 |
pt1.setLocation(point_out1); |
499 |
pt2.setLocation(point_out2); |
500 |
lineString.add(pt1); |
501 |
lineString.add(pt2); |
502 |
|
503 |
feature.setGeometry(lineString); |
504 |
//features.add(feature);
|
505 |
if (addingToBlock == false) { |
506 |
//System.out.println("createLine(): A?adimos una linea a la lista de entidades");
|
507 |
features.add(feature); |
508 |
} else {
|
509 |
//System.out.println("createLine(): A?adimos una linea al bloque " + iterator);
|
510 |
blk.add(feature); |
511 |
} |
512 |
} |
513 |
|
514 |
/* (non-Javadoc)
|
515 |
* @see org.cresques.io.DxfFile.EntityFactory#createText(org.cresques.io.DxfGroupVector)
|
516 |
*/
|
517 |
public void createText(DxfGroupVector grp) throws Exception { |
518 |
double x = 0.0, y = 0.0, z = 0.0, h= 0.0, rot= 0.0; |
519 |
DxfGroup g = null;
|
520 |
Point2D pt1 = null, pt2 = null; |
521 |
Point2D pt = null; |
522 |
Point point = new Point(); |
523 |
|
524 |
point.isText = true;
|
525 |
|
526 |
Feature feature = new Feature();
|
527 |
|
528 |
feature.setProp("dxfEntity", "Text"); |
529 |
if (grp.hasCode(8)) |
530 |
feature.setProp("layer", grp.getDataAsString(8)); |
531 |
if (grp.hasCode(39)) { |
532 |
Double doub = new Double(grp.getDataAsDouble(39)); |
533 |
String string = doub.toString();
|
534 |
feature.setProp("thickness", string);
|
535 |
} else {
|
536 |
Double doub = new Double(0.0); |
537 |
feature.setProp("thickness", doub.toString());
|
538 |
} |
539 |
if (grp.hasCode(62)) { |
540 |
Integer integer = new Integer(grp.getDataAsInt(62)); |
541 |
String string = integer.toString();
|
542 |
feature.setProp("color", string);
|
543 |
//entity.dxfColor = grp.getDataAsInt(62);
|
544 |
} else {
|
545 |
DxfLayer layer = (DxfLayer)layers.getByName(grp.getDataAsString(8));
|
546 |
int clr = layer.colorNumber;
|
547 |
Integer integer = new Integer(clr); |
548 |
String string = integer.toString();
|
549 |
feature.setProp("color", string);
|
550 |
} |
551 |
if (grp.hasCode(1)) { |
552 |
String strAux1 = grp.getDataAsString(1); |
553 |
strAux1 = DxfConvTexts.ConvertText(strAux1); |
554 |
feature.setProp("text", strAux1);
|
555 |
//txt = grp.getDataAsString(1);
|
556 |
} else {
|
557 |
feature.setProp("text", "No Text Code"); |
558 |
} |
559 |
if (grp.hasCode(40)) { |
560 |
Double heightD = new Double(grp.getDataAsDouble(40)); |
561 |
String heightS = heightD.toString();
|
562 |
feature.setProp("textHeight", heightS);
|
563 |
} else {
|
564 |
feature.setProp("textHeight", "20.0"); |
565 |
} |
566 |
if (grp.hasCode(50)) { |
567 |
Double rotD = new Double(grp.getDataAsDouble(50)); |
568 |
String rotS = rotD.toString();
|
569 |
feature.setProp("textRotation", rotS);
|
570 |
} else {
|
571 |
feature.setProp("textRotation", "0.0"); |
572 |
} |
573 |
x = grp.getDataAsDouble(10);
|
574 |
y = grp.getDataAsDouble(20);
|
575 |
if (grp.hasCode(30)){ |
576 |
z = grp.getDataAsDouble(30);
|
577 |
Double doub = new Double(z); |
578 |
String string = doub.toString();
|
579 |
feature.setProp("elevation", string);
|
580 |
} |
581 |
if (grp.hasCode(210)) |
582 |
xtruX = grp.getDataAsDouble(210);
|
583 |
if (grp.hasCode(220)) |
584 |
xtruY = grp.getDataAsDouble(220);
|
585 |
if (grp.hasCode(230)) |
586 |
xtruZ = grp.getDataAsDouble(230);
|
587 |
Point3D point_in = new Point3D(x, y, z);
|
588 |
Point3D xtru = new Point3D(xtruX, xtruY, xtruZ);
|
589 |
Point2D point_out = DxfCalXtru.CalculateXtru(point_in, xtru);
|
590 |
x = point_out.getX(); |
591 |
y = point_out.getY(); |
592 |
//entity.setPt1(proj.createPoint(x, y));
|
593 |
//point.add(proj.createPoint(x, y));
|
594 |
//lineText.add(proj.createPoint(x, y));
|
595 |
/*if (grp.hasCode(11)) {
|
596 |
x = grp.getDataAsDouble(11);
|
597 |
y = grp.getDataAsDouble(21);
|
598 |
//entity.setPt2(proj.createPoint(x, y));
|
599 |
lineText.add(proj.createPoint(x, y));
|
600 |
}
|
601 |
entity.h = grp.getDataAsDouble(40);
|
602 |
if (grp.hasCode(50))
|
603 |
entity.rot = grp.getDataAsDouble(50);
|
604 |
if (grp.hasCode(62))
|
605 |
entity.dxfColor = grp.getDataAsInt(62);
|
606 |
if (grp.hasCode(72))
|
607 |
entity.align = grp.getDataAsInt(72);*/
|
608 |
point.add(new Point2D.Double(x, y)); |
609 |
feature.setGeometry(point); |
610 |
//entities.add(entity);
|
611 |
//features.add(feature);
|
612 |
if (addingToBlock == false) { |
613 |
features.add(feature); |
614 |
} else {
|
615 |
//System.out.println("createText(): A?adimos un text al bloque " + iterator);
|
616 |
blk.add(feature); |
617 |
} |
618 |
} |
619 |
|
620 |
public void createPoint(DxfGroupVector grp) throws Exception { |
621 |
double x = 0.0, y = 0.0, z = 0.0; |
622 |
DxfGroup g = null;
|
623 |
Point2D pt = null; |
624 |
Point point = new Point(); |
625 |
Feature feature = new Feature();
|
626 |
|
627 |
feature.setProp("dxfEntity", "Point"); |
628 |
if (grp.hasCode(8)) |
629 |
feature.setProp("layer", grp.getDataAsString(8)); |
630 |
if (grp.hasCode(39)) { |
631 |
Double doub = new Double(grp.getDataAsDouble(39)); |
632 |
String string = doub.toString();
|
633 |
feature.setProp("thickness", string);
|
634 |
} else {
|
635 |
Double doub = new Double(0.0); |
636 |
feature.setProp("thickness", doub.toString());
|
637 |
} |
638 |
if (grp.hasCode(62)) { |
639 |
Integer integer = new Integer(grp.getDataAsInt(62)); |
640 |
String string = integer.toString();
|
641 |
feature.setProp("color", string);
|
642 |
} else {
|
643 |
DxfLayer layer = (DxfLayer)layers.getByName(grp.getDataAsString(8));
|
644 |
int clr = layer.colorNumber;
|
645 |
Integer integer = new Integer(clr); |
646 |
String string = integer.toString();
|
647 |
feature.setProp("color", string);
|
648 |
} |
649 |
x = grp.getDataAsDouble(10);
|
650 |
y = grp.getDataAsDouble(20);
|
651 |
if (grp.hasCode(30)) { |
652 |
z = grp.getDataAsDouble(30);
|
653 |
Double doub = new Double(z); |
654 |
String string = doub.toString();
|
655 |
feature.setProp("elevation", string);
|
656 |
} |
657 |
if (grp.hasCode(210)) |
658 |
xtruX = grp.getDataAsDouble(210);
|
659 |
if (grp.hasCode(220)) |
660 |
xtruY = grp.getDataAsDouble(220);
|
661 |
if (grp.hasCode(230)) |
662 |
xtruZ = grp.getDataAsDouble(230);
|
663 |
Point3D point_in = new Point3D(x, y, z);
|
664 |
Point3D xtru = new Point3D(xtruX, xtruY, xtruZ);
|
665 |
Point2D point_out = DxfCalXtru.CalculateXtru(point_in, xtru);
|
666 |
x = point_out.getX(); |
667 |
y = point_out.getY(); |
668 |
point.add(new Point2D.Double(x, y)); |
669 |
|
670 |
feature.setGeometry(point); |
671 |
//features.add(feature);
|
672 |
if (addingToBlock == false) { |
673 |
features.add(feature); |
674 |
} else {
|
675 |
//System.out.println("createPoint(): A?adimos un punto al bloque " + iterator);
|
676 |
blk.add(feature); |
677 |
} |
678 |
} |
679 |
|
680 |
public void createCircle(DxfGroupVector grp) throws Exception { |
681 |
double x = 0.0, y = 0.0, z = 0.0; |
682 |
double r = 0.0; |
683 |
DxfGroup g = null;
|
684 |
LineString lineString = new LineString();
|
685 |
Polygon polygon = new Polygon(); |
686 |
Feature feaBordes = new Feature();
|
687 |
Feature feaFondos = new Feature();
|
688 |
|
689 |
feaBordes.setProp("dxfEntity", "Circle"); |
690 |
feaFondos.setProp("dxfEntity", "Circle"); |
691 |
if (grp.hasCode(8)) |
692 |
feaBordes.setProp("layer", grp.getDataAsString(8)); |
693 |
feaFondos.setProp("layer", grp.getDataAsString(8)); |
694 |
if (grp.hasCode(39)) { |
695 |
Double doub = new Double(grp.getDataAsDouble(39)); |
696 |
String string = doub.toString();
|
697 |
feaBordes.setProp("thickness", string);
|
698 |
feaFondos.setProp("thickness", string);
|
699 |
} else {
|
700 |
Double doub = new Double(0.0); |
701 |
feaBordes.setProp("thickness", doub.toString());
|
702 |
feaFondos.setProp("thickness", doub.toString());
|
703 |
} |
704 |
if (grp.hasCode(62)) { |
705 |
Integer integer = new Integer(grp.getDataAsInt(62)); |
706 |
String string = integer.toString();
|
707 |
feaBordes.setProp("color", string);
|
708 |
feaFondos.setProp("color", string);
|
709 |
} else {
|
710 |
DxfLayer layer = (DxfLayer)layers.getByName(grp.getDataAsString(8));
|
711 |
int clr = layer.colorNumber;
|
712 |
Integer integer = new Integer(clr); |
713 |
String string = integer.toString();
|
714 |
feaBordes.setProp("color", string);
|
715 |
feaFondos.setProp("color", string);
|
716 |
} |
717 |
x = grp.getDataAsDouble(10);
|
718 |
y = grp.getDataAsDouble(20);
|
719 |
if (grp.hasCode(30)) { |
720 |
z = grp.getDataAsDouble(30);
|
721 |
Double doub = new Double(z); |
722 |
String string = doub.toString();
|
723 |
feaBordes.setProp("elevation", string);
|
724 |
feaFondos.setProp("elevation", string);
|
725 |
} |
726 |
if (grp.hasCode(40)) r = grp.getDataAsDouble(40); |
727 |
if (grp.hasCode(210)) |
728 |
xtruX = grp.getDataAsDouble(210);
|
729 |
if (grp.hasCode(220)) |
730 |
xtruY = grp.getDataAsDouble(220);
|
731 |
if (grp.hasCode(230)) |
732 |
xtruZ = grp.getDataAsDouble(230);
|
733 |
Point3D point_in = new Point3D(x, y, z);
|
734 |
Point3D xtru = new Point3D(xtruX, xtruY, xtruZ);
|
735 |
Point2D point_out = DxfCalXtru.CalculateXtru(point_in, xtru);
|
736 |
x = point_out.getX(); |
737 |
y = point_out.getY(); |
738 |
|
739 |
Point2D center = proj.createPoint( x, y);
|
740 |
Point2D[] pts = new Point2D[360]; |
741 |
int angulo = 0; |
742 |
for (angulo=0; angulo<360; angulo++) { |
743 |
pts[angulo] = new Point2D.Double(center.getX(), center.getY()); |
744 |
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)); |
745 |
if (pts.length == 1) { |
746 |
firstPt = pts[angulo]; |
747 |
} |
748 |
} |
749 |
for (int i=0; i<pts.length; i++) { |
750 |
lineString.add(pts[i]); |
751 |
polygon.add(pts[i]); |
752 |
} |
753 |
|
754 |
feaBordes.setGeometry(lineString); |
755 |
feaFondos.setGeometry(polygon); |
756 |
//features.add(feature);
|
757 |
if (addingToBlock == false) { |
758 |
//System.out.println("createCircle(): A?ade un circulo a la lista de entidades");
|
759 |
features.add(feaBordes); |
760 |
features.add(feaFondos); |
761 |
} else {
|
762 |
//System.out.println("createCircle(): A?adimos un circulo al bloque " + iterator);
|
763 |
blk.add(feaBordes); |
764 |
blk.add(feaFondos); |
765 |
} |
766 |
} |
767 |
|
768 |
public void createArc(DxfGroupVector grp) throws Exception { |
769 |
double x = 0.0, y = 0.0, z = 0.0; |
770 |
double r = 0.0, empieza = 0.0, acaba = 0.0; |
771 |
DxfGroup g = null;
|
772 |
LineString lineString = new LineString();
|
773 |
Feature feature = new Feature();
|
774 |
|
775 |
feature.setProp("dxfEntity", "Arc"); |
776 |
if (grp.hasCode(8)) |
777 |
feature.setProp("layer", grp.getDataAsString(8)); |
778 |
if (grp.hasCode(39)) { |
779 |
Double doub = new Double(grp.getDataAsDouble(39)); |
780 |
String string = doub.toString();
|
781 |
feature.setProp("thickness", string);
|
782 |
} else {
|
783 |
Double doub = new Double(0.0); |
784 |
feature.setProp("thickness", doub.toString());
|
785 |
} |
786 |
if (grp.hasCode(62)) { |
787 |
Integer integer = new Integer(grp.getDataAsInt(62)); |
788 |
String string = integer.toString();
|
789 |
feature.setProp("color", string);
|
790 |
} else {
|
791 |
DxfLayer layer = (DxfLayer)layers.getByName(grp.getDataAsString(8));
|
792 |
int clr = layer.colorNumber;
|
793 |
Integer integer = new Integer(clr); |
794 |
String string = integer.toString();
|
795 |
feature.setProp("color", string);
|
796 |
} |
797 |
x = grp.getDataAsDouble(10);
|
798 |
y = grp.getDataAsDouble(20);
|
799 |
if (grp.hasCode(30)) { |
800 |
z = grp.getDataAsDouble(30);
|
801 |
Double doub = new Double(z); |
802 |
String string = doub.toString();
|
803 |
feature.setProp("elevation", string);
|
804 |
} |
805 |
if (grp.hasCode(40)) r = grp.getDataAsDouble(40); |
806 |
if (grp.hasCode(50)) empieza = grp.getDataAsDouble(50); |
807 |
if (grp.hasCode(51)) acaba = grp.getDataAsDouble(51); |
808 |
if (grp.hasCode(210)) |
809 |
xtruX = grp.getDataAsDouble(210);
|
810 |
if (grp.hasCode(220)) |
811 |
xtruY = grp.getDataAsDouble(220);
|
812 |
if (grp.hasCode(230)) |
813 |
xtruZ = grp.getDataAsDouble(230);
|
814 |
Point3D point_in = new Point3D(x, y, z);
|
815 |
Point3D xtru = new Point3D(xtruX, xtruY, xtruZ);
|
816 |
Point2D point_out = DxfCalXtru.CalculateXtru(point_in, xtru);
|
817 |
x = point_out.getX(); |
818 |
y = point_out.getY(); |
819 |
|
820 |
Point2D center = proj.createPoint( x, y);
|
821 |
//System.out.println("empieza = " + empieza + ", acaba = " + acaba);
|
822 |
int iempieza = (int)empieza; |
823 |
int iacaba = (int)acaba; |
824 |
//System.out.println("iempieza = " + iempieza + ", iacaba = " + iacaba);
|
825 |
double angulo = 0; |
826 |
Point2D[] pts = null; |
827 |
if (empieza <= acaba) {
|
828 |
pts = new Point2D[(iacaba-iempieza)+2]; |
829 |
angulo = empieza; |
830 |
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)); |
831 |
for (int i=1; i<=(iacaba-iempieza)+1; i++) { |
832 |
angulo = (double)(iempieza+i);
|
833 |
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)); |
834 |
} |
835 |
angulo = acaba; |
836 |
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)); |
837 |
} else {
|
838 |
pts = new Point2D[(360-iempieza)+iacaba+2]; |
839 |
angulo = empieza; |
840 |
//System.out.println("pts[0] = " + pts[0] + ", center = " + center + ", angulo = " + angulo);
|
841 |
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)); |
842 |
for (int i=1; i<=(360-iempieza); i++) { |
843 |
angulo = (double)(iempieza+i);
|
844 |
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)); |
845 |
} |
846 |
for (int i=(360-iempieza)+1; i<=(360-iempieza)+iacaba; i++) { |
847 |
angulo = (double)(i-(360-iempieza)); |
848 |
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)); |
849 |
} |
850 |
angulo = acaba; |
851 |
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)); |
852 |
} |
853 |
for (int i=0; i<pts.length; i++) { |
854 |
lineString.add(pts[i]); |
855 |
} |
856 |
|
857 |
feature.setGeometry(lineString); |
858 |
//features.add(feature);
|
859 |
if (addingToBlock == false) { |
860 |
features.add(feature); |
861 |
} else {
|
862 |
//System.out.println("createArc(): A?adimos un arco al bloque " + iterator);
|
863 |
blk.add(feature); |
864 |
} |
865 |
} |
866 |
|
867 |
public void createInsert(DxfGroupVector grp) throws Exception { |
868 |
double x = 0.0, y = 0.0, z = 0.0; |
869 |
DxfGroup g = null;
|
870 |
Point2D pt = new Point2D.Double(0.0, 0.0); |
871 |
Point2D scaleFactor = new Point2D.Double(1.0, 1.0); |
872 |
double rotAngle = 0.0; |
873 |
String blockName = ""; |
874 |
|
875 |
InsPoint insert = new InsPoint();
|
876 |
Feature feature = new Feature();
|
877 |
Point secondGeom = new Point(); |
878 |
Feature secondFeat = new Feature();
|
879 |
|
880 |
feature.setProp("dxfEntity", "Insert"); |
881 |
secondFeat.setProp("dxfEntity", "Insert"); |
882 |
if (grp.hasCode(2)) { |
883 |
blockName = grp.getDataAsString(2);
|
884 |
//feature.setProp("blockName", blockName);
|
885 |
insert.setBlockName(blockName); |
886 |
} |
887 |
if (grp.hasCode(8)) { |
888 |
feature.setProp("layer", grp.getDataAsString(8)); |
889 |
secondFeat.setProp("layer", grp.getDataAsString(8)); |
890 |
} |
891 |
|
892 |
Double doub = new Double(0.0); |
893 |
secondFeat.setProp("thickness", doub.toString());
|
894 |
|
895 |
if (grp.hasCode(62)) { |
896 |
Integer integer = new Integer(grp.getDataAsInt(62)); |
897 |
String string = integer.toString();
|
898 |
feature.setProp("color", string);
|
899 |
secondFeat.setProp("color", string);
|
900 |
} else {
|
901 |
DxfLayer layer = (DxfLayer)layers.getByName(grp.getDataAsString(8));
|
902 |
int clr = layer.colorNumber;
|
903 |
Integer integer = new Integer(clr); |
904 |
String string = integer.toString();
|
905 |
feature.setProp("color", string);
|
906 |
secondFeat.setProp("color", string);
|
907 |
} |
908 |
if (grp.hasCode(10)) x = grp.getDataAsDouble(10); |
909 |
if (grp.hasCode(20)) y = grp.getDataAsDouble(20); |
910 |
if (grp.hasCode(30)) { |
911 |
z = grp.getDataAsDouble(30);
|
912 |
Double doubz = new Double(z); |
913 |
String string = doubz.toString();
|
914 |
feature.setProp("elevation", string);
|
915 |
secondFeat.setProp("elevation", string);
|
916 |
} |
917 |
if (grp.hasCode(41)) { |
918 |
scaleFactor.setLocation(grp.getDataAsDouble(41), scaleFactor.getY());
|
919 |
//Double scaleFactorX = new Double(scaleFactor.getX());
|
920 |
//feature.setProp("scaleFactorX", scaleFactorX.toString());
|
921 |
insert.setScaleFactor(scaleFactor); |
922 |
} else {
|
923 |
//Double scaleFactorX = new Double(scaleFactor.getX());
|
924 |
//feature.setProp("scaleFactorX", scaleFactorX.toString());
|
925 |
insert.setScaleFactor(scaleFactor); |
926 |
} |
927 |
if (grp.hasCode(42)) { |
928 |
scaleFactor.setLocation(scaleFactor.getX(), grp.getDataAsDouble(42));
|
929 |
//Double scaleFactorY = new Double(scaleFactor.getY());
|
930 |
//feature.setProp("scaleFactorY", scaleFactorY.toString());
|
931 |
insert.setScaleFactor(scaleFactor); |
932 |
} else {
|
933 |
//Double scaleFactorY = new Double(scaleFactor.getY());
|
934 |
//feature.setProp("scaleFactorY", scaleFactorY.toString());
|
935 |
insert.setScaleFactor(scaleFactor); |
936 |
} |
937 |
if (grp.hasCode(43)) { |
938 |
// TODO La coordenada z
|
939 |
} |
940 |
if (grp.hasCode(50)) { |
941 |
rotAngle = grp.getDataAsDouble(50);
|
942 |
//Double objRotAngle = new Double(rotAngle);
|
943 |
//feature.setProp("rotAngle", objRotAngle.toString());
|
944 |
insert.setRotAngle(rotAngle); |
945 |
} |
946 |
if (grp.hasCode(210)) |
947 |
xtruX = grp.getDataAsDouble(210);
|
948 |
if (grp.hasCode(220)) |
949 |
xtruY = grp.getDataAsDouble(220);
|
950 |
if (grp.hasCode(230)) |
951 |
xtruZ = grp.getDataAsDouble(230);
|
952 |
Point3D point_in = new Point3D(x, y, z);
|
953 |
Point3D xtru = new Point3D(xtruX, xtruY, xtruZ);
|
954 |
Point2D point_out = DxfCalXtru.CalculateXtru(point_in, xtru);
|
955 |
x = point_out.getX(); |
956 |
y = point_out.getY(); |
957 |
|
958 |
insert.setBlkList(blkList); |
959 |
|
960 |
insert.encuentraBloque(blockName); |
961 |
|
962 |
insert.add(new Point2D.Double(x, y)); |
963 |
secondGeom.add(new Point2D.Double(x, y)); |
964 |
|
965 |
feature.setGeometry(insert); |
966 |
secondFeat.setGeometry(secondGeom); |
967 |
|
968 |
gestionaInsert(feature); |
969 |
|
970 |
if (addingToBlock == false) { |
971 |
features.add(secondFeat); |
972 |
} |
973 |
//if (addingToBlock == true && feature.getProp("blockFound").equals("true")) {
|
974 |
if (addingToBlock == true && insert.getBlockFound() == true) { |
975 |
//System.out.println("createInsert(): A?adimos un insert al bloque " + iterator);
|
976 |
blk.add(feature); |
977 |
} |
978 |
} |
979 |
|
980 |
public void createSolid(DxfGroupVector grp) throws Exception { |
981 |
double x = 0.0, y = 0.0, z1 = 0.0, z2 = 0.0, z3 = 0.0, z4 = 0.0; |
982 |
DxfGroup g = null;
|
983 |
//Point2D pt1 = null, pt2 = null, pt3 = null, pt4 = null;
|
984 |
Point2D[] pts = new Point2D[4]; |
985 |
//DxfLayer layer = (DxfLayer) layers.getByName(grp.getDataAsString(8));
|
986 |
|
987 |
LineString lineString = new LineString();
|
988 |
Polygon polygon = new Polygon(); |
989 |
Feature feaBordes = new Feature();
|
990 |
Feature feaFondos = new Feature();
|
991 |
double elev = 0; |
992 |
|
993 |
feaBordes.setProp("dxfEntity", "Solid"); |
994 |
feaFondos.setProp("dxfEntity", "Solid"); |
995 |
if (grp.hasCode(8)) |
996 |
feaBordes.setProp("layer", grp.getDataAsString(8)); |
997 |
feaFondos.setProp("layer", grp.getDataAsString(8)); |
998 |
x = grp.getDataAsDouble(10);
|
999 |
y = grp.getDataAsDouble(20);
|
1000 |
if (grp.hasCode(30)) { |
1001 |
z1 = grp.getDataAsDouble(30);
|
1002 |
elev = z1; |
1003 |
Double doub = new Double(elev); |
1004 |
String string = doub.toString();
|
1005 |
feaBordes.setProp("elevation", string);
|
1006 |
feaFondos.setProp("elevation", string);
|
1007 |
} |
1008 |
pts[0] = proj.createPoint(x, y);
|
1009 |
x = grp.getDataAsDouble(11);
|
1010 |
y = grp.getDataAsDouble(21);
|
1011 |
if (grp.hasCode(31)) z2 = grp.getDataAsDouble(31); |
1012 |
pts[1] = proj.createPoint(x, y);
|
1013 |
x = grp.getDataAsDouble(12);
|
1014 |
y = grp.getDataAsDouble(22);
|
1015 |
if (grp.hasCode(32)) z3 = grp.getDataAsDouble(32); |
1016 |
pts[2] = proj.createPoint(x, y);
|
1017 |
x = grp.getDataAsDouble(13);
|
1018 |
y = grp.getDataAsDouble(23);
|
1019 |
if (grp.hasCode(33)) z2 = grp.getDataAsDouble(33); |
1020 |
pts[3] = proj.createPoint(x, y);
|
1021 |
if (grp.hasCode(39)) { |
1022 |
Double doub = new Double(grp.getDataAsDouble(39)); |
1023 |
String string = doub.toString();
|
1024 |
feaBordes.setProp("thickness", string);
|
1025 |
feaFondos.setProp("thickness", string);
|
1026 |
} else {
|
1027 |
Double doub = new Double(0.0); |
1028 |
feaBordes.setProp("thickness", doub.toString());
|
1029 |
feaFondos.setProp("thickness", doub.toString());
|
1030 |
} |
1031 |
if (grp.hasCode(62)) { |
1032 |
Integer integer = new Integer(grp.getDataAsInt(62)); |
1033 |
String string = integer.toString();
|
1034 |
feaBordes.setProp("color", string);
|
1035 |
feaFondos.setProp("color", string);
|
1036 |
} else {
|
1037 |
DxfLayer layer = (DxfLayer)layers.getByName(grp.getDataAsString(8));
|
1038 |
int clr = layer.colorNumber;
|
1039 |
Integer integer = new Integer(clr); |
1040 |
String string = integer.toString();
|
1041 |
feaBordes.setProp("color", string);
|
1042 |
feaFondos.setProp("color", string);
|
1043 |
} |
1044 |
if (grp.hasCode(210)) |
1045 |
xtruX = grp.getDataAsDouble(210);
|
1046 |
if (grp.hasCode(220)) |
1047 |
xtruY = grp.getDataAsInt(220);
|
1048 |
if (grp.hasCode(230)) |
1049 |
xtruZ = grp.getDataAsInt(230);
|
1050 |
Point3D point_in1 = new Point3D(pts[0].getX(), pts[0].getY(), z1); |
1051 |
Point3D point_in2 = new Point3D(pts[1].getX(), pts[1].getY(), z2); |
1052 |
Point3D point_in3 = new Point3D(pts[2].getX(), pts[2].getY(), z3); |
1053 |
Point3D point_in4 = new Point3D(pts[3].getX(), pts[3].getY(), z4); |
1054 |
Point3D xtru = new Point3D(xtruX, xtruY, xtruZ);
|
1055 |
Point2D point_out1 = DxfCalXtru.CalculateXtru(point_in1, xtru);
|
1056 |
Point2D point_out2 = DxfCalXtru.CalculateXtru(point_in2, xtru);
|
1057 |
Point2D point_out3 = DxfCalXtru.CalculateXtru(point_in3, xtru);
|
1058 |
Point2D point_out4 = DxfCalXtru.CalculateXtru(point_in4, xtru);
|
1059 |
pts[0].setLocation(point_out1);
|
1060 |
pts[1].setLocation(point_out2);
|
1061 |
pts[2].setLocation(point_out3);
|
1062 |
pts[3].setLocation(point_out4);
|
1063 |
|
1064 |
Point2D aux = pts[2]; |
1065 |
pts[2] = pts[3]; |
1066 |
pts[3] = aux;
|
1067 |
|
1068 |
for (int i=0; i<pts.length; i++) { |
1069 |
lineString.add(pts[i]); |
1070 |
polygon.add(pts[i]); |
1071 |
} |
1072 |
|
1073 |
// Para cerrarlos.
|
1074 |
lineString.add(pts[0]);
|
1075 |
polygon.add(pts[0]);
|
1076 |
|
1077 |
feaBordes.setGeometry(lineString); |
1078 |
feaFondos.setGeometry(polygon); |
1079 |
//features.add(feature);
|
1080 |
if (addingToBlock == false) { |
1081 |
//System.out.println("createSolid(): A?ade un solid a la lista de entidades");
|
1082 |
features.add(feaBordes); |
1083 |
features.add(feaFondos); |
1084 |
} else {
|
1085 |
//System.out.println("createSolid(): A?adimos un circulo al bloque " + iterator);
|
1086 |
blk.add(feaBordes); |
1087 |
blk.add(feaFondos); |
1088 |
} |
1089 |
} |
1090 |
|
1091 |
public void createBlock(DxfGroupVector grp) throws Exception { |
1092 |
//DxfLayer layer = (DxfLayer) layers.getByName(grp.getDataAsString(8));
|
1093 |
blk = new FeatureCollection(proj);
|
1094 |
|
1095 |
Point2D basePoint = new Point2D.Double(); |
1096 |
String blockName = ""; |
1097 |
//System.out.println("createBlock(): Creamos nuevo bloque, el bloque " + iterator);
|
1098 |
|
1099 |
addingToBlock = true;
|
1100 |
//System.out.println("createBlock(): A?adimos el bloque " + iterator + " a la lista de bloques");
|
1101 |
blkList.add(iterator, blk); |
1102 |
|
1103 |
//System.out.println("createBlock(): Rellenamos la informacion del bloque " + iterator);
|
1104 |
|
1105 |
if (grp.hasCode(8)) |
1106 |
blk.setProp("layer", grp.getDataAsString(8)); |
1107 |
if (grp.hasCode(62)) { |
1108 |
Integer integer = new Integer(grp.getDataAsInt(62)); |
1109 |
String string = integer.toString();
|
1110 |
blk.setProp("color", string);
|
1111 |
} else {
|
1112 |
DxfLayer layer = (DxfLayer)layers.getByName(grp.getDataAsString(8));
|
1113 |
int clr = layer.colorNumber;
|
1114 |
Integer integer = new Integer(clr); |
1115 |
String string = integer.toString();
|
1116 |
blk.setProp("color", string);
|
1117 |
} |
1118 |
|
1119 |
if (grp.hasCode(1)) { |
1120 |
blockName = grp.getDataAsString(1);
|
1121 |
//blk.setBlkName(blockName);
|
1122 |
blk.setProp("blockName", blockName);
|
1123 |
} |
1124 |
if (grp.hasCode(2)) { |
1125 |
blockName = grp.getDataAsString(2);
|
1126 |
//blk.setBlkName(blockName);
|
1127 |
blk.setProp("blockName", blockName);
|
1128 |
} |
1129 |
if (grp.hasCode(3)) { |
1130 |
blockName = grp.getDataAsString(3);
|
1131 |
//blk.setBlkName(blockName);
|
1132 |
blk.setProp("blockName", blockName);
|
1133 |
} |
1134 |
if (grp.hasCode(10)) { |
1135 |
//basePoint.setLocation(grp.getDataAsDouble(10), basePoint.getY());
|
1136 |
//blk.setBPoint(basePoint);
|
1137 |
Double basePointX = new Double(grp.getDataAsDouble(10)); |
1138 |
blk.setProp("basePointX", basePointX.toString());
|
1139 |
} |
1140 |
if (grp.hasCode(20)) { |
1141 |
//basePoint.setLocation(basePoint.getX(), grp.getDataAsDouble(20));
|
1142 |
//blk.setBPoint(basePoint);
|
1143 |
Double basePointY = new Double(grp.getDataAsDouble(20)); |
1144 |
blk.setProp("basePointY", basePointY.toString());
|
1145 |
} |
1146 |
if (grp.hasCode(30)) { |
1147 |
//basePoint.setLocation(basePoint.getZ(), grp.getDataAsDouble(30));
|
1148 |
//blk.setBPoint(basePoint);
|
1149 |
Double basePointZ = new Double(grp.getDataAsDouble(30)); |
1150 |
blk.setProp("basePointZ", basePointZ.toString());
|
1151 |
} |
1152 |
if (grp.hasCode(70)) { |
1153 |
//blk.flags = grp.getDataAsInt(70);
|
1154 |
Integer blockFlags = new Integer(grp.getDataAsInt(70)); |
1155 |
blk.setProp("blockFlags", blockFlags.toString());
|
1156 |
} |
1157 |
} |
1158 |
|
1159 |
public void endBlk(DxfGroupVector grp) throws Exception { |
1160 |
//DxfLayer layer = (DxfLayer) layers.getByName(grp.getDataAsString(8));
|
1161 |
setAddingToBlock(false);
|
1162 |
iterator = iterator + 1;
|
1163 |
} |
1164 |
|
1165 |
public void testBlocks() { |
1166 |
System.out.println("getBlkList() = " + getBlkList()); |
1167 |
Vector blkList = getBlkList();
|
1168 |
FeatureCollection block = null;
|
1169 |
Feature feature = null;
|
1170 |
InsPoint insert = null;
|
1171 |
Point2D point1 = new Point2D.Double(); |
1172 |
Point2D point2 = new Point2D.Double(); |
1173 |
System.out.println("blkList = " + blkList); |
1174 |
System.out.println("blkList.size() = " + blkList.size()); |
1175 |
for (int i=0; i<blkList.size(); i++) { |
1176 |
System.out.println("compruebaBloques(): Bloque " + i +" de " + blkList.size()); |
1177 |
block = (FeatureCollection) blkList.get(i); |
1178 |
int aux = block.size();
|
1179 |
for (int j=0; j<aux; j++) { |
1180 |
feature = (Feature)block.get(j); |
1181 |
//if (feature.getGeometry() instanceof InsPoint && feature.getProp("isAnInsert") == "true") {
|
1182 |
if (feature.getGeometry() instanceof InsPoint) { |
1183 |
insert = (InsPoint)feature.getGeometry(); |
1184 |
String nomBlock = insert.getBlockName();
|
1185 |
System.out.println("compruebaBloques(): Bloque = " + i + ", elemento = " + j + ", inserta el bloque = " + nomBlock); |
1186 |
System.out.println("compruebaBloques(): insert.get(0) = " + insert.get(0)); |
1187 |
System.out.println("compruebaBloques(): feature.getProp(rotAngle) = " + insert.getRotAngle()); |
1188 |
System.out.println("compruebaBloques(): insert.getScaleFactor() = " + insert.getScaleFactor()); |
1189 |
//if (feature.getProp("blockFound") == "false") {
|
1190 |
if (insert.getBlockFound() == false) { |
1191 |
System.out.println("compruebaBloques(): Ahora se ocupa del DxfInsert " + nomBlock); |
1192 |
boolean aux_bool = insert.encuentraBloque(nomBlock);
|
1193 |
gestionaInsert(feature); |
1194 |
block.add(feature); |
1195 |
} |
1196 |
|
1197 |
} |
1198 |
} |
1199 |
} |
1200 |
} |
1201 |
|
1202 |
public void gestionaInsert(Feature feature) { |
1203 |
Feature feature2 = null;
|
1204 |
Point point = null; |
1205 |
LineString lineString = null;
|
1206 |
Polygon polygon = null; |
1207 |
InsPoint insert = new InsPoint();
|
1208 |
insert = (InsPoint)feature.getGeometry(); |
1209 |
double bPointX = 0.0; |
1210 |
double bPointY = 0.0; |
1211 |
if (insert.getBlockFound() == true) { |
1212 |
bPointX = Double.parseDouble(insert.getBlock().getProp("basePointX")); |
1213 |
bPointY = Double.parseDouble(insert.getBlock().getProp("basePointY")); |
1214 |
} |
1215 |
double sFactorX = insert.getScaleFactor().getX();
|
1216 |
double sFactorY = insert.getScaleFactor().getY();
|
1217 |
double rAngleGra = insert.getRotAngle();
|
1218 |
double rAngleRad = rAngleGra*Math.PI/180.0; |
1219 |
InsPoint insert2 = null;
|
1220 |
|
1221 |
for (int i=0; i<insert.getBlock().size(); i++) { |
1222 |
//System.out.println("gestionaInserts: insert.getBlock().features.size() = " + insert.getBlock().size());
|
1223 |
feature2 = (Feature)insert.getBlock().get(i); |
1224 |
|
1225 |
// Para que los elementos dentro del bloque tengan la misma layer
|
1226 |
// y color que el insert al que corresponden. Esto no debe funcionar
|
1227 |
// asi. Cada elemento tiene sus propias caracteristicas aunque
|
1228 |
// este dentro de un bloque.
|
1229 |
//feature2.setProp("layer", feature.getProp("layer"));
|
1230 |
//feature2.setProp("color", feature.getProp("color"));
|
1231 |
//feature2.setProp("text", feature.getProp("text"));
|
1232 |
|
1233 |
Point2D point1 = new Point2D.Double(); |
1234 |
Point2D point11 = new Point2D.Double(); |
1235 |
Point2D pointAux = null; |
1236 |
|
1237 |
if (feature2.getGeometry() instanceof InsPoint){ |
1238 |
insert2 = (InsPoint)feature2.getGeometry(); |
1239 |
point1 = insert2.get(0);
|
1240 |
|
1241 |
pointAux = new Point2D.Double(point1.getX() - bPointX, point1.getY() - bPointY); |
1242 |
double laX = insert.get(0).getX() + ((pointAux.getX()*sFactorX)*Math.cos(rAngleRad) + (pointAux.getY()*sFactorY)*(-1)*Math.sin(rAngleRad)); |
1243 |
double laY = insert.get(0).getY() + ((pointAux.getX()*sFactorX)*Math.sin(rAngleRad) + (pointAux.getY()*sFactorY)*Math.cos(rAngleRad)); |
1244 |
point11.setLocation(laX, laY); |
1245 |
InsPoint insert3 = new InsPoint();
|
1246 |
|
1247 |
insert3.add(point11); |
1248 |
|
1249 |
insert3.setBlkList(insert2.getBlkList()); |
1250 |
insert3.setBlock(insert2.getBlock()); |
1251 |
insert3.setBlockName(insert2.getBlockName()); |
1252 |
insert3.setRotAngle(insert2.getRotAngle()); |
1253 |
Point2D newScale = new Point2D.Double(insert2.getScaleFactor().getX() * sFactorX, insert2.getScaleFactor().getY() * sFactorY); |
1254 |
insert3.setScaleFactor(newScale); |
1255 |
|
1256 |
Feature feature3 = new Feature();
|
1257 |
feature3.setProp("layer", feature2.getProp("layer")); |
1258 |
feature3.setProp("color", feature2.getProp("color")); |
1259 |
feature3.setProp("dxfEntity", feature2.getProp("dxfEntity")); |
1260 |
feature3.setProp("elevation", feature2.getProp("elevation")); |
1261 |
feature3.setGeometry(insert3); |
1262 |
|
1263 |
gestionaInsert(feature3); |
1264 |
} else if (feature2.getGeometry() instanceof LineString) { |
1265 |
lineString = (LineString)feature2.getGeometry(); |
1266 |
LineString lineString2 = new LineString();
|
1267 |
Point2D[] points = new Point2D[lineString.pointNr()]; |
1268 |
Point2D[] pointss = new Point2D[lineString.pointNr()]; |
1269 |
for (int j=0; j<lineString.pointNr(); j++) { |
1270 |
points[j] = (Point2D)lineString.get(j);
|
1271 |
pointss[j] = new Point2D.Double(); |
1272 |
|
1273 |
pointAux = new Point2D.Double(points[j].getX() - bPointX, points[j].getY() - bPointY); |
1274 |
double laX = insert.get(0).getX() + ((pointAux.getX()*sFactorX)*Math.cos(rAngleRad) + (pointAux.getY()*sFactorY)*(-1)*Math.sin(rAngleRad)); |
1275 |
double laY = insert.get(0).getY() + ((pointAux.getX()*sFactorX)*Math.sin(rAngleRad) + (pointAux.getY()*sFactorY)*Math.cos(rAngleRad)); |
1276 |
pointss[j].setLocation(laX, laY); |
1277 |
lineString2.add(pointss[j]); |
1278 |
} |
1279 |
|
1280 |
Feature feature3 = new Feature();
|
1281 |
feature3.setProp("layer", feature2.getProp("layer")); |
1282 |
feature3.setProp("color", feature2.getProp("color")); |
1283 |
feature3.setProp("dxfEntity", feature2.getProp("dxfEntity")); |
1284 |
feature3.setProp("elevation", feature2.getProp("elevation")); |
1285 |
feature3.setProp("thickness", feature2.getProp("thickness")); |
1286 |
feature3.setGeometry(lineString2); |
1287 |
|
1288 |
if (addingToBlock == false) { |
1289 |
features.add(feature3); |
1290 |
} |
1291 |
} else if (feature2.getGeometry() instanceof Polygon) { |
1292 |
polygon = (Polygon)feature2.getGeometry();
|
1293 |
Polygon polygon2 = new Polygon(); |
1294 |
Point2D[] points = new Point2D[polygon.pointNr()]; |
1295 |
Point2D[] pointss = new Point2D[polygon.pointNr()]; |
1296 |
for (int j=0; j<polygon.pointNr(); j++) { |
1297 |
points[j] = (Point2D)polygon.get(j);
|
1298 |
pointss[j] = new Point2D.Double(); |
1299 |
|
1300 |
points[j].setLocation(points[j].getX() - bPointX, points[j].getY() - bPointY); |
1301 |
double laX = insert.get(0).getX() + ((points[j].getX()*sFactorX)*Math.cos(rAngleRad) + (points[j].getY()*sFactorY)*(-1)*Math.sin(rAngleRad)); |
1302 |
double laY = insert.get(0).getY() + ((points[j].getX()*sFactorX)*Math.sin(rAngleRad) + (points[j].getY()*sFactorY)*Math.cos(rAngleRad)); |
1303 |
pointss[j].setLocation(laX, laY); |
1304 |
polygon2.add(pointss[j]); |
1305 |
} |
1306 |
|
1307 |
Feature feature3 = new Feature();
|
1308 |
feature3.setProp("layer", feature2.getProp("layer")); |
1309 |
feature3.setProp("color", feature2.getProp("color")); |
1310 |
feature3.setProp("dxfEntity", feature2.getProp("dxfEntity")); |
1311 |
feature3.setProp("elevation", feature2.getProp("elevation")); |
1312 |
feature3.setProp("thickness", feature2.getProp("thickness")); |
1313 |
feature3.setGeometry(polygon2); |
1314 |
|
1315 |
if (addingToBlock == false) { |
1316 |
features.add(feature3); |
1317 |
} |
1318 |
} else if (feature2.getGeometry() instanceof Point) { |
1319 |
point = (Point)feature2.getGeometry();
|
1320 |
point1 = point.get(0);
|
1321 |
|
1322 |
pointAux = new Point2D.Double(point1.getX() - bPointX, point1.getY() - bPointY); |
1323 |
double laX = insert.get(0).getX() + ((pointAux.getX()*sFactorX)*Math.cos(rAngleRad) + (pointAux.getY()*sFactorY)*(-1)*Math.sin(rAngleRad)); |
1324 |
double laY = insert.get(0).getY() + ((pointAux.getX()*sFactorX)*Math.sin(rAngleRad) + (pointAux.getY()*sFactorY)*Math.cos(rAngleRad)); |
1325 |
point11.setLocation(laX, laY); |
1326 |
Point pointt = new Point(); |
1327 |
pointt.add(point11); |
1328 |
|
1329 |
Feature feature3 = new Feature();
|
1330 |
feature3.setProp("layer", feature2.getProp("layer")); |
1331 |
feature3.setProp("color", feature2.getProp("color")); |
1332 |
feature3.setProp("dxfEntity", feature2.getProp("dxfEntity")); |
1333 |
feature3.setProp("elevation", feature2.getProp("elevation")); |
1334 |
feature3.setProp("thickness", feature2.getProp("thickness")); |
1335 |
if (point.isText) {
|
1336 |
feature3.setProp("text", feature2.getProp("text")); |
1337 |
} |
1338 |
feature3.setGeometry(pointt); |
1339 |
|
1340 |
if (addingToBlock == false) { |
1341 |
features.add(feature3); |
1342 |
} |
1343 |
} else {
|
1344 |
System.out.println("gestionaInserts: Encontrado elemento desconocido"); |
1345 |
} |
1346 |
} |
1347 |
} |
1348 |
|
1349 |
/* (non-Javadoc)
|
1350 |
* @see org.cresques.io.DxfFile.EntityFactory#getExtent()
|
1351 |
*/
|
1352 |
public Extent getExtent() {
|
1353 |
Feature feature = new Feature();
|
1354 |
Extent extent = new Extent();
|
1355 |
Iterator iter = features.iterator();
|
1356 |
while (iter.hasNext()) {
|
1357 |
feature = (Feature)iter.next(); |
1358 |
extent.add(feature.getExtent()); |
1359 |
} |
1360 |
return extent;
|
1361 |
} |
1362 |
|
1363 |
public void setProjection(IProjection p) { |
1364 |
proj = p; |
1365 |
} |
1366 |
|
1367 |
/* (non-Javadoc)
|
1368 |
* @see org.cresques.io.DxfFile.EntityFactory#reProject(org.cresques.geo.ReProjection)
|
1369 |
*/
|
1370 |
public void reProject(ICoordTrans rp) { |
1371 |
Feature feature = new Feature();
|
1372 |
Extent extent = new Extent();
|
1373 |
Iterator iter = features.iterator();
|
1374 |
while (iter.hasNext()) {
|
1375 |
feature = (Feature)iter.next(); |
1376 |
((Projected) feature).reProject(rp); |
1377 |
extent.add(feature.getExtent()); |
1378 |
} |
1379 |
setProjection(rp.getPDest()); |
1380 |
} |
1381 |
|
1382 |
/* (non-Javadoc)
|
1383 |
* @see org.cresques.geo.Projected#getProjection()
|
1384 |
*/
|
1385 |
public IProjection getProjection() {
|
1386 |
return proj;
|
1387 |
} |
1388 |
|
1389 |
public IObjList getObjects() { return features;} |
1390 |
|
1391 |
public void draw(Graphics2D g, ViewPortData vp) { |
1392 |
Iterator iter = features.iterator();
|
1393 |
Extent extent; |
1394 |
while (iter.hasNext()) {
|
1395 |
Feature feature = new Feature();
|
1396 |
feature = (Feature)iter.next(); |
1397 |
extent = feature.getExtent(); |
1398 |
if (vp.getExtent().minX()> extent.maxX()) continue; |
1399 |
if (vp.getExtent().minY()> extent.maxY()) continue; |
1400 |
if (vp.getExtent().maxX()< extent.minX()) continue; |
1401 |
if (vp.getExtent().maxY()< extent.minY()) continue; |
1402 |
//if (!feature.layer.frozen)
|
1403 |
feature.draw(g, vp); |
1404 |
} |
1405 |
} |
1406 |
|
1407 |
public static Vector createArc(Point2D coord1, Point2D coord2, double bulge) { |
1408 |
return new DxfCalArcs(coord1, coord2, bulge).getPoints(1); |
1409 |
} |
1410 |
|
1411 |
/* (non-Javadoc)
|
1412 |
* @see org.cresques.io.DxfFile.EntityFactory#getBlkList()
|
1413 |
*/
|
1414 |
public Vector getBlkList() { |
1415 |
return blkList;
|
1416 |
} |
1417 |
|
1418 |
/* (non-Javadoc)
|
1419 |
* @see org.cresques.io.DxfFile.EntityFactory#getDxfEntityList()
|
1420 |
*/
|
1421 |
public DxfEntityList getDxfEntityList() {
|
1422 |
// TODO Auto-generated method stub
|
1423 |
return null; |
1424 |
} |
1425 |
|
1426 |
/* (non-Javadoc)
|
1427 |
* @see org.cresques.io.DxfFile.EntityFactory#getBlk()
|
1428 |
*/
|
1429 |
public DxfBlock getBlk() {
|
1430 |
// TODO Auto-generated method stub
|
1431 |
return null; |
1432 |
} |
1433 |
|
1434 |
/* (non-Javadoc)
|
1435 |
* @see org.cresques.io.DxfFile.EntityFactory#createSpline(org.cresques.io.DxfGroupVector)
|
1436 |
*/
|
1437 |
public void createSpline(DxfGroupVector v) throws Exception { |
1438 |
// TODO Auto-generated method stub
|
1439 |
|
1440 |
} |
1441 |
|
1442 |
} |