Revision 9986 trunk/libraries/libDwg/src/com/iver/cit/jdwglib/dwg/readers/DwgFileV14Reader.java
DwgFileV14Reader.java | ||
---|---|---|
1660 | 1660 |
List extData = (List)val.get(1); |
1661 | 1661 |
obj.setExtendedData(extData); |
1662 | 1662 |
|
1663 |
/* TODO |
|
1664 |
if _type < len(_objflags): |
|
1665 |
_gflag, _reader = _objflags[_type] |
|
1666 |
|
|
1667 |
_bitpos, _objbsize = dwgutil.get_raw_long(_data, _bitpos) |
|
1668 |
# print "object data size in bits: %d" % _objbsize |
|
1669 |
# print "bitpos: %d" % _bitpos |
|
1670 |
if _reader is not None: |
|
1671 |
_reader(_ent, _data, _bitpos) |
|
1672 |
elif _type in _vmap: |
|
1673 |
_stype = _vmap[_type] |
|
1674 |
# print "type: %d => %s" % (_type, _stype) |
|
1675 |
if _stype == 'HATCH': # where is the data kept? |
|
1676 |
_bitpos, _val = dwgutil.test_bit(_data, _bitpos) |
|
1677 |
# print "graphic flag: " + str(_val) |
|
1678 |
if _stype in _vobjmap: |
|
1679 |
_vobjmap[_stype](_ent, _data, _bitpos) |
|
1680 |
else: |
|
1681 |
# print "unhandled object type: %d" % _type |
|
1682 |
pass |
|
1683 |
_objlist.append(_ent) |
|
1684 |
*/ |
|
1685 |
|
|
1686 |
|
|
1663 |
//Graphics data |
|
1687 | 1664 |
boolean gflag = false; |
1688 | 1665 |
gflag = obj.isGraphicsFlag(); |
1689 | 1666 |
if (gflag) { |
... | ... | |
1702 | 1679 |
} |
1703 | 1680 |
}//if gflag |
1704 | 1681 |
|
1705 |
readSpecificObject(obj, intData, bitPos); |
|
1682 |
|
|
1683 |
//size in bits |
|
1684 |
val = DwgUtil.getRawLong(intData, bitPos); |
|
1685 |
bitPos = ((Integer)val.get(0)).intValue(); |
|
1686 |
int sizeInBits = ((Integer)val.get(1)).intValue(); |
|
1687 |
obj.setSizeInBits(sizeInBits); |
|
1688 |
|
|
1689 |
if(obj.getClass() != DwgObject.class){ |
|
1690 |
//El objeto ha sido reconocido |
|
1691 |
readSpecificObject(obj, intData, bitPos); |
|
1692 |
}else{ |
|
1693 |
if(type > 500){ |
|
1694 |
/* |
|
1695 |
* Pag 46 de la spec: restamos 500 al tipo y nos da un ?ndice |
|
1696 |
* a la tabla de clases (CLASSES section) |
|
1697 |
* |
|
1698 |
* Filtro aquellos que sean mayores de 500 porque todav?a |
|
1699 |
* nos quedan por implementar muchas entidades DWG (para no confundirlas) |
|
1700 |
* |
|
1701 |
* */ |
|
1702 |
int newIndex = type - 500; |
|
1703 |
if(newIndex < (dwgFile.getDwgClasses().size() - 1)){ |
|
1704 |
DwgClass dwgClass = (DwgClass) dwgFile.getDwgClasses().get(index); |
|
1705 |
String dxfEntityName = dwgClass.getDxfName(); |
|
1706 |
/* |
|
1707 |
* A partir del nombre de la entidad, la instanciamos |
|
1708 |
* y construimos un READER para ella. |
|
1709 |
* |
|
1710 |
* Hay que a?adir un nuevo metodo para la factoria de DWG |
|
1711 |
* para que reciba un nombre de entidad DXF |
|
1712 |
* */ |
|
1713 |
} |
|
1714 |
}//if type 500 |
|
1715 |
}//if DwgObject.class |
|
1716 |
|
|
1717 |
|
|
1718 |
|
|
1719 |
|
|
1720 |
|
|
1721 |
// elif _type in _vmap: |
|
1722 |
// _stype = _vmap[_type] |
|
1723 |
// |
|
1724 |
// if _stype == 'HATCH': # where is the data kept? |
|
1725 |
// _bitpos, _val = dwgutil.test_bit(_data, _bitpos) |
|
1726 |
// # print "graphic flag: " + str(_val) |
|
1727 |
// |
|
1728 |
// if _stype in _vobjmap: |
|
1729 |
// _vobjmap[_stype](_ent, _data, _bitpos) |
|
1730 |
// else: |
|
1731 |
// # print "unhandled object type: %d" % _type |
|
1732 |
// pass |
|
1733 |
// _objlist.append(_ent) |
|
1734 |
|
|
1735 |
|
|
1736 |
/* |
|
1737 |
_vobjmap = { |
|
1738 |
'DICTIONARYVAR' : dictionaryvar_reader, |
|
1739 |
'HATCH' : hatch_reader, |
|
1740 |
'IDBUFFER' : idbuffer_reader, |
|
1741 |
'IMAGE' : image_reader, |
|
1742 |
'IMAGEDEF' : imagedef_reader, |
|
1743 |
'IMAGEDEFREACTOR' : imagedefreactor_reader, |
|
1744 |
'LAYER_INDEX' : layer_index_reader, |
|
1745 |
'LWPLINE' : lwpline_reader, |
|
1746 |
# 'OLE2FRAME' : ole2frame_reader, |
|
1747 |
'RASTERVARIABLES' : rastervariables_reader, |
|
1748 |
'SORTENTSTABLE' : sortentstable_reader, |
|
1749 |
'SPATIAL_FILTER' : spatial_filter_reader, |
|
1750 |
'SPATIAL_INDEX' : spatial_index_reader, |
|
1751 |
'XRECORD' : xrecord_reader |
|
1752 |
} |
|
1753 |
|
|
1754 |
|
|
1755 |
|
|
1756 |
* */ |
|
1757 |
|
|
1758 |
|
|
1759 |
|
|
1760 |
|
|
1761 |
|
|
1706 | 1762 |
return obj; |
1763 |
|
|
1707 | 1764 |
} catch (Exception e) { |
1708 | 1765 |
// logger.warn("Exception capturada. Probablemente se ha encontrado un" + |
1709 | 1766 |
// "objeto con type non fixed"); |
Also available in: Unified diff