Revision 10820

View differences:

trunk/libraries/libDwg/src/com/iver/cit/jdwglib/dwg/readers/DwgFileV12Reader.java
95 95
	private DwgFile dwgFile;
96 96
	private ByteBuffer bb;
97 97
	ArrayList readers = new ArrayList();
98
	/*
99
	 * En Python:
100
	 *  if _version != 'AC1009':
101
        if _version == 'AC1010':
102
            r13 = True
103
        else:
104
            print "unknown version"
105
	 * 
106
	 * */
107 98
	private boolean r13 = false;
108 99
	int index = 0;
109 100
	
......
198 189
			byte[] header = new byte[12];
199 190
			bb.get(header);
200 191
			String headerStr = new String(header);
201
			System.out.println(headerStr);
202 192
			
203 193
//		    (_b1, _w1, _w2, _w3, _b2) = struct.unpack("<BhhhB", handle.read(8))
204 194
			bb.order(ByteOrder.LITTLE_ENDIAN);
......
731 721
			short style = bb.getShort();
732 722
			short crc = bb.getShort();
733 723

  
734
			//TODO Vemos si el indice que ocupa la layer en la tabla
735
			//de layers se corresponde con el valor short de las entidades
736
			//graficas
737 724
			DwgHandleReference handle = new DwgHandleReference(0x5, i);
738 725
			layer.setHandle(handle);
739 726
			dwgFile.addDwgObject(layer);
......
1081 1068
			double[] pt10 = getPoint(false);
1082 1069
			blk.setBasePoint(pt10);
1083 1070
			String blockName = getString();
1084
			
1071
			blk.setName(blockName);
1085 1072
			Block block = getBlock(blockName);
1086 1073
			if(block == null){
1087 1074
				System.out.println(blockName+" no encontrado en la tabla de bloques");
1088 1075
			}
1089 1076
			
1090
			//TODO En DWG 12 no se distingue Block de BlockHeader, en ulteriores
1091
			//versiones si
1092
			//REVISAR EL CASO DE LOS BLOQUES
1093
			
1094
			
1095 1077
			if((opts & 0x2) > 0)
1096 1078
			{
1097 1079
				//puede ser que se trate de referencias
......
1149 1131
	}
1150 1132
	class EndBlkReader implements EntityReader{
1151 1133
		public void read(ByteBuffer bb, byte flags, short opts, DwgObject dwgObj) {
1152
			System.out.println("endblk");
1153 1134
		}
1154 1135
	}
1155 1136
	
......
1162 1143
			bb.order(ByteOrder.nativeOrder());
1163 1144
			short w1 = bb.getShort();//Puede ser este el identificador de bloque???
1164 1145
			
1146
			DwgHandleReference blockHandle = new 
1147
				DwgHandleReference(0x5, w1);
1148
			insert.setBlockHeaderHandle(blockHandle);
1149
			
1165 1150
			double[] pt10 = getPoint(false);
1166 1151
			insert.setInsertionPoint(pt10);
1167 1152
			
1168
			
1169 1153
			bb.order(ByteOrder.LITTLE_ENDIAN);
1170 1154
			
1171 1155
			double x = 0d, y = 0d, z = 0d;
......
1368 1352
		byte curveType75;
1369 1353
		
1370 1354
		
1355
		private void reset(){
1356
			flag70 = 0;
1357
			meshM71 = 0;
1358
			meshN72 = 0;
1359
			startW40 = 0;
1360
			smoothM73 = 0;
1361
			smoothN74 = 0;
1362
			curveType75 = 0;
1363
		}
1364
		
1371 1365
		public void read(ByteBuffer bb, byte flags, short opts, DwgObject dwgObj) {
1372 1366
			super.read(bb, flags, opts, dwgObj);
1373 1367
			
......
1449 1443
				}
1450 1444
			}
1451 1445
			
1446
			reset();
1452 1447
			
1453 1448
			return solution;
1454 1449
		}
......
1507 1502
		 * */
1508 1503
		byte vertexFlag70;
1509 1504
		
1505
		/**
1506
		 * If the vertex is a pfaceface vertex it hasnt real coordinates.
1507
		 * Instead it has an index for each vertex of the mesh's face
1508
		 * */
1509
		int[] pfacefaceIndex;
1510 1510
		
1511
		void reset(){
1512
			pt10 = null;
1513
			startWidth40 = 0;
1514
			endWidth41 = 0;
1515
			tangentDir50 = 0;
1516
			vertexFlag70 = 0;
1517
			pfacefaceIndex = null;
1511 1518
		
1519
		}
1520
		
1521
		/*
1522
		 * azabala
1523
		 * Nos estabamos encontrando con vertices muy raros
1524
		 * (e incluso con valores NaN) cuando el valor de opts
1525
		 * es 16872, si seguiamos al pie de la letra la especificaci?n
1526
		 * de http://www.iwriteiam.nl/DWG12.html o Pythoncad.
1527
		 * 
1528
		 * Haciendo un poco de ingenieria inversa hemos visto que
1529
		 * si opts==16872, hay que modificar el algoritmo 
1530
		 * */
1531
		
1512 1532
		public void read(ByteBuffer bb, byte flags, short opts, DwgObject dwgObj) {
1513 1533
			super.read(bb, flags, opts, dwgObj);
1514
			pt10 = getPoint(false);
1515
			bb.order(ByteOrder.LITTLE_ENDIAN);
1516
			if((opts & 0x1) > 0){
1517
				startWidth40 = bb.getDouble();
1534
			if(opts != 16872){
1535
				int position = bb.position();
1536
				pt10 = getPoint(false);
1537
if(pt10[0] < 0 || pt10[0] < 600000 || pt10[0] > 800000){
1538
System.currentTimeMillis();
1539
}
1540
				bb.order(ByteOrder.LITTLE_ENDIAN);
1541
				if((opts & 0x1) > 0){
1542
					startWidth40 = bb.getDouble();
1543
				}
1544
				if((opts & 0x2) > 0){
1545
					endWidth41 = bb.getDouble();
1546
				}
1547
				if((opts & 0x4) > 0){
1548
					tangentDir50 = bb.getDouble();
1549
				}
1550
				if((opts & 0x8) > 0){
1551
					vertexFlag70 = bb.get();
1552
				}
1553
			}else{
1554
				//if opts == 16872 (decimal) we invert the
1555
				//order of the reading
1556
				bb.order(ByteOrder.LITTLE_ENDIAN);
1557
				if((opts & 0x1) > 0){
1558
					startWidth40 = bb.getDouble();
1559
				}
1560
				if((opts & 0x2) > 0){
1561
					endWidth41 = bb.getDouble();
1562
				}
1563
				if((opts & 0x4) > 0){
1564
					tangentDir50 = bb.getDouble();
1565
				}
1566
				if((opts & 0x8) > 0){
1567
					vertexFlag70 = bb.get();
1568
				}
1569
				int p1 = bb.getShort();
1570
				int p2 = bb.getShort();
1571
				int p3 = bb.getShort();
1572
				int p4 = bb.getShort();
1573
				
1574
				pfacefaceIndex = new int[]{p1,p2,p3,p4};
1518 1575
			}
1519
			if((opts & 0x2) > 0){
1520
				endWidth41 = bb.getDouble();
1521
			}
1522
			if((opts & 0x4) > 0){
1523
				tangentDir50 = bb.getDouble();
1524
			}
1525
			if((opts & 0x8) > 0){
1526
				vertexFlag70 = bb.get();
1527
			}
1576
			
1577
			
1578
			
1528 1579
		}
1529 1580

  
1530 1581
		DwgObject getDwgObject(int index) {
......
1547 1598
					 	The vertex indexes that define the mesh are given by 71, 
1548 1599
					 	72, 73, and 74 groups, the values of which are integers 
1549 1600
					 	specifying one of the previously defined vertices by 
1550
					 	index. If the index is negative, the edge that begins with 
1551
					 	that vertex is invisible. The first zero vertex marks the 
1552
					 	end of the vertices of the face. Since the 71 through 74 
1601
					 	index. 
1602
					 	If the index is negative, the edge that begins with 
1603
					 	that vertex is invisible. 
1604
					 	
1605
					 	The first zero vertex marks the 
1606
					 	end of the vertices of the face. 
1607
					 	
1608
					 	Since the 71 through 74 
1553 1609
					 	groups are optional fields with default values of zero, 
1554 1610
					 	they are present in DXF only if nonzero."
1611
					 	
1555 1612
					 But DWG 12 spec doesnt say anything about 71,72,73 and
1556 1613
					 74 fields for VERTEX.	
1557 1614
					 * */
1558 1615
					solution = new DwgVertexPFaceFace(index);
1616
					((DwgVertexPFaceFace)solution).setVerticesidx(pfacefaceIndex);
1559 1617
				}
1560 1618
			}else if( (vertexFlag70 & POLYLINE_3D) != 0){
1561 1619
				solution = new DwgVertex3D(index);
......
1566 1624
				((DwgVertex2D)solution).setPoint(pt10);
1567 1625
				((DwgVertex2D)solution).setFlags(vertexFlag70);
1568 1626
			}
1627
			
1628
			reset();
1569 1629
			return solution;
1570 1630
		}
1571 1631
	}
