Revision 29001 branches/v2_0_0_prep/libraries/libDwg/src/org/gvsig/dwg/lib/objects/DwgSolid.java

View differences:

DwgSolid.java
48 48
import org.gvsig.dwg.lib.util.AcadExtrusionCalculator;
49 49
import org.gvsig.dwg.lib.util.FMapUtil;
50 50
import org.gvsig.fmap.geom.Geometry;
51
import org.gvsig.fmap.geom.exception.CreateGeometryException;
51 52

  
52 53
/**
53 54
 * The DwgSolid class represents a DWG Solid
......
222 223
	public double getZ() {
223 224
		return getElevation();
224 225
	}
225
	public Geometry toFMapGeometry(boolean is3DFile) {
226
		Geometry solid = null;
226
	public Geometry toFMapGeometry(boolean is3DFile) throws CreateGeometryException {
227
		int subType = getGeometrySubType(is3DFile);
228

  
227 229
		double[] p1 = getCorner1();
228 230
		double[] p2 = getCorner2();
229 231
		double[] p3 = getCorner3();
......
240 242
			pts.add(p23d);
241 243
			pts.add(p33d);
242 244
			pts.add(p43d);
243

  
244
			solid = FMapUtil.ptsTo3DPolygon(pts);
245

  
246

  
247 245
		} else {
248 246
			pts.add(p1);
249 247
			pts.add(p2);
250 248
			pts.add(p3);
251 249
			pts.add(p4);
252
			solid = FMapUtil.ptsTo2DPolygon(pts);
253 250
		}
254
		return solid;
251
		return FMapUtil.ptsToPolygon(pts, subType);
255 252
//		return ShapeFactory.createGeometry(solid);
256 253

  
257 254
	}
......
321 318

  
322 319
	}
323 320

  
321

  
322
	public int getGeometrySubType(boolean is3DFile) {
323
		if (is3DFile) {
324
			return Geometry.SUBTYPES.GEOM3D;
325
		} else {
326
			return Geometry.SUBTYPES.GEOM2D;
327
		}
328
	}
329

  
330
	public int getGeometryType() {
331
		// return Geometry.TYPES.SOLID; FIXME not implemented
332
		return Geometry.TYPES.SURFACE;
333
	}
334

  
324 335
}

Also available in: Unified diff