Class DwgFileV14Reader

java.lang.Object
org.gvsig.dwg.lib.readers.DwgFileV14Reader
All Implemented Interfaces:
IDwgFileReader

public class DwgFileV14Reader extends Object implements IDwgFileReader
The DwgFileV14Reader reads the DWG version 14 format
Author:
jmorell
  • Field Details

  • Constructor Details

    • DwgFileV14Reader

      public DwgFileV14Reader()
  • Method Details

    • read

      public void read(DwgFile dwgFile, ByteBuffer bb) throws IOException
      Reads the DWG version 15 format
      Specified by:
      read in interface IDwgFileReader
      Parameters:
      dwgFile - Represents the DWG file that we want to read
      bb - Memory mapped byte buffer of the whole DWG file
      Throws:
      IOException - When DWG file path is wrong
    • readHeaders

      protected void readHeaders()
      It reads all HEADER section of a DWG 13-14 file. This method must be called only for debug purposes because we dont the meaning (or the practical application) of the fields readed with it TODO Pasarlo a la clase abstracta comun que se haga de las versiones 15, 13-14 (la cabecera es la misma practicamente)
    • readDwgSectionOffsets

      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)
    • readDwgObjectOffsets

      protected void readDwgObjectOffsets() throws Exception
      Throws:
      Exception
    • readDwgClasses

      protected void readDwgClasses() throws Exception
      Throws:
      Exception
    • readDwgObjects

      protected void readDwgObjects()
      Reads all the object referenced in the object map section of the DWG file (using their object file obsets)
    • getDwgObjectByIndex

      public DwgObject getDwgObjectByIndex(int index)
      Return a dwg object from its index in the dwg file
      Parameters:
      index - of the requested dwg object in the dwg file
    • readDwgObject

      protected DwgObject readDwgObject(int offset, int index)
      Reads a dwg drawing entity (dwg object) given its offset in the file
      Parameters:
      offset - offset of the dwg object in the file
      index - order of the entity in the objects map (1, 2, etc.)
    • readSpecificObject

      protected void readSpecificObject(DwgObject obj, int[] data, int bitPos) throws Exception
      Throws:
      Exception
    • readObjectHeader

      public int readObjectHeader(int[] data, int offset, DwgObject dwgObject)
      Description copied from interface: IDwgFileReader
      Reads the header of a dwg object
      Specified by:
      readObjectHeader in interface IDwgFileReader
    • readObjectTailer

      public int readObjectTailer(int[] data, int offset, DwgObject dwgObject) throws RuntimeException, CorruptedDwgEntityException
      Description copied from interface: IDwgFileReader
      Reads the tailer of a dwg object.
      Specified by:
      readObjectTailer in interface IDwgFileReader
      Throws:
      RuntimeException
      CorruptedDwgEntityException