| | |
| | | |
| | | //~--- JDK imports ------------------------------------------------------------ |
| | | |
| | | import javax.swing.*; |
| | | import java.io.EOFException; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | |
| | | import java.nio.MappedByteBuffer; |
| | | import java.nio.channels.FileChannel; |
| | | import java.nio.channels.ReadableByteChannel; |
| | | import javax.swing.JFileChooser; |
| | | import javax.swing.JFrame; |
| | | |
| | | import org.apache.log4j.LogManager; |
| | | import org.apache.log4j.Logger; |
| | | |
| | | import com.vividsolutions.jts.geom.GeometryFactory; |
| | | |
| | | import com.ximple.util.DgnUtility; |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | public class Dgn7fileReader |
| | | { |
| | | private static final Logger logger = LogManager.getLogger("com.isimple.glyphjump.io.dgn7"); |
| | | private static final Logger logger = LogManager.getLogger(Dgn7fileReader.class); |
| | | |
| | | private Dgn7fileHeader header; |
| | | private ReadableByteChannel channel; |
| | | ByteBuffer buffer; |
| | |
| | | { |
| | | int lowCoorX = buffer.getInt(); |
| | | |
| | | lowCoorX = Utility.convertFromDGN(lowCoorX); |
| | | record.minX = Utility.converUnitToCoord(lowCoorX); |
| | | lowCoorX = DgnUtility.convertFromDGN(lowCoorX); |
| | | record.minX = DgnUtility.converUnitToCoord(lowCoorX); |
| | | |
| | | int lowCoorY = buffer.getInt(); |
| | | |
| | | lowCoorY = Utility.convertFromDGN(lowCoorY); |
| | | record.minY = Utility.converUnitToCoord(lowCoorY); |
| | | lowCoorY = DgnUtility.convertFromDGN(lowCoorY); |
| | | record.minY = DgnUtility.converUnitToCoord(lowCoorY); |
| | | |
| | | int lowCoorZ = buffer.getInt(); |
| | | |
| | | lowCoorZ = Utility.convertFromDGN(lowCoorZ); |
| | | record.minZ = Utility.converUnitToCoord(lowCoorZ); |
| | | lowCoorZ = DgnUtility.convertFromDGN(lowCoorZ); |
| | | record.minZ = DgnUtility.converUnitToCoord(lowCoorZ); |
| | | |
| | | int highCoorX = buffer.getInt(); |
| | | |
| | | highCoorX = Utility.convertFromDGN(highCoorX); |
| | | record.maxX = Utility.converUnitToCoord(highCoorX); |
| | | highCoorX = DgnUtility.convertFromDGN(highCoorX); |
| | | record.maxX = DgnUtility.converUnitToCoord(highCoorX); |
| | | |
| | | int highCoorY = buffer.getInt(); |
| | | |
| | | highCoorY = Utility.convertFromDGN(highCoorY); |
| | | record.maxY = Utility.converUnitToCoord(highCoorY); |
| | | highCoorY = DgnUtility.convertFromDGN(highCoorY); |
| | | record.maxY = DgnUtility.converUnitToCoord(highCoorY); |
| | | |
| | | int highCoorZ = buffer.getInt(); |
| | | |
| | | highCoorZ = Utility.convertFromDGN(highCoorZ); |
| | | record.maxZ = Utility.converUnitToCoord(highCoorZ); |
| | | highCoorZ = DgnUtility.convertFromDGN(highCoorZ); |
| | | record.maxZ = DgnUtility.converUnitToCoord(highCoorZ); |
| | | } |
| | | |
| | | buffer.reset(); |