public class DwgFileV15Reader extends Object implements IDwgFileReader
Modifier and Type | Field and Description |
---|---|
protected ByteBuffer |
bb |
protected DwgFile |
dwgFile |
Constructor and Description |
---|
DwgFileV15Reader() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkSuperentities() |
DwgObject |
getDwgObjectByIndex(int index)
Return a dwg object from its index in the dwg file
|
void |
read(DwgFile dwgFile,
ByteBuffer bb)
Reads the DWG version 15 format
|
protected void |
readDwgClasses() |
protected void |
readDwgClasses2() |
protected DwgObject |
readDwgObject(int offset,
int index)
Reads a dwg drawing entity (dwg object) given its offset in the file
|
protected void |
readDwgObjectOffsets()
OpenDWG spec says: This section -object map- is a table which gives the
location of each object in the DWG file.
|
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
|
protected void |
readHeaders() |
int |
readObjectHeader(int[] data,
int offset,
DwgObject dwgObject)
Reads the header of an object in a DWG file Version 15
|
int |
readObjectTailer(int[] data,
int offset,
DwgObject dwgObject)
Reads the tail of an object in a DWG file Version 15
|
protected void |
readSpecificObject(DwgObject obj,
int[] data,
int bitPos) |
protected DwgFile dwgFile
protected ByteBuffer bb
public void read(DwgFile dwgFile, ByteBuffer bb) throws IOException
read
in interface IDwgFileReader
dwgFile
- Represents the DWG file that we want to readbb
- Memory mapped byte buffer of the whole DWG fileIOException
- When DWG file path is wrongprotected void checkSuperentities()
protected void readDwgSectionOffsets()
protected void readDwgObjectOffsets() throws Exception
Exception
protected void readDwgObjects()
public int readObjectHeader(int[] data, int offset, DwgObject dwgObject)
readObjectHeader
in interface IDwgFileReader
data
- Array of unsigned bytes obtained from the DWG binary fileoffset
- The current bit offset where the value beginspublic int readObjectTailer(int[] data, int offset, DwgObject dwgObject) throws RuntimeException, CorruptedDwgEntityException
readObjectTailer
in interface IDwgFileReader
data
- Array of bytes obtained from the DWG binary fileoffset
- Offset for this array of bytesCorruptedDwgEntityException
RuntimeException
public DwgObject getDwgObjectByIndex(int index)
index
- of the requested dwg object in the dwg fileprotected DwgObject readDwgObject(int offset, int index)
protected void readSpecificObject(DwgObject obj, int[] data, int bitPos) throws RuntimeException, CorruptedDwgEntityException
protected void readHeaders()