Revision 23940 trunk/libraries/libDwg/src/com/iver/cit/jdwglib/dwg/readers/DwgFileVR2004Reader.java

View differences:

DwgFileVR2004Reader.java
1 1
/*
2 2
 * Created on 09-ene-2007
3 3
 *
4
 * gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
4
 * gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
5 5
 *
6 6
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
7 7
 *
......
23 23
 *
24 24
 *  Generalitat Valenciana
25 25
 *   Conselleria d'Infraestructures i Transport
26
 *   Av. Blasco Ib??ez, 50
26
 *   Av. Blasco Ib��ez, 50
27 27
 *   46010 VALENCIA
28 28
 *   SPAIN
29 29
 *
......
44 44

  
45 45
package com.iver.cit.jdwglib.dwg.readers;
46 46

  
47
import java.io.IOException;
47 48
import java.nio.ByteBuffer;
48 49
import java.nio.ByteOrder;
50
import java.util.ArrayList;
51
import java.util.Comparator;
52
import java.util.List;
53
import java.util.TreeSet;
49 54

  
55
import org.apache.log4j.Logger;
56

  
57
import com.iver.cit.jdwglib.dwg.CorruptedDwgEntityException;
58
import com.iver.cit.jdwglib.dwg.DwgClass2004;
59
import com.iver.cit.jdwglib.dwg.DwgFile;
60
import com.iver.cit.jdwglib.dwg.DwgHandleReference;
61
import com.iver.cit.jdwglib.dwg.DwgObject;
62
import com.iver.cit.jdwglib.dwg.DwgObjectFactory;
63
import com.iver.cit.jdwglib.dwg.DwgObjectOffset;
64
import com.iver.cit.jdwglib.dwg.DwgUtil;
65

  
50 66
/**
51 67
 * @author alzabord
52 68
 *
53
 * TODO To change the template for this generated type comment go to
54
 * Window - Preferences - Java - Code Style - Code Templates
69
 * TODO To change the template for this generated type comment go to Window -
70
 * Preferences - Java - Code Style - Code Templates
55 71
 */
