Revision 10313 trunk/libraries/libDwg/src/com/iver/cit/jdwglib/dwg/readers/DwgFileV15Reader.java

View differences:

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;
41 42

  
42 43
import com.iver.cit.gvsig.fmap.drivers.dgn.ByteUtils;
43 44
import com.iver.cit.jdwglib.dwg.CorruptedDwgEntityException;
......
47 48
import com.iver.cit.jdwglib.dwg.DwgObjectFactory;
48 49
import com.iver.cit.jdwglib.dwg.DwgObjectOffset;
49 50
import com.iver.cit.jdwglib.dwg.DwgUtil;
51
import com.iver.cit.jdwglib.dwg.objects.DwgBlock;
52
import com.iver.cit.jdwglib.dwg.objects.DwgBlockControl;
53
import com.iver.cit.jdwglib.dwg.objects.DwgBlockHeader;
50 54

  
51 55
import freenet.support.HexUtil;
52 56

  
......
83 87
			//		    		"el DWG file ...");
84 88
		}
85 89
		readDwgObjects();
90
		//checkSuperentities();
86 91
	}
92
	
93
	/*
94
	 *TODO: Eliminar esto cuando terminemos con el testeo
95
	 */
96
	protected void checkSuperentities(){
97
		System.out.println("***** CHEQUEANDO LAS SUPERENTIDADES *****");
98
		LinkedList objects = dwgFile.getDwgObjects();
99
		DwgObject obj;
100
		DwgObject superEnt;
101
		boolean buscado=false;
102
		boolean perdidos=false;
103
		int j=0;
104
		for (int i=0; i<objects.size(); i++){
105
			obj = (DwgObject)objects.get(i);
106
			if (obj.hasSubEntityHandle()){
107
				buscado = true;
108
				superEnt = dwgFile.getDwgSuperEntity(obj);
109
				if (superEnt == null){
110
					j++;
111
				}
112
			}
113
		}
114
		if(j!=0) {
115
			System.out.println("+++++ SE HAN PERDIDO LAS SUPERENTIDADES DE "+ j+" OBJETOS +++++");
116
		}
117
		System.out.println("***** FIN DEL CHEQUEO DE LAS SUPERENTIDADES *****");
118
		
119
	}
120
	
87 121

  
88 122
	/**
89 123
	 * It read the SECTIONS from the header of the DWG file
......
221 255
			 * (aunque la sigo leyendo por si aparecen problemas de puntero de
222 256
			 * fichero) No considero por tanto los DwgObject if (obj != null) {
223 257
			 * dwgFile.addDwgObject(obj); }
258
			 *	
259
			 * paco: propongo reconsiderar esto. Si no cargamos todos los objetos
260
			 * podemos tener problemas con las subentities.
224 261
			 */
225 262
			if (obj != null && obj.getClass() != DwgObject.class) {
226 263
				dwgFile.addDwgObject(obj);
227
			}
264
//			    DwgObject superEnt = dwgFile.getDwgSuperEntity(obj);
265
//			    if(superEnt != null){
266
//			      System.out.println(superEnt.getClass().getName() + "(TIPO " +Integer.toHexString(superEnt.getType())+") ES SUPERENTITY DE "+obj.getClass().getName());
267
			    } 
268

  
269
//			}
228 270
		}
229 271
	}
230 272

  
......
337 379
		dwgObject.setLayerHandle(handle);
338 380
//		System.out.println("layerHandle: code = "+handle.getCode()+" offset = "+handle.getOffset());
339 381
		
340
//		System.out.println(cadena + " ==> " + handle);
341

  
342 382
		if (!dwgObject.isNoLinks()) {
343 383

  
344 384
			DwgHandleReference previousHandle = new DwgHandleReference();
......
414 454
			int type = ((Integer) v.get(1)).intValue();
415 455

  
416 456
			obj = DwgObjectFactory.getInstance().create(type, index);
457

  
458
//			System.out.println("SE HA CREADO UN OBJETO DEL TIPO = "+type+" =>> "+obj.getClass().getName());
417 459
			if(obj == null)
418 460
				return null;
419
			obj.setDwgFile(this.dwgFile);
420 461

  
421 462
			v = DwgUtil.getRawLong(data, bitPos);
422 463
			bitPos = ((Integer) v.get(0)).intValue();

Also available in: Unified diff