com.iver.cit.gvsig.fmap.drivers.dgn
Class DGNReader

java.lang.Object
  extended bycom.iver.cit.gvsig.fmap.drivers.dgn.DGNReader

public class DGNReader
extends java.lang.Object

Clase dedicada a leer del fichero DGN.

Author:
FJP

Constructor Summary
DGNReader(java.lang.String pathFich)
          Crea un nuevo DGNReader.
 
Method Summary
 void DGNDumpElement(DGNInfo psInfo, DGNElemCore psElement, java.lang.String fp)
          Muestra por consola los elementos que contiene el DGN.
 double[] DGNGetRawExtents(DGNInfo info, byte[] pabyRawData, DGNElemCore elemento)
          Devuelve los extent de una fila.
 int DGNGetShapeFillInfo(DGNElemCore psElem)
          Fetch fill color for a shape.
 int DGNGotoElement(int element_id)
          Seek to indicated element.
 java.awt.Color DGNLookupColor(int color_index)
          Translate color index into RGB values.
 DGNElemCore DGNReadElement()
          DOCUMENT ME!
 java.awt.geom.Rectangle2D getBoundingBox()
          Devuelve el rectángulo del extent.
 DGNInfo getInfo()
          Devuelve la información del DGN.
 int getNumEntities()
          Devuelve el número de elementos.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DGNReader

public DGNReader(java.lang.String pathFich)
Crea un nuevo DGNReader.

Parameters:
pathFich - DOCUMENT ME!
Method Detail

getInfo

public DGNInfo getInfo()
Devuelve la información del DGN.

Returns:
DGNInfo Información.

getNumEntities

public int getNumEntities()
Devuelve el número de elementos.

Returns:
Número de elementos.

getBoundingBox

public java.awt.geom.Rectangle2D getBoundingBox()
Devuelve el rectángulo del extent.

Returns:
Rectángulo.

DGNGotoElement

public int DGNGotoElement(int element_id)
Seek to indicated element. Changes what element will be read on the next call to DGNReadElement(). Note that this function requires and index, and one will be built if not already available.

Parameters:
element_id - the element to seek to. These values are sequentially ordered starting at zero for the first element.
Returns:
returns TRUE on success or FALSE on failure.

DGNReadElement

public DGNElemCore DGNReadElement()
DOCUMENT ME!

Returns:
DOCUMENT ME!

DGNGetRawExtents

public double[] DGNGetRawExtents(DGNInfo info,
                                 byte[] pabyRawData,
                                 DGNElemCore elemento)
Devuelve los extent de una fila.

Parameters:
info - Información del DGN.
pabyRawData - Vector de byte.
elemento - Elemento.
Returns:
Vector de double.

DGNDumpElement

public void DGNDumpElement(DGNInfo psInfo,
                           DGNElemCore psElement,
                           java.lang.String fp)
Muestra por consola los elementos que contiene el DGN.

Parameters:
psInfo - Información del DGN.
psElement - elemento
fp - path del fichero.

DGNLookupColor

public java.awt.Color DGNLookupColor(int color_index)
Translate color index into RGB values. If no color table has yet been encountered in the file a hard-coded "default" color table will be used. This seems to be what Microstation uses as a color table when there isn't one in a DGN file but I am not absolutely convinced it is appropriate.

Parameters:
color_index - the color index to lookup.
Returns:
TRUE on success or FALSE on failure. May fail if color_index is out of range.

DGNGetShapeFillInfo

public int DGNGetShapeFillInfo(DGNElemCore psElem)
Fetch fill color for a shape. This method will check for a 0x0041 user attribute linkaged with fill color information for the element. If found the function returns TRUE, and places the fill color in pnColor, otherwise FALSE is returned and pnColor is not updated.

Parameters:
psElem - the element.
Returns:
index of color on success or -1 on failure.