......
1843 1903
				if( (entity instanceof IDwgVertex) && (currentPolyline != null)){
1844 1904
					currentPolyline.addVertex((IDwgVertex) entity);
1845 1905
					
1846
				}else if( (entity instanceof IDwgBlockMember) && (currentBlock != null)){
1906
				}else if( (entity instanceof IDwgBlockMember) && 
1907
						!(entity instanceof IDwgVertex) &&
1908
						(currentBlock != null)){
1909
					//In DWG 12 vertex is not part of Block.
1910
					//its part of a polyline (which is part of a block)
1847 1911
					currentBlock.addObject(entity);
1848 1912
				} else{
1849 1913
//					if(! paperSpace)//TODO solo a?adimos las entidades en espacio modelo????
......
2048 2112
		short w1 = bb.getShort();
2049 2113
		double[] inBase = getPoint(true);
2050 2114
		double[] extMin = getPoint(true);
2115
		dwgFile.setHeader("MSPACE_EXTMIN", extMin);
2051 2116
		double[] extMax = getPoint(true);
2117
		dwgFile.setHeader("MSPACE_EXTMAX", extMax);
2052 2118
		double[] limMin = getPoint(false);
2053 2119
		double[] limMax = getPoint(false);
2054 2120
		
......
2102 2168
		bb.position(0x3ef);
2103 2169
	}
2104 2170
	
2105
	
2106
	
2107
	
2108
	
2109 2171
	class Dwg12Table{
2110 2172
		short s1;
2111 2173
		int i1;
trunk/libraries/libDwg/src/com/iver/cit/jdwglib/dwg/readers/DwgFileV14Reader.java
1562 1562
							return null;
1563 1563
						}//if
1564 1564
					}//if newIndex
1565
					else{
1566
						return null;
1567
					}
1565 1568
				}else {
1566 1569
					logger.info("Encontrado tipo " + type);
1567 1570
					return null;
trunk/libraries/libDwg/src/com/iver/cit/jdwglib/dwg/readers/DwgFileV15Reader.java
38 38
import java.nio.ByteBuffer;
39 39
import java.nio.ByteOrder;
40 40
import java.util.ArrayList;
41
import java.util.LinkedList;
42 41
import java.util.List;
43 42

  
44 43
import org.apache.log4j.Logger;
45 44

  
46 45
import com.iver.cit.gvsig.fmap.drivers.dgn.ByteUtils;
47 46
import com.iver.cit.jdwglib.dwg.CorruptedDwgEntityException;
47
import com.iver.cit.jdwglib.dwg.DwgClass;
48 48
import com.iver.cit.jdwglib.dwg.DwgFile;
49 49
import com.iver.cit.jdwglib.dwg.DwgHandleReference;
50 50
import com.iver.cit.jdwglib.dwg.DwgObject;
51 51
import com.iver.cit.jdwglib.dwg.DwgObjectFactory;
52 52
import com.iver.cit.jdwglib.dwg.DwgObjectOffset;
53 53
import com.iver.cit.jdwglib.dwg.DwgUtil;
54
import com.iver.cit.jdwglib.dwg.objects.DwgBlock;
55
import com.iver.cit.jdwglib.dwg.objects.DwgBlockControl;
56
import com.iver.cit.jdwglib.dwg.objects.DwgBlockHeader;
57 54

  
58 55
import freenet.support.HexUtil;
59 56

  
......
82 79
	public void read(DwgFile dwgFile, ByteBuffer bb) throws IOException {
83 80
		this.dwgFile = dwgFile;
84 81
		this.bb = bb;
85

  
86
		readDwgSectionOffsets();
87 82
		try {
83
			readDwgSectionOffsets();
84
			readHeaders();
85
			readDwgClasses();
88 86
			readDwgObjectOffsets();
89
			//readDwgClasses(bb);
87
			readDwgObjects();
88
			//checkSuperentities();
90 89
		} catch (Exception e) {
91
			//		    System.out.println("Error leyendo offsets y classes. Posible
92
			// corrupci�n en" +
93
			//		    		"el DWG file ...");
90
			e.printStackTrace();
91
			logger.error(e);
94 92
		}
95
		readDwgObjects();
96
		//checkSuperentities();
93
		
97 94
	}
98 95
	
99 96
	/*
......
203 200
		}//while
204 201
	}
205 202

  
206
	/*
207
	 * Unused.
208
	 * 
209
	 * Dwg spec says that drawing entities (objects) that has not a fixed type
210
	 * must read its type from this section
211
	 * 
212
	 *  
213
	 */
214 203
	protected void readDwgClasses() throws Exception {
215 204
		int offset = dwgFile.getDwgSectionOffset("CLASSES");
205
		bb.position(offset);
206
		//1? leemos el sentinnel inicial
207
		bb.order(ByteOrder.nativeOrder());
208
		byte[] sentinel = new byte[16];
209
		bb.get(sentinel);
210
		if (sentinel[0] != 0x8d)
211
			logger.warn("sentinel[0] != 0x8d");
212
		if (sentinel[1] != 0xa1)
213
			logger.warn("sentinel[1] != 0xa1");
214
		if (sentinel[2] != 0xc4)
215
			logger.warn("sentinel[2] != 0xc4");
216
		if (sentinel[3] != 0xb8)
217
			logger.warn("sentinel[3] != 0xb8");
218
		if (sentinel[4] != 0xc4)
219
			logger.warn("sentinel[4] != 0xc4");
220
		if (sentinel[5] != 0xa9)
221
			logger.warn("sentinel[5] != 0xa9");
222
		if (sentinel[6] != 0xf8)
223
			logger.warn("sentinel[6] != 0xf8");
224
		if (sentinel[7] != 0xc5)
225
			logger.warn("sentinel[7] != 0xc5");
226
		if (sentinel[8] != 0xc0)
227
			logger.warn("sentinel[8] != 0xc0");
228
		if (sentinel[9] != 0xdc)
229
			logger.warn("sentinel[9] != 0xdc");
230
		if (sentinel[10] != 0xf4)
231
			logger.warn("sentinel[10] != 0xf4");
232
		if (sentinel[11] != 0x5f)
233
			logger.warn("sentinel[11] != 0x5f");
234
		if (sentinel[12] != 0xe7)
235
			logger.warn("sentinel[12] != 0xe7");
236
		if (sentinel[13] != 0xcf)
237
			logger.warn("sentinel[13] != 0xcf");
238
		if (sentinel[14] != 0xb6)
239
			logger.warn("sentinel[14] != 0xb6");
240
		if (sentinel[15] != 0x8a)
241
			logger.warn("sentinel[15] != 0x8a");
242

  
243
		bb.order(ByteOrder.LITTLE_ENDIAN);
244
		int size = bb.getInt();
245
		byte[] data = new byte[size];
246
		bb.get(data);
247
		int[] intData = DwgUtil.toIntArray(data);
248
		short crc = bb.getShort();
249

  
250
		int maxBit = size * 8;
251
		int bitPos = 0;
252
		List val = null;
253
		while ((bitPos + 8) < maxBit) {
254
			val = DwgUtil.getBitShort(intData, bitPos);
255
			bitPos = ((Integer) val.get(0)).intValue();
256
			int classNum = ((Integer) val.get(1)).intValue();
257

  
258
			val = DwgUtil.getBitShort(intData, bitPos);
259
			bitPos = ((Integer) val.get(0)).intValue();
260
			int version = ((Integer) val.get(1)).intValue();
261

  
262
			val = DwgUtil.getTextString(intData, bitPos);
263
			bitPos = ((Integer) val.get(0)).intValue();
264
			String appName = (String) val.get(1);
265

  
266
			val = DwgUtil.getTextString(intData, bitPos);
267
			bitPos = ((Integer) val.get(0)).intValue();
268
			String cPlusPlusName = (String) val.get(1);
269

  
270
			val = DwgUtil.getTextString(intData, bitPos);
271
			bitPos = ((Integer) val.get(0)).intValue();
272
			String dxfName = (String) val.get(1);
273

  
274
			val = DwgUtil.testBit(intData, bitPos);
275
			bitPos = ((Integer) val.get(0)).intValue();
276
			boolean isZombie = ((Boolean) val.get(1)).booleanValue();
277

  
278
			val = DwgUtil.getBitShort(intData, bitPos);
279
			bitPos = ((Integer) val.get(0)).intValue();
280
			int id = ((Integer) val.get(1)).intValue();
281

  
282
			DwgClass dwgClass = new DwgClass(classNum, version, appName,
283
					cPlusPlusName, dxfName, isZombie, id);
284
			dwgFile.addDwgClass(dwgClass);
285

  
286
		}//while
287
		//		Por ultimo, el sentinnel final
288
		bb.order(ByteOrder.nativeOrder());
289
		byte[] lastSentinnel = new byte[16];
290
		bb.get(lastSentinnel);
291
		if (lastSentinnel[0] != 0x72)
292
			logger.warn("lastSentinnel[0] != 0x72");
293
		if (lastSentinnel[1] != 0x5e)
294
			logger.warn("lastSentinnel[1] != 0x5e");
295
		if (lastSentinnel[2] != 0x3b)
296
			logger.warn("lastSentinnel[2] != 0x3b");
297
		if (lastSentinnel[3] != 0x47)
298
			logger.warn("lastSentinnel[3] != 0x47");
299
		if (lastSentinnel[4] != 0x3b)
300
			logger.warn("lastSentinnel[4] != 0x3b");
301
		if (lastSentinnel[5] != 0x56)
302
			logger.warn("lastSentinnel[5] != 0x56");
303
		if (lastSentinnel[6] != 0x07)
304
			logger.warn("lastSentinnel[6] != 0x07");
305
		if (lastSentinnel[7] != 0x3a)
306
			logger.warn("lastSentinnel[7] != 0x3a");
307
		if (lastSentinnel[8] != 0x3f)
308
			logger.warn("lastSentinnel[8] != 0x3f");
309
		if (lastSentinnel[9] != 0x23)
310
			logger.warn("lastSentinnel[9] != 0x23");
311
		if (lastSentinnel[10] != 0x0b)
312
			logger.warn("lastSentinnel[10] != 0x0b");
313
		if (lastSentinnel[11] != 0xa0)
314
			logger.warn("lastSentinnel[11] != 0xa0");
315
		if (lastSentinnel[12] != 0x18)
316
			logger.warn("lastSentinnel[12] != 0x18");
317
		if (lastSentinnel[13] != 0x30)
318
			logger.warn("lastSentinnel[13] != 0x30");
319
		if (lastSentinnel[14] != 0x49)
320
			logger.warn("lastSentinnel[14] != 0x49");
321
		if (lastSentinnel[15] != 0x75)
322
			logger.warn("lastSentinnel[15] != 0x75");
323
	}
324
	
325
	protected void readDwgClasses2() throws Exception {
326
		int offset = dwgFile.getDwgSectionOffset("CLASSES");
216 327
		// Por ahora nos saltamos los 16 bytes de control
217 328
		bb.position(offset + 16);
218 329
		bb.order(ByteOrder.LITTLE_ENDIAN);
......
275 386
//			}
276 387
		}
277 388
	}
