Revision 207 branches/v02_desarrollo/libraries/libCq CMS for java.old/src/org/cresques/px/dxf/DxfFeatureMaker.java

View differences:

DxfFeatureMaker.java
134 134
			//feature.setProp("elevation", string);
135 135
			feaBordes.setProp("elevation", string);
136 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());
137 142
		}
138 143
		if (grp.hasCode(70))
139 144
			flags = grp.getDataAsInt(70);
......
167 172
				LineString lineString = (LineString)feaBordes.getGeometry();
168 173
				Polygon polygon = (Polygon)feaFondos.getGeometry();
169 174
				lineString.add(firstPt);
170
				polygon.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);
171 182
				if (bulge!=0) {
172 183
					bulge = 0.0;
173 184
				}
......
625 636
		y = grp.getDataAsDouble(21);
626 637
		if (grp.hasCode(31)) {
627 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());
628 644
		}
629 645
		pt2 = proj.createPoint(x, y);
630 646
		if (grp.hasCode(210))
......
721 737
			Double doub = new Double(z);
722 738
			String string = doub.toString();
723 739
			feature.setProp("elevation", string);
740
		} else {
741
			Double doub = new Double(0.0);
742
			feature.setProp("elevation", doub.toString());
724 743
		}
725 744
		if (grp.hasCode(210))
726 745
			xtruX = grp.getDataAsDouble(210);
......
799 818
			Double doub = new Double(z);
800 819
			String string = doub.toString();
801 820
			feature.setProp("elevation", string);
821
		} else {
822
			Double doub = new Double(0.0);
823
			feature.setProp("elevation", doub.toString());
802 824
		}
803 825
		if (grp.hasCode(210))
804 826
			xtruX = grp.getDataAsDouble(210);
......
872 894
			String string = doub.toString();
873 895
			feaBordes.setProp("elevation", string);
874 896
			feaFondos.setProp("elevation", string);
897
		} else {
898
			Double doub = new Double(0.0);
899
			feaBordes.setProp("elevation", doub.toString());
900
			feaFondos.setProp("elevation", doub.toString());
875 901
		}
876 902
		if (grp.hasCode(40)) r = grp.getDataAsDouble(40);
877 903
		if (grp.hasCode(210))
......
953 979
			Double doub = new Double(z);
954 980
			String string = doub.toString();
955 981
			feature.setProp("elevation", string);
982
		} else {
983
			Double doub = new Double(0.0);
984
			feature.setProp("elevation", doub.toString());
956 985
		}
957 986
		if (grp.hasCode(40)) r = grp.getDataAsDouble(40);
958 987
		if (grp.hasCode(50)) empieza = grp.getDataAsDouble(50);
......
1069 1098
			String string = doubz.toString();
1070 1099
			feature.setProp("elevation", string);
1071 1100
			secondFeat.setProp("elevation", string);
1101
		} else {
1102
			Double elev = new Double(z);
1103
			//feature.setProp("elevation", doub.toString());
1104
			feature.setProp("elevation", elev.toString());
1105
			secondFeat.setProp("elevation", elev.toString());
1072 1106
		}
1073 1107
		if (grp.hasCode(41)) {
1074 1108
			scaleFactor.setLocation(grp.getDataAsDouble(41), scaleFactor.getY());
......
1159 1193
			String string = doub.toString();
1160 1194
			feaBordes.setProp("elevation", string);
1161 1195
			feaFondos.setProp("elevation", string);
1196
		} else {
1197
			Double doub = new Double(0.0);
1198
			feaBordes.setProp("elevation", doub.toString());
1199
			feaFondos.setProp("elevation", doub.toString());
1162 1200
		}
1163 1201
		pts[0] = proj.createPoint(x, y);
1164 1202
		x = grp.getDataAsDouble(11);
......
1372 1410
	}
1373 1411
	public void createAttrib(DxfGroupVector grp) throws Exception {
1374 1412
		// TODO
1375
		Feature attFeature = new Feature();
1413
		/*Feature attFeature = new Feature();
1376 1414
		lastFeaBordes = attFeature;
1377
		lastFeaBordes.setGeometry(new Point());
1415
		lastFeaBordes.setGeometry(new Point());*/
1378 1416
	}
1379 1417
	
1380 1418
	public void createBlock(DxfGroupVector grp) throws Exception {
......
1446 1484
			//blk.flags = grp.getDataAsInt(70);
1447 1485
			Integer blockFlags = new Integer(grp.getDataAsInt(70));
1448 1486
			blk.setProp("blockFlags", blockFlags.toString());
1487
			// 041103: Hoy por hoy esto no lo utilizamos.
1449 1488
		}
1450 1489
	}
1451 1490
	

Also available in: Unified diff