svn-gvsig-desktop / trunk / libraries / libDwg / src / com / iver / cit / jdwglib / dwg / readers / objreaders / v1314 / DwgLineReader1314.java @ 10103
History | View | Annotate | Download (2.6 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.DwgLine; |
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 DwgLineReader1314 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 DwgLine)) |
27 |
throw new RuntimeException("ArcReader 14 solo puede leer DwgInsert"); |
28 |
DwgLine l = (DwgLine) dwgObj; |
29 |
int bitPos = offset;
|
30 |
bitPos = headTailReader.readObjectHeader(data, bitPos, l); |
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 |
l.setP1(new double[]{x, y, z}); |
44 |
|
45 |
val = DwgUtil.getBitDouble(data, bitPos); |
46 |
bitPos = ((Integer) val.get(0)).intValue(); |
47 |
x = ((Double) val.get(1)).doubleValue(); |
48 |
|
49 |
val = DwgUtil.getBitDouble(data, bitPos); |
50 |
bitPos = ((Integer) val.get(0)).intValue(); |
51 |
y = ((Double) val.get(1)).doubleValue(); |
52 |
|
53 |
val = DwgUtil.getBitDouble(data, bitPos); |
54 |
bitPos = ((Integer) val.get(0)).intValue(); |
55 |
z = ((Double) val.get(1)).doubleValue(); |
56 |
l.setP2(new double[]{x, y, z}); |
57 |
|
58 |
val = DwgUtil.getBitDouble(data, bitPos); |
59 |
bitPos = ((Integer) val.get(0)).intValue(); |
60 |
double thickness = ((Double) val.get(1)).doubleValue(); |
61 |
l.setThickness(thickness); |
62 |
|
63 |
val = DwgUtil.getBitDouble(data, bitPos); |
64 |
bitPos = ((Integer) val.get(0)).intValue(); |
65 |
x = ((Double) val.get(1)).doubleValue(); |
66 |
|
67 |
val = DwgUtil.getBitDouble(data, bitPos); |
68 |
bitPos = ((Integer) val.get(0)).intValue(); |
69 |
y = ((Double) val.get(1)).doubleValue(); |
70 |
|
71 |
val = DwgUtil.getBitDouble(data, bitPos); |
72 |
bitPos = ((Integer) val.get(0)).intValue(); |
73 |
z = ((Double) val.get(1)).doubleValue(); |
74 |
l.setExtrusion(new double[]{x, y, z}); |
75 |
|
76 |
bitPos = headTailReader.readObjectTailer(data, bitPos, l); |
77 |
} |
78 |
} |