389
	
278 390

  
391

  
279 392
	/**
280 393
	 * Reads the header of an object in a DWG file Version 15
281 394
	 * 
......
430 543
		return readDwgObject(doo.getOffset(), index);
431 544
	}
432 545

  
546
	
433 547
	/**
434 548
	 * Reads a dwg drawing entity (dwg object) given its offset in the file
435 549
	 */
......
458 572
			ArrayList v = DwgUtil.getBitShort(data, bitPos);
459 573
			bitPos = ((Integer) v.get(0)).intValue();
460 574
			int type = ((Integer) v.get(1)).intValue();
461

  
462 575
			obj = DwgObjectFactory.getInstance().create(type, index);
463

  
464
//			System.out.println("SE HA CREADO UN OBJETO DEL TIPO = "+type+" =>> "+obj.getClass().getName());
465
			if(obj == null)
466
				return null;
467

  
576
			if (obj == null) {
577
				if (type >= 500) {
578
					int newIndex = type - 500;
579
					if (newIndex < (dwgFile.getDwgClasses().size() - 1)) {
580
						DwgClass dwgClass = (DwgClass) dwgFile.getDwgClasses()
581
								.get(newIndex);
582
						String dxfEntityName = dwgClass.getDxfName();
583
						obj = DwgObjectFactory.getInstance().create(
584
								dxfEntityName, index);
585
						if (obj == null) {
586
							logger.info(dxfEntityName
587
									+ " todavia no est? implementado");
588
							return null;
589
						}//if
590
					}//if newIndex
591
					else{
592
						return null;
593
					}
594
				}else {
595
					logger.info("Encontrado tipo " + type);
596
					return null;
597
				}
598
			}//if obj == null
599
			
600
			
468 601
			v = DwgUtil.getRawLong(data, bitPos);
469 602
			bitPos = ((Integer) v.get(0)).intValue();
470 603
			int objBSize = ((Integer) v.get(1)).intValue();
......
529 662
				logger.warn("No se ha implementado la lectura de "+obj.getClass().getName()+", code="+obj.getType());
530 663
			}
531 664
	}
665
	
666
	
667
	//TODO PROBAR, ESTA COPIADO A PELO DE DWG13-14. SI VALE, LLEVAR A UNA
668
	//CLASE ABSTRACTA
