public class DwgFileV14Reader extends java.lang.Object implements IDwgFileReader
Modifier and Type | Field and Description |
---|---|
protected java.nio.ByteBuffer |
bb |
protected DwgFile |
dwgFile |
Constructor and Description |
---|
DwgFileV14Reader() |
Modifier and Type | Method and Description |
---|---|
DwgObject |
getDwgObjectByIndex(int index)
Return a dwg object from its index in the dwg file
|
void |
read(DwgFile dwgFile,
java.nio.ByteBuffer bb)
Reads the DWG version 15 format
|
protected void |
readDwgClasses() |
protected DwgObject |
readDwgObject(int offset,
int index)
Reads a dwg drawing entity (dwg object) given its offset in the file
|
protected void |
readDwgObjectOffsets() |
protected void |
readDwgObjects()
Reads all the object referenced in the object map section of the DWG file
(using their object file obsets)
|
protected void |
readDwgSectionOffsets()
It read the SECTIONS from the header of the DWG file
TODO Mover esto a una clase abstracta Reader, pues es similar para DWG 15
(o hacer que esta herede de DWG 15)
|
protected void |
readHeaders()
It reads all HEADER section of a DWG 13-14 file.
|
int |
readObjectHeader(int[] data,
int offset,
DwgObject dwgObject)
Reads the header of a dwg object
|
int |
readObjectTailer(int[] data,
int offset,
DwgObject dwgObject)
Reads the tailer of a dwg object.
|
protected void |
readSpecificObject(DwgObject obj,
int[] data,
int bitPos) |
protected DwgFile dwgFile
protected java.nio.ByteBuffer bb
public void read(DwgFile dwgFile, java.nio.ByteBuffer bb) throws java.io.IOException
read
in interface IDwgFileReader
dwgFile
- Represents the DWG file that we want to readbb
- Memory mapped byte buffer of the whole DWG filejava.io.IOException
- When DWG file path is wrongprotected void readHeaders()
protected void readDwgSectionOffsets()
protected void readDwgObjectOffsets() throws java.lang.Exception
java.lang.Exception
protected void readDwgClasses() throws java.lang.Exception
java.lang.Exception
protected void readDwgObjects()
public DwgObject getDwgObjectByIndex(int index)
index
- of the requested dwg object in the dwg fileprotected DwgObject readDwgObject(int offset, int index)
offset
- offset of the dwg object in the fileindex
- order of the entity in the objects map (1, 2, etc.)protected void readSpecificObject(DwgObject obj, int[] data, int bitPos) throws java.lang.Exception
java.lang.Exception
public int readObjectHeader(int[] data, int offset, DwgObject dwgObject)
IDwgFileReader
readObjectHeader
in interface IDwgFileReader
public int readObjectTailer(int[] data, int offset, DwgObject dwgObject) throws java.lang.RuntimeException, CorruptedDwgEntityException
IDwgFileReader
readObjectTailer
in interface IDwgFileReader
java.lang.RuntimeException
CorruptedDwgEntityException