56
public class DwgFileVR2004Reader extends DwgFileV15Reader {
57
	protected void readDwgSectionOffsets(ByteBuffer bb) {
58
		bb.position(12);
72
public class DwgFileVR2004Reader implements IDwgFileReader {
73

  
74
	protected DwgFile dwgFile;
75

  
76
	protected ByteBuffer bb;
77

  
78
	static byte[] magicNumber = null;
79

  
80
	private String version = "";
81

  
82
	private byte[] unknowSixBytes;
83

  
84
	private byte[] threeBytes0;
85

  
86
	private byte[] unknowTwoBytes;
87

  
88
	private byte[] eightyTwoBytes0;
89

  
90
	private byte[] encryptedData;
91

  
92
	private byte[] decryptedData;
93

  
94
	private String fileID = "";
95

  
96
	private int rootTreeNodeGap;
97

  
98
	private int lowermostLeftTreeNodeGap;
99

  
100
	private int lowermostRightTreeNodeGap;
101

  
102
	private int lastSectionId; // Last Section identifier
103

  
104
	private int lastSectionAddress; // Last Section Address
105

  
106
	private int SecondHeaderAddress; // Second Header Address
107

  
108
	private int gapAmount; // Number of Gaps
109

  
110
	private int sectionAmount; // Number of Sections
111

  
112
	private int sectionMapId; // Section Map identifier
113

  
114
	private int sectionMapAddress; // Section Map address
115

  
116
	private int sectionInfoId; // Section Info identifier
117

  
118
	private int sectionInfoIndex = 0; // Section Info identifier into the
119

  
120
	// Sections Array
121

  
122
	private int sectionArraySize;
123

  
124
	private int gapArraySize;
125

  
126
	private byte[] generatedSequence;
127

  
128
	private Section[] sections;
129

  
130
	private Gap[] gaps;
131

  
132
	static final int TYPE_SECTION_MAP = 1;
133

  
134
	static final int TYPE_SECTION_INFO = 2;
135

  
136
	private static Logger logger = Logger.getLogger(DwgFileVR2004Reader.class.getName());
137

  
138
	/**
139
	 * Reads the DWG version 2004 format
140
	 *
141
	 * @param dwgFile
142
	 *            Represents the DWG file that we want to read
143
	 * @throws IOException
144
	 *             When DWG file path is wrong
145
	 */
146
	public void read(DwgFile dwgFile, ByteBuffer bb) throws IOException {
147

  
148
		this.dwgFile = dwgFile;
149
		this.bb = bb;
150

  
151
		readDwgR2004FileHeader(bb);
152
		readDwgR2004SectionMap(bb);
153
		readDwgR2004InfoSection(bb);
154
		readDwgR2004Headers(bb);
155
		readDwgR2004Classes(bb);
156
		readDwgR2004ObjectOffsets(bb);
157

  
158
		readDwgR2004Objects();
159

  
160
	}
161

  
162
	protected void readDwgR2004InfoSection(ByteBuffer bb) {
163
		int numDescriptions;
164

  
165
		int sizeOfSection;
166
		int numSections;
167
		int maxDecompressedSize;
168
		int compressed;
169
		int sectionType;
170
		int encrypted;
171
		String sectionName = "";
172

  
173
		int sectionNumber;
174
		int dataSize;
175
		int startOffset;
176

  
177
		char c;
178
		int pos;
179

  
180
		if (sectionInfoIndex == 0) {
181
			logger.error("No se ha encontrado la Section Info en el array de secciones.");
182
		}
183

  
184
		pos = sections[sectionInfoIndex].getAddress(); // we get the address for the Section Info
185

  
186
		bb.position(pos);
187

  
188
		ByteBuffer dData = readSystemSection(bb);
189
		dData.order(ByteOrder.LITTLE_ENDIAN);
190
		dData.position(0);
191

  
192
		/*
193
		 * We start reading the Section Info once decompressed We will find data
194
		 * blocks depending on numDescriptions value
195
		 */
196
		numDescriptions = dData.getInt();
197
		dData.getInt(); // 0x02
198
		dData.getInt(); // 0x00007400
199
		dData.getInt(); // 0x00
200
		dData.getInt(); // unknown
201

  
202
		for (int i = 0; i < numDescriptions; i++) {
203
			sizeOfSection = dData.getInt();
204
			dData.getInt(); // unknown
205
			numSections = dData.getInt();
206
			maxDecompressedSize = dData.getInt();
207
			dData.getInt(); // unknown
208
			compressed = dData.getInt();
209
			sectionType = dData.getInt();
210
			encrypted = dData.getInt();
211
			sectionName = "";
212
			for (int j = 0; j < 64; j++) {
213
				c = (char) dData.get();
214
				sectionName = sectionName + c;
215
			}
216

  
217
			for (int k = 0; k < numSections; k++) {
218
				sectionNumber = dData.getInt(); // index into the Sections Array
219
				dataSize = dData.getInt();
220
				startOffset = dData.getInt();
221
				dData.getInt(); // unknown
222

  
223

  
224
				// We set the name for the Section, so we can localize it by the name
225
				for (int j = 0; j < sectionAmount; j++) {
226
					Section section = sections[j];
227
					if (section.getNumber() == sectionNumber) {
228
						section.setName(sectionName);
229
						section.setSizeOfLogicalSection(sizeOfSection);
230
						section.setDataSize(dataSize);
231
						section.setMaxDecompressedSize(maxDecompressedSize);
232
						section.setCompressed(compressed);
233
						section.setType(sectionType);
234
						section.setEncrypted(encrypted);
235
						section.setStartOffset(startOffset);
236
					}
237
				}
238

  
239
			}
240
		}
241
	}
242

  
243
	/**
244
	 * This function reads the header section of the file, with the encrypted
245
	 * data
246
	 *
247
	 * @param bb
248
	 *            ByteBuffer containing the opened DWG file
249
	 */
250
	protected void readDwgR2004FileHeader(ByteBuffer bb) {
251

  
252
		logger.info("STARTING TO READ DWG FILE.");
59 253
		bb.order(ByteOrder.LITTLE_ENDIAN);
60
		short codePage = bb.getShort();
61
		int count = bb.getInt();
62
		for (int i=0; i<count; i++) {
63
			byte rec = bb.get();
64
			int seek = bb.getInt();
65
			int size = bb.getInt();
66
			if (rec==0) {
67
				dwgFile.addDwgSectionOffset("HEADERS", seek, size);
68
			} else if (rec==1) {
69
				dwgFile.addDwgSectionOffset("CLASSES", seek, size);
70
			} else if (rec==2) {
71
				dwgFile.addDwgSectionOffset("OBJECTS", seek, size);
72
			} else if (rec==3) {
73
				dwgFile.addDwgSectionOffset("UNKNOWN", seek, size);
74
			} else if (rec==4) {
75
				dwgFile.addDwgSectionOffset("R14DATA", seek, size);
76
			} else if (rec==5) {
77
				dwgFile.addDwgSectionOffset("R14REC5", seek, size);
254
		for (int i = 0; i < 6; i++) {
255
			version = version + (char) bb.get();
256
		}
257
		if (!version.equalsIgnoreCase("AC1018")) {
258
			logger.error("Error en la version: " + version);
259
		}
260

  
261
		/*
262
		 * OpenAlliance documentation says we will read 6 0x00 bytes but the
263
		 * sixth one is always 0x4C
264
		 */
265
		unknowSixBytes = new byte[6];
266
		int pos = 6;
267
		for (int i = 0; i < 5; i++) {
268
			unknowSixBytes[i] = bb.get();
269
			if (unknowSixBytes[i] != 0) {
270
				logger.warn("(unknowSixBytes) En la posicion 0x"
271
						+ Integer.toHexString(pos + i)
272
						+ " debería haber un 0, pero hay un 0x"
273
						+ Integer.toHexString(unknowSixBytes[i]));
274
			}
275
		}
276
		pos = 0xB;
277
		unknowSixBytes[5] = bb.get();
278
		if (unknowSixBytes[5] != 0x4C) {
279
			logger.warn("(unknowSixBytes) En la posicion 0x"
280
					+ Integer.toHexString(pos)
281
					+ " debería haber un 0x4C, pero hay un 0x"
282
					+ Integer.toHexString(unknowSixBytes[5]));
283
		}
284

  
285
		bb.get(); // Unknown Byte
286
		bb.getInt(); // previewAddress
287
		bb.get(); // dwgVer
288
		bb.get(); // maintReleaseVer
289
		bb.getShort(); // codepage
290

  
291
		/*
292
		 * OpenAlliance documentation says we will read 3 0x00 bytes but what we
293
		 * always find is 0x00, 0x19 and then 0x4C
294
		 */
295
		threeBytes0 = new byte[3];
296
		pos = 0x15;
297
		bb.get(threeBytes0);
298
		if (threeBytes0[0] != 0x0) {
299
			logger.warn("Posible error leyendo la cabecera del archivo DWG: " +
300
					"En la posicion 0x" + Integer.toHexString(pos)
301
					+ " debería haber un 0x0, pero hay un 0x"
302
					+ Integer.toHexString(threeBytes0[0]));
303
		}
304
		pos = 0x16;
305
		if (threeBytes0[1] != 0x19) {
306
			logger.warn("Posible error leyendo la cabecera del archivo DWG: " +
307
					"En la posicion 0x" + Integer.toHexString(pos)
308
					+ " debería haber un 0x19, pero hay un 0x"
309
					+ Integer.toHexString(threeBytes0[1]));
310
		}
311
		pos = 0x17;
312
		if (threeBytes0[2] != 0x4C) {
313
			logger.warn("Posible error leyendo la cabecera del archivo DWG: " +
314
					"En la posicion 0x" + Integer.toHexString(pos)
315
					+ " debería haber un 0x4C, pero hay un 0x"
316
					+ Integer.toHexString(threeBytes0[2]));
317
		}
318

  
319
		bb.getInt(); // security Type
320
		bb.getInt(); // unknownLong
321
		bb.getInt(); // dwgPropertyAddr
322
		bb.getInt(); // vbaProjectAddr
323
		bb.getInt(); // 0x00000080
324

  
325
		pos = 0x2C;
326

  
327
		unknowTwoBytes = new byte[2];
328
		for (int i = 0; i < 2; i++) {
329
			unknowTwoBytes[i] = bb.get();
330
		}
331
		pos = 0x2E;
332
		eightyTwoBytes0 = new byte[82];
333
		for (int i = 0; i < eightyTwoBytes0.length; i++) {
334
			eightyTwoBytes0[i] = bb.get();
335
			if (eightyTwoBytes0[i] != 0) {
336
				logger.warn("Posible error leyendo la cabecera del archivo DWG: " +
337
						"(eightyTwoBytes0) En la posicion 0x"
338
						+ Integer.toHexString(pos + i)
339
						+ " debería haber un 0, pero hay un 0x"
340
						+ Integer.toHexString(eightyTwoBytes0[i]));
341
			}
342
		}
343

  
344
		int len = 0x6C;
345
		encryptedData = new byte[len];
346
		decryptedData = new byte[len];
347
		if (magicNumber == null) {
348
			DwgFileVR2004Reader.setMagicNumber();
349
		}
350

  
351
		// decryptedData will contain the decrypted sequence after xor'ing the
352
		// encrypted data
353
		for (int i = 0; i < len; i++) {
354
			encryptedData[i] = bb.get();
355
			decryptedData[i] = (byte) (encryptedData[i] ^ magicNumber[i]);
356
		}
357

  
358
		ByteBuffer decryptedDataBB = ByteBuffer.allocate(len);
359
		decryptedDataBB.put(decryptedData);
360
		decryptedDataBB.position(0);
361
		decryptedDataBB.order(ByteOrder.LITTLE_ENDIAN);
362

  
363
		// we start intercepting the decrypted variables
364
		for (int i = 0; i < 12; i++) {
365
			fileID = fileID + (char) decryptedDataBB.get();
366
		}
367
		decryptedDataBB.getInt(); // 0x00
368

  
369
		decryptedDataBB.getInt(); // 0x6C
370

  
371
		decryptedDataBB.getInt(); // 0x04
372

  
373
		rootTreeNodeGap = decryptedDataBB.getInt();
374
		lowermostLeftTreeNodeGap = decryptedDataBB.getInt();
375
		lowermostRightTreeNodeGap = decryptedDataBB.getInt();
376
		decryptedDataBB.getInt(); // unknown
377
		lastSectionId = decryptedDataBB.getInt();
378

  
379
		lastSectionAddress = decryptedDataBB.getInt();
380
		decryptedDataBB.getInt(); // 0x00
381

  
382
		SecondHeaderAddress = decryptedDataBB.getInt();
383
		decryptedDataBB.getInt(); // 0x00
384

  
385
		gapAmount = decryptedDataBB.getInt();
386
		sectionAmount = decryptedDataBB.getInt(); // Very important: this is
387
		// the number of sections in the file
388
		decryptedDataBB.getInt(); // 0x20
389
		decryptedDataBB.getInt(); // 0x80
390
		decryptedDataBB.getInt(); // 0x40
391

  
392
		sectionMapId = decryptedDataBB.getInt();
393
		sectionMapAddress = decryptedDataBB.getInt() + 0x100; // the Section Map Address
394
		decryptedDataBB.getInt(); // 0x00
395
		sectionInfoId = decryptedDataBB.getInt(); // Very important: the id of the Section Info
396
		sectionArraySize = decryptedDataBB.getInt();
397
		gapArraySize = decryptedDataBB.getInt();
398
		decryptedDataBB.getInt(); // CRC
399
		len = 0x14;
400
		generatedSequence = new byte[len];
401
		bb.get(generatedSequence);
402
		// Done reading the encrypted variables
403

  
404
	}
405

  
406
	/*************************************************************************************
407
	 * **********************************************************************/
408

  
409
	/**
410
	 * Read and store all the header variables into the
411
	 * <code> HeaderVars </code> Map
412
	 *
413
	 * @param bb
414
	 *            ByteBuffer containing the opened DWG file
415
	 */
416
	private void readDwgR2004Headers(ByteBuffer bb) {
417

  
418
		/*
419
		 * NOTA (Paco) He encontrado un sitio web con explicacion de ¿todas?
420
		 * estas variables: http://www.hispacad.com/variables
421
		 */
422

  
423
		ByteBuffer decompressedBB = readSection(bb, "AcDb:Header");
424

  
425
		byte[] sentinel = new byte[16];
426
		decompressedBB.order(ByteOrder.nativeOrder());
427
		decompressedBB.position(0);
428
		decompressedBB.get(sentinel); // we get the sentinel that ALWAYS
429
		// appears before the data
430

  
431
		if ((sentinel[0] & 0xFF) != 0xcf)
432
			logger.warn("sentinel[0] != 0xcf found " + (sentinel[0] & 0xFF));
433
		if ((sentinel[1] & 0xFF) != 0x7b)
434
			logger.warn("sentinel[1] != 0x7b found " + (sentinel[1] & 0xFF));
435
		if ((sentinel[2] & 0xFF) != 0x1f)
436
			logger.warn("sentinel[2] != 0x1f found " + (sentinel[2] & 0xFF));
437
		if ((sentinel[3] & 0xFF) != 0x23)
438
			logger.warn("sentinel[3] != 0x23 found " + (sentinel[3] & 0xFF));
439
		if ((sentinel[4] & 0xFF) != 0xfd)
440
			logger.warn("sentinel[4] != 0xfd found " + (sentinel[4] & 0xFF));
441
		if ((sentinel[5] & 0xFF) != 0xde)
442
			logger.warn("sentinel[5] != 0xde found " + (sentinel[5] & 0xFF));
443
		if ((sentinel[6] & 0xFF) != 0x38)
444
			logger.warn("sentinel[6] != 0x38 found " + (sentinel[6] & 0xFF));
445
		if ((sentinel[7] & 0xFF) != 0xa9)
446
			logger.warn("sentinel[7] != 0xa9 found " + (sentinel[7] & 0xFF));
447
		if ((sentinel[8] & 0xFF) != 0x5f)
448
			logger.warn("sentinel[8] != 0x5f found " + (sentinel[8] & 0xFF));
449
		if ((sentinel[9] & 0xFF) != 0x7c)
450
			logger.warn("sentinel[9] != 0x7c found " + (sentinel[9] & 0xFF));
451
		if ((sentinel[10] & 0xFF) != 0x68)
452
			logger.warn("sentinel[10] != 0x68 found " + (sentinel[10] & 0xFF));
453
		if ((sentinel[11] & 0xFF) != 0xb8)
454
			logger.warn("sentinel[11] != 0xb8 found " + (sentinel[11] & 0xFF));
455
		if ((sentinel[12] & 0xFF) != 0x4e)
456
			logger.warn("sentinel[12] != 0x4e found " + (sentinel[12] & 0xFF));
457
		if ((sentinel[13] & 0xFF) != 0x6d)
458
			logger.warn("sentinel[13] != 0x6d found " + (sentinel[13] & 0xFF));
459
		if ((sentinel[14] & 0xFF) != 0x33)
460
			logger.warn("sentinel[14] != 0x33 found " + (sentinel[14] & 0xFF));
461
		if ((sentinel[15] & 0xFF) != 0x5f)
462
			logger.warn("sentinel[15] != 0x5f found " + (sentinel[15] & 0xFF));
463

  
464
		// we start working with data that comes after the beginning sentinel
465
		decompressedBB.order(ByteOrder.LITTLE_ENDIAN);
466
		int size = decompressedBB.getInt(); // this size is never correct
467

  
468
		decompressedBB.order(ByteOrder.nativeOrder());
469
		byte[] data = new byte[size];
470
		decompressedBB.get(data);
471

  
472
		int[] intData = DwgUtil.toIntArray(data);
473

  
474
		bb.order(ByteOrder.LITTLE_ENDIAN);
475
		decompressedBB.getShort(); // CRC
476

  
477
		decompressedBB.order(ByteOrder.nativeOrder());
478
		byte[] lastSentinnel = new byte[16]; // we know it comes there because we already found it
479
		decompressedBB.get(lastSentinnel);
480

  
481
		if ((lastSentinnel[0] & 0xFF) != 0x30)
482
			logger.warn("lastSentinnel[0] != 0x30 , is: " + lastSentinnel[0]);
483
		if ((lastSentinnel[1] & 0xFF) != 0x84)
484
			logger.warn("lastSentinnel[1] != 0x84 , is: " + lastSentinnel[1]);
485
		if ((lastSentinnel[2] & 0xFF) != 0xe0)
486
			logger.warn("lastSentinnel[2] != 0xe0 , is: " + lastSentinnel[2]);
487
		if ((lastSentinnel[3] & 0xFF) != 0xdc)
488
			logger.warn("lastSentinnel[3] != 0xdc , is: " + lastSentinnel[3]);
489
		if ((lastSentinnel[4] & 0xFF) != 0x02)
490
			logger.warn("lastSentinnel[4] != 0x02 , is: " + lastSentinnel[4]);
491
		if ((lastSentinnel[5] & 0xFF) != 0x21)
492
			logger.warn("lastSentinnel[5] != 0x21 , is: " + lastSentinnel[5]);
493
		if ((lastSentinnel[6] & 0xFF) != 0xc7)
494
			logger.warn("lastSentinnel[6] != 0xc7 , is: " + lastSentinnel[6]);
495
		if ((lastSentinnel[7] & 0xFF) != 0x56)
496
			logger.warn("lastSentinnel[7] != 0x56 , is: " + lastSentinnel[7]);
497
		if ((lastSentinnel[8] & 0xFF) != 0xa0)
498
			logger.warn("lastSentinnel[8] != 0xa0 , is: " + lastSentinnel[8]);
499
		if ((lastSentinnel[9] & 0xFF) != 0x83)
500
			logger.warn("lastSentinnel[9] != 0x83 , is: " + lastSentinnel[9]);
501
		if ((lastSentinnel[10] & 0xFF) != 0x97)
502
			logger.warn("lastSentinnel[10] != 0x97 , is: " + lastSentinnel[10]);
503
		if ((lastSentinnel[11] & 0xFF) != 0x47)
504
			logger.warn("lastSentinnel[11] != 0x47 , is: " + lastSentinnel[11]);
505
		if ((lastSentinnel[12] & 0xFF) != 0xb1)
506
			logger.warn("lastSentinnel[12] != 0xb1 , is: " + lastSentinnel[12]);
507
		if ((lastSentinnel[13] & 0xFF) != 0x92)
508
			logger.warn("lastSentinnel[13] != 0x92 , is: " + lastSentinnel[13]);
509
		if ((lastSentinnel[14] & 0xFF) != 0xcc)
510
			logger.warn("lastSentinnel[14] != 0xcc , is: " + lastSentinnel[14]);
511
		if ((lastSentinnel[15] & 0xFF) != 0xa0)
512
			logger.warn("lastSentinnel[15] != 0xa0 , is: " + lastSentinnel[15]);
513

  
514
		int bitPos = 0;
515
		try {
516

  
517
			List val = DwgUtil.getBitDouble(intData, bitPos); // Unknown
518
			bitPos = ((Integer) val.get(0)).intValue();
519
			dwgFile.setHeader("VAL1", val.get(1));
520

  
521
			val = DwgUtil.getBitDouble(intData, bitPos); // Unknown
522
			bitPos = ((Integer) val.get(0)).intValue();
523
			dwgFile.setHeader("VAL2", val.get(1));
524

  
525
			val = DwgUtil.getBitDouble(intData, bitPos); // Unknown
526
			bitPos = ((Integer) val.get(0)).intValue();
527
			dwgFile.setHeader("VAL3", val.get(1));
528

  
529
			val = DwgUtil.getBitDouble(intData, bitPos); // Unknown
530
			bitPos = ((Integer) val.get(0)).intValue();
531
			dwgFile.setHeader("VAL4", val.get(1));
532

  
533
			val = DwgUtil.getTextString(intData, bitPos); // Unknown
534
			bitPos = ((Integer) val.get(0)).intValue();
535
			dwgFile.setHeader("STRING1", val.get(1));
536

  
537
			val = DwgUtil.getTextString(intData, bitPos); // Unknown
538
			bitPos = ((Integer) val.get(0)).intValue();
539
			dwgFile.setHeader("STRING2", val.get(1));
540

  
541
			val = DwgUtil.getTextString(intData, bitPos); // Unknown
542
			bitPos = ((Integer) val.get(0)).intValue();
543
			dwgFile.setHeader("STRING3", val.get(1));
544

  
545
			val = DwgUtil.getTextString(intData, bitPos); // Unknown
546
			bitPos = ((Integer) val.get(0)).intValue();
547
			dwgFile.setHeader("STRING4", val.get(1));
548

  
549
			val = DwgUtil.getBitLong(intData, bitPos); // Unknown
550
			bitPos = ((Integer) val.get(0)).intValue();
551
			dwgFile.setHeader("LONG1", val.get(1));
552

  
553
			val = DwgUtil.getBitLong(intData, bitPos); // Unknown
554
			bitPos = ((Integer) val.get(0)).intValue();
555
			dwgFile.setHeader("LONG2", val.get(1));
556

  
557
			val = DwgUtil.testBit(intData, bitPos);
558
			bitPos = ((Integer) val.get(0)).intValue();
559
			dwgFile.setHeader("DIMASO", val.get(1));
560

  
561
			val = DwgUtil.testBit(intData, bitPos);
562
			bitPos = ((Integer) val.get(0)).intValue();
563
			dwgFile.setHeader("DIMSHO", val.get(1));
564

  
565
			val = DwgUtil.testBit(intData, bitPos);
566
			bitPos = ((Integer) val.get(0)).intValue();
567
			dwgFile.setHeader("PLINEGEN", val.get(1));
568

  
569
			val = DwgUtil.testBit(intData, bitPos);
570
			bitPos = ((Integer) val.get(0)).intValue();
571
			dwgFile.setHeader("ORTHOMODE", val.get(1));
572

  
573
			val = DwgUtil.testBit(intData, bitPos);
574
			bitPos = ((Integer) val.get(0)).intValue();
575
			dwgFile.setHeader("REGENMODE", val.get(1));
576

  
577
			val = DwgUtil.testBit(intData, bitPos);
578
			bitPos = ((Integer) val.get(0)).intValue();
579
			dwgFile.setHeader("FILLMODE", val.get(1));
580

  
581
			val = DwgUtil.testBit(intData, bitPos);
582
			bitPos = ((Integer) val.get(0)).intValue();
583
			dwgFile.setHeader("QTEXTMODE", val.get(1));
584

  
585
			val = DwgUtil.testBit(intData, bitPos);
586
			bitPos = ((Integer) val.get(0)).intValue();
587
			dwgFile.setHeader("PSLTSCALE", val.get(1));
588

  
589
			val = DwgUtil.testBit(intData, bitPos);
590
			bitPos = ((Integer) val.get(0)).intValue();
591
			dwgFile.setHeader("LIMCHECK", val.get(1));
592

  
593
			val = DwgUtil.testBit(intData, bitPos);
594
			bitPos = ((Integer) val.get(0)).intValue();
595
			dwgFile.setHeader("UNDOCUMENTED1", val.get(1));
596

  
597
			val = DwgUtil.testBit(intData, bitPos);
598
			bitPos = ((Integer) val.get(0)).intValue();
599
			dwgFile.setHeader("USER_TIMER", val.get(1));
600

  
601
			val = DwgUtil.testBit(intData, bitPos);
602
			bitPos = ((Integer) val.get(0)).intValue();
603
			dwgFile.setHeader("SKPOLY", val.get(1));
604

  
605
			val = DwgUtil.testBit(intData, bitPos);
606
			bitPos = ((Integer) val.get(0)).intValue();
607
			dwgFile.setHeader("ANGDIR", val.get(1));
608

  
609
			val = DwgUtil.testBit(intData, bitPos);
610
			bitPos = ((Integer) val.get(0)).intValue();
611
			dwgFile.setHeader("SPLFRAME", val.get(1));
612

  
613
			val = DwgUtil.testBit(intData, bitPos);
614
			bitPos = ((Integer) val.get(0)).intValue();
615
			dwgFile.setHeader("MIRRTEXT", val.get(1));
616

  
617
			val = DwgUtil.testBit(intData, bitPos);
618
			bitPos = ((Integer) val.get(0)).intValue();
619
			dwgFile.setHeader("WORLDVIEW", val.get(1));
620

  
621
			val = DwgUtil.testBit(intData, bitPos);
622
			bitPos = ((Integer) val.get(0)).intValue();
623
			dwgFile.setHeader("TILEMODE", val.get(1));
624

  
625
			val = DwgUtil.testBit(intData, bitPos);
626
			bitPos = ((Integer) val.get(0)).intValue();
627
			dwgFile.setHeader("PLIMCHECK", val.get(1));
628

  
629
			val = DwgUtil.testBit(intData, bitPos);
630
			bitPos = ((Integer) val.get(0)).intValue();
631
			dwgFile.setHeader("VISRETAIN", val.get(1));
632

  
633
			val = DwgUtil.testBit(intData, bitPos);
634
			bitPos = ((Integer) val.get(0)).intValue();
635
			dwgFile.setHeader("DISPSILH", val.get(1));
636

  
637
			val = DwgUtil.testBit(intData, bitPos);
638
			bitPos = ((Integer) val.get(0)).intValue();
639
			dwgFile.setHeader("PELLISE", val.get(1));
640

  
641
			val = DwgUtil.getBitShort(intData, bitPos);
642
			bitPos = ((Integer) val.get(0)).intValue();
643
			dwgFile.setHeader("PROXYGRAPH", val.get(1));
644

  
645
			val = DwgUtil.getBitShort(intData, bitPos);
646
			bitPos = ((Integer) val.get(0)).intValue();
647
			dwgFile.setHeader("TREEDEPTH", val.get(1));
648

  
649
			val = DwgUtil.getBitShort(intData, bitPos);
650
			bitPos = ((Integer) val.get(0)).intValue();
651
			dwgFile.setHeader("LUNITS", val.get(1));
652

  
653
			val = DwgUtil.getBitShort(intData, bitPos);
654
			bitPos = ((Integer) val.get(0)).intValue();
655
			dwgFile.setHeader("LUPREC", val.get(1));
656

  
657
			val = DwgUtil.getBitShort(intData, bitPos);
658
			bitPos = ((Integer) val.get(0)).intValue();
659
			dwgFile.setHeader("AUNITS", val.get(1));
660

  
661
			val = DwgUtil.getBitShort(intData, bitPos);
662
			bitPos = ((Integer) val.get(0)).intValue();
663
			dwgFile.setHeader("AUPREC", val.get(1));
664

  
665
			val = DwgUtil.getBitShort(intData, bitPos);
666
			bitPos = ((Integer) val.get(0)).intValue();
667
			dwgFile.setHeader("ATTMODE", val.get(1));
668

  
669
			val = DwgUtil.getBitShort(intData, bitPos);
670
			bitPos = ((Integer) val.get(0)).intValue();
671
			dwgFile.setHeader("PDMODE", val.get(1));
672

  
673
			val = DwgUtil.getBitLong(intData, bitPos);
674
			bitPos = ((Integer) val.get(0)).intValue();
675
			dwgFile.setHeader("UNKNOWN1", val.get(1));
676

  
677
			val = DwgUtil.getBitLong(intData, bitPos);
678
			bitPos = ((Integer) val.get(0)).intValue();
679
			dwgFile.setHeader("UNKNOWN2", val.get(1));
680

  
681
			val = DwgUtil.getBitLong(intData, bitPos);
682
			bitPos = ((Integer) val.get(0)).intValue();
683
			dwgFile.setHeader("UNKNOWN3", val.get(1));
684

  
685
			val = DwgUtil.getBitShort(intData, bitPos);
686
			bitPos = ((Integer) val.get(0)).intValue();
687
			dwgFile.setHeader("USERI1", val.get(1));
688

  
689
			val = DwgUtil.getBitShort(intData, bitPos);
690
			bitPos = ((Integer) val.get(0)).intValue();
691
			dwgFile.setHeader("USERI2", val.get(1));
692

  
693
			val = DwgUtil.getBitShort(intData, bitPos);
694
			bitPos = ((Integer) val.get(0)).intValue();
695
			dwgFile.setHeader("USERI3", val.get(1));
696

  
697
			val = DwgUtil.getBitShort(intData, bitPos);
698
			bitPos = ((Integer) val.get(0)).intValue();
699
			dwgFile.setHeader("USERI4", val.get(1));
700

  
701
			val = DwgUtil.getBitShort(intData, bitPos);
702
			bitPos = ((Integer) val.get(0)).intValue();
703
			dwgFile.setHeader("USERI5", val.get(1));
704

  
705
			val = DwgUtil.getBitShort(intData, bitPos);
706
			bitPos = ((Integer) val.get(0)).intValue();
707
			dwgFile.setHeader("SPLINESEGS", val.get(1));
708

  
709
			val = DwgUtil.getBitShort(intData, bitPos);
710
			bitPos = ((Integer) val.get(0)).intValue();
711
			dwgFile.setHeader("SURFU", val.get(1));
712

  
713
			val = DwgUtil.getBitShort(intData, bitPos);
714
			bitPos = ((Integer) val.get(0)).intValue();
715
			dwgFile.setHeader("SURFV", val.get(1));
716

  
717
			val = DwgUtil.getBitShort(intData, bitPos);
718
			bitPos = ((Integer) val.get(0)).intValue();
719
			dwgFile.setHeader("SURFTYPE", val.get(1));
720

  
721
			val = DwgUtil.getBitShort(intData, bitPos);
722
			bitPos = ((Integer) val.get(0)).intValue();
723
			dwgFile.setHeader("SURFTAB1", val.get(1));
724

  
725
			val = DwgUtil.getBitShort(intData, bitPos);
726
			bitPos = ((Integer) val.get(0)).intValue();
727
			dwgFile.setHeader("SURFTAB2", val.get(1));
728

  
729
			val = DwgUtil.getBitShort(intData, bitPos);
730
			bitPos = ((Integer) val.get(0)).intValue();
731
			dwgFile.setHeader("SPLINETYPE", val.get(1));
732

  
733
			val = DwgUtil.getBitShort(intData, bitPos);
734
			bitPos = ((Integer) val.get(0)).intValue();
735
			dwgFile.setHeader("SHADEDGE", val.get(1));
736

  
737
			val = DwgUtil.getBitShort(intData, bitPos);
738
			bitPos = ((Integer) val.get(0)).intValue();
739
			dwgFile.setHeader("SHADEDIF", val.get(1));
740

  
741
			val = DwgUtil.getBitShort(intData, bitPos);
742
			bitPos = ((Integer) val.get(0)).intValue();
743
			dwgFile.setHeader("UNITMODE", val.get(1));
744

  
745
			val = DwgUtil.getBitShort(intData, bitPos);
746
			bitPos = ((Integer) val.get(0)).intValue();
747
			dwgFile.setHeader("MAXACTVP", val.get(1));
748

  
749
			val = DwgUtil.getBitShort(intData, bitPos);
750
			bitPos = ((Integer) val.get(0)).intValue();
751
			dwgFile.setHeader("ISOLINES", val.get(1));
752

  
753
			val = DwgUtil.getBitShort(intData, bitPos);
754
			bitPos = ((Integer) val.get(0)).intValue();
755
			dwgFile.setHeader("CMLJUST", val.get(1));
756

  
757
			val = DwgUtil.getBitShort(intData, bitPos);
758
			bitPos = ((Integer) val.get(0)).intValue();
759
			dwgFile.setHeader("TEXTQLTY", val.get(1));
760

  
761
			val = DwgUtil.getBitDouble(intData, bitPos);
762
			bitPos = ((Integer) val.get(0)).intValue();
763
			dwgFile.setHeader("LTSCALE", val.get(1));
764

  
765
			val = DwgUtil.getBitDouble(intData, bitPos);
766
			bitPos = ((Integer) val.get(0)).intValue();
767
			dwgFile.setHeader("TEXTSIZE", val.get(1));
768

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

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

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

  
781
			val = DwgUtil.getBitDouble(intData, bitPos);
782
			bitPos = ((Integer) val.get(0)).intValue();
783
			dwgFile.setHeader("THICKNESS", val.get(1));
784

  
785
			val = DwgUtil.getBitDouble(intData, bitPos);
786
			bitPos = ((Integer) val.get(0)).intValue();
787
			dwgFile.setHeader("ANGBASE", val.get(1));
788

  
789
			val = DwgUtil.getBitDouble(intData, bitPos);
790
			bitPos = ((Integer) val.get(0)).intValue();
791
			dwgFile.setHeader("PDSIZE", val.get(1));
792

  
793
			val = DwgUtil.getBitDouble(intData, bitPos);
794
			bitPos = ((Integer) val.get(0)).intValue();
795
			dwgFile.setHeader("PLINEWID", val.get(1));
796

  
797
			val = DwgUtil.getBitDouble(intData, bitPos);
798
			bitPos = ((Integer) val.get(0)).intValue();
799
			dwgFile.setHeader("USERR1", val.get(1));
800

  
801
			val = DwgUtil.getBitDouble(intData, bitPos);
802
			bitPos = ((Integer) val.get(0)).intValue();
803
			dwgFile.setHeader("USERR2", val.get(1));
804

  
805
			val = DwgUtil.getBitDouble(intData, bitPos);
806
			bitPos = ((Integer) val.get(0)).intValue();
807
			dwgFile.setHeader("USERR3", val.get(1));
808

  
809
			val = DwgUtil.getBitDouble(intData, bitPos);
810
			bitPos = ((Integer) val.get(0)).intValue();
811
			dwgFile.setHeader("USERR4", val.get(1));
812

  
813
			val = DwgUtil.getBitDouble(intData, bitPos);
814
			bitPos = ((Integer) val.get(0)).intValue();
815
			dwgFile.setHeader("USERR5", val.get(1));
816

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

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

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

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

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

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

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

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

  
849
			int[] tdcreate = new int[2];
850

  
851
			val = DwgUtil.getBitLong(intData, bitPos);
852
			bitPos = ((Integer) val.get(0)).intValue();
853
			tdcreate[0] = ((Integer) val.get(1)).intValue();
854

  
855
			val = DwgUtil.getBitLong(intData, bitPos);
856
			bitPos = ((Integer) val.get(0)).intValue();
857
			tdcreate[1] = ((Integer) val.get(1)).intValue();
858

  
859
			dwgFile.setHeader("TDCREATE", tdcreate);
860

  
861
			int[] tdupdate = new int[2];
862

  
863
			val = DwgUtil.getBitLong(intData, bitPos);
864
			bitPos = ((Integer) val.get(0)).intValue();
865
			tdupdate[0] = ((Integer) val.get(1)).intValue();
866

  
867
			val = DwgUtil.getBitLong(intData, bitPos);
868
			bitPos = ((Integer) val.get(0)).intValue();
869
			tdupdate[1] = ((Integer) val.get(1)).intValue();
870

  
871
			dwgFile.setHeader("TDUPDATE", tdupdate);
872

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

  
877
			val = DwgUtil.getBitLong(intData, bitPos);
878
			bitPos = ((Integer) val.get(0)).intValue();
879
			dwgFile.setHeader("UNKNOWN5", val.get(1));
880

  
881
			val = DwgUtil.getBitLong(intData, bitPos);
882
			bitPos = ((Integer) val.get(0)).intValue();
883
			dwgFile.setHeader("UNKNOWN6", val.get(1));
884

  
885
			int[] tdindwg = new int[2];
886

  
887
			val = DwgUtil.getBitLong(intData, bitPos);
888
			bitPos = ((Integer) val.get(0)).intValue();
889
			tdindwg[0] = ((Integer) val.get(1)).intValue();
890

  
891
			val = DwgUtil.getBitLong(intData, bitPos);
892
			bitPos = ((Integer) val.get(0)).intValue();
893
			tdindwg[1] = ((Integer) val.get(1)).intValue();
894

  
895
			int[] tdusrtime = new int[2];
896

  
897
			val = DwgUtil.getBitLong(intData, bitPos);
898
			bitPos = ((Integer) val.get(0)).intValue();
899
			tdusrtime[0] = ((Integer) val.get(1)).intValue();
900

  
901
			val = DwgUtil.getBitLong(intData, bitPos);
902
			bitPos = ((Integer) val.get(0)).intValue();
903
			tdusrtime[1] = ((Integer) val.get(1)).intValue();
904

  
905
			dwgFile.setHeader("TDUSRTIME", tdusrtime);
906

  
907
			//FIXME: En versiones anteriores solo había una variable
908
			// "CECOLOR" de tipo entero, habría que comprobar donde se
909
			// utiliza para, si es necesario, utilizar apropiadamente
910
			// las nuevas.
911
			val = DwgUtil.getCmColor(intData, bitPos, dwgFile.getDwgVersion());
912
			bitPos = ((Integer) val.get(0)).intValue();
913
			dwgFile.setHeader("CECOLOR", val.get(1));
914
			dwgFile.setHeader("CECOLOR_RGBVALUE", val.get(2));
915
			Object cecolorColorByte = val.get(3);
916
			dwgFile.setHeader("CECOLOR_COLORBYTE", cecolorColorByte);
917
			dwgFile.setHeader("CECOLOR_NAME", val.get(4));
918

  
919
			dwgFile.getDwgVersion();
920

  
921
			val = DwgUtil.getHandle(intData, bitPos);
922
			bitPos = ((Integer) val.get(0)).intValue();
923
			int intHandle = DwgUtil.handleToInt(val);
924
			dwgFile.setHeader("HANDSEED", new Integer(intHandle));
925

  
926
			val = DwgUtil.getHandle(intData, bitPos);
927
			bitPos = ((Integer) val.get(0)).intValue();
928
			intHandle = DwgUtil.handleToInt(val);
929
			dwgFile.setHeader("CLAYER", new Integer(intHandle));
930

  
931
			val = DwgUtil.getHandle(intData, bitPos);
932
			bitPos = ((Integer) val.get(0)).intValue();
933
			intHandle = DwgUtil.handleToInt(val);
934
			dwgFile.setHeader("TEXSTYLE", new Integer(intHandle));
935

  
936
			val = DwgUtil.getHandle(intData, bitPos);
937
			bitPos = ((Integer) val.get(0)).intValue();
938
			intHandle = DwgUtil.handleToInt(val);
939
			dwgFile.setHeader("CELLTYPE", new Integer(intHandle));
940

  
941
			val = DwgUtil.getHandle(intData, bitPos);
942
			bitPos = ((Integer) val.get(0)).intValue();
943
			intHandle = DwgUtil.handleToInt(val);
944
			dwgFile.setHeader("DIMSTYLE", new Integer(intHandle));
945

  
946
			val = DwgUtil.getHandle(intData, bitPos);
947
			bitPos = ((Integer) val.get(0)).intValue();
948
			intHandle = DwgUtil.handleToInt(val);
949
			dwgFile.setHeader("CMLSTYLE", new Integer(intHandle));
950

  
951
			// DWG 2000+
952
			val = DwgUtil.getBitDouble(intData, bitPos);
953
			bitPos = ((Integer) val.get(0)).intValue();
954
			dwgFile.setHeader("PSVPSCALE", val.get(1));
955

  
956
			double[] spaces1 = new double[3];
957

  
958
			val = DwgUtil.getBitDouble(intData, bitPos);
959
			bitPos = ((Integer) val.get(0)).intValue();
960
			spaces1[0] = ((Double) val.get(1)).doubleValue();
961

  
962
			val = DwgUtil.getBitDouble(intData, bitPos);
963
			bitPos = ((Integer) val.get(0)).intValue();
964
			spaces1[1] = ((Double) val.get(1)).doubleValue();
965

  
966
			val = DwgUtil.getBitDouble(intData, bitPos);
967
			bitPos = ((Integer) val.get(0)).intValue();
968
			spaces1[2] = ((Double) val.get(1)).doubleValue();
969

  
970
			dwgFile.setHeader("PSPACE_INSBASE", spaces1);
971

  
972
			double[] spaces2 = new double[3];
973

  
974
			val = DwgUtil.getBitDouble(intData, bitPos);
975
			bitPos = ((Integer) val.get(0)).intValue();
976
			spaces2[0] = ((Double) val.get(1)).doubleValue();
977

  
978
			val = DwgUtil.getBitDouble(intData, bitPos);
979
			bitPos = ((Integer) val.get(0)).intValue();
980
			spaces2[1] = ((Double) val.get(1)).doubleValue();
981

  
982
			val = DwgUtil.getBitDouble(intData, bitPos);
983
			bitPos = ((Integer) val.get(0)).intValue();
984
			spaces2[2] = ((Double) val.get(1)).doubleValue();
985

  
986
			dwgFile.setHeader("PSPACE_EXTMIN", spaces2);
987

  
988
			double[] spaces3 = new double[3];
989

  
990
			val = DwgUtil.getBitDouble(intData, bitPos);
991
			bitPos = ((Integer) val.get(0)).intValue();
992
			spaces3[0] = ((Double) val.get(1)).doubleValue();
993

  
994
			val = DwgUtil.getBitDouble(intData, bitPos);
995
			bitPos = ((Integer) val.get(0)).intValue();
996
			spaces3[1] = ((Double) val.get(1)).doubleValue();
997

  
998
			val = DwgUtil.getBitDouble(intData, bitPos);
999
			bitPos = ((Integer) val.get(0)).intValue();
1000
			spaces3[2] = ((Double) val.get(1)).doubleValue();
1001
			dwgFile.setHeader("PSPACE_EXTMAX", spaces2);
1002

  
1003
			double[] spaces4 = new double[2];
1004
			val = DwgUtil.getRawDouble(intData, bitPos);
1005
			bitPos = ((Integer) val.get(0)).intValue();
1006
			spaces4[0] = ((Double) val.get(1)).doubleValue();
1007

  
1008
			val = DwgUtil.getRawDouble(intData, bitPos);
1009
			bitPos = ((Integer) val.get(0)).intValue();
1010
			spaces4[1] = ((Double) val.get(1)).doubleValue();
1011

  
1012
			dwgFile.setHeader("PSPACE_LIMMIN", spaces4);
1013

  
1014
			double[] spaces5 = new double[2];
1015
			val = DwgUtil.getRawDouble(intData, bitPos);
1016
			bitPos = ((Integer) val.get(0)).intValue();
1017
			spaces5[0] = ((Double) val.get(1)).doubleValue();
1018

  
1019
			val = DwgUtil.getRawDouble(intData, bitPos);
1020
			bitPos = ((Integer) val.get(0)).intValue();
1021
			spaces5[1] = ((Double) val.get(1)).doubleValue();
1022

  
1023
			dwgFile.setHeader("PSPACE_LIMMAX", spaces5);
1024

  
1025
			val = DwgUtil.getBitDouble(intData, bitPos);
1026
			bitPos = ((Integer) val.get(0)).intValue();
1027
			dwgFile.setHeader("PSPACE_ELEVATION", val.get(1));
1028

  
1029
			double[] spaces6 = new double[6];
1030

  
1031
			val = DwgUtil.getBitDouble(intData, bitPos);
1032
			bitPos = ((Integer) val.get(0)).intValue();
1033
			spaces6[0] = ((Double) val.get(1)).doubleValue();
1034

  
1035
			val = DwgUtil.getBitDouble(intData, bitPos);
1036
			bitPos = ((Integer) val.get(0)).intValue();
1037
			spaces6[1] = ((Double) val.get(1)).doubleValue();
1038

  
1039
			val = DwgUtil.getBitDouble(intData, bitPos);
1040
			bitPos = ((Integer) val.get(0)).intValue();
1041
			spaces6[2] = ((Double) val.get(1)).doubleValue();
1042

  
1043
			dwgFile.setHeader("PSPACE_UCSORG", spaces6);
1044

  
1045
			double[] spaces7 = new double[6];
1046
			val = DwgUtil.getBitDouble(intData, bitPos);
1047
			bitPos = ((Integer) val.get(0)).intValue();
1048
			spaces7[0] = ((Double) val.get(1)).doubleValue();
1049

  
1050
			val = DwgUtil.getBitDouble(intData, bitPos);
1051
			bitPos = ((Integer) val.get(0)).intValue();
1052
			spaces7[1] = ((Double) val.get(1)).doubleValue();
1053

  
1054
			val = DwgUtil.getBitDouble(intData, bitPos);
1055
			bitPos = ((Integer) val.get(0)).intValue();
1056
			spaces7[2] = ((Double) val.get(1)).doubleValue();
1057

  
1058
			dwgFile.setHeader("PSPACE_UCSXDIR", spaces7);
1059

  
1060
			double[] spaces8 = new double[6];
1061
			val = DwgUtil.getBitDouble(intData, bitPos);
1062
			bitPos = ((Integer) val.get(0)).intValue();
1063
			spaces8[0] = ((Double) val.get(1)).doubleValue();
1064

  
1065
			val = DwgUtil.getBitDouble(intData, bitPos);
1066
			bitPos = ((Integer) val.get(0)).intValue();
1067
			spaces8[1] = ((Double) val.get(1)).doubleValue();
1068

  
1069
			val = DwgUtil.getBitDouble(intData, bitPos);
1070
			bitPos = ((Integer) val.get(0)).intValue();
1071
			spaces8[2] = ((Double) val.get(1)).doubleValue();
1072

  
1073
			dwgFile.setHeader("PSPACE_UCSYDIR", spaces8);
1074

  
1075
			val = DwgUtil.getHandle(intData, bitPos);
1076
			bitPos = ((Integer) val.get(0)).intValue();
1077
			intHandle = DwgUtil.handleToInt(val);
1078
			dwgFile.setHeader("PSPACE_UCSNAME", new Integer(intHandle));
1079

  
1080
			// R2000+ Only
1081

  
1082
			val = DwgUtil.getHandle(intData, bitPos);
1083
			bitPos = ((Integer) val.get(0)).intValue();
1084
			intHandle = DwgUtil.handleToInt(val);
1085
			dwgFile.setHeader("PUCSBASE", new Integer(intHandle));
1086

  
1087
			val = DwgUtil.getBitShort(intData, bitPos);
1088
			bitPos = ((Integer) val.get(0)).intValue();
1089
			dwgFile.setHeader("PUCSORTHOVIEW", val.get(1));
1090

  
1091
			val = DwgUtil.getHandle(intData, bitPos);
1092
			bitPos = ((Integer) val.get(0)).intValue();
1093
			intHandle = DwgUtil.handleToInt(val);
1094
			dwgFile.setHeader("PUCSORTHOREF", new Integer(intHandle));
1095

  
1096
			double[] pucsorgtop = new double[3];
1097
			val = DwgUtil.getBitDouble(intData, bitPos);
1098
			bitPos = ((Integer) val.get(0)).intValue();
1099
			pucsorgtop[0] = ((Double) val.get(1)).doubleValue();
1100
			val = DwgUtil.getBitDouble(intData, bitPos);
1101
			bitPos = ((Integer) val.get(0)).intValue();
1102
			pucsorgtop[1] = ((Double) val.get(1)).doubleValue();
1103
			val = DwgUtil.getBitDouble(intData, bitPos);
1104
			bitPos = ((Integer) val.get(0)).intValue();
1105
			pucsorgtop[2] = ((Double) val.get(1)).doubleValue();
1106
			dwgFile.setHeader("PUCSORGTOP", pucsorgtop);
1107

  
1108
			double[] pucsorgbottom = new double[3];
1109
			val = DwgUtil.getBitDouble(intData, bitPos);
1110
			bitPos = ((Integer) val.get(0)).intValue();
1111
			pucsorgbottom[0] = ((Double) val.get(1)).doubleValue();
1112
			val = DwgUtil.getBitDouble(intData, bitPos);
1113
			bitPos = ((Integer) val.get(0)).intValue();
1114
			pucsorgbottom[1] = ((Double) val.get(1)).doubleValue();
1115
			val = DwgUtil.getBitDouble(intData, bitPos);
1116
			bitPos = ((Integer) val.get(0)).intValue();
1117
			pucsorgbottom[2] = ((Double) val.get(1)).doubleValue();
1118
			dwgFile.setHeader("PUCSORGBOTTOM", pucsorgbottom);
1119

  
1120
			double[] pucsorgleft = new double[3];
1121
			val = DwgUtil.getBitDouble(intData, bitPos);
1122
			bitPos = ((Integer) val.get(0)).intValue();
1123
			pucsorgleft[0] = ((Double) val.get(1)).doubleValue();
1124
			val = DwgUtil.getBitDouble(intData, bitPos);
1125
			bitPos = ((Integer) val.get(0)).intValue();
1126
			pucsorgleft[1] = ((Double) val.get(1)).doubleValue();
1127
			val = DwgUtil.getBitDouble(intData, bitPos);
1128
			bitPos = ((Integer) val.get(0)).intValue();
1129
			pucsorgleft[2] = ((Double) val.get(1)).doubleValue();
1130
			dwgFile.setHeader("PUCSORGLEFT", pucsorgleft);
1131

  
1132
			double[] pucsorgright = new double[3];
1133
			val = DwgUtil.getBitDouble(intData, bitPos);
1134
			bitPos = ((Integer) val.get(0)).intValue();
1135
			pucsorgright[0] = ((Double) val.get(1)).doubleValue();
1136
			val = DwgUtil.getBitDouble(intData, bitPos);
1137
			bitPos = ((Integer) val.get(0)).intValue();
1138
			pucsorgright[1] = ((Double) val.get(1)).doubleValue();
1139
			val = DwgUtil.getBitDouble(intData, bitPos);
1140
			bitPos = ((Integer) val.get(0)).intValue();
1141
			pucsorgright[2] = ((Double) val.get(1)).doubleValue();
1142
			dwgFile.setHeader("PUCSORGRIGHT", pucsorgright);
1143

  
1144
			double[] pucsorgfront = new double[3];
1145
			val = DwgUtil.getBitDouble(intData, bitPos);
1146
			bitPos = ((Integer) val.get(0)).intValue();
1147
			pucsorgfront[0] = ((Double) val.get(1)).doubleValue();
1148
			val = DwgUtil.getBitDouble(intData, bitPos);
1149
			bitPos = ((Integer) val.get(0)).intValue();
1150
			pucsorgfront[1] = ((Double) val.get(1)).doubleValue();
1151
			val = DwgUtil.getBitDouble(intData, bitPos);
1152
			bitPos = ((Integer) val.get(0)).intValue();
1153
			pucsorgfront[2] = ((Double) val.get(1)).doubleValue();
1154
			dwgFile.setHeader("PUCSORGFRONT", pucsorgfront);
1155

  
1156
			double[] pucsorgback = new double[3];
1157
			val = DwgUtil.getBitDouble(intData, bitPos);
1158
			bitPos = ((Integer) val.get(0)).intValue();
1159
			pucsorgback[0] = ((Double) val.get(1)).doubleValue();
1160
			val = DwgUtil.getBitDouble(intData, bitPos);
1161
			bitPos = ((Integer) val.get(0)).intValue();
1162
			pucsorgback[1] = ((Double) val.get(1)).doubleValue();
1163
			val = DwgUtil.getBitDouble(intData, bitPos);
1164
			bitPos = ((Integer) val.get(0)).intValue();
1165
			pucsorgback[2] = ((Double) val.get(1)).doubleValue();
1166
			dwgFile.setHeader("PUCSORGBACK", pucsorgback);
1167

  
1168
			// Common
1169

  
1170
			double[] spaces9 = new double[6];
1171
			val = DwgUtil.getBitDouble(intData, bitPos);
1172
			bitPos = ((Integer) val.get(0)).intValue();
1173
			spaces9[0] = ((Double) val.get(1)).doubleValue();
1174

  
1175
			val = DwgUtil.getBitDouble(intData, bitPos);
1176
			bitPos = ((Integer) val.get(0)).intValue();
1177
			spaces9[1] = ((Double) val.get(1)).doubleValue();
1178

  
1179
			val = DwgUtil.getBitDouble(intData, bitPos);
1180
			bitPos = ((Integer) val.get(0)).intValue();
1181
			spaces9[2] = ((Double) val.get(1)).doubleValue();
1182

  
1183
			dwgFile.setHeader("MSPACE_INSBASE", spaces9);
1184

  
1185
			double[] spaces10 = new double[6];
1186
			val = DwgUtil.getBitDouble(intData, bitPos);
1187
			bitPos = ((Integer) val.get(0)).intValue();
1188
			spaces10[0] = ((Double) val.get(1)).doubleValue();
1189

  
1190
			val = DwgUtil.getBitDouble(intData, bitPos);
1191
			bitPos = ((Integer) val.get(0)).intValue();
1192
			spaces10[1] = ((Double) val.get(1)).doubleValue();
1193

  
1194
			val = DwgUtil.getBitDouble(intData, bitPos);
1195
			bitPos = ((Integer) val.get(0)).intValue();
1196
			spaces10[2] = ((Double) val.get(1)).doubleValue();
1197

  
1198
			dwgFile.setHeader("MSPACE_EXTMIN", spaces10);
1199

  
1200
			double[] spaces11 = new double[3];
1201
			val = DwgUtil.getBitDouble(intData, bitPos);
1202
			bitPos = ((Integer) val.get(0)).intValue();
1203
			spaces11[0] = ((Double) val.get(1)).doubleValue();
1204

  
1205
			val = DwgUtil.getBitDouble(intData, bitPos);
1206
			bitPos = ((Integer) val.get(0)).intValue();
1207
			spaces11[1] = ((Double) val.get(1)).doubleValue();
1208

  
1209
			val = DwgUtil.getBitDouble(intData, bitPos);
1210
			bitPos = ((Integer) val.get(0)).intValue();
1211
			spaces11[2] = ((Double) val.get(1)).doubleValue();
1212

  
1213
			dwgFile.setHeader("MSPACE_EXTMAX", spaces11);
1214

  
1215
			double[] spaces12 = new double[2];
1216
			val = DwgUtil.getRawDouble(intData, bitPos);
1217
			bitPos = ((Integer) val.get(0)).intValue();
1218
			spaces12[0] = ((Double) val.get(1)).doubleValue();
1219

  
1220
			val = DwgUtil.getRawDouble(intData, bitPos);
1221
			bitPos = ((Integer) val.get(0)).intValue();
1222
			spaces12[1] = ((Double) val.get(1)).doubleValue();
1223

  
1224
			dwgFile.setHeader("MSPACE_LIMMIN", spaces12);
1225

  
1226
			double[] spaces13 = new double[2];
1227
			val = DwgUtil.getRawDouble(intData, bitPos);
1228
			bitPos = ((Integer) val.get(0)).intValue();
1229
			spaces13[0] = ((Double) val.get(1)).doubleValue();
1230

  
1231
			val = DwgUtil.getRawDouble(intData, bitPos);
1232
			bitPos = ((Integer) val.get(0)).intValue();
1233
			spaces13[1] = ((Double) val.get(1)).doubleValue();
1234

  
1235
			dwgFile.setHeader("MSPACE_LIMMAX", spaces13);
1236

  
1237
			val = DwgUtil.getBitDouble(intData, bitPos);
1238
			bitPos = ((Integer) val.get(0)).intValue();
1239
			dwgFile.setHeader("MSPACE_ELEVATION", (Double) val.get(1));
1240

  
1241
			double[] spaces14 = new double[3];
1242
			val = DwgUtil.getBitDouble(intData, bitPos);
1243
			bitPos = ((Integer) val.get(0)).intValue();
1244
			spaces14[0] = ((Double) val.get(1)).doubleValue();
1245

  
1246
			val = DwgUtil.getBitDouble(intData, bitPos);
1247
			bitPos = ((Integer) val.get(0)).intValue();
1248
			spaces14[1] = ((Double) val.get(1)).doubleValue();
1249

  
1250
			val = DwgUtil.getBitDouble(intData, bitPos);
1251
			bitPos = ((Integer) val.get(0)).intValue();
1252
			spaces14[2] = ((Double) val.get(1)).doubleValue();
1253

  
1254
			dwgFile.setHeader("MSPACE_UCSORG", spaces14);
1255

  
1256
			double[] spaces15 = new double[3];
1257
			val = DwgUtil.getBitDouble(intData, bitPos);
1258
			bitPos = ((Integer) val.get(0)).intValue();
1259
			spaces15[0] = ((Double) val.get(1)).doubleValue();
1260

  
1261
			val = DwgUtil.getBitDouble(intData, bitPos);
1262
			bitPos = ((Integer) val.get(0)).intValue();
1263
			spaces15[1] = ((Double) val.get(1)).doubleValue();
1264

  
1265
			val = DwgUtil.getBitDouble(intData, bitPos);
1266
			bitPos = ((Integer) val.get(0)).intValue();
1267
			spaces15[2] = ((Double) val.get(1)).doubleValue();
1268

  
1269
			dwgFile.setHeader("MSPACE_UCSXDIR", spaces15);
1270

  
1271
			double[] spaces16 = new double[3];
1272
			val = DwgUtil.getBitDouble(intData, bitPos);
1273
			bitPos = ((Integer) val.get(0)).intValue();
1274
			spaces16[0] = ((Double) val.get(1)).doubleValue();
1275

  
1276
			val = DwgUtil.getBitDouble(intData, bitPos);
1277
			bitPos = ((Integer) val.get(0)).intValue();
1278
			spaces16[1] = ((Double) val.get(1)).doubleValue();
1279

  
1280
			val = DwgUtil.getBitDouble(intData, bitPos);
1281
			bitPos = ((Integer) val.get(0)).intValue();
1282
			spaces16[2] = ((Double) val.get(1)).doubleValue();
1283

  
1284
			dwgFile.setHeader("MSPACE_UCSYDIR", spaces16);
1285

  
1286
			val = DwgUtil.getHandle(intData, bitPos);
1287
			bitPos = ((Integer) val.get(0)).intValue();
1288
			intHandle = DwgUtil.handleToInt(val);
1289
			dwgFile.setHeader("MSPACE_UCSNAME", new Integer(intHandle));
1290

  
1291
			val = DwgUtil.getHandle(intData, bitPos);
1292
			bitPos = ((Integer) val.get(0)).intValue();
1293
			intHandle = DwgUtil.handleToInt(val);
1294
			dwgFile.setHeader("UCSBASE", new Integer(intHandle));
1295

  
1296
			val = DwgUtil.getBitShort(intData, bitPos);
1297
			bitPos = ((Integer) val.get(0)).intValue();
1298
			dwgFile.setHeader("UCSORTHOVIEW", val.get(1));
1299

  
1300
			val = DwgUtil.getHandle(intData, bitPos);
1301
			bitPos = ((Integer) val.get(0)).intValue();
1302
			intHandle = DwgUtil.handleToInt(val);
1303
			dwgFile.setHeader("UCSORTHOREF", new Integer(intHandle));
1304

  
1305
			double[] ucsorgtop = new double[3];
1306
			val = DwgUtil.getBitDouble(intData, bitPos);
1307
			bitPos = ((Integer) val.get(0)).intValue();
1308
			ucsorgtop[0] = ((Double) val.get(1)).doubleValue();
1309
			val = DwgUtil.getBitDouble(intData, bitPos);
1310
			bitPos = ((Integer) val.get(0)).intValue();
1311
			ucsorgtop[1] = ((Double) val.get(1)).doubleValue();
1312
			val = DwgUtil.getBitDouble(intData, bitPos);
1313
			bitPos = ((Integer) val.get(0)).intValue();
1314
			ucsorgtop[2] = ((Double) val.get(1)).doubleValue();
1315
			dwgFile.setHeader("UCSORGTOP", ucsorgtop);
1316

  
1317
			double[] ucsorgbottom = new double[3];
1318
			val = DwgUtil.getBitDouble(intData, bitPos);
1319
			bitPos = ((Integer) val.get(0)).intValue();
1320
			ucsorgbottom[0] = ((Double) val.get(1)).doubleValue();
1321
			val = DwgUtil.getBitDouble(intData, bitPos);
1322
			bitPos = ((Integer) val.get(0)).intValue();
1323
			ucsorgbottom[1] = ((Double) val.get(1)).doubleValue();
1324
			val = DwgUtil.getBitDouble(intData, bitPos);
1325
			bitPos = ((Integer) val.get(0)).intValue();
1326
			ucsorgbottom[2] = ((Double) val.get(1)).doubleValue();
1327
			dwgFile.setHeader("UCSORGBOTTOM", ucsorgbottom);
1328

  
1329
			double[] ucsorgleft = new double[3];
1330
			val = DwgUtil.getBitDouble(intData, bitPos);
1331
			bitPos = ((Integer) val.get(0)).intValue();
1332
			ucsorgleft[0] = ((Double) val.get(1)).doubleValue();
1333
			val = DwgUtil.getBitDouble(intData, bitPos);
1334
			bitPos = ((Integer) val.get(0)).intValue();
1335
			ucsorgleft[1] = ((Double) val.get(1)).doubleValue();
1336
			val = DwgUtil.getBitDouble(intData, bitPos);
1337
			bitPos = ((Integer) val.get(0)).intValue();
1338
			ucsorgleft[2] = ((Double) val.get(1)).doubleValue();
1339
			dwgFile.setHeader("UCSORGLEFT", ucsorgleft);
1340

  
1341
			double[] ucsorgright = new double[3];
1342
			val = DwgUtil.getBitDouble(intData, bitPos);
1343
			bitPos = ((Integer) val.get(0)).intValue();
1344
			ucsorgright[0] = ((Double) val.get(1)).doubleValue();
1345
			val = DwgUtil.getBitDouble(intData, bitPos);
1346
			bitPos = ((Integer) val.get(0)).intValue();
1347
			ucsorgright[1] = ((Double) val.get(1)).doubleValue();
1348
			val = DwgUtil.getBitDouble(intData, bitPos);
1349
			bitPos = ((Integer) val.get(0)).intValue();
1350
			ucsorgright[2] = ((Double) val.get(1)).doubleValue();
1351
			dwgFile.setHeader("UCSORGRIGHT", ucsorgright);
1352

  
1353
			double[] ucsorgfront = new double[3];
1354
			val = DwgUtil.getBitDouble(intData, bitPos);
1355
			bitPos = ((Integer) val.get(0)).intValue();
1356
			ucsorgfront[0] = ((Double) val.get(1)).doubleValue();
1357
			val = DwgUtil.getBitDouble(intData, bitPos);
1358
			bitPos = ((Integer) val.get(0)).intValue();
1359
			ucsorgfront[1] = ((Double) val.get(1)).doubleValue();
1360
			val = DwgUtil.getBitDouble(intData, bitPos);
1361
			bitPos = ((Integer) val.get(0)).intValue();
1362
			ucsorgfront[2] = ((Double) val.get(1)).doubleValue();
1363
			dwgFile.setHeader("UCSORGFRONT", ucsorgfront);
1364

  
1365
			double[] ucsorgback = new double[3];
1366
			val = DwgUtil.getBitDouble(intData, bitPos);
1367
			bitPos = ((Integer) val.get(0)).intValue();
1368
			ucsorgback[0] = ((Double) val.get(1)).doubleValue();
1369
			val = DwgUtil.getBitDouble(intData, bitPos);
1370
			bitPos = ((Integer) val.get(0)).intValue();
1371
			ucsorgback[1] = ((Double) val.get(1)).doubleValue();
1372
			val = DwgUtil.getBitDouble(intData, bitPos);
1373
			bitPos = ((Integer) val.get(0)).intValue();
1374
			ucsorgback[2] = ((Double) val.get(1)).doubleValue();
1375
			dwgFile.setHeader("UCSORGBACK", ucsorgback);
1376

  
1377
			val = DwgUtil.getTextString(intData, bitPos);
1378
			bitPos = ((Integer) val.get(0)).intValue();
1379
			dwgFile.setHeader("DIMPOST", val.get(1));
1380

  
1381
			val = DwgUtil.getTextString(intData, bitPos);
1382
			bitPos = ((Integer) val.get(0)).intValue();
1383
			dwgFile.setHeader("DIMAPOST", val.get(1));
1384

  
1385
			// Common
1386

  
1387
			val = DwgUtil.getBitDouble(intData, bitPos);
1388
			bitPos = ((Integer) val.get(0)).intValue();
1389
			dwgFile.setHeader("DIMSCALE", val.get(1));
1390

  
1391
			val = DwgUtil.getBitDouble(intData, bitPos);
1392
			bitPos = ((Integer) val.get(0)).intValue();
1393
			dwgFile.setHeader("DIMASZ", val.get(1));
1394

  
1395
			val = DwgUtil.getBitDouble(intData, bitPos);
1396
			bitPos = ((Integer) val.get(0)).intValue();
1397
			dwgFile.setHeader("DIMEXO", val.get(1));
1398

  
1399
			val = DwgUtil.getBitDouble(intData, bitPos);
1400
			bitPos = ((Integer) val.get(0)).intValue();
1401
			dwgFile.setHeader("DIMDLI", val.get(1));
1402

  
1403
			val = DwgUtil.getBitDouble(intData, bitPos);
1404
			bitPos = ((Integer) val.get(0)).intValue();
1405
			dwgFile.setHeader("DIMEXE", val.get(1));
1406

  
1407
			val = DwgUtil.getBitDouble(intData, bitPos);
1408
			bitPos = ((Integer) val.get(0)).intValue();
1409
			dwgFile.setHeader("DIMAND", val.get(1)); //FIXME: ¿o es DIMRND?
1410

  
1411
			val = DwgUtil.getBitDouble(intData, bitPos);
1412
			bitPos = ((Integer) val.get(0)).intValue();
1413
			dwgFile.setHeader("DIMDLE", val.get(1));
1414

  
1415
			val = DwgUtil.getBitDouble(intData, bitPos);
1416
			bitPos = ((Integer) val.get(0)).intValue();
1417
			dwgFile.setHeader("DIMTP", val.get(1));
1418

  
1419
			val = DwgUtil.getBitDouble(intData, bitPos);
1420
			bitPos = ((Integer) val.get(0)).intValue();
1421
			dwgFile.setHeader("DIMTM", val.get(1));
1422

  
1423
			// DWG 2000 +
1424
			val = DwgUtil.testBit(intData, bitPos);
1425
			bitPos = ((Integer) val.get(0)).intValue();
1426
			dwgFile.setHeader("DIMTOL", val.get(1));
1427

  
1428
			val = DwgUtil.testBit(intData, bitPos);
1429
			bitPos = ((Integer) val.get(0)).intValue();
1430
			dwgFile.setHeader("DIMLIM", val.get(1));
1431

  
1432
			val = DwgUtil.testBit(intData, bitPos);
1433
			bitPos = ((Integer) val.get(0)).intValue();
1434
			dwgFile.setHeader("DIMTIH", val.get(1));
1435

  
1436
			val = DwgUtil.testBit(intData, bitPos);
1437
			bitPos = ((Integer) val.get(0)).intValue();
1438
			dwgFile.setHeader("DIMTOH", val.get(1));
1439

  
1440
			val = DwgUtil.testBit(intData, bitPos);
1441
			bitPos = ((Integer) val.get(0)).intValue();
1442
			dwgFile.setHeader("DIMSE1", val.get(1));
1443

  
1444
			val = DwgUtil.testBit(intData, bitPos);
1445
			bitPos = ((Integer) val.get(0)).intValue();
1446
			dwgFile.setHeader("DIMSE2", val.get(1));
1447

  
1448
			val = DwgUtil.getBitShort(intData, bitPos);
1449
			bitPos = ((Integer) val.get(0)).intValue();
1450
			dwgFile.setHeader("DIMTAD", val.get(1));
1451

  
1452
			val = DwgUtil.getBitShort(intData, bitPos);
1453
			bitPos = ((Integer) val.get(0)).intValue();
1454
			dwgFile.setHeader("DIMZIN", val.get(1));
1455

  
1456
			val = DwgUtil.getBitShort(intData, bitPos);
1457
			bitPos = ((Integer) val.get(0)).intValue();
1458
			dwgFile.setHeader("DIMAZIN", val.get(1));
1459

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

  
1464
			val = DwgUtil.getBitDouble(intData, bitPos);
1465
			bitPos = ((Integer) val.get(0)).intValue();
1466
			dwgFile.setHeader("DIMCEN", val.get(1));
1467

  
1468
			val = DwgUtil.getBitDouble(intData, bitPos);
1469
			bitPos = ((Integer) val.get(0)).intValue();
1470
			dwgFile.setHeader("DIMSZ", val.get(1));
1471

  
1472
			val = DwgUtil.getBitDouble(intData, bitPos);
1473
			bitPos = ((Integer) val.get(0)).intValue();
1474
			dwgFile.setHeader("DIMALTF", val.get(1));
1475

  
1476
			val = DwgUtil.getBitDouble(intData, bitPos);
1477
			bitPos = ((Integer) val.get(0)).intValue();
1478
			dwgFile.setHeader("DIMLFAC", val.get(1));
1479

  
1480
			val = DwgUtil.getBitDouble(intData, bitPos);
1481
			bitPos = ((Integer) val.get(0)).intValue();
1482
			dwgFile.setHeader("DIMTVP", val.get(1));
1483

  
1484
			val = DwgUtil.getBitDouble(intData, bitPos);
1485
			bitPos = ((Integer) val.get(0)).intValue();
1486
			dwgFile.setHeader("DIMTFAC", val.get(1));
1487

  
1488
			val = DwgUtil.getBitDouble(intData, bitPos);
1489
			bitPos = ((Integer) val.get(0)).intValue();
1490
			dwgFile.setHeader("DIMGAP", val.get(1));
1491

  
1492
			// DWG 2000+
1493

  
1494
			val = DwgUtil.getBitDouble(intData, bitPos);
1495
			bitPos = ((Integer) val.get(0)).intValue();
1496
			dwgFile.setHeader("DIMALTRND", val.get(1));
1497

  
1498
			val = DwgUtil.testBit(intData, bitPos);
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff