org.cresques.io
Class DxfFile

java.lang.Object
  extended byorg.cresques.io.GeoFile
      extended byorg.cresques.io.DxfFile
All Implemented Interfaces:
Extent.Has, Projected

public class DxfFile
extends GeoFile

Clase que representa un fichero en formato DXF. Contiene los interfaces y métodos necesarios para acceder a la información almacenada en su interior.

Author:
jmorell

Nested Class Summary
static interface DxfFile.EntityFactory
          Crea los objetos en el Modelo correspondiente.
static interface DxfFile.VarSettings
          Establece el estado de las variables propias de un DXF que están definidas en la sección HEADER.
 
Field Summary
 
Fields inherited from class org.cresques.io.GeoFile
bytesReaded, extent, lineCnt
 
Constructor Summary
DxfFile(IProjection proj, java.lang.String name, DxfFile.EntityFactory maker)
          Constructor de la clase
DxfFile(IProjection proj, java.lang.String name, DxfFile.EntityFactory maker, DxfFile.VarSettings dxfVars)
          Constructor de la clase que además incorpora la capacidad de leer una porción del HEADER
 
Method Summary
 void close()
           
 IObjList getObjects()
          Devuelve los objetos geométricos obtenidos de un DXF
 boolean isCadFlag()
          Informa sobre si estamos trabajando con el modelo de datos GIS o con el de CAD
 GeoFile load()
          Carga un fichero en formato DXF
 GeoFile load(java.io.Reader fr)
          Carga un fichero en formato DXF tomando un Reader como parámetro
 void reProject(ICoordTrans rp)
          Habilita la reproyección cartográfica
 void save(java.lang.String fName)
          jmorell: Método que permite salvar capas al formato DXF2000.
 void setCadFlag(boolean cadFlag)
          Establece si trabajamos con el modelo de datos GIS o con el de CAD
 void writeAppidTable(java.io.FileWriter fw)
          Escritor de la tabla APPID.
 void writeBlockRecordTable(java.io.FileWriter fw)
          Escritor de la tabla BLOCK_RECORD.
 void writeBlocks(java.io.FileWriter fw)
          Escritor de la sección de bloques por defecto de un DXF2000.
 void writeDimStyleTable(java.io.FileWriter fw)
          Escritor de la tabla DIMSTYLE.
 void writeEntities(java.io.FileWriter fw)
          Escritor de la sección ENTITIES de entidades.
 void writeHeader(java.io.FileWriter fw)
          Escritor de la cabecera de un DXF.
 void writeLayerTable(java.io.FileWriter fw)
          Escritor de la tabla LAYER.
 void writeLTypeTable(java.io.FileWriter fw)
          Escritor de la tabla LTYPE.
 void writeObjects(java.io.FileWriter fw)
          050224, jmorell: Escritura de la sección OBJECTS según QCAD.
 void writeStyleTable(java.io.FileWriter fw)
          Escritor de la tabla STYLE.
 void writeTables(java.io.FileWriter fw)
          Escritor de la sección TABLES de un DXF.
 void writeUCSTable(java.io.FileWriter fw)
          Escritor de la tabla UCS.
 void writeViewTable(java.io.FileWriter fw)
          Escritor de la tabla VIEW.
 void writeVPortTable(java.io.FileWriter fw)
          Escritor de la tabla VPORT.
 
Methods inherited from class org.cresques.io.GeoFile
filterWS, getExtent, getFileSize, getName, getProjection, getTime, setFileSize, setName, setProjection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DxfFile

public DxfFile(IProjection proj,
               java.lang.String name,
               DxfFile.EntityFactory maker)
Constructor de la clase


DxfFile

public DxfFile(IProjection proj,
               java.lang.String name,
               DxfFile.EntityFactory maker,
               DxfFile.VarSettings dxfVars)
Constructor de la clase que además incorpora la capacidad de leer una porción del HEADER

Method Detail

load

public GeoFile load()
Carga un fichero en formato DXF

Specified by:
load in class GeoFile

load

public GeoFile load(java.io.Reader fr)
             throws java.lang.NumberFormatException,
                    java.lang.Exception
Carga un fichero en formato DXF tomando un Reader como parámetro

Returns:
devuelve un objeto GeoFile, padre de DxfFile
Throws:
java.lang.NumberFormatException
java.lang.Exception