669
	protected void readHeaders() {
670

  
671
		int offset = dwgFile.getDwgSectionOffset("HEADERS");
672
		bb.position(offset);
673

  
674
		//1? leemos el sentinnel inicial
675
		bb.order(ByteOrder.nativeOrder());
676
		byte[] sentinel = new byte[16];
677
		bb.get(sentinel);
678

  
679
		if (sentinel[0] != 0xcf)
680
			logger.warn("sentinel[0] != 0xcf");
681
		if (sentinel[1] != 0x7b)
682
			logger.warn("sentinel[1] != 0x7b");
683
		if (sentinel[2] != 0x1f)
684
			logger.warn("sentinel[2] != 0x1f");
685
		if (sentinel[3] != 0x23)
686
			logger.warn("sentinel[3] != 0x23");
687
		if (sentinel[4] != 0xfd)
688
			logger.warn("sentinel[4] != 0xfd");
689
		if (sentinel[5] != 0xde)
690
			logger.warn("sentinel[5] != 0xde");
691
		if (sentinel[6] != 0x38)
692
			logger.warn("sentinel[6] != 0x38");
693
		if (sentinel[7] != 0xa9)
694
			logger.warn("sentinel[7] != 0xa9");
695
		if (sentinel[8] != 0x5f)
696
			logger.warn("sentinel[8] != 0x5f");
697
		if (sentinel[9] != 0x7c)
698
			logger.warn("sentinel[9] != 0x7c");
699
		if (sentinel[10] != 0x68)
700
			logger.warn("sentinel[10] != 0x68");
701
		if (sentinel[11] != 0xb8)
702
			logger.warn("sentinel[11] != 0xb8");
703
		if (sentinel[12] != 0x4e)
704
			logger.warn("sentinel[12] != 0x4e");
705
		if (sentinel[13] != 0x6d)
706
			logger.warn("sentinel[13] != 0x6d");
707
		if (sentinel[14] != 0x33)
708
			logger.warn("sentinel[14] != 0x33");
709
		if (sentinel[15] != 0x5f)
710
			logger.warn("sentinel[15] != 0x5f");
711

  
712
		//2? seguidamente leemos los datos
713
		bb.order(ByteOrder.LITTLE_ENDIAN);
714
		int size = bb.getInt();
715

  
716
		bb.order(ByteOrder.nativeOrder());
717
		byte[] data = new byte[size];
718
		bb.get(data);
719

  
720
		int[] intData = DwgUtil.toIntArray(data);
721

  
722
		//3? a continuacion el CRC de la seccion HEADER
723
		bb.order(ByteOrder.LITTLE_ENDIAN);
724
		short crc = bb.getShort();
725

  
726
		//Por ultimo, el sentinnel final
727
		bb.order(ByteOrder.nativeOrder());
728
		byte[] lastSentinnel = new byte[16];
729
		bb.get(lastSentinnel);
730
		if (lastSentinnel[0] != 0x30)
731
			logger.warn("lastSentinnel[0] != 0x30");
732
		if (lastSentinnel[1] != 0x84)
733
			logger.warn("lastSentinnel[1] != 0x84");
734
		if (lastSentinnel[2] != 0xe0)
735
			logger.warn("lastSentinnel[2] != 0xe0");
736
		if (lastSentinnel[3] != 0xdc)
737
			logger.warn("lastSentinnel[3] != 0xdc");
738
		if (lastSentinnel[4] != 0x02)
739
			logger.warn("lastSentinnel[4] != 0x02");
740
		if (lastSentinnel[5] != 0x21)
741
			logger.warn("lastSentinnel[5] != 0x21");
742
		if (lastSentinnel[6] != 0xc7)
743
			logger.warn("lastSentinnel[6] != 0xc7");
744
		if (lastSentinnel[7] != 0x56)
745
			logger.warn("lastSentinnel[7] != 0x56");
746
		if (lastSentinnel[8] != 0xa0)
747
			logger.warn("lastSentinnel[8] != 0xa0");
748
		if (lastSentinnel[9] != 0x83)
749
			logger.warn("lastSentinnel[9] != 0x83");
750
		if (lastSentinnel[10] != 0x97)
751
			logger.warn("lastSentinnel[10] != 0x97");
752
		if (lastSentinnel[11] != 0x47)
753
			logger.warn("lastSentinnel[11] != 0x47");
754
		if (lastSentinnel[12] != 0xb1)
755
			logger.warn("lastSentinnel[12] != 0xb1");
756
		if (lastSentinnel[13] != 0x92)
757
			logger.warn("lastSentinnel[13] != 0x92");
758
		if (lastSentinnel[14] != 0xcc)
759
			logger.warn("lastSentinnel[14] != 0xcc");
760
		if (lastSentinnel[15] != 0xa0)
761
			logger.warn("lastSentinnel[15] != 0xa0");
762

  
763
		//Ahora interpretamos los datos en bruto
764
		int bitPos = 0;
765
		try {
766
			List val = DwgUtil.getBitDouble(intData, bitPos);
767
			bitPos = ((Integer) val.get(0)).intValue();
768
			dwgFile.setHeader("VAL1", val.get(1));
769

  
770
			val = DwgUtil.getBitDouble(intData, bitPos);
771
			bitPos = ((Integer) val.get(0)).intValue();
772
			dwgFile.setHeader("VAL2", val.get(1));
773

  
774
			val = DwgUtil.getBitDouble(intData, bitPos);
775
			bitPos = ((Integer) val.get(0)).intValue();
776
			dwgFile.setHeader("VAL3", val.get(1));
777

  
778
			val = DwgUtil.getBitDouble(intData, bitPos);
779
			bitPos = ((Integer) val.get(0)).intValue();
780
			dwgFile.setHeader("VAL4", val.get(1));
781

  
782
			val = DwgUtil.getTextString(intData, bitPos);
783
			bitPos = ((Integer) val.get(0)).intValue();
784
			dwgFile.setHeader("STRING1", val.get(1));
785

  
786
			val = DwgUtil.getTextString(intData, bitPos);
787
			bitPos = ((Integer) val.get(0)).intValue();
788
			dwgFile.setHeader("STRING2", val.get(1));
789

  
790
			val = DwgUtil.getTextString(intData, bitPos);
791
			bitPos = ((Integer) val.get(0)).intValue();
792
			dwgFile.setHeader("STRING3", val.get(1));
793

  
794
			val = DwgUtil.getTextString(intData, bitPos);
795
			bitPos = ((Integer) val.get(0)).intValue();
796
			dwgFile.setHeader("STRING4", val.get(1));
797

  
798
			val = DwgUtil.getBitLong(intData, bitPos);
799
			bitPos = ((Integer) val.get(0)).intValue();
800
			dwgFile.setHeader("LONG1", val.get(1));
801

  
802
			val = DwgUtil.getBitLong(intData, bitPos);
803
			bitPos = ((Integer) val.get(0)).intValue();
804
			dwgFile.setHeader("LONG2", val.get(1));
805

  
806
//			val = DwgUtil.getBitShort(intData, bitPos);
807
//			bitPos = ((Integer) val.get(0)).intValue();
808
//			dwgFile.setHeader("SHORT1", val.get(1));
809

  
810
			//TODO REFACTORIZAR ESTO PARA USAR DWGHANDLEREFERENCE
811

  
812
			//TODO Los handle se leen asi??
813
			val = DwgUtil.getHandle(intData, bitPos);
814
			bitPos = ((Integer) val.get(0)).intValue();
815
			dwgFile.setHeader("HANDLE1", val.get(1));
816

  
817
			val = DwgUtil.testBit(intData, bitPos);
818
			bitPos = ((Integer) val.get(0)).intValue();
819
			dwgFile.setHeader("DIMASO", val.get(1));
820

  
821
			val = DwgUtil.testBit(intData, bitPos);
822
			bitPos = ((Integer) val.get(0)).intValue();
823
			dwgFile.setHeader("DIMSHO", val.get(1));
824

  
825
//			val = DwgUtil.testBit(intData, bitPos);
826
//			bitPos = ((Integer) val.get(0)).intValue();
827
//			dwgFile.setHeader("DIMSAV", val.get(1));
828

  
829
			val = DwgUtil.testBit(intData, bitPos);
830
			bitPos = ((Integer) val.get(0)).intValue();
831
			dwgFile.setHeader("PLINEGEN", val.get(1));
832

  
833
			val = DwgUtil.testBit(intData, bitPos);
834
			bitPos = ((Integer) val.get(0)).intValue();
835
			dwgFile.setHeader("ORTHOMODE", val.get(1));
836

  
837
			val = DwgUtil.testBit(intData, bitPos);
838
			bitPos = ((Integer) val.get(0)).intValue();
839
			dwgFile.setHeader("REGENMODE", val.get(1));
840

  
841
			val = DwgUtil.testBit(intData, bitPos);
842
			bitPos = ((Integer) val.get(0)).intValue();
843
			dwgFile.setHeader("FILLMODE", val.get(1));
844

  
845
			val = DwgUtil.testBit(intData, bitPos);
846
			bitPos = ((Integer) val.get(0)).intValue();
847
			dwgFile.setHeader("QTEXTMODE", val.get(1));
848

  
849
			val = DwgUtil.testBit(intData, bitPos);
850
			bitPos = ((Integer) val.get(0)).intValue();
851
			dwgFile.setHeader("PSLTSCALE", val.get(1));
852

  
853
			val = DwgUtil.testBit(intData, bitPos);
854
			bitPos = ((Integer) val.get(0)).intValue();
855
			dwgFile.setHeader("LIMCHECK", val.get(1));
856

  
857
//			val = DwgUtil.testBit(intData, bitPos);
858
//			bitPos = ((Integer) val.get(0)).intValue();
859
//			dwgFile.setHeader("BLIPMODE", val.get(1));
860

  
861
			val = DwgUtil.testBit(intData, bitPos);
862
			bitPos = ((Integer) val.get(0)).intValue();
863
			dwgFile.setHeader("USER_TIMER", val.get(1));
864

  
865
			val = DwgUtil.testBit(intData, bitPos);
866
			bitPos = ((Integer) val.get(0)).intValue();
867
			dwgFile.setHeader("SKPOLY", val.get(1));
868

  
869
			val = DwgUtil.testBit(intData, bitPos);
870
			bitPos = ((Integer) val.get(0)).intValue();
871
			dwgFile.setHeader("ANGDIR", val.get(1));
872

  
873
			val = DwgUtil.testBit(intData, bitPos);
874
			bitPos = ((Integer) val.get(0)).intValue();
875
			dwgFile.setHeader("SPLFRAME", val.get(1));
876

  
877
//			val = DwgUtil.testBit(intData, bitPos);
878
//			bitPos = ((Integer) val.get(0)).intValue();
879
//			dwgFile.setHeader("ATTREQ", val.get(1));
880
//
881
//			val = DwgUtil.testBit(intData, bitPos);
882
//			bitPos = ((Integer) val.get(0)).intValue();
883
//			dwgFile.setHeader("ATTDIA", val.get(1));
884

  
885
			val = DwgUtil.testBit(intData, bitPos);
886
			bitPos = ((Integer) val.get(0)).intValue();
887
			dwgFile.setHeader("MIRRTEXT", val.get(1));
888

  
889
			val = DwgUtil.testBit(intData, bitPos);
890
			bitPos = ((Integer) val.get(0)).intValue();
891
			dwgFile.setHeader("WORLDVIEW", val.get(1));
892

  
893
//			val = DwgUtil.testBit(intData, bitPos);
894
//			bitPos = ((Integer) val.get(0)).intValue();
895
//			dwgFile.setHeader("WIREFRAME", val.get(1));
896

  
897
			val = DwgUtil.testBit(intData, bitPos);
898
			bitPos = ((Integer) val.get(0)).intValue();
899
			dwgFile.setHeader("TILEMODE", val.get(1));
900

  
901
			val = DwgUtil.testBit(intData, bitPos);
902
			bitPos = ((Integer) val.get(0)).intValue();
903
			dwgFile.setHeader("PLIMCHECK", val.get(1));
904

  
905
			val = DwgUtil.testBit(intData, bitPos);
906
			bitPos = ((Integer) val.get(0)).intValue();
907
			dwgFile.setHeader("VISRETAIN", val.get(1));
908

  
909
//			val = DwgUtil.testBit(intData, bitPos);
910
//			bitPos = ((Integer) val.get(0)).intValue();
911
//			dwgFile.setHeader("DELOBJ", val.get(1));
912

  
913
			val = DwgUtil.testBit(intData, bitPos);
914
			bitPos = ((Integer) val.get(0)).intValue();
915
			dwgFile.setHeader("DISPSILH", val.get(1));
916

  
917
			val = DwgUtil.testBit(intData, bitPos);
918
			bitPos = ((Integer) val.get(0)).intValue();
919
			dwgFile.setHeader("PELLISE", val.get(1));
920

  
921
			val = DwgUtil.getBitShort(intData, bitPos);
922
			bitPos = ((Integer) val.get(0)).intValue();
923
			if (dwgFile.getDwgVersion() == "R14")
924
				dwgFile.setHeader("PROXYGRAPH", val.get(1));
925
			else
926
				dwgFile.setHeader("SAVEIMAGES", val.get(1));
927

  
928
//			val = DwgUtil.getBitShort(intData, bitPos);
929
//			bitPos = ((Integer) val.get(0)).intValue();
930
//			dwgFile.setHeader("DRAGMODE", val.get(1));
931

  
932
			val = DwgUtil.getBitShort(intData, bitPos);
933
			bitPos = ((Integer) val.get(0)).intValue();
934
			dwgFile.setHeader("TREEDEPTH", val.get(1));
935

  
936
			val = DwgUtil.getBitShort(intData, bitPos);
937
			bitPos = ((Integer) val.get(0)).intValue();
938
			dwgFile.setHeader("LUNITS", val.get(1));
939

  
940
			val = DwgUtil.getBitShort(intData, bitPos);
941
			bitPos = ((Integer) val.get(0)).intValue();
942
			dwgFile.setHeader("LUPREC", val.get(1));
943

  
944
			val = DwgUtil.getBitShort(intData, bitPos);
945
			bitPos = ((Integer) val.get(0)).intValue();
946
			dwgFile.setHeader("AUNITS", val.get(1));
947

  
948
			val = DwgUtil.getBitShort(intData, bitPos);
949
			bitPos = ((Integer) val.get(0)).intValue();
950
			dwgFile.setHeader("AUPREC", val.get(1));
951

  
952
//			val = DwgUtil.getBitShort(intData, bitPos);
953
//			bitPos = ((Integer) val.get(0)).intValue();
954
//			dwgFile.setHeader("OSMODE", val.get(1));
955

  
956
			val = DwgUtil.getBitShort(intData, bitPos);
957
			bitPos = ((Integer) val.get(0)).intValue();
958
			dwgFile.setHeader("ATTMODE", val.get(1));
959

  
960
//			val = DwgUtil.getBitShort(intData, bitPos);
961
//			bitPos = ((Integer) val.get(0)).intValue();
962
//			dwgFile.setHeader("COORDS", val.get(1));
963

  
964
			val = DwgUtil.getBitShort(intData, bitPos);
965
			bitPos = ((Integer) val.get(0)).intValue();
966
			dwgFile.setHeader("PDMODE", val.get(1));
967

  
968
//			val = DwgUtil.getBitShort(intData, bitPos);
969
//			bitPos = ((Integer) val.get(0)).intValue();
970
//			dwgFile.setHeader("PICKSTYLE", val.get(1));
971

  
972
			val = DwgUtil.getBitShort(intData, bitPos);
973
			bitPos = ((Integer) val.get(0)).intValue();
974
			dwgFile.setHeader("USERI1", val.get(1));
975

  
976
			val = DwgUtil.getBitShort(intData, bitPos);
977
			bitPos = ((Integer) val.get(0)).intValue();
978
			dwgFile.setHeader("USERI2", val.get(1));
979

  
980
			val = DwgUtil.getBitShort(intData, bitPos);
981
			bitPos = ((Integer) val.get(0)).intValue();
982
			dwgFile.setHeader("USERI3", val.get(1));
983

  
984
			val = DwgUtil.getBitShort(intData, bitPos);
985
			bitPos = ((Integer) val.get(0)).intValue();
986
			dwgFile.setHeader("USERI4", val.get(1));
987

  
988
			val = DwgUtil.getBitShort(intData, bitPos);
989
			bitPos = ((Integer) val.get(0)).intValue();
990
			dwgFile.setHeader("USERI5", val.get(1));
991

  
992
			val = DwgUtil.getBitShort(intData, bitPos);
993
			bitPos = ((Integer) val.get(0)).intValue();
994
			dwgFile.setHeader("SPLINESEGS", val.get(1));
995

  
996
			val = DwgUtil.getBitShort(intData, bitPos);
997
			bitPos = ((Integer) val.get(0)).intValue();
998
			dwgFile.setHeader("SURFU", val.get(1));
999

  
1000
			val = DwgUtil.getBitShort(intData, bitPos);
1001
			bitPos = ((Integer) val.get(0)).intValue();
1002
			dwgFile.setHeader("SURFV", val.get(1));
1003

  
1004
			val = DwgUtil.getBitShort(intData, bitPos);
1005
			bitPos = ((Integer) val.get(0)).intValue();
1006
			dwgFile.setHeader("SURFTYPE", val.get(1));
1007

  
1008
			val = DwgUtil.getBitShort(intData, bitPos);
1009
			bitPos = ((Integer) val.get(0)).intValue();
1010
			dwgFile.setHeader("SURFTAB1", val.get(1));
1011

  
1012
			val = DwgUtil.getBitShort(intData, bitPos);
1013
			bitPos = ((Integer) val.get(0)).intValue();
1014
			dwgFile.setHeader("SURFTAB2", val.get(1));
1015

  
1016
			val = DwgUtil.getBitShort(intData, bitPos);
1017
			bitPos = ((Integer) val.get(0)).intValue();
1018
			dwgFile.setHeader("SPLINETYPE", val.get(1));
1019

  
1020
			val = DwgUtil.getBitShort(intData, bitPos);
1021
			bitPos = ((Integer) val.get(0)).intValue();
1022
			dwgFile.setHeader("SHADEDGE", val.get(1));
1023

  
1024
			val = DwgUtil.getBitShort(intData, bitPos);
1025
			bitPos = ((Integer) val.get(0)).intValue();
1026
			dwgFile.setHeader("SHADEDIF", val.get(1));
1027

  
1028
			val = DwgUtil.getBitShort(intData, bitPos);
1029
			bitPos = ((Integer) val.get(0)).intValue();
1030
			dwgFile.setHeader("UNITMODE", val.get(1));
1031

  
1032
			val = DwgUtil.getBitShort(intData, bitPos);
1033
			bitPos = ((Integer) val.get(0)).intValue();
1034
			dwgFile.setHeader("MAXACTVP", val.get(1));
1035

  
1036
			val = DwgUtil.getBitShort(intData, bitPos);
1037
			bitPos = ((Integer) val.get(0)).intValue();
1038
			dwgFile.setHeader("ISOLINES", val.get(1));
1039

  
1040
			val = DwgUtil.getBitShort(intData, bitPos);
1041
			bitPos = ((Integer) val.get(0)).intValue();
1042
			dwgFile.setHeader("CMLJUST", val.get(1));
1043

  
1044
			val = DwgUtil.getBitShort(intData, bitPos);
1045
			bitPos = ((Integer) val.get(0)).intValue();
1046
			dwgFile.setHeader("TEXTQLTY", val.get(1));
1047

  
1048
			val = DwgUtil.getBitDouble(intData, bitPos);
1049
			bitPos = ((Integer) val.get(0)).intValue();
1050
			dwgFile.setHeader("LTSCALE", val.get(1));
1051

  
1052
			val = DwgUtil.getBitDouble(intData, bitPos);
1053
			bitPos = ((Integer) val.get(0)).intValue();
1054
			dwgFile.setHeader("TEXTSIZE", val.get(1));
1055

  
1056
			val = DwgUtil.getBitDouble(intData, bitPos);
1057
			bitPos = ((Integer) val.get(0)).intValue();
1058
			dwgFile.setHeader("TRACEWID", val.get(1));
1059

  
1060
			val = DwgUtil.getBitDouble(intData, bitPos);
1061
			bitPos = ((Integer) val.get(0)).intValue();
1062
			dwgFile.setHeader("SKETCHINC", val.get(1));
1063

  
1064
			val = DwgUtil.getBitDouble(intData, bitPos);
1065
			bitPos = ((Integer) val.get(0)).intValue();
1066
			dwgFile.setHeader("FILLETRAD", val.get(1));
1067

  
1068
			val = DwgUtil.getBitDouble(intData, bitPos);
1069
			bitPos = ((Integer) val.get(0)).intValue();
1070
			dwgFile.setHeader("THICKNESS", val.get(1));
1071

  
1072
			val = DwgUtil.getBitDouble(intData, bitPos);
1073
			bitPos = ((Integer) val.get(0)).intValue();
1074
			dwgFile.setHeader("ANGBASE", val.get(1));
1075

  
1076
			val = DwgUtil.getBitDouble(intData, bitPos);
1077
			bitPos = ((Integer) val.get(0)).intValue();
1078
			dwgFile.setHeader("PDSIZE", val.get(1));
1079

  
1080
			val = DwgUtil.getBitDouble(intData, bitPos);
1081
			bitPos = ((Integer) val.get(0)).intValue();
1082
			dwgFile.setHeader("PLINEWID", val.get(1));
1083

  
1084
			val = DwgUtil.getBitDouble(intData, bitPos);
1085
			bitPos = ((Integer) val.get(0)).intValue();
1086
			dwgFile.setHeader("USERR1", val.get(1));
1087

  
1088
			val = DwgUtil.getBitDouble(intData, bitPos);
1089
			bitPos = ((Integer) val.get(0)).intValue();
1090
			dwgFile.setHeader("USERR2", val.get(1));
1091

  
1092
			val = DwgUtil.getBitDouble(intData, bitPos);
1093
			bitPos = ((Integer) val.get(0)).intValue();
1094
			dwgFile.setHeader("USERR3", val.get(1));
1095

  
1096
			val = DwgUtil.getBitDouble(intData, bitPos);
1097
			bitPos = ((Integer) val.get(0)).intValue();
1098
			dwgFile.setHeader("USERR4", val.get(1));
1099

  
1100
			val = DwgUtil.getBitDouble(intData, bitPos);
1101
			bitPos = ((Integer) val.get(0)).intValue();
1102
			dwgFile.setHeader("USERR5", val.get(1));
1103

  
1104
			val = DwgUtil.getBitDouble(intData, bitPos);
1105
			bitPos = ((Integer) val.get(0)).intValue();
1106
			dwgFile.setHeader("CHAMFERA", val.get(1));
1107

  
1108
			val = DwgUtil.getBitDouble(intData, bitPos);
1109
			bitPos = ((Integer) val.get(0)).intValue();
1110
			dwgFile.setHeader("CHAMFERB", val.get(1));
1111

  
1112
			val = DwgUtil.getBitDouble(intData, bitPos);
1113
			bitPos = ((Integer) val.get(0)).intValue();
1114
			dwgFile.setHeader("CHAMFERC", val.get(1));
1115

  
1116
			val = DwgUtil.getBitDouble(intData, bitPos);
1117
			bitPos = ((Integer) val.get(0)).intValue();
1118
			dwgFile.setHeader("CHAMFERD", val.get(1));
1119

  
1120
			val = DwgUtil.getBitDouble(intData, bitPos);
1121
			bitPos = ((Integer) val.get(0)).intValue();
1122
			dwgFile.setHeader("FACETRES", val.get(1));
1123

  
1124
			val = DwgUtil.getBitDouble(intData, bitPos);
1125
			bitPos = ((Integer) val.get(0)).intValue();
1126
			dwgFile.setHeader("CMLSCALE", val.get(1));
1127

  
1128
			val = DwgUtil.getBitDouble(intData, bitPos);
1129
			bitPos = ((Integer) val.get(0)).intValue();
1130
			dwgFile.setHeader("CELTSCALE", val.get(1));
1131

  
1132
			val = DwgUtil.getTextString(intData, bitPos);
1133
			bitPos = ((Integer) val.get(0)).intValue();
1134
			dwgFile.setHeader("MENUNAME", val.get(1));
1135

  
1136
			int[] tdcreate = new int[2];
1137
			val = DwgUtil.getBitLong(intData, bitPos);
1138
			bitPos = ((Integer) val.get(0)).intValue();
1139
			tdcreate[0] = ((Integer) val.get(1)).intValue();
1140
			val = DwgUtil.getBitLong(intData, bitPos);
1141
			bitPos = ((Integer) val.get(0)).intValue();
1142
			tdcreate[1] = ((Integer) val.get(1)).intValue();
1143
			dwgFile.setHeader("TDCREATE", tdcreate);
1144

  
1145
			int[] tdupdate = new int[2];
1146
			val = DwgUtil.getBitLong(intData, bitPos);
1147
			bitPos = ((Integer) val.get(0)).intValue();
1148
			tdupdate[0] = ((Integer) val.get(1)).intValue();
1149
			val = DwgUtil.getBitLong(intData, bitPos);
1150
			bitPos = ((Integer) val.get(0)).intValue();
1151
			tdupdate[1] = ((Integer) val.get(1)).intValue();
1152
			dwgFile.setHeader("TDUPDATE", tdupdate);
1153

  
1154
			int[] tdindwg = new int[2];
1155
			val = DwgUtil.getBitLong(intData, bitPos);
1156
			bitPos = ((Integer) val.get(0)).intValue();
1157
			tdindwg[0] = ((Integer) val.get(1)).intValue();
1158
			val = DwgUtil.getBitLong(intData, bitPos);
1159
			bitPos = ((Integer) val.get(0)).intValue();
1160
			tdindwg[1] = ((Integer) val.get(1)).intValue();
1161
			dwgFile.setHeader("TDINDWG", tdindwg);
1162

  
1163
			int[] tdusrtime = new int[2];
1164
			val = DwgUtil.getBitLong(intData, bitPos);
1165
			bitPos = ((Integer) val.get(0)).intValue();
1166
			tdusrtime[0] = ((Integer) val.get(1)).intValue();
1167
			val = DwgUtil.getBitLong(intData, bitPos);
1168
			bitPos = ((Integer) val.get(0)).intValue();
1169
			tdusrtime[1] = ((Integer) val.get(1)).intValue();
1170
			dwgFile.setHeader("TDUSRTIME", tdusrtime);
1171

  
1172
			val = DwgUtil.getBitShort(intData, bitPos);
1173
			bitPos = ((Integer) val.get(0)).intValue();
1174
			dwgFile.setHeader("CECOLOR", val.get(1));
1175

  
1176
			val = DwgUtil.getHandle(intData, bitPos);
1177
			bitPos = ((Integer) val.get(0)).intValue();
1178
			int intHandle = DwgUtil.handleToInt(val);
1179
			dwgFile.setHeader("HANDSEED", new Integer(intHandle));
1180

  
1181
			//creo que CLAYER marca la capa actualmente seleccionada en el menu
1182
			// de
1183
			// autocad
1184

  
1185
			val = DwgUtil.getHandle(intData, bitPos);
1186
			bitPos = ((Integer) val.get(0)).intValue();
1187
			intHandle = DwgUtil.handleToInt(val);
1188
			dwgFile.setHeader("CLAYER", new Integer(intHandle));
1189

  
1190
			val = DwgUtil.getHandle(intData, bitPos);
1191
			bitPos = ((Integer) val.get(0)).intValue();
1192
			intHandle = DwgUtil.handleToInt(val);
1193
			dwgFile.setHeader("TEXSTYLE", new Integer(intHandle));
1194

  
1195
			val = DwgUtil.getHandle(intData, bitPos);
1196
			bitPos = ((Integer) val.get(0)).intValue();
1197
			intHandle = DwgUtil.handleToInt(val);
1198
			dwgFile.setHeader("CELLTYPE", new Integer(intHandle));
1199

  
1200
			val = DwgUtil.getHandle(intData, bitPos);
1201
			bitPos = ((Integer) val.get(0)).intValue();
1202
			intHandle = DwgUtil.handleToInt(val);
1203
			dwgFile.setHeader("DIMSTYLE", new Integer(intHandle));
1204

  
1205
			val = DwgUtil.getHandle(intData, bitPos);
1206
			bitPos = ((Integer) val.get(0)).intValue();
1207
			intHandle = DwgUtil.handleToInt(val);
1208
			dwgFile.setHeader("CMLSTYLE", new Integer(intHandle));
1209

  
1210
			//this property is exclusive of DWG 2000
1211
			val = DwgUtil.getBitDouble(intData, bitPos);
1212
			bitPos = ((Integer) val.get(0)).intValue();
1213
			dwgFile.setHeader("PSVPSCALE", val.get(1));
1214
							
1215
			
1216
			double[] spaces1 = new double[3];
1217
			val = DwgUtil.getBitDouble(intData, bitPos);
1218
			bitPos = ((Integer) val.get(0)).intValue();
1219
			spaces1[0] = ((Double) val.get(1)).doubleValue();
1220
			val = DwgUtil.getBitDouble(intData, bitPos);
1221
			bitPos = ((Integer) val.get(0)).intValue();
1222
			spaces1[1] = ((Double) val.get(1)).doubleValue();
1223
			val = DwgUtil.getBitDouble(intData, bitPos);
1224
			bitPos = ((Integer) val.get(0)).intValue();
1225
			spaces1[2] = ((Double) val.get(1)).doubleValue();
1226
			dwgFile.setHeader("PSPACE_INSBASE", spaces1);
1227

  
1228
			double[] spaces2 = new double[3];
1229
			val = DwgUtil.getBitDouble(intData, bitPos);
1230
			bitPos = ((Integer) val.get(0)).intValue();
1231
			spaces2[0] = ((Double) val.get(1)).doubleValue();
1232
			val = DwgUtil.getBitDouble(intData, bitPos);
1233
			bitPos = ((Integer) val.get(0)).intValue();
1234
			spaces2[1] = ((Double) val.get(1)).doubleValue();
1235
			val = DwgUtil.getBitDouble(intData, bitPos);
1236
			bitPos = ((Integer) val.get(0)).intValue();
1237
			spaces2[2] = ((Double) val.get(1)).doubleValue();
1238
			dwgFile.setHeader("PSPACE_EXTMIN", spaces2);
1239

  
1240
			double[] spaces3 = new double[3];
1241
			val = DwgUtil.getBitDouble(intData, bitPos);
1242
			bitPos = ((Integer) val.get(0)).intValue();
1243
			spaces3[0] = ((Double) val.get(1)).doubleValue();
1244
			val = DwgUtil.getBitDouble(intData, bitPos);
1245
			bitPos = ((Integer) val.get(0)).intValue();
1246
			spaces3[1] = ((Double) val.get(1)).doubleValue();
1247
			val = DwgUtil.getBitDouble(intData, bitPos);
1248
			bitPos = ((Integer) val.get(0)).intValue();
1249
			spaces3[2] = ((Double) val.get(1)).doubleValue();
1250
			dwgFile.setHeader("PSPACE_EXTMAX", spaces2);
1251

  
1252
			double[] spaces4 = new double[2];
1253
			val = DwgUtil.getRawDouble(intData, bitPos);
1254
			bitPos = ((Integer) val.get(0)).intValue();
1255
			spaces4[0] = ((Double) val.get(1)).doubleValue();
1256
			val = DwgUtil.getRawDouble(intData, bitPos);
1257
			bitPos = ((Integer) val.get(0)).intValue();
1258
			spaces4[1] = ((Double) val.get(1)).doubleValue();
1259
			dwgFile.setHeader("PSPACE_LIMMIN", spaces4);
1260

  
1261
			double[] spaces5 = new double[2];
1262
			val = DwgUtil.getRawDouble(intData, bitPos);
1263
			bitPos = ((Integer) val.get(0)).intValue();
1264
			spaces5[0] = ((Double) val.get(1)).doubleValue();
1265
			val = DwgUtil.getRawDouble(intData, bitPos);
1266
			bitPos = ((Integer) val.get(0)).intValue();
1267
			spaces5[1] = ((Double) val.get(1)).doubleValue();
1268
			dwgFile.setHeader("PSPACE_LIMMAX", spaces5);
1269

  
1270
			val = DwgUtil.getBitDouble(intData, bitPos);
1271
			bitPos = ((Integer) val.get(0)).intValue();
1272
			dwgFile.setHeader("PSPACE_ELEVATION", val.get(1));
1273

  
1274
			double[] spaces6 = new double[6];
1275
			val = DwgUtil.getBitDouble(intData, bitPos);
1276
			bitPos = ((Integer) val.get(0)).intValue();
1277
			spaces6[0] = ((Double) val.get(1)).doubleValue();
1278
			val = DwgUtil.getBitDouble(intData, bitPos);
1279
			bitPos = ((Integer) val.get(0)).intValue();
1280
			spaces6[1] = ((Double) val.get(1)).doubleValue();
1281
			val = DwgUtil.getBitDouble(intData, bitPos);
1282
			bitPos = ((Integer) val.get(0)).intValue();
1283
			spaces6[2] = ((Double) val.get(1)).doubleValue();
1284
			dwgFile.setHeader("PSPACE_UCSORG", spaces6);
1285

  
1286
			double[] spaces7 = new double[6];
1287
			val = DwgUtil.getBitDouble(intData, bitPos);
1288
			bitPos = ((Integer) val.get(0)).intValue();
1289
			spaces7[0] = ((Double) val.get(1)).doubleValue();
1290
			val = DwgUtil.getBitDouble(intData, bitPos);
1291
			bitPos = ((Integer) val.get(0)).intValue();
1292
			spaces7[1] = ((Double) val.get(1)).doubleValue();
1293
			val = DwgUtil.getBitDouble(intData, bitPos);
1294
			bitPos = ((Integer) val.get(0)).intValue();
1295
			spaces7[2] = ((Double) val.get(1)).doubleValue();
1296
			dwgFile.setHeader("PSPACE_UCSXDIR", spaces7);
1297

  
1298
			double[] spaces8 = new double[6];
1299
			val = DwgUtil.getBitDouble(intData, bitPos);
1300
			bitPos = ((Integer) val.get(0)).intValue();
1301
			spaces8[0] = ((Double) val.get(1)).doubleValue();
1302
			val = DwgUtil.getBitDouble(intData, bitPos);
1303
			bitPos = ((Integer) val.get(0)).intValue();
1304
			spaces8[1] = ((Double) val.get(1)).doubleValue();
1305
			val = DwgUtil.getBitDouble(intData, bitPos);
1306
			bitPos = ((Integer) val.get(0)).intValue();
1307
			spaces8[2] = ((Double) val.get(1)).doubleValue();
1308
			dwgFile.setHeader("PSPACE_UCSYDIR", spaces8);
1309

  
1310
			val = DwgUtil.getHandle(intData, bitPos);
1311
			bitPos = ((Integer) val.get(0)).intValue();
1312
			intHandle = DwgUtil.handleToInt(val);
1313
			dwgFile.setHeader("PSPACE_UCSNAME", new Integer(intHandle));
1314

  
1315
			///DWG 2000 ONLY
1316
			
1317
			val = DwgUtil.getHandle(intData, bitPos);
1318
			bitPos = ((Integer) val.get(0)).intValue();
1319
			intHandle = DwgUtil.handleToInt(val);
1320
			dwgFile.setHeader("PUCSBASE", new Integer(intHandle));
1321
			
1322
			val = DwgUtil.getBitShort(intData, bitPos);
1323
			bitPos = ((Integer) val.get(0)).intValue();
1324
			dwgFile.setHeader("PUCSBASE", val.get(1));
1325
			
1326
			val = DwgUtil.getHandle(intData, bitPos);
1327
			bitPos = ((Integer) val.get(0)).intValue();
1328
			intHandle = DwgUtil.handleToInt(val);
1329
			dwgFile.setHeader("PUCSORTHOREF", new Integer(intHandle));
1330
			
1331
			double[] pucsorgtop = new double[3];
1332
			val = DwgUtil.getBitDouble(intData, bitPos);
1333
			bitPos = ((Integer) val.get(0)).intValue();
1334
			pucsorgtop[0] = ((Double) val.get(1)).doubleValue();
1335
			val = DwgUtil.getBitDouble(intData, bitPos);
1336
			bitPos = ((Integer) val.get(0)).intValue();
1337
			pucsorgtop[1] = ((Double) val.get(1)).doubleValue();
1338
			val = DwgUtil.getBitDouble(intData, bitPos);
1339
			bitPos = ((Integer) val.get(0)).intValue();
1340
			pucsorgtop[2] = ((Double) val.get(1)).doubleValue();
1341
			dwgFile.setHeader("PUCSORGTOP", pucsorgtop);
1342
				
1343
			double[] pucsorgbottom = new double[3];
1344
			val = DwgUtil.getBitDouble(intData, bitPos);
1345
			bitPos = ((Integer) val.get(0)).intValue();
1346
			pucsorgbottom[0] = ((Double) val.get(1)).doubleValue();
1347
			val = DwgUtil.getBitDouble(intData, bitPos);
1348
			bitPos = ((Integer) val.get(0)).intValue();
1349
			pucsorgbottom[1] = ((Double) val.get(1)).doubleValue();
1350
			val = DwgUtil.getBitDouble(intData, bitPos);
1351
			bitPos = ((Integer) val.get(0)).intValue();
1352
			pucsorgbottom[2] = ((Double) val.get(1)).doubleValue();
1353
			dwgFile.setHeader("PUCSORGBOTTOM", pucsorgbottom);
1354
			
1355
			double[] pucsorgleft = new double[3];
1356
			val = DwgUtil.getBitDouble(intData, bitPos);
1357
			bitPos = ((Integer) val.get(0)).intValue();
1358
			pucsorgleft[0] = ((Double) val.get(1)).doubleValue();
1359
			val = DwgUtil.getBitDouble(intData, bitPos);
1360
			bitPos = ((Integer) val.get(0)).intValue();
1361
			pucsorgleft[1] = ((Double) val.get(1)).doubleValue();
1362
			val = DwgUtil.getBitDouble(intData, bitPos);
1363
			bitPos = ((Integer) val.get(0)).intValue();
1364
			pucsorgleft[2] = ((Double) val.get(1)).doubleValue();
1365
			dwgFile.setHeader("PUCSORGLEFT", pucsorgleft);
1366
				
1367
			double[] pucsorgright = new double[3];
1368
			val = DwgUtil.getBitDouble(intData, bitPos);
1369
			bitPos = ((Integer) val.get(0)).intValue();
1370
			pucsorgright[0] = ((Double) val.get(1)).doubleValue();
1371
			val = DwgUtil.getBitDouble(intData, bitPos);
1372
			bitPos = ((Integer) val.get(0)).intValue();
1373
			pucsorgright[1] = ((Double) val.get(1)).doubleValue();
1374
			val = DwgUtil.getBitDouble(intData, bitPos);
1375
			bitPos = ((Integer) val.get(0)).intValue();
1376
			pucsorgright[2] = ((Double) val.get(1)).doubleValue();
1377
			dwgFile.setHeader("PUCSORGRIGHT", pucsorgright);
1378
			
1379
			double[] pucsorgfront = new double[3];
1380
			val = DwgUtil.getBitDouble(intData, bitPos);
1381
			bitPos = ((Integer) val.get(0)).intValue();
1382
			pucsorgfront[0] = ((Double) val.get(1)).doubleValue();
1383
			val = DwgUtil.getBitDouble(intData, bitPos);
1384
			bitPos = ((Integer) val.get(0)).intValue();
1385
			pucsorgfront[1] = ((Double) val.get(1)).doubleValue();
1386
			val = DwgUtil.getBitDouble(intData, bitPos);
1387
			bitPos = ((Integer) val.get(0)).intValue();
1388
			pucsorgfront[2] = ((Double) val.get(1)).doubleValue();
1389
			dwgFile.setHeader("PUCSORGFRONT", pucsorgfront);
1390
			
1391
			double[] pucsorgback = new double[3];
1392
			val = DwgUtil.getBitDouble(intData, bitPos);
1393
			bitPos = ((Integer) val.get(0)).intValue();
1394
			pucsorgback[0] = ((Double) val.get(1)).doubleValue();
1395
			val = DwgUtil.getBitDouble(intData, bitPos);
1396
			bitPos = ((Integer) val.get(0)).intValue();
1397
			pucsorgback[1] = ((Double) val.get(1)).doubleValue();
1398
			val = DwgUtil.getBitDouble(intData, bitPos);
1399
			bitPos = ((Integer) val.get(0)).intValue();
1400
			pucsorgback[2] = ((Double) val.get(1)).doubleValue();
1401
			dwgFile.setHeader("PUCSORGBACK", pucsorgback);	
1402
				
1403
			
1404
			//COMMON
1405
			double[] spaces9 = new double[6];
1406
			val = DwgUtil.getBitDouble(intData, bitPos);
1407
			bitPos = ((Integer) val.get(0)).intValue();
1408
			spaces9[0] = ((Double) val.get(1)).doubleValue();
1409
			val = DwgUtil.getBitDouble(intData, bitPos);
1410
			bitPos = ((Integer) val.get(0)).intValue();
1411
			spaces9[1] = ((Double) val.get(1)).doubleValue();
1412
			val = DwgUtil.getBitDouble(intData, bitPos);
1413
			bitPos = ((Integer) val.get(0)).intValue();
1414
			spaces9[2] = ((Double) val.get(1)).doubleValue();
1415
			dwgFile.setHeader("MSPACE_INSBASE", spaces9);
1416

  
1417
			double[] spaces10 = new double[6];
1418
			val = DwgUtil.getBitDouble(intData, bitPos);
1419
			bitPos = ((Integer) val.get(0)).intValue();
1420
			spaces10[0] = ((Double) val.get(1)).doubleValue();
1421
			val = DwgUtil.getBitDouble(intData, bitPos);
1422
			bitPos = ((Integer) val.get(0)).intValue();
1423
			spaces10[1] = ((Double) val.get(1)).doubleValue();
1424
			val = DwgUtil.getBitDouble(intData, bitPos);
1425
			bitPos = ((Integer) val.get(0)).intValue();
1426
			spaces10[2] = ((Double) val.get(1)).doubleValue();
1427
			dwgFile.setHeader("MSPACE_EXTMIN", spaces10);
1428

  
1429
			double[] spaces11 = new double[3];
1430
			val = DwgUtil.getBitDouble(intData, bitPos);
1431
			bitPos = ((Integer) val.get(0)).intValue();
1432
			spaces11[0] = ((Double) val.get(1)).doubleValue();
1433
			val = DwgUtil.getBitDouble(intData, bitPos);
1434
			bitPos = ((Integer) val.get(0)).intValue();
1435
			spaces11[1] = ((Double) val.get(1)).doubleValue();
1436
			val = DwgUtil.getBitDouble(intData, bitPos);
1437
			bitPos = ((Integer) val.get(0)).intValue();
1438
			spaces11[2] = ((Double) val.get(1)).doubleValue();
1439
			dwgFile.setHeader("MSPACE_EXTMAX", spaces11);
1440

  
1441
			double[] spaces12 = new double[2];
1442
			val = DwgUtil.getRawDouble(intData, bitPos);
1443
			bitPos = ((Integer) val.get(0)).intValue();
1444
			spaces12[0] = ((Double) val.get(1)).doubleValue();
1445
			val = DwgUtil.getRawDouble(intData, bitPos);
1446
			bitPos = ((Integer) val.get(0)).intValue();
1447
			spaces12[1] = ((Double) val.get(1)).doubleValue();
1448
			dwgFile.setHeader("MSPACE_LIMMIN", spaces12);
1449

  
1450
			double[] spaces13 = new double[2];
1451
			val = DwgUtil.getRawDouble(intData, bitPos);
1452
			bitPos = ((Integer) val.get(0)).intValue();
1453
			spaces13[0] = ((Double) val.get(1)).doubleValue();
1454
			val = DwgUtil.getRawDouble(intData, bitPos);
1455
			bitPos = ((Integer) val.get(0)).intValue();
1456
			spaces13[1] = ((Double) val.get(1)).doubleValue();
1457
			dwgFile.setHeader("MSPACE_LIMMAX", spaces13);
1458

  
1459
			val = DwgUtil.getBitDouble(intData, bitPos);
1460
			bitPos = ((Integer) val.get(0)).intValue();
1461
			dwgFile.setHeader("MSPACE_ELEVATION", (Double) val.get(1));
1462

  
1463
			double[] spaces14 = new double[3];
1464
			val = DwgUtil.getBitDouble(intData, bitPos);
1465
			bitPos = ((Integer) val.get(0)).intValue();
1466
			spaces14[0] = ((Double) val.get(1)).doubleValue();
1467
			val = DwgUtil.getBitDouble(intData, bitPos);
1468
			bitPos = ((Integer) val.get(0)).intValue();
1469
			spaces14[1] = ((Double) val.get(1)).doubleValue();
1470
			val = DwgUtil.getBitDouble(intData, bitPos);
1471
			bitPos = ((Integer) val.get(0)).intValue();
1472
			spaces14[2] = ((Double) val.get(1)).doubleValue();
1473
			dwgFile.setHeader("MSPACE_UCSORG", spaces14);
1474

  
1475
			double[] spaces15 = new double[3];
1476
			val = DwgUtil.getBitDouble(intData, bitPos);
1477
			bitPos = ((Integer) val.get(0)).intValue();
1478
			spaces15[0] = ((Double) val.get(1)).doubleValue();
1479
			val = DwgUtil.getBitDouble(intData, bitPos);
1480
			bitPos = ((Integer) val.get(0)).intValue();
1481
			spaces15[1] = ((Double) val.get(1)).doubleValue();
1482
			val = DwgUtil.getBitDouble(intData, bitPos);
1483
			bitPos = ((Integer) val.get(0)).intValue();
1484
			spaces15[2] = ((Double) val.get(1)).doubleValue();
1485
			dwgFile.setHeader("MSPACE_UCSXDIR", spaces15);
1486

  
1487
			double[] spaces16 = new double[3];
1488
			val = DwgUtil.getBitDouble(intData, bitPos);
1489
			bitPos = ((Integer) val.get(0)).intValue();
1490
			spaces16[0] = ((Double) val.get(1)).doubleValue();
1491
			val = DwgUtil.getBitDouble(intData, bitPos);
1492
			bitPos = ((Integer) val.get(0)).intValue();
1493
			spaces16[1] = ((Double) val.get(1)).doubleValue();
1494
			val = DwgUtil.getBitDouble(intData, bitPos);
1495
			bitPos = ((Integer) val.get(0)).intValue();
1496
			spaces16[2] = ((Double) val.get(1)).doubleValue();
1497
			dwgFile.setHeader("MSPACE_UCSYDIR", spaces16);
1498

  
1499
			val = DwgUtil.getHandle(intData, bitPos);
1500
			bitPos = ((Integer) val.get(0)).intValue();
1501
			intHandle = DwgUtil.handleToInt(val);
1502
			dwgFile.setHeader("MSPACE_UCSNAME", new Integer(intHandle));
1503

  
1504
			//DWG 2000
1505
			
1506
			val = DwgUtil.getHandle(intData, bitPos);
1507
			bitPos = ((Integer) val.get(0)).intValue();
1508
			intHandle = DwgUtil.handleToInt(val);
1509
			dwgFile.setHeader("UCSBASE", new Integer(intHandle));
1510
			
1511
			val = DwgUtil.getBitShort(intData, bitPos);
1512
			bitPos = ((Integer) val.get(0)).intValue();
1513
			dwgFile.setHeader("UCSORTHOVIEW", val.get(1));
1514
			
1515
			val = DwgUtil.getHandle(intData, bitPos);
1516
			bitPos = ((Integer) val.get(0)).intValue();
1517
			intHandle = DwgUtil.handleToInt(val);
1518
			dwgFile.setHeader("UCSORTHOREF", new Integer(intHandle));
1519
			
1520
			double[] ucsorgtop = new double[3];
1521
			val = DwgUtil.getBitDouble(intData, bitPos);
1522
			bitPos = ((Integer) val.get(0)).intValue();
1523
			ucsorgtop[0] = ((Double) val.get(1)).doubleValue();
1524
			val = DwgUtil.getBitDouble(intData, bitPos);
1525
			bitPos = ((Integer) val.get(0)).intValue();
1526
			ucsorgtop[1] = ((Double) val.get(1)).doubleValue();
1527
			val = DwgUtil.getBitDouble(intData, bitPos);
1528
			bitPos = ((Integer) val.get(0)).intValue();
1529
			ucsorgtop[2] = ((Double) val.get(1)).doubleValue();
1530
			dwgFile.setHeader("UCSORGTOP", ucsorgtop);	
1531
			
1532
			double[] ucsorgbottom = new double[3];
1533
			val = DwgUtil.getBitDouble(intData, bitPos);
1534
			bitPos = ((Integer) val.get(0)).intValue();
1535
			ucsorgbottom[0] = ((Double) val.get(1)).doubleValue();
1536
			val = DwgUtil.getBitDouble(intData, bitPos);
1537
			bitPos = ((Integer) val.get(0)).intValue();
1538
			ucsorgbottom[1] = ((Double) val.get(1)).doubleValue();
1539
			val = DwgUtil.getBitDouble(intData, bitPos);
1540
			bitPos = ((Integer) val.get(0)).intValue();
1541
			ucsorgbottom[2] = ((Double) val.get(1)).doubleValue();
1542
			dwgFile.setHeader("UCSORGBOTTOM", ucsorgbottom);
1543
			
1544
			double[] ucsorgleft = new double[3];
1545
			val = DwgUtil.getBitDouble(intData, bitPos);
1546
			bitPos = ((Integer) val.get(0)).intValue();
1547
			ucsorgleft[0] = ((Double) val.get(1)).doubleValue();
1548
			val = DwgUtil.getBitDouble(intData, bitPos);
1549
			bitPos = ((Integer) val.get(0)).intValue();
1550
			ucsorgleft[1] = ((Double) val.get(1)).doubleValue();
1551
			val = DwgUtil.getBitDouble(intData, bitPos);
1552
			bitPos = ((Integer) val.get(0)).intValue();
1553
			ucsorgleft[2] = ((Double) val.get(1)).doubleValue();
1554
			dwgFile.setHeader("UCSORGLEFT", ucsorgleft);	
1555
			
1556
			double[] ucsorgright = new double[3];
1557
			val = DwgUtil.getBitDouble(intData, bitPos);
1558
			bitPos = ((Integer) val.get(0)).intValue();
1559
			ucsorgright[0] = ((Double) val.get(1)).doubleValue();
1560
			val = DwgUtil.getBitDouble(intData, bitPos);
1561
			bitPos = ((Integer) val.get(0)).intValue();
1562
			ucsorgright[1] = ((Double) val.get(1)).doubleValue();
1563
			val = DwgUtil.getBitDouble(intData, bitPos);
1564
			bitPos = ((Integer) val.get(0)).intValue();
1565
			ucsorgright[2] = ((Double) val.get(1)).doubleValue();
1566
			dwgFile.setHeader("UCSORGRIGHT", ucsorgright);	
1567
			
1568
			double[] ucsorgfront = new double[3];
1569
			val = DwgUtil.getBitDouble(intData, bitPos);
1570
			bitPos = ((Integer) val.get(0)).intValue();
1571
			ucsorgfront[0] = ((Double) val.get(1)).doubleValue();
1572
			val = DwgUtil.getBitDouble(intData, bitPos);
1573
			bitPos = ((Integer) val.get(0)).intValue();
1574
			ucsorgfront[1] = ((Double) val.get(1)).doubleValue();
1575
			val = DwgUtil.getBitDouble(intData, bitPos);
1576
			bitPos = ((Integer) val.get(0)).intValue();
1577
			ucsorgfront[2] = ((Double) val.get(1)).doubleValue();
1578
			dwgFile.setHeader("UCSORGFRONT", ucsorgfront);	
1579
			
1580
			double[] ucsorgback = new double[3];
1581
			val = DwgUtil.getBitDouble(intData, bitPos);
1582
			bitPos = ((Integer) val.get(0)).intValue();
1583
			ucsorgback[0] = ((Double) val.get(1)).doubleValue();
1584
			val = DwgUtil.getBitDouble(intData, bitPos);
1585
			bitPos = ((Integer) val.get(0)).intValue();
1586
			ucsorgback[1] = ((Double) val.get(1)).doubleValue();
1587
			val = DwgUtil.getBitDouble(intData, bitPos);
1588
			bitPos = ((Integer) val.get(0)).intValue();
1589
			ucsorgback[2] = ((Double) val.get(1)).doubleValue();
1590
			dwgFile.setHeader("UCSORGBACK", ucsorgback);	
1591
			
1592
			val = DwgUtil.getTextString(intData, bitPos);
1593
			bitPos = ((Integer) val.get(0)).intValue();
1594
			dwgFile.setHeader("DIMPOST", val.get(1));	
1595
				
1596
			val = DwgUtil.getTextString(intData, bitPos);
1597
			bitPos = ((Integer) val.get(0)).intValue();
1598
			dwgFile.setHeader("DIMAPOST", val.get(1));	
1599
			
1600
				
1601
			//Not readed in dwg 2000
1602
			
1603
//			val = DwgUtil.testBit(intData, bitPos);
1604
//			bitPos = ((Integer) val.get(0)).intValue();
1605
//			dwgFile.setHeader("DIMTOL", val.get(1));
1606
//
1607
//			val = DwgUtil.testBit(intData, bitPos);
1608
//			bitPos = ((Integer) val.get(0)).intValue();
1609
//			dwgFile.setHeader("DIMLIM", val.get(1));
1610
//
1611
//			val = DwgUtil.testBit(intData, bitPos);
1612
//			bitPos = ((Integer) val.get(0)).intValue();
1613
//			dwgFile.setHeader("DIMTIH", val.get(1));
1614
//
1615
//			val = DwgUtil.testBit(intData, bitPos);
1616
//			bitPos = ((Integer) val.get(0)).intValue();
1617
//			dwgFile.setHeader("DIMTOH", val.get(1));
1618
//
1619
//			val = DwgUtil.testBit(intData, bitPos);
1620
//			bitPos = ((Integer) val.get(0)).intValue();
1621
//			dwgFile.setHeader("DIMSE1", val.get(1));
1622
//
1623
//			val = DwgUtil.testBit(intData, bitPos);
1624
//			bitPos = ((Integer) val.get(0)).intValue();
1625
//			dwgFile.setHeader("DIMTSE2", val.get(1));
1626
//
1627
//			val = DwgUtil.testBit(intData, bitPos);
1628
//			bitPos = ((Integer) val.get(0)).intValue();
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff