svn-gvsig-desktop / branches / v10 / libraries / libDwg / src / com / iver / cit / jdwglib / dwg / readers / objreaders / v1314 / DwgPointReader1314.java @ 10539
History | View | Annotate | Download (2.37 KB)
1 |
/*
|
---|---|
2 |
* Created on 25-ene-2007 by azabala
|
3 |
*
|
4 |
*/
|
5 |
package com.iver.cit.jdwglib.dwg.readers.objreaders.v1314; |
6 |
|
7 |
import java.util.List; |
8 |
|
9 |
import com.iver.cit.jdwglib.dwg.CorruptedDwgEntityException; |
10 |
import com.iver.cit.jdwglib.dwg.DwgObject; |
11 |
import com.iver.cit.jdwglib.dwg.DwgUtil; |
12 |
import com.iver.cit.jdwglib.dwg.objects.DwgPoint; |
13 |
|
14 |
/**
|
15 |
* @author alzabord
|
16 |
*
|
17 |
* TODO To change the template for this generated type comment go to
|
18 |
* Window - Preferences - Java - Code Style - Code Templates
|
19 |
*/
|
20 |
public class DwgPointReader1314 extends AbstractDwg1314Reader{ |
21 |
|
22 |
/* (non-Javadoc)
|
23 |
* @see com.iver.cit.jdwglib.dwg.readers.IDwgObjectReader#readSpecificObj(int[], int, com.iver.cit.jdwglib.dwg.DwgObject)
|
24 |
*/
|
25 |
public void readSpecificObj(int[] data, int offset, DwgObject dwgObj) throws RuntimeException, CorruptedDwgEntityException { |
26 |
if(! (dwgObj instanceof DwgPoint)) |
27 |
throw new RuntimeException("ArcReader 14 solo puede leer DwgPoint"); |
28 |
DwgPoint pt = (DwgPoint)dwgObj; |
29 |
int bitPos = offset;
|
30 |
bitPos = headTailReader.readObjectHeader(data, offset, dwgObj ); |
31 |
|
32 |
List val = DwgUtil.getBitDouble(data, bitPos);
|
33 |
bitPos = ((Integer) val.get(0)).intValue(); |
34 |
double x = ((Double) val.get(1)).doubleValue(); |
35 |
|
36 |
val = DwgUtil.getBitDouble(data, bitPos); |
37 |
bitPos = ((Integer) val.get(0)).intValue(); |
38 |
double y = ((Double) val.get(1)).doubleValue(); |
39 |
|
40 |
val = DwgUtil.getBitDouble(data, bitPos); |
41 |
bitPos = ((Integer) val.get(0)).intValue(); |
42 |
double z = ((Double) val.get(1)).doubleValue(); |
43 |
pt.setPoint(new double[]{x, y, z}); |
44 |
|
45 |
val = DwgUtil.getBitDouble(data, bitPos); |
46 |
bitPos = ((Integer) val.get(0)).intValue(); |
47 |
double thickness = ((Double) val.get(1)).doubleValue(); |
48 |
pt.setThickness(thickness); |
49 |
|
50 |
val = DwgUtil.getBitDouble(data, bitPos); |
51 |
bitPos = ((Integer) val.get(0)).intValue(); |
52 |
x = ((Double) val.get(1)).doubleValue(); |
53 |
|
54 |
val = DwgUtil.getBitDouble(data, bitPos); |
55 |
bitPos = ((Integer) val.get(0)).intValue(); |
56 |
y = ((Double) val.get(1)).doubleValue(); |
57 |
|
58 |
val = DwgUtil.getBitDouble(data, bitPos); |
59 |
bitPos = ((Integer) val.get(0)).intValue(); |
60 |
z = ((Double) val.get(1)).doubleValue(); |
61 |
pt.setExtrusion(new double[]{x, y, z}); |
62 |
|
63 |
val = DwgUtil.getBitDouble(data, bitPos); |
64 |
bitPos = ((Integer) val.get(0)).intValue(); |
65 |
double xAxisAngle = ((Double) val.get(1)).doubleValue(); |
66 |
pt.setXAxisAngle(xAxisAngle); |
67 |
|
68 |
bitPos = headTailReader.readObjectTailer(data, bitPos, pt); |
69 |
|
70 |
} |
71 |
|
72 |
|
73 |
} |