getObjects

public IObjList getObjects()
Devuelve los objetos geométricos obtenidos de un DXF

Specified by:
getObjects in class GeoFile

save

public void save(java.lang.String fName)
          throws java.io.IOException
jmorell: Método que permite salvar capas al formato DXF2000. Este método ha sido actualizado en el proceso de implementación del piloto de CAD. En este piloto debía existir soporte para elipses, y este es uno de los motivos que nos llevan a implementar ahora para DXF2000, puesto que el DXF R12 no soporta elipses.

Parameters:
fName -
Throws:
java.io.IOException

writeHeader

public void writeHeader(java.io.FileWriter fw)
                 throws java.io.IOException
Escritor de la cabecera de un DXF. jmorell: Actualización del escritor de DXF de R12 a 2000.

Throws:
java.io.IOException

writeTables

public void writeTables(java.io.FileWriter fw)
                 throws java.io.IOException
Escritor de la sección TABLES de un DXF.

Throws:
java.io.IOException

writeVPortTable

public void writeVPortTable(java.io.FileWriter fw)
                     throws java.io.IOException
Escritor de la tabla VPORT.

Parameters:
fw -
Throws:
java.io.IOException

writeLTypeTable

public void writeLTypeTable(java.io.FileWriter fw)
                     throws java.io.IOException
Escritor de la tabla LTYPE.

Parameters:
fw -
Throws:
java.io.IOException

writeLayerTable

public void writeLayerTable(java.io.FileWriter fw)
                     throws java.io.IOException
Escritor de la tabla LAYER.

Parameters:
fw -
Throws:
java.io.IOException

writeStyleTable

public void writeStyleTable(java.io.FileWriter fw)
                     throws java.io.IOException
Escritor de la tabla STYLE.

Parameters:
fw -
Throws:
java.io.IOException

writeViewTable

public void writeViewTable(java.io.FileWriter fw)
                    throws java.io.IOException
Escritor de la tabla VIEW.

Parameters:
fw -
Throws:
java.io.IOException

writeUCSTable

public void writeUCSTable(java.io.FileWriter fw)
                   throws java.io.IOException
Escritor de la tabla UCS.

Parameters:
fw -
Throws:
java.io.IOException

writeAppidTable

public void writeAppidTable(java.io.FileWriter fw)
                     throws java.io.IOException
Escritor de la tabla APPID.

Parameters:
fw -
Throws:
java.io.IOException

writeDimStyleTable

public void writeDimStyleTable(java.io.FileWriter fw)
                        throws java.io.IOException
Escritor de la tabla DIMSTYLE.

Parameters:
fw -
Throws:
java.io.IOException

writeBlockRecordTable

public void writeBlockRecordTable(java.io.FileWriter fw)
                           throws java.io.IOException
Escritor de la tabla BLOCK_RECORD.

Parameters:
fw -
Throws:
java.io.IOException

writeBlocks

public void writeBlocks(java.io.FileWriter fw)
                 throws java.io.IOException
Escritor de la sección de bloques por defecto de un DXF2000.

Parameters:
fw -
Throws:
java.io.IOException

writeEntities

public void writeEntities(java.io.FileWriter fw)
                   throws java.io.IOException
Escritor de la sección ENTITIES de entidades.

Parameters:
fw -
Throws:
java.io.IOException

writeObjects

public void writeObjects(java.io.FileWriter fw)
                  throws java.io.IOException
050224, jmorell: Escritura de la sección OBJECTS según QCAD. Writes a objects section. This section is needed in VER_R13. Note that this method currently only writes a faked OBJECTS section to make the file readable by Aut*cad.

Throws:
java.io.IOException

reProject

public void reProject(ICoordTrans rp)
Habilita la reproyección cartográfica

Specified by:
reProject in interface Projected
Specified by:
reProject in class GeoFile

close

public void close()
Specified by:
close in class GeoFile

isCadFlag

public boolean isCadFlag()
Informa sobre si estamos trabajando con el modelo de datos GIS o con el de CAD

Returns:
Returns the cadFlag.

setCadFlag

public void setCadFlag(boolean cadFlag)
Establece si trabajamos con el modelo de datos GIS o con el de CAD

Parameters:
cadFlag - The cadFlag to set.