root / trunk / org.gvsig.dwg / org.gvsig.dwg.lib / src / main / java / org / gvsig / dwg / lib / readers / v1314 / DwgPolyline3DReader1314.java @ 5
History | View | Annotate | Download (1.94 KB)
1 |
/*
|
---|---|
2 |
* Created on 25-ene-2007 by azabala
|
3 |
*
|
4 |
*/
|
5 |
package org.gvsig.dwg.lib.readers.v1314; |
6 |
|
7 |
import java.util.List; |
8 |
|
9 |
import org.gvsig.dwg.lib.CorruptedDwgEntityException; |
10 |
import org.gvsig.dwg.lib.DwgHandleReference; |
11 |
import org.gvsig.dwg.lib.DwgObject; |
12 |
import org.gvsig.dwg.lib.DwgUtil; |
13 |
import org.gvsig.dwg.lib.objects.DwgPolyline3D; |
14 |
|
15 |
|
16 |
/**
|
17 |
* @author alzabord
|
18 |
*
|
19 |
* TODO To change the template for this generated type comment go to
|
20 |
* Window - Preferences - Java - Code Style - Code Templates
|
21 |
*/
|
22 |
public class DwgPolyline3DReader1314 extends AbstractDwg1314Reader{ |
23 |
|
24 |
/* (non-Javadoc)
|
25 |
* @see com.iver.cit.jdwglib.dwg.readers.IDwgObjectReader#readSpecificObj(int[], int, com.iver.cit.jdwglib.dwg.DwgObject)
|
26 |
*/
|
27 |
public void readSpecificObj(int[] data, int offset, DwgObject dwgObj) throws RuntimeException, CorruptedDwgEntityException { |
28 |
if(! (dwgObj instanceof DwgPolyline3D)) |
29 |
throw new RuntimeException("ArcReader 14 solo puede leer DwgPolyline3d"); |
30 |
DwgPolyline3D l = (DwgPolyline3D)dwgObj; |
31 |
|
32 |
int bitPos = offset;
|
33 |
bitPos = headTailReader.readObjectHeader(data, bitPos, l); |
34 |
|
35 |
List val = DwgUtil.getRawChar(data, bitPos);
|
36 |
bitPos = ((Integer) val.get(0)).intValue(); |
37 |
int flags = ((Integer) val.get(1)).intValue(); |
38 |
l.setSplineFlags(flags); |
39 |
|
40 |
val = DwgUtil.getRawChar(data, bitPos); |
41 |
bitPos = ((Integer) val.get(0)).intValue(); |
42 |
int closedFlags = ((Integer) val.get(1)).intValue(); |
43 |
l.setClosedFlags(closedFlags); |
44 |
|
45 |
bitPos = headTailReader.readObjectTailer(data, bitPos, l); |
46 |
|
47 |
DwgHandleReference firstVerHdl = new DwgHandleReference();
|
48 |
bitPos = firstVerHdl.read(data, bitPos); |
49 |
l.setFirstVertexHandle(firstVerHdl); |
50 |
|
51 |
DwgHandleReference lastVerHdl = new DwgHandleReference();
|
52 |
bitPos = lastVerHdl.read(data, bitPos); |
53 |
l.setLastVertexHandle(lastVerHdl); |
54 |
|
55 |
DwgHandleReference seqendHdl = new DwgHandleReference();
|
56 |
bitPos = seqendHdl.read(data, bitPos); |
57 |
l.setSeqendHandle(seqendHdl); |
58 |
} |
59 |
} |