svn-gvsig-desktop / branches / v10 / libraries / libDwg / src / com / iver / cit / jdwglib / test / Test.java @ 10539
History | View | Annotate | Download (3.53 KB)
1 |
/* jdwglib. Java Library for reading Dwg files.
|
---|---|
2 |
*
|
3 |
* Author: Jose Morell Rama (jose.morell@gmail.com).
|
4 |
* Port from the Pythoncad Dwg library by Art Haas.
|
5 |
*
|
6 |
* Copyright (C) 2005 Jose Morell, IVER TI S.A. and Generalitat Valenciana
|
7 |
*
|
8 |
* This program is free software; you can redistribute it and/or
|
9 |
* modify it under the terms of the GNU General Public License
|
10 |
* as published by the Free Software Foundation; either version 2
|
11 |
* of the License, or (at your option) any later version.
|
12 |
*
|
13 |
* This program is distributed in the hope that it will be useful,
|
14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16 |
* GNU General Public License for more details.
|
17 |
*
|
18 |
* You should have received a copy of the GNU General Public License
|
19 |
* along with this program; if not, write to the Free Software
|
20 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
21 |
*
|
22 |
* For more information, contact:
|
23 |
*
|
24 |
* Jose Morell (jose.morell@gmail.com)
|
25 |
*
|
26 |
* or
|
27 |
*
|
28 |
* IVER TI S.A.
|
29 |
* C/Salamanca, 50
|
30 |
* 46005 Valencia
|
31 |
* Spain
|
32 |
* +34 963163400
|
33 |
* dac@iver.es
|
34 |
*/
|
35 |
package com.iver.cit.jdwglib.test; |
36 |
|
37 |
import java.io.IOException; |
38 |
|
39 |
import com.iver.cit.jdwglib.dwg.DwgFile; |
40 |
import com.iver.cit.jdwglib.dwg.DwgVersionNotSupportedException; |
41 |
|
42 |
/**
|
43 |
* Test class for jdwglib
|
44 |
*
|
45 |
* @author jmorell
|
46 |
*/
|
47 |
public class Test { |
48 |
|
49 |
/**
|
50 |
* Main method of the jdwglib test class
|
51 |
*
|
52 |
* @param args Parameters list
|
53 |
*/
|
54 |
public static void main(String[] args) { |
55 |
new Test();
|
56 |
} |
57 |
|
58 |
/**
|
59 |
* This method is useful to test jdwglib with sets of DWG files
|
60 |
*/
|
61 |
public Test() {
|
62 |
try {
|
63 |
//dwgFile.read("C:/jmorell/data/dwgtests/dwg2000.dwg");
|
64 |
//dwgFile.read("C:/jmorell/data/dwgtests/dwg2000arc.dwg");
|
65 |
//dwgFile.read("c:/jmorell/data/dwgtests/dwg2000lwpline.dwg");
|
66 |
//dwgFile.read("c:/jmorell/data/dwgtests/sabretest2000.dwg");
|
67 |
//dwgFile.read("c:/jmorell/data/dwgtests/lwpline2000.dwg");
|
68 |
//dwgFile.read("c:/jmorell/data/dwgtests/sabretest2000lwp.dwg");
|
69 |
//dwgFile.read("C:/jmorell/data/dwgtests/ycad/hexhouse_lns4.dwg");
|
70 |
//dwgFile.read("C:/jmorell/data/dwgtests/894/e89414_2000_pol.dwg");
|
71 |
//dwgFile.read("C:/jmorell/data/dwgtests/846/e84644_2000.dwg");
|
72 |
//dwgFile.read("D:/jmorell/data/dwgtest/carto/e61443.dwg");
|
73 |
//dwgFile.read("D:/jmorell/data/dwgtest/carto/lwpline1.dwg");
|
74 |
//dwgFile.read("C:/jmorell/data/dwgtests/ycad/fixt3_lns3.dwg");
|
75 |
//dwgFile.read("C:/jmorell/data/dwgtests/lwpline.dwg");
|
76 |
//dwgFile.read("C:/jmorell/data/dwgtests/894/e89414_2000.dwg");
|
77 |
//dwgFile.read("C:/jmorell/data/dwgtests/ycad/blk3.dwg");
|
78 |
//DwgFile dwg = new DwgFile("/media/ntfs/jmorell/data/dwgtest/carto/e72231.dwg");
|
79 |
DwgFile dwg = new DwgFile("C:/jmorell/data/dwgtests/bloques a saco/MOSAICO_MACARAO_2000.dwg"); |
80 |
long t1 = System.currentTimeMillis(); |
81 |
dwg.read(); |
82 |
long t2 = System.currentTimeMillis(); |
83 |
System.out.println("Tiempo empleado por la librerÃa en leer el fichero dwg = " + (t2-t1)); |
84 |
t1 = System.currentTimeMillis();
|
85 |
// dwg.initializeLayerTable();
|
86 |
dwg.calculateGisModelDwgPolylines(); |
87 |
// dwg.applyExtrusions();
|
88 |
// dwg.testDwg3D();
|
89 |
dwg.blockManagement(); |
90 |
t2 = System.currentTimeMillis();
|
91 |
System.out.println("Tiempo empleado por la librerÃa en tratar el fichero dwg = " + (t2-t1)); |
92 |
System.out.println("Java!"); |
93 |
} catch (IOException e) { |
94 |
System.out.println("IOException!"); |
95 |
e.printStackTrace(); |
96 |
} catch (DwgVersionNotSupportedException e) {
|
97 |
// TODO Auto-generated catch block
|
98 |
|
99 |
e.printStackTrace(); |
100 |
} |
101 |
} |
102 |
} |