Revision 406
tags/org.gvsig.dwg-2.0.92/org.gvsig.dwg.app/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
|
|
3 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
4 |
|
|
5 |
<modelVersion>4.0.0</modelVersion> |
|
6 |
<artifactId>org.gvsig.dwg.app</artifactId> |
|
7 |
<packaging>pom</packaging> |
|
8 |
<name>${project.artifactId}</name> |
|
9 |
<parent> |
|
10 |
<groupId>org.gvsig</groupId> |
|
11 |
<artifactId>org.gvsig.dwg</artifactId> |
|
12 |
<version>2.0.92</version> |
|
13 |
</parent> |
|
14 |
|
|
15 |
<modules> |
|
16 |
<module>org.gvsig.dwg.app.mainplugin</module> |
|
17 |
</modules> |
|
18 |
|
|
19 |
|
|
20 |
</project> |
tags/org.gvsig.dwg-2.0.92/org.gvsig.dwg.app/org.gvsig.dwg.app.mainplugin/buildNumber.properties | ||
---|---|---|
1 |
#Fri Oct 05 13:28:05 CEST 2018 |
|
2 |
buildNumber=2160 |
tags/org.gvsig.dwg-2.0.92/org.gvsig.dwg.app/org.gvsig.dwg.app.mainplugin/src/main/assembly/gvsig-plugin-package.xml | ||
---|---|---|
1 |
<assembly> |
|
2 |
<id>gvsig-plugin-package</id> |
|
3 |
<formats> |
|
4 |
<format>zip</format> |
|
5 |
</formats> |
|
6 |
<baseDirectory>${project.artifactId}</baseDirectory> |
|
7 |
<includeBaseDirectory>true</includeBaseDirectory> |
|
8 |
<files> |
|
9 |
<file> |
|
10 |
<source>target/${project.artifactId}-${project.version}.jar</source> |
|
11 |
<outputDirectory>lib</outputDirectory> |
|
12 |
</file> |
|
13 |
<file> |
|
14 |
<source>target/package.info</source> |
|
15 |
</file> |
|
16 |
</files> |
|
17 |
|
|
18 |
<fileSets> |
|
19 |
<fileSet> |
|
20 |
<directory>src/main/resources-plugin</directory> |
|
21 |
<outputDirectory>.</outputDirectory> |
|
22 |
</fileSet> |
|
23 |
</fileSets> |
|
24 |
|
|
25 |
<dependencySets> |
|
26 |
<dependencySet> |
|
27 |
<useProjectArtifact>false</useProjectArtifact> |
|
28 |
<useTransitiveDependencies>false</useTransitiveDependencies> |
|
29 |
<outputDirectory>lib</outputDirectory> |
|
30 |
<includes> |
|
31 |
<include>org.gvsig:org.gvsig.dwg.provider.legend</include> |
|
32 |
<include>org.gvsig:org.gvsig.dwg.provider</include> |
|
33 |
<include>org.gvsig:org.gvsig.dwg.lib</include> |
|
34 |
</includes> |
|
35 |
</dependencySet> |
|
36 |
</dependencySets> |
|
37 |
|
|
38 |
</assembly> |
tags/org.gvsig.dwg-2.0.92/org.gvsig.dwg.app/org.gvsig.dwg.app.mainplugin/src/main/java/org/gvsig/dwg/DWGRegisterExtension.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
package org.gvsig.dwg; |
|
23 |
|
|
24 |
import org.gvsig.andami.IconThemeHelper; |
|
25 |
import org.gvsig.andami.plugins.Extension; |
|
26 |
import org.gvsig.dwg.fmap.dal.store.dwg.DWGStoreProvider; |
|
27 |
import org.gvsig.fmap.mapcontext.MapContextLocator; |
|
28 |
|
|
29 |
/** |
|
30 |
* Dummy DWG extension, as all the registration happens in the |
|
31 |
* {@link DWGLibrary}. |
|
32 |
* |
|
33 |
* @author gvSIG Team |
|
34 |
*/ |
|
35 |
public class DWGRegisterExtension extends Extension { |
|
36 |
|
|
37 |
public void execute(String actionCommand) { |
|
38 |
// Nothing to do |
|
39 |
} |
|
40 |
|
|
41 |
public void initialize() { |
|
42 |
IconThemeHelper.registerIcon("layer", "layer-icon-dwg", this); |
|
43 |
} |
|
44 |
|
|
45 |
public void postInitialize() { |
|
46 |
MapContextLocator.getMapContextManager().registerIconLayer(DWGStoreProvider.NAME, "layer-icon-dwg"); |
|
47 |
} |
|
48 |
|
|
49 |
public boolean isEnabled() { |
|
50 |
// Nothing to do |
|
51 |
return false; |
|
52 |
} |
|
53 |
|
|
54 |
public boolean isVisible() { |
|
55 |
// Nothing to do |
|
56 |
return false; |
|
57 |
} |
|
58 |
|
|
59 |
} |
tags/org.gvsig.dwg-2.0.92/org.gvsig.dwg.app/org.gvsig.dwg.app.mainplugin/src/main/resources-plugin/config.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
<plugin-config> |
|
3 |
<libraries library-dir="lib"> |
|
4 |
</libraries> |
|
5 |
<depends plugin-name="org.gvsig.app.mainplugin"/> |
|
6 |
<resourceBundle name="text"/> |
|
7 |
<extensions> |
|
8 |
<extension class-name="org.gvsig.dwg.DWGRegisterExtension" |
|
9 |
description="DWG Driver" |
|
10 |
active="true"> |
|
11 |
</extension> |
|
12 |
|
|
13 |
</extensions> |
|
14 |
</plugin-config> |
tags/org.gvsig.dwg-2.0.92/org.gvsig.dwg.app/org.gvsig.dwg.app.mainplugin/src/test/java/org/gvsig/dwg/fmap/dal/store/dwg/TestDWG.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2008 IVER T.I. S.A. {{Task}} |
|
26 |
*/ |
|
27 |
|
|
28 |
package org.gvsig.dwg.fmap.dal.store.dwg; |
|
29 |
|
|
30 |
import java.io.File; |
|
31 |
|
|
32 |
import org.gvsig.fmap.dal.DataStoreParameters; |
|
33 |
import org.gvsig.fmap.dal.exception.DataException; |
|
34 |
import org.gvsig.fmap.dal.feature.BaseTestFeatureStore; |
|
35 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
36 |
|
|
37 |
public class TestDWG extends BaseTestFeatureStore { |
|
38 |
|
|
39 |
|
|
40 |
protected boolean testDXFInitialized = false; |
|
41 |
|
|
42 |
public static File file_prueba = new File(TestDWG.class.getResource( |
|
43 |
"data/V2000.dwg").getFile()); |
|
44 |
|
|
45 |
/* |
|
46 |
* (non-Javadoc) |
|
47 |
* |
|
48 |
* @see |
|
49 |
* org.gvsig.fmap.dal.feature.BaseTestFeatureStore#getDefaultDataStoreParameters |
|
50 |
* () |
|
51 |
*/ |
|
52 |
public DataStoreParameters getDefaultDataStoreParameters() |
|
53 |
throws DataException { |
|
54 |
DWGStoreParameters dwgParameters = null; |
|
55 |
|
|
56 |
dwgParameters = (DWGStoreParameters) dataManager |
|
57 |
.createStoreParameters(DWGStoreProvider.NAME); |
|
58 |
|
|
59 |
dwgParameters.setFile(file_prueba); |
|
60 |
dwgParameters.setCRS("EPSG:23030"); |
|
61 |
return dwgParameters; |
|
62 |
} |
|
63 |
|
|
64 |
/* |
|
65 |
* (non-Javadoc) |
|
66 |
* |
|
67 |
* @see org.gvsig.fmap.dal.feature.BaseTestFeatureStore#hasExplorer() |
|
68 |
*/ |
|
69 |
public boolean hasExplorer() { |
|
70 |
// TODO Auto-generated method stub |
|
71 |
return false; |
|
72 |
} |
|
73 |
|
|
74 |
public boolean usesResources() { |
|
75 |
return true; |
|
76 |
} |
|
77 |
|
|
78 |
|
|
79 |
public void testLegendAndLabeling() throws Exception { |
|
80 |
DataStoreParameters params = getDefaultDataStoreParameters(); |
|
81 |
FeatureStore store = (FeatureStore) dataManager.openStore(params |
|
82 |
.getDataStoreName(), params); |
|
83 |
|
|
84 |
assertNotNull(store.invokeDynMethod("getLegend", null)); |
|
85 |
assertNotNull(store.invokeDynMethod("getLabeling", null)); |
|
86 |
store.dispose(); |
|
87 |
} |
|
88 |
} |
tags/org.gvsig.dwg-2.0.92/org.gvsig.dwg.app/org.gvsig.dwg.app.mainplugin/src/test/java/org/gvsig/dwg/fmap/dal/store/dwg/TestDWG2004.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 2 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
|
|
23 |
/* |
|
24 |
* AUTHORS (In addition to CIT): |
|
25 |
* 2009 IVER T.I {{Task}} |
|
26 |
*/ |
|
27 |
|
|
28 |
package org.gvsig.dwg.fmap.dal.store.dwg; |
|
29 |
|
|
30 |
import java.io.File; |
|
31 |
|
|
32 |
public class TestDWG2004 extends TestDWG { |
|
33 |
public static File file_prueba = new File(TestDWG.class.getResource( |
|
34 |
"data/V2004.dwg").getFile()); |
|
35 |
} |
tags/org.gvsig.dwg-2.0.92/org.gvsig.dwg.app/org.gvsig.dwg.app.mainplugin/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
|
|
3 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
4 |
|
|
5 |
<modelVersion>4.0.0</modelVersion> |
|
6 |
<artifactId>org.gvsig.dwg.app.mainplugin</artifactId> |
|
7 |
<packaging>jar</packaging> |
|
8 |
<name>${project.artifactId}</name> |
|
9 |
<description> |
|
10 |
DWG file format support (read-only) |
|
11 |
|
|
12 |
Supported versions: |
|
13 |
- v12 |
|
14 |
- v14 |
|
15 |
- v15 |
|
16 |
- v2004 |
|
17 |
|
|
18 |
</description> |
|
19 |
<parent> |
|
20 |
<groupId>org.gvsig</groupId> |
|
21 |
<artifactId>org.gvsig.dwg.app</artifactId> |
|
22 |
<version>2.0.92</version> |
|
23 |
</parent> |
|
24 |
|
|
25 |
<dependencies> |
|
26 |
<dependency> |
|
27 |
<groupId>org.gvsig</groupId> |
|
28 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
29 |
<scope>compile</scope> |
|
30 |
</dependency> |
|
31 |
<dependency> |
|
32 |
<groupId>org.gvsig</groupId> |
|
33 |
<artifactId>org.gvsig.andami</artifactId> |
|
34 |
<scope>compile</scope> |
|
35 |
</dependency> |
|
36 |
<dependency> |
|
37 |
<groupId>org.gvsig</groupId> |
|
38 |
<artifactId>org.gvsig.dwg.provider</artifactId> |
|
39 |
<scope>compile</scope> |
|
40 |
</dependency> |
|
41 |
<dependency> |
|
42 |
<groupId>org.gvsig</groupId> |
|
43 |
<artifactId>org.gvsig.dwg.provider.legend</artifactId> |
|
44 |
<scope>compile</scope> |
|
45 |
</dependency> |
|
46 |
|
|
47 |
<dependency> |
|
48 |
<groupId>org.gvsig</groupId> |
|
49 |
<artifactId>org.gvsig.dwg.lib</artifactId> |
|
50 |
<scope>runtime</scope> |
|
51 |
</dependency> |
|
52 |
|
|
53 |
<!-- Tests --> |
|
54 |
|
|
55 |
<dependency> |
|
56 |
<groupId>org.gvsig</groupId> |
|
57 |
<artifactId>org.gvsig.fmap.dal.impl</artifactId> |
|
58 |
<type>test-jar</type> |
|
59 |
<scope>test</scope> |
|
60 |
</dependency> |
|
61 |
|
|
62 |
<dependency> |
|
63 |
<groupId>org.gvsig</groupId> |
|
64 |
<artifactId>org.gvsig.fmap.dal.impl</artifactId> |
|
65 |
<type>jar</type> |
|
66 |
<scope>test</scope> |
|
67 |
</dependency> |
|
68 |
|
|
69 |
</dependencies> |
|
70 |
|
|
71 |
<properties> |
|
72 |
<!-- Package info property values --> |
|
73 |
<!-- Default values in org.gvsig.desktop --> |
|
74 |
<gvsig.package.info.name>Formats: dwg file format support (read-only)</gvsig.package.info.name> |
|
75 |
<gvsig.package.info.state>testing</gvsig.package.info.state> |
|
76 |
<gvsig.package.info.official>true</gvsig.package.info.official> |
|
77 |
<gvsig.package.info.dependencies>required: org.gvsig.app.mainplugin -ge 2.1.0-A</gvsig.package.info.dependencies> |
|
78 |
<gvsig.package.info.categories>Formats,Vector</gvsig.package.info.categories> |
|
79 |
<gvsig.package.info.poolURL>https://devel.gvsig.org/download/projects/gvsig-dwg/pool</gvsig.package.info.poolURL> |
|
80 |
</properties> |
|
81 |
|
|
82 |
<build> |
|
83 |
<plugins> |
|
84 |
|
|
85 |
<plugin> |
|
86 |
<!-- Skip compilation tests --> |
|
87 |
<groupId>org.apache.maven.plugins</groupId> |
|
88 |
<artifactId>maven-compiler-plugin</artifactId> |
|
89 |
<executions> |
|
90 |
<execution> |
|
91 |
<id>default-testCompile</id> |
|
92 |
<phase>process-test-sources</phase> |
|
93 |
<goals> |
|
94 |
<goal>testCompile</goal> |
|
95 |
</goals> |
|
96 |
<configuration> |
|
97 |
<skip>true</skip> |
|
98 |
</configuration> |
|
99 |
</execution> |
|
100 |
</executions> |
|
101 |
</plugin> |
|
102 |
|
|
103 |
<plugin> |
|
104 |
<!-- Skip test execution --> |
|
105 |
<groupId>org.apache.maven.plugins</groupId> |
|
106 |
<artifactId>maven-surefire-plugin</artifactId> |
|
107 |
<configuration> |
|
108 |
<skipTests>true</skipTests> |
|
109 |
</configuration> |
|
110 |
</plugin> |
|
111 |
|
|
112 |
</plugins> |
|
113 |
</build> |
|
114 |
|
|
115 |
</project> |
|
116 |
|
|
0 | 117 |
tags/org.gvsig.dwg-2.0.92/org.gvsig.dwg.lib/src/test/java/org/gvsig/dwg/lib/DwgTestSuite.java | ||
---|---|---|
1 |
/* |
|
2 |
* Created on 08-feb-2007 |
|
3 |
* |
|
4 |
* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
5 |
* |
|
6 |
* Copyright (C) 2004 IVER T.I. 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 |
* Generalitat Valenciana |
|
25 |
* Conselleria d'Infraestructures i Transport |
|
26 |
* Av. Blasco Ib??ez, 50 |
|
27 |
* 46010 VALENCIA |
|
28 |
* SPAIN |
|
29 |
* |
|
30 |
* +34 963862235 |
|
31 |
* gvsig@gva.es |
|
32 |
* www.gvsig.gva.es |
|
33 |
* |
|
34 |
* or |
|
35 |
* |
|
36 |
* IVER T.I. S.A |
|
37 |
* Salamanca 50 |
|
38 |
* 46005 Valencia |
|
39 |
* Spain |
|
40 |
* |
|
41 |
* +34 963163400 |
|
42 |
* dac@iver.es |
|
43 |
*/ |
|
44 |
/* CVS MESSAGES: |
|
45 |
* |
|
46 |
* $Id: DwgTestSuite.java 28970 2009-05-25 13:27:14Z jmvivo $ |
|
47 |
* $Log$ |
|
48 |
* Revision 1.1.2.1 2007-02-28 07:35:10 jmvivo |
|
49 |
* Actualizado desde el HEAD. |
|
50 |
* |
|
51 |
* Revision 1.1 2007/02/08 20:27:57 azabala |
|
52 |
* *** empty log message *** |
|
53 |
* |
|
54 |
* |
|
55 |
*/ |
|
56 |
package org.gvsig.dwg.lib; |
|
57 |
|
|
58 |
import junit.framework.Test; |
|
59 |
import junit.framework.TestSuite; |
|
60 |
|
|
61 |
public class DwgTestSuite { |
|
62 |
|
|
63 |
public static Test suite() { |
|
64 |
TestSuite suite = new TestSuite("Test for com.iver.cit.jdwglib.dwg"); |
|
65 |
//$JUnit-BEGIN$ |
|
66 |
suite.addTestSuite(DwgFileTest.class); |
|
67 |
//$JUnit-END$ |
|
68 |
return suite; |
|
69 |
} |
|
70 |
|
|
71 |
} |
|
72 |
|
tags/org.gvsig.dwg-2.0.92/org.gvsig.dwg.lib/src/test/java/org/gvsig/dwg/lib/DwgFileTest.java | ||
---|---|---|
1 |
package org.gvsig.dwg.lib; |
|
2 |
|
|
3 |
import java.io.File; |
|
4 |
import java.io.IOException; |
|
5 |
import java.net.URL; |
|
6 |
|
|
7 |
import junit.framework.TestCase; |
|
8 |
|
|
9 |
public class DwgFileTest extends TestCase { |
|
10 |
private File baseDataPath; |
|
11 |
|
|
12 |
protected void setUp() throws Exception { |
|
13 |
super.setUp(); |
|
14 |
URL url = this.getClass().getResource("data"); |
|
15 |
if (url == null) { |
|
16 |
throw new Exception("Can't find 'data' dir"); |
|
17 |
} |
|
18 |
|
|
19 |
baseDataPath = new File(url.getFile()); |
|
20 |
if (!baseDataPath.exists()) { |
|
21 |
throw new Exception("Can't find 'data' dir"); |
|
22 |
} |
|
23 |
|
|
24 |
} |
|
25 |
|
|
26 |
protected void tearDown() throws Exception { |
|
27 |
super.tearDown(); |
|
28 |
} |
|
29 |
public void test1() throws IOException, DwgVersionNotSupportedException { |
|
30 |
// String fileName = baseDataPath.getAbsolutePath()+"/Un punto.dwg"; |
|
31 |
// DwgFile dwg = new DwgFile(fileName); |
|
32 |
// |
|
33 |
// dwg.read(); |
|
34 |
// dwg.calculateGisModelDwgPolylines(); |
|
35 |
// dwg.blockManagement(); |
|
36 |
// LinkedList dwgObjects = dwg.getDwgObjects(); |
|
37 |
} |
|
38 |
|
|
39 |
public void test2() throws RuntimeException, CorruptedDwgEntityException{ |
|
40 |
//Dwg Object that is supposed to be |
|
41 |
//an LWPOLYLINE in V14 version |
|
42 |
/* |
|
43 |
int[] data = new int[]{61,64,64,183,19,227,104,16 |
|
44 |
,0,5,8,59,72,32,252,47,90,142, |
|
45 |
234,145,50,10,71,11,213,36,229, |
|
46 |
162,130,10,228,126,23,174,130, |
|
47 |
145,50,15,98,141,196,244,229, |
|
48 |
162,130,12,126,23,169,66,58, |
|
49 |
145,50,12,47,90,138,68,229, |
|
50 |
162,130,8,0,0,4,7,74,137,50, |
|
51 |
15,177,66,231,252,221,162,130, |
|
52 |
9,130,151,21,242,151,21,190, |
|
53 |
8,21,8,56}; |
|
54 |
*/ |
|
55 |
// int[] data = new int[]{62,128,64,71,99, |
|
56 |
// 40,48,0,5,8,27,72, |
|
57 |
// 100,126,23,169,68, |
|
58 |
// 178,105,50,13,114, |
|
59 |
// 63,11,82,165,162,130, |
|
60 |
// 13,114,63,11,210,138, |
|
61 |
// 105,50,8,173,114,59, |
|
62 |
// 138,205,162,130,15,98, |
|
63 |
// 141,192,241,58,105,50, |
|
64 |
// 11,51,51,52,178,229,162, |
|
65 |
// 130,14,110,102,98,97,234, |
|
66 |
// 105,50,11,51,51,52,179,21, |
|
67 |
// 162,130,10,149,192,240,42, |
|
68 |
// 162,105,50,14,189,27,131, |
|
69 |
// 107,69,162,130,14,31,169, |
|
70 |
// 66,227,74,105,50,9,240,86, |
|
71 |
// 185,27,117,162,130,11,59, |
|
72 |
// 51,51,52,234,105,50,13,114, |
|
73 |
// 63,11,83,85,162,130,9,74,228, |
|
74 |
// 126,22,186,105,50,11,51,51,50, |
|
75 |
// 51,53,162,130,11,137,232,82,190, |
|
76 |
// 58,105,50,9,74,228,122,147,13,162, |
|
77 |
// 130,11,137,232,82,189,106,105,50,9, |
|
78 |
// 74,228,122,146,213,162,130,9,74,228,122,20,202,105,50,12,126,23,171,194,173,162,130,12,126,23,169,68,178,105,50,13,114,63,11,82,165,162,130,9,130,151,22,10,136,182,8,21,8,120}; |
|
79 |
// //1er intento: suponemos que la LWPOLYLINE cumple la especificaci?n |
|
80 |
// //a rajatabla |
|
81 |
// int bitPos = 0; |
|
82 |
// List val = DwgUtil.getBitShort(data, bitPos); |
|
83 |
// bitPos = ((Integer) val.get(0)).intValue(); |
|
84 |
// int type = ((Integer) val.get(1)).intValue(); |
|
85 |
// System.out.println("type = " + type); |
|
86 |
// |
|
87 |
// DwgHandleReference hr = new DwgHandleReference(); |
|
88 |
// bitPos = hr.read(data, bitPos); |
|
89 |
// System.out.println("handle, code="+ |
|
90 |
// hr.getCode()+ |
|
91 |
// " ,offset="+ |
|
92 |
// hr.getOffset()); |
|
93 |
// |
|
94 |
// //Ahora pasamos a la extended data |
|
95 |
// val = DwgUtil.getBitShort(data, bitPos); |
|
96 |
// bitPos = ((Integer) val.get(0)).intValue(); |
|
97 |
// int extendedDataSize = ((Integer) val.get(1)).intValue(); |
|
98 |
// System.out.println("EED size="+extendedDataSize); |
|
99 |
// //como el size es 0, me lo salto |
|
100 |
// |
|
101 |
// //ver si tiene datos graficos |
|
102 |
// val = DwgUtil.testBit(data, bitPos); |
|
103 |
// bitPos = ((Integer) val.get(0)).intValue(); |
|
104 |
// boolean hasGraphicsData = ((Boolean) val.get(1)) |
|
105 |
// .booleanValue(); |
|
106 |
// System.out.println("graphics = "+hasGraphicsData); |
|
107 |
// |
|
108 |
// //como se que no hay graphics me lo salto |
|
109 |
// //tama?o en bits |
|
110 |
// val = DwgUtil.getRawLong(data, bitPos); |
|
111 |
// bitPos = ((Integer) val.get(0)).intValue(); |
|
112 |
// int sizeInBits = ((Integer) val.get(1)).intValue(); |
|
113 |
// System.out.println("sizeInBits = "+sizeInBits); |
|
114 |
// |
|
115 |
// /* |
|
116 |
// * Ahora, lo que viene es lo que en la spec se dice |
|
117 |
// * "Common entity data". Revisar bien pues PythonCAD no lo lee |
|
118 |
// * como en la spec. |
|
119 |
// * |
|
120 |
// * pag 42. |
|
121 |
// R13-R14 Only: |
|
122 |
// RL : Size of object data in bits |
|
123 |
// 6B : Flags (FEDCBA) |
|
124 |
// 6B : Common parameters (CCSSII) |
|
125 |
// Segun esto, deberia leer 6 bits y 6 bits |
|
126 |
// |
|
127 |
// FLAGS |
|
128 |
// Mas adelante (pag 43), dice: |
|
129 |
// DC : This is the number of reactors attached to an |
|
130 |
// entity as a bitshort. |
|
131 |
// This feature may have been dormant in R13, |
|
132 |
// but it appears in R14, and in files saved as R13 by R14. |
|
133 |
// |
|
134 |
// Ahora bien, pythoncad las est? leyendo como bitLong |
|
135 |
// ?En que quedamos, son 2 bits, 1 bitLong o 1 bitShort? |
|
136 |
// TODO REVISAR |
|
137 |
// |
|
138 |
// COMMON PARAMETERS |
|
139 |
// Al principio, dice que son 6 bits (CC, SS, II) |
|
140 |
// pero luego dice (pag 43): |
|
141 |
// CC : Color bitshort |
|
142 |
// SS : Linetype scale bitdouble |
|
143 |
// II : "Invisible" flag bitshort |
|
144 |
// |
|
145 |
// Pythoncad, en vez de como 2 bits, los est? leyendo |
|
146 |
// como BitShort, BitDouble y BitShort |
|
147 |
// |
|
148 |
// * */ |
|
149 |
// |
|
150 |
// Integer mode = (Integer) DwgUtil.getBits(data, 2, bitPos); |
|
151 |
// bitPos += 2; |
|
152 |
// System.out.println("mode = "+mode); |
|
153 |
// |
|
154 |
// /* |
|
155 |
// val = DwgUtil.getBitLong(data, bitPos); |
|
156 |
// bitPos = ((Integer) val.get(0)).intValue(); |
|
157 |
// int rnum = ((Integer) val.get(1)).intValue(); |
|
158 |
// System.out.println("numReactors = "+rnum); |
|
159 |
//*/ |
|
160 |
// val = DwgUtil.getBitShort(data, bitPos); |
|
161 |
// bitPos = ((Integer) val.get(0)).intValue(); |
|
162 |
// int rnum = ((Integer) val.get(1)).intValue(); |
|
163 |
// System.out.println("numReactors = "+rnum); |
|
164 |
// |
|
165 |
// |
|
166 |
// val = DwgUtil.testBit(data, bitPos); |
|
167 |
// bitPos = ((Integer) val.get(0)).intValue(); |
|
168 |
// boolean isLyrByLineType = ((Boolean) val.get(1)).booleanValue(); |
|
169 |
// System.out.println("isLyrByLineType="+isLyrByLineType); |
|
170 |
// |
|
171 |
// val = DwgUtil.testBit(data, bitPos); |
|
172 |
// bitPos = ((Integer) val.get(0)).intValue(); |
|
173 |
// boolean noLinks = ((Boolean) val.get(1)).booleanValue(); |
|
174 |
// System.out.println("noLinks="+noLinks); |
|
175 |
// |
|
176 |
// |
|
177 |
// val = DwgUtil.getBitShort(data, bitPos); |
|
178 |
// bitPos = ((Integer) val.get(0)).intValue(); |
|
179 |
// int color = ((Integer) val.get(1)).intValue(); |
|
180 |
// System.out.println("color="+color); |
|
181 |
// |
|
182 |
// |
|
183 |
// val = DwgUtil.getBitDouble(data, bitPos); |
|
184 |
// bitPos = ((Integer) val.get(0)).intValue(); |
|
185 |
// float ltscale = ((Double) val.get(1)).floatValue(); |
|
186 |
// System.out.println("ltscale="+ltscale); |
|
187 |
// |
|
188 |
// val = DwgUtil.getBitShort(data, bitPos); |
|
189 |
// bitPos = ((Integer) val.get(0)).intValue(); |
|
190 |
// int invis = ((Integer) val.get(1)).intValue(); |
|
191 |
// System.out.println("invis="+invis); |
|
192 |
// |
|
193 |
// val = DwgUtil.getBitShort(data, bitPos); |
|
194 |
// bitPos = ((Integer) val.get(0)).intValue(); |
|
195 |
// int flag = ((Integer) val.get(1)).intValue(); |
|
196 |
// System.out.println("flag="+flag); |
|
197 |
// |
|
198 |
// double dVal = 0d; |
|
199 |
// if((flag & 0x4) > 0){ |
|
200 |
// val = DwgUtil.getBitDouble(data, bitPos); |
|
201 |
// bitPos = ((Integer) val.get(0)).intValue(); |
|
202 |
// dVal = ((Double) val.get(1)).doubleValue(); |
|
203 |
// } |
|
204 |
// System.out.println("constWidth="+dVal); |
|
205 |
// |
|
206 |
// dVal = 0d; |
|
207 |
// if((flag & 0x8) > 0){ |
|
208 |
// val = DwgUtil.getBitDouble(data, bitPos); |
|
209 |
// bitPos = ((Integer) val.get(0)).intValue(); |
|
210 |
// dVal = ((Double) val.get(1)).doubleValue(); |
|
211 |
// } |
|
212 |
// System.out.println("elevation="+dVal); |
|
213 |
// |
|
214 |
// dVal = 0d; |
|
215 |
// if ((flag & 0x2) > 0){ |
|
216 |
// val = DwgUtil.getBitDouble(data, bitPos); |
|
217 |
// bitPos = ((Integer) val.get(0)).intValue(); |
|
218 |
// dVal = ((Double) val.get(1)).doubleValue(); |
|
219 |
// } |
|
220 |
// System.out.println("thickness="+dVal); |
|
221 |
// |
|
222 |
// double x, y, z ; |
|
223 |
// x = 0d; |
|
224 |
// y = 0d; |
|
225 |
// z = 0d; |
|
226 |
// |
|
227 |
// if ((flag & 0x1) > 0){ |
|
228 |
// val = DwgUtil.getBitDouble(data, bitPos); |
|
229 |
// bitPos = ((Integer) val.get(0)).intValue(); |
|
230 |
// x = ((Double) val.get(1)).doubleValue(); |
|
231 |
// |
|
232 |
// val = DwgUtil.getBitDouble(data, bitPos); |
|
233 |
// bitPos = ((Integer) val.get(0)).intValue(); |
|
234 |
// y = ((Double) val.get(1)).doubleValue(); |
|
235 |
// |
|
236 |
// val = DwgUtil.getBitDouble(data, bitPos); |
|
237 |
// bitPos = ((Integer) val.get(0)).intValue(); |
|
238 |
// z = ((Double) val.get(1)).doubleValue(); |
|
239 |
// } |
|
240 |
// System.out.println("normal="+x+","+y+","+z); |
|
241 |
// |
|
242 |
// val = DwgUtil.getBitLong(data, bitPos); |
|
243 |
// bitPos = ((Integer) val.get(0)).intValue(); |
|
244 |
// int np = ((Integer) val.get(1)).intValue(); |
|
245 |
// System.out.println("numPoints="+np); |
|
246 |
// |
|
247 |
// int nb = 0; |
|
248 |
// if((flag & 0x10) > 0){ |
|
249 |
// val = DwgUtil.getBitLong(data, bitPos); |
|
250 |
// bitPos = ((Integer) val.get(0)).intValue(); |
|
251 |
// nb = ((Integer) val.get(1)).intValue(); |
|
252 |
// } |
|
253 |
// System.out.println("numBulges="+nb); |
|
254 |
// int nw = 0; |
|
255 |
// if((flag & 0x20) > 0){ |
|
256 |
// val = DwgUtil.getBitLong(data, bitPos); |
|
257 |
// bitPos = ((Integer) val.get(0)).intValue(); |
|
258 |
// nw = ((Integer) val.get(1)).intValue(); |
|
259 |
// } |
|
260 |
// System.out.println("numWidths="+nw); |
|
261 |
// if(np > 0){ |
|
262 |
// Point2D[] points = new Point2D[np]; |
|
263 |
// for(int i = 0; i < np; i++){ |
|
264 |
// val = DwgUtil.getRawDouble(data, bitPos); |
|
265 |
// bitPos = ((Integer) val.get(0)).intValue(); |
|
266 |
// x = ((Double) val.get(1)).doubleValue(); |
|
267 |
// |
|
268 |
// val = DwgUtil.getRawDouble(data, bitPos); |
|
269 |
// bitPos = ((Integer) val.get(0)).intValue(); |
|
270 |
// y = ((Double) val.get(1)).doubleValue(); |
|
271 |
// |
|
272 |
// points[i] = new Point2D.Double(x, y); |
|
273 |
// System.out.println("Punto"+i+"="+x+","+y); |
|
274 |
// }//for |
|
275 |
// }//if np |
|
276 |
// |
|
277 |
// if(nb > 0){ |
|
278 |
// double[] bulges = new double[nb]; |
|
279 |
// for(int i = 0; i < nb; i++){ |
|
280 |
// val = DwgUtil.getRawDouble(data, bitPos); |
|
281 |
// bitPos = ((Integer) val.get(0)).intValue(); |
|
282 |
// bulges[i] = ((Double) val.get(1)).doubleValue(); |
|
283 |
// System.out.println("Bulge"+i+"="+bulges[i]); |
|
284 |
// }//for |
|
285 |
// |
|
286 |
// }//if nb |
|
287 |
// |
|
288 |
// if(nw > 0){ |
|
289 |
// double[][] widths = new double[nw][2]; |
|
290 |
// for(int i = 0; i < nw; i++){ |
|
291 |
// val = DwgUtil.getBitDouble(data, bitPos); |
|
292 |
// bitPos = ((Integer) val.get(0)).intValue(); |
|
293 |
// double sw = ((Double) val.get(1)).doubleValue(); |
|
294 |
// |
|
295 |
// val = DwgUtil.getBitDouble(data, bitPos); |
|
296 |
// bitPos = ((Integer) val.get(0)).intValue(); |
|
297 |
// double ew = ((Double) val.get(1)).doubleValue(); |
|
298 |
// |
|
299 |
// widths[i][0] = sw; |
|
300 |
// widths[i][1] = ew; |
|
301 |
// System.out.println("Width"+i+"="+sw+","+ew); |
|
302 |
// }//for |
|
303 |
// } |
|
304 |
} |
|
305 |
|
|
306 |
public void test3(){ |
|
307 |
//test of extrusion |
|
308 |
double[] coord = null; |
|
309 |
double[] extrusion = null; |
|
310 |
double[] extrusion2 = new double[]{0, 0, 1}; |
|
311 |
|
|
312 |
coord = new double[]{790089.65, 4477974.75, 9.560000000114087}; |
|
313 |
extrusion = new double[]{-0.5037965987025721, 0.07005064807841195, 0.8609772899673451}; |
|
314 |
//1. algoritmo original, vector normal distinto |
|
315 |
// double[] newCoord = AcadExtrusionCalculator.extrude(coord, extrusion); |
|
316 |
// newCoord = AcadExtrusionCalculator.extrude3(coord, extrusion); |
|
317 |
// |
|
318 |
//2? ahora con vector normal coincidente con eje Z |
|
319 |
// newCoord = AcadExtrusionCalculator.extrude(coord, extrusion2); |
|
320 |
// newCoord = AcadExtrusionCalculator.extrude3(coord, extrusion2); |
|
321 |
} |
|
322 |
} |
tags/org.gvsig.dwg-2.0.92/org.gvsig.dwg.lib/src/main/java/org/gvsig/dwg/lib/readers/IDwgObjectReader.java | ||
---|---|---|
1 |
/* |
|
2 |
* Created on 09-ene-2007 |
|
3 |
* |
|
4 |
* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
5 |
* |
|
6 |
* Copyright (C) 2004 IVER T.I. 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 |
* Generalitat Valenciana |
|
25 |
* Conselleria d'Infraestructures i Transport |
|
26 |
* Av. Blasco Ib??ez, 50 |
|
27 |
* 46010 VALENCIA |
|
28 |
* SPAIN |
|
29 |
* |
|
30 |
* +34 963862235 |
|
31 |
* gvsig@gva.es |
|
32 |
* www.gvsig.gva.es |
|
33 |
* |
|
34 |
* or |
|
35 |
* |
|
36 |
* IVER T.I. S.A |
|
37 |
* Salamanca 50 |
|
38 |
* 46005 Valencia |
|
39 |
* Spain |
|
40 |
* |
|
41 |
* +34 963163400 |
|
42 |
* dac@iver.es |
|
43 |
*/ |
|
44 |
|
|
45 |
package org.gvsig.dwg.lib.readers; |
|
46 |
|
|
47 |
import org.gvsig.dwg.lib.CorruptedDwgEntityException; |
|
48 |
import org.gvsig.dwg.lib.DwgObject; |
|
49 |
|
|
50 |
/** |
|
51 |
* Each dwg entity in the dwg section OBJECTS has a common part |
|
52 |
* and an specific part. |
|
53 |
* This interface has the responsability of reading the specif part. |
|
54 |
* |
|
55 |
* In previous versions of libDwg DwgObject has this responsability, but |
|
56 |
* with the inclusion of new versions of DWG (12, 13, 14, 2004) implementation |
|
57 |
* is function of the dwg entity and the version. |
|
58 |
* |
|
59 |
* |
|
60 |
* |
|
61 |
* @author azabala |
|
62 |
|
|
63 |
*/ |
|
64 |
public interface IDwgObjectReader { |
|
65 |
|
|
66 |
|
|
67 |
/** |
|
68 |
* Reads the specific part of the dwg object |
|
69 |
* @throws Exception |
|
70 |
* */ |
|
71 |
public void readSpecificObj(int[] data, int offset, DwgObject dwgObj) throws RuntimeException, CorruptedDwgEntityException; |
|
72 |
/** |
|
73 |
* Sets the fileReader (wich has the responsability of read |
|
74 |
* head and tail of a dwg object) |
|
75 |
* */ |
|
76 |
public void setFileReader(IDwgFileReader headTailReader); |
|
77 |
} |
tags/org.gvsig.dwg-2.0.92/org.gvsig.dwg.lib/src/main/java/org/gvsig/dwg/lib/readers/DwgObjectReaderPool.java | ||
---|---|---|
1 |
/* |
|
2 |
* Created on 09-ene-2007 |
|
3 |
* |
|
4 |
* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana |
|
5 |
* |
|
6 |
* Copyright (C) 2004 IVER T.I. 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 |
* Generalitat Valenciana |
|
25 |
* Conselleria d'Infraestructures i Transport |
|
26 |
* Av. Blasco Ib��ez, 50 |
|
27 |
* 46010 VALENCIA |
|
28 |
* SPAIN |
|
29 |
* |
|
30 |
* +34 963862235 |
|
31 |
* gvsig@gva.es |
|
32 |
* www.gvsig.gva.es |
|
33 |
* |
|
34 |
* or |
|
35 |
* |
|
36 |
* IVER T.I. S.A |
|
37 |
* Salamanca 50 |
|
38 |
* 46005 Valencia |
|
39 |
* Spain |
|
40 |
* |
|
41 |
* +34 963163400 |
|
42 |
* dac@iver.es |
|
43 |
*/ |
|
44 |
package org.gvsig.dwg.lib.readers; |
|
45 |
|
|
46 |
import java.util.HashMap; |
|
47 |
import java.util.Map; |
|
48 |
|
|
49 |
import org.gvsig.dwg.lib.DwgObject; |
|
50 |
import org.gvsig.dwg.lib.objects.DwgArc; |
|
51 |
import org.gvsig.dwg.lib.objects.DwgAttdef; |
|
52 |
import org.gvsig.dwg.lib.objects.DwgAttrib; |
|
53 |
import org.gvsig.dwg.lib.objects.DwgBlock; |
|
54 |
import org.gvsig.dwg.lib.objects.DwgBlockControl; |
|
55 |
import org.gvsig.dwg.lib.objects.DwgBlockHeader; |
|
56 |
import org.gvsig.dwg.lib.objects.DwgCircle; |
|
57 |
import org.gvsig.dwg.lib.objects.DwgDictionary; |
|
58 |
import org.gvsig.dwg.lib.objects.DwgDictionaryVar; |
|
59 |
import org.gvsig.dwg.lib.objects.DwgDimOrd; |
|
60 |
import org.gvsig.dwg.lib.objects.DwgEllipse; |
|
61 |
import org.gvsig.dwg.lib.objects.DwgEndblk; |
|
62 |
import org.gvsig.dwg.lib.objects.DwgFace3D; |
|
63 |
import org.gvsig.dwg.lib.objects.DwgHatch; |
|
64 |
import org.gvsig.dwg.lib.objects.DwgIdBuffer; |
|
65 |
import org.gvsig.dwg.lib.objects.DwgImage; |
|
66 |
import org.gvsig.dwg.lib.objects.DwgImageDef; |
|
67 |
import org.gvsig.dwg.lib.objects.DwgImageDefReactor; |
|
68 |
import org.gvsig.dwg.lib.objects.DwgInsert; |
|
69 |
import org.gvsig.dwg.lib.objects.DwgLayer; |
|
70 |
import org.gvsig.dwg.lib.objects.DwgLayerControl; |
|
71 |
import org.gvsig.dwg.lib.objects.DwgLayerIndex; |
|
72 |
import org.gvsig.dwg.lib.objects.DwgLine; |
|
73 |
import org.gvsig.dwg.lib.objects.DwgLinearDimension; |
|
74 |
import org.gvsig.dwg.lib.objects.DwgLwPolyline; |
|
75 |
import org.gvsig.dwg.lib.objects.DwgMText; |
|
76 |
import org.gvsig.dwg.lib.objects.DwgMeshPolyline; |
|
77 |
import org.gvsig.dwg.lib.objects.DwgMinsert; |
|
78 |
import org.gvsig.dwg.lib.objects.DwgOle2Frame; |
|
79 |
import org.gvsig.dwg.lib.objects.DwgPFacePolyline; |
|
80 |
import org.gvsig.dwg.lib.objects.DwgPoint; |
|
81 |
import org.gvsig.dwg.lib.objects.DwgPolyline2D; |
|
82 |
import org.gvsig.dwg.lib.objects.DwgPolyline3D; |
|
83 |
import org.gvsig.dwg.lib.objects.DwgRasterVariables; |
|
84 |
import org.gvsig.dwg.lib.objects.DwgSeqend; |
|
85 |
import org.gvsig.dwg.lib.objects.DwgSolid; |
|
86 |
import org.gvsig.dwg.lib.objects.DwgSortEntStable; |
|
87 |
import org.gvsig.dwg.lib.objects.DwgSpline; |
|
88 |
import org.gvsig.dwg.lib.objects.DwgText; |
|
89 |
import org.gvsig.dwg.lib.objects.DwgVertex2D; |
|
90 |
import org.gvsig.dwg.lib.objects.DwgVertex3D; |
|
91 |
import org.gvsig.dwg.lib.objects.DwgVertexMesh; |
|
92 |
import org.gvsig.dwg.lib.objects.DwgVertexPFace; |
|
93 |
import org.gvsig.dwg.lib.objects.DwgVertexPFaceFace; |
|
94 |
import org.gvsig.dwg.lib.objects.DwgXRecord; |
|
95 |
import org.gvsig.dwg.lib.readers.v1314.DwgArcReader1314; |
|
96 |
import org.gvsig.dwg.lib.readers.v1314.DwgAttdefReader1314; |
|
97 |
import org.gvsig.dwg.lib.readers.v1314.DwgAttribReader1314; |
|
98 |
import org.gvsig.dwg.lib.readers.v1314.DwgBlockControlReader1314; |
|
99 |
import org.gvsig.dwg.lib.readers.v1314.DwgBlockHeaderReader1314; |
|
100 |
import org.gvsig.dwg.lib.readers.v1314.DwgBlockReader1314; |
|
101 |
import org.gvsig.dwg.lib.readers.v1314.DwgCircleReader1314; |
|
102 |
import org.gvsig.dwg.lib.readers.v1314.DwgDictionaryReader1314; |
|
103 |
import org.gvsig.dwg.lib.readers.v1314.DwgDictionaryVarReader1314; |
|
104 |
import org.gvsig.dwg.lib.readers.v1314.DwgDimOrdReader1314; |
|
105 |
import org.gvsig.dwg.lib.readers.v1314.DwgEllipseReader1314; |
|
106 |
import org.gvsig.dwg.lib.readers.v1314.DwgEndBlkReader1314; |
|
107 |
import org.gvsig.dwg.lib.readers.v1314.DwgFace3DReader1314; |
|
108 |
import org.gvsig.dwg.lib.readers.v1314.DwgHatchReader1314; |
|
109 |
import org.gvsig.dwg.lib.readers.v1314.DwgIdBufferReader1314; |
|
110 |
import org.gvsig.dwg.lib.readers.v1314.DwgImageDefReactor1314; |
|
111 |
import org.gvsig.dwg.lib.readers.v1314.DwgImageDefReader1314; |
|
112 |
import org.gvsig.dwg.lib.readers.v1314.DwgImageReader1314; |
|
113 |
import org.gvsig.dwg.lib.readers.v1314.DwgInsertReader1314; |
|
114 |
import org.gvsig.dwg.lib.readers.v1314.DwgLayerControlReader1314; |
|
115 |
import org.gvsig.dwg.lib.readers.v1314.DwgLayerIndexReader1314; |
|
116 |
import org.gvsig.dwg.lib.readers.v1314.DwgLayerReader1314; |
|
117 |
import org.gvsig.dwg.lib.readers.v1314.DwgLineReader1314; |
|
118 |
import org.gvsig.dwg.lib.readers.v1314.DwgLinearDimensionReader1314; |
|
119 |
import org.gvsig.dwg.lib.readers.v1314.DwgLwPolylineReader1314; |
|
120 |
import org.gvsig.dwg.lib.readers.v1314.DwgMTextReader1314; |
|
121 |
import org.gvsig.dwg.lib.readers.v1314.DwgMeshReader1314; |
|
122 |
import org.gvsig.dwg.lib.readers.v1314.DwgMinsertReader1314; |
|
123 |
import org.gvsig.dwg.lib.readers.v1314.DwgOle2FrameReader1314; |
|
124 |
import org.gvsig.dwg.lib.readers.v1314.DwgPFaceReader1314; |
|
125 |
import org.gvsig.dwg.lib.readers.v1314.DwgPointReader1314; |
|
126 |
import org.gvsig.dwg.lib.readers.v1314.DwgPolyline2DReader1314; |
|
127 |
import org.gvsig.dwg.lib.readers.v1314.DwgPolyline3DReader1314; |
|
128 |
import org.gvsig.dwg.lib.readers.v1314.DwgRasterVariablesReader1314; |
|
129 |
import org.gvsig.dwg.lib.readers.v1314.DwgSeqEndReader1314; |
|
130 |
import org.gvsig.dwg.lib.readers.v1314.DwgSolidReader1314; |
|
131 |
import org.gvsig.dwg.lib.readers.v1314.DwgSortEntsTableReader1314; |
|
132 |
import org.gvsig.dwg.lib.readers.v1314.DwgSplineReader1314; |
|
133 |
import org.gvsig.dwg.lib.readers.v1314.DwgTextReader1314; |
|
134 |
import org.gvsig.dwg.lib.readers.v1314.DwgVertex2DReader1314; |
|
135 |
import org.gvsig.dwg.lib.readers.v1314.DwgVertex3DReader1314; |
|
136 |
import org.gvsig.dwg.lib.readers.v1314.DwgVertexMeshReader1314; |
|
137 |
import org.gvsig.dwg.lib.readers.v1314.DwgVertexPFaceFaceReader1314; |
|
138 |
import org.gvsig.dwg.lib.readers.v1314.DwgVertexPFaceReader1314; |
|
139 |
import org.gvsig.dwg.lib.readers.v1314.DwgXrecordReader1314; |
|
140 |
import org.gvsig.dwg.lib.readers.v15.DwgArcReader15; |
|
141 |
import org.gvsig.dwg.lib.readers.v15.DwgAttdefReader15; |
|
142 |
import org.gvsig.dwg.lib.readers.v15.DwgAttribReader15; |
|
143 |
import org.gvsig.dwg.lib.readers.v15.DwgBlockControlReader15; |
|
144 |
import org.gvsig.dwg.lib.readers.v15.DwgBlockHeaderReader15; |
|
145 |
import org.gvsig.dwg.lib.readers.v15.DwgBlockReader15; |
|
146 |
import org.gvsig.dwg.lib.readers.v15.DwgCircleReader15; |
|
147 |
import org.gvsig.dwg.lib.readers.v15.DwgDictionaryReader15; |
|
148 |
import org.gvsig.dwg.lib.readers.v15.DwgEllipseReader15; |
|
149 |
import org.gvsig.dwg.lib.readers.v15.DwgEndBlkReader15; |
|
150 |
import org.gvsig.dwg.lib.readers.v15.DwgInsertReader15; |
|
151 |
import org.gvsig.dwg.lib.readers.v15.DwgLayerControlReader15; |
|
152 |
import org.gvsig.dwg.lib.readers.v15.DwgLayerReader15; |
|
153 |
import org.gvsig.dwg.lib.readers.v15.DwgLineReader15; |
|
154 |
import org.gvsig.dwg.lib.readers.v15.DwgLinearDimensionReader15; |
|
155 |
import org.gvsig.dwg.lib.readers.v15.DwgLwPolylineReader15; |
|
156 |
import org.gvsig.dwg.lib.readers.v15.DwgMTextReader15; |
|
157 |
import org.gvsig.dwg.lib.readers.v15.DwgMeshReader15; |
|
158 |
import org.gvsig.dwg.lib.readers.v15.DwgPFaceReader15; |
|
159 |
import org.gvsig.dwg.lib.readers.v15.DwgPointReader15; |
|
160 |
import org.gvsig.dwg.lib.readers.v15.DwgPolyline2DReader15; |
|
161 |
import org.gvsig.dwg.lib.readers.v15.DwgPolyline3DReader15; |
|
162 |
import org.gvsig.dwg.lib.readers.v15.DwgSeqEndReader15; |
|
163 |
import org.gvsig.dwg.lib.readers.v15.DwgSolidReader15; |
|
164 |
import org.gvsig.dwg.lib.readers.v15.DwgSplineReader15; |
|
165 |
import org.gvsig.dwg.lib.readers.v15.DwgTextReader15; |
|
166 |
import org.gvsig.dwg.lib.readers.v15.DwgVertex2DReader15; |
|
167 |
import org.gvsig.dwg.lib.readers.v15.DwgVertex3DReader15; |
|
168 |
import org.gvsig.dwg.lib.readers.v15.DwgVertexMeshReader15; |
|
169 |
import org.gvsig.dwg.lib.readers.v15.DwgVertexPFaceFaceReader15; |
|
170 |
import org.gvsig.dwg.lib.readers.v15.DwgVertexPFaceReader15; |
|
171 |
import org.gvsig.dwg.lib.readers.v2004.DwgArcReader2004; |
|
172 |
import org.gvsig.dwg.lib.readers.v2004.DwgAttdefReader2004; |
|
173 |
import org.gvsig.dwg.lib.readers.v2004.DwgAttribReader2004; |
|
174 |
import org.gvsig.dwg.lib.readers.v2004.DwgBlockControlReader2004; |
|
175 |
import org.gvsig.dwg.lib.readers.v2004.DwgBlockHeaderReader2004; |
|
176 |
import org.gvsig.dwg.lib.readers.v2004.DwgBlockReader2004; |
|
177 |
import org.gvsig.dwg.lib.readers.v2004.DwgCircleReader2004; |
|
178 |
import org.gvsig.dwg.lib.readers.v2004.DwgDictionaryReader2004; |
|
179 |
import org.gvsig.dwg.lib.readers.v2004.DwgEllipseReader2004; |
|
180 |
import org.gvsig.dwg.lib.readers.v2004.DwgEndBlkReader2004; |
|
181 |
import org.gvsig.dwg.lib.readers.v2004.DwgInsertReader2004; |
|
182 |
import org.gvsig.dwg.lib.readers.v2004.DwgLayerControlReader2004; |
|
183 |
import org.gvsig.dwg.lib.readers.v2004.DwgLayerReader2004; |
|
184 |
import org.gvsig.dwg.lib.readers.v2004.DwgLineReader2004; |
|
185 |
import org.gvsig.dwg.lib.readers.v2004.DwgLinearDimensionReader2004; |
|
186 |
import org.gvsig.dwg.lib.readers.v2004.DwgLwPolylineReader2004; |
|
187 |
import org.gvsig.dwg.lib.readers.v2004.DwgMTextReader2004; |
|
188 |
import org.gvsig.dwg.lib.readers.v2004.DwgMeshReader2004; |
|
189 |
import org.gvsig.dwg.lib.readers.v2004.DwgPFaceReader2004; |
|
190 |
import org.gvsig.dwg.lib.readers.v2004.DwgPointReader2004; |
|
191 |
import org.gvsig.dwg.lib.readers.v2004.DwgPolyline2DReader2004; |
|
192 |
import org.gvsig.dwg.lib.readers.v2004.DwgPolyline3DReader2004; |
|
193 |
import org.gvsig.dwg.lib.readers.v2004.DwgSeqEndReader2004; |
|
194 |
import org.gvsig.dwg.lib.readers.v2004.DwgSolidReader2004; |
|
195 |
import org.gvsig.dwg.lib.readers.v2004.DwgSplineReader2004; |
|
196 |
import org.gvsig.dwg.lib.readers.v2004.DwgTextReader2004; |
|
197 |
import org.gvsig.dwg.lib.readers.v2004.DwgVertex2DReader2004; |
|
198 |
import org.gvsig.dwg.lib.readers.v2004.DwgVertex3DReader2004; |
|
199 |
import org.gvsig.dwg.lib.readers.v2004.DwgVertexMeshReader2004; |
|
200 |
import org.gvsig.dwg.lib.readers.v2004.DwgVertexPFaceFaceReader2004; |
|
201 |
import org.gvsig.dwg.lib.readers.v2004.DwgVertexPFaceReader2004; |
|
202 |
|
|
203 |
/** |
|
204 |
* @author azabala |
|
205 |
*/ |
|
206 |
public class DwgObjectReaderPool { |
|
207 |
|
|
208 |
private static final DwgObjectReaderPool _instance = |
|
209 |
new DwgObjectReaderPool(); |
|
210 |
|
|
211 |
private Map obj_readers; |
|
212 |
|
|
213 |
static{ |
|
214 |
|
|
215 |
// READERS FOR DWG V2004 |
|
216 |
_instance.put(DwgArc.class, "2004", new DwgArcReader2004()); |
|
217 |
_instance.put(DwgAttdef.class, "2004", new DwgAttdefReader2004()); |
|
218 |
_instance.put(DwgAttrib.class, "2004", new DwgAttribReader2004()); |
|
219 |
_instance.put(DwgBlock.class, "2004", new DwgBlockReader2004()); |
|
220 |
_instance.put(DwgBlockControl.class, "2004", new DwgBlockControlReader2004()); |
|
221 |
_instance.put(DwgBlockHeader.class, "2004", new DwgBlockHeaderReader2004()); |
|
222 |
_instance.put(DwgCircle.class, "2004", new DwgCircleReader2004()); |
|
223 |
_instance.put(DwgEllipse.class, "2004", new DwgEllipseReader2004()); |
|
224 |
_instance.put(DwgEndblk.class, "2004", new DwgEndBlkReader2004()); |
|
225 |
_instance.put(DwgInsert.class, "2004", new DwgInsertReader2004()); |
|
226 |
_instance.put(DwgLayer.class, "2004", new DwgLayerReader2004()); |
|
227 |
_instance.put(DwgLayerControl.class, "2004", new DwgLayerControlReader2004()); |
|
228 |
_instance.put(DwgLine.class, "2004", new DwgLineReader2004()); |
|
229 |
_instance.put(DwgLinearDimension.class, "2004", new DwgLinearDimensionReader2004()); |
|
230 |
_instance.put(DwgLwPolyline.class, "2004", new DwgLwPolylineReader2004()); |
|
231 |
_instance.put(DwgMText.class, "2004", new DwgMTextReader2004()); |
|
232 |
_instance.put(DwgPoint.class, "2004", new DwgPointReader2004()); |
|
233 |
_instance.put(DwgPolyline2D.class, "2004", new DwgPolyline2DReader2004()); |
|
234 |
_instance.put(DwgPolyline3D.class, "2004", new DwgPolyline3DReader2004()); |
|
235 |
_instance.put(DwgSeqend.class, "2004", new DwgSeqEndReader2004()); |
|
236 |
_instance.put(DwgSpline.class, "2004", new DwgSplineReader2004()); |
|
237 |
_instance.put(DwgText.class, "2004", new DwgTextReader2004()); |
|
238 |
_instance.put(DwgVertex2D.class, "2004", new DwgVertex2DReader2004()); |
|
239 |
_instance.put(DwgVertex3D.class, "2004", new DwgVertex3DReader2004()); |
|
240 |
_instance.put(DwgDictionary.class, "2004", new DwgDictionaryReader2004()); |
|
241 |
_instance.put(DwgVertexPFace.class, "2004", new DwgVertexPFaceReader2004()); |
|
242 |
_instance.put(DwgVertexPFaceFace.class, "2004", new DwgVertexPFaceFaceReader2004()); |
|
243 |
_instance.put(DwgPFacePolyline.class, "2004", new DwgPFaceReader2004()); |
|
244 |
_instance.put(DwgMeshPolyline.class, "2004", new DwgMeshReader2004()); |
|
245 |
_instance.put(DwgVertexMesh.class, "2004", new DwgVertexMeshReader2004()); |
|
246 |
_instance.put(DwgSolid.class, "2004", new DwgSolidReader2004()); |
|
247 |
|
|
248 |
//READERS FOR DWG V15 |
|
249 |
_instance.put(DwgArc.class, "15", new DwgArcReader15()); |
|
250 |
_instance.put(DwgAttdef.class, "15", new DwgAttdefReader15()); |
|
251 |
_instance.put(DwgAttrib.class, "15", new DwgAttribReader15()); |
|
252 |
_instance.put(DwgBlock.class, "15", new DwgBlockReader15()); |
|
253 |
_instance.put(DwgBlockControl.class, "15", new DwgBlockControlReader15()); |
|
254 |
_instance.put(DwgBlockHeader.class, "15", new DwgBlockHeaderReader15()); |
|
255 |
_instance.put(DwgCircle.class, "15", new DwgCircleReader15()); |
|
256 |
_instance.put(DwgEllipse.class, "15", new DwgEllipseReader15()); |
|
257 |
_instance.put(DwgEndblk.class, "15", new DwgEndBlkReader15()); |
|
258 |
_instance.put(DwgInsert.class, "15", new DwgInsertReader15()); |
|
259 |
_instance.put(DwgLayer.class, "15", new DwgLayerReader15()); |
|
260 |
_instance.put(DwgLayerControl.class, "15", new DwgLayerControlReader15()); |
|
261 |
_instance.put(DwgLine.class, "15", new DwgLineReader15()); |
|
262 |
_instance.put(DwgLinearDimension.class, "15", new DwgLinearDimensionReader15()); |
|
263 |
_instance.put(DwgLwPolyline.class, "15", new DwgLwPolylineReader15()); |
|
264 |
_instance.put(DwgMText.class, "15", new DwgMTextReader15()); |
|
265 |
_instance.put(DwgPoint.class, "15", new DwgPointReader15()); |
|
266 |
_instance.put(DwgPolyline2D.class, "15", new DwgPolyline2DReader15()); |
|
267 |
_instance.put(DwgPolyline3D.class, "15", new DwgPolyline3DReader15()); |
|
268 |
_instance.put(DwgSeqend.class, "15", new DwgSeqEndReader15()); |
|
269 |
// _instance.put(DwgSolid.class, "15", new DwgSolidReader15()); |
|
270 |
_instance.put(DwgSpline.class, "15", new DwgSplineReader15()); |
|
271 |
_instance.put(DwgText.class, "15", new DwgTextReader15()); |
|
272 |
_instance.put(DwgVertex2D.class, "15", new DwgVertex2DReader15()); |
|
273 |
_instance.put(DwgVertex3D.class, "15", new DwgVertex3DReader15()); |
|
274 |
_instance.put(DwgDictionary.class, "15", new DwgDictionaryReader15()); |
|
275 |
_instance.put(DwgVertexPFace.class, "15", new DwgVertexPFaceReader15()); |
|
276 |
_instance.put(DwgVertexPFaceFace.class, "15", new DwgVertexPFaceFaceReader15()); |
|
277 |
_instance.put(DwgPFacePolyline.class, "15", new DwgPFaceReader15()); |
|
278 |
_instance.put(DwgMeshPolyline.class, "15", new DwgMeshReader15()); |
|
279 |
_instance.put(DwgVertexMesh.class, "15", new DwgVertexMeshReader15()); |
|
280 |
|
|
281 |
//READERS FOR DWG V13 AND V14 |
|
282 |
_instance.put(DwgArc.class, "1314", new DwgArcReader1314()); |
|
283 |
_instance.put(DwgAttdef.class, "1314", new DwgAttdefReader1314()); |
|
284 |
_instance.put(DwgAttrib.class, "1314", new DwgAttribReader1314()); |
|
285 |
_instance.put(DwgBlock.class, "1314", new DwgBlockReader1314()); |
|
286 |
_instance.put(DwgBlockControl.class, "1314", new DwgBlockControlReader1314()); |
|
287 |
_instance.put(DwgBlockHeader.class, "1314", new DwgBlockHeaderReader1314()); |
|
288 |
_instance.put(DwgCircle.class, "1314", new DwgCircleReader1314()); |
|
289 |
_instance.put(DwgDictionary.class, "1314", new DwgDictionaryReader1314()); |
|
290 |
_instance.put(DwgDictionaryVar.class, "1314", new DwgDictionaryVarReader1314()); |
|
291 |
_instance.put(DwgDimOrd.class, "1314", new DwgDimOrdReader1314()); |
|
292 |
_instance.put(DwgEllipse.class, "1314", new DwgEllipseReader1314()); |
|
293 |
_instance.put(DwgEndblk.class, "1314", new DwgEndBlkReader1314()); |
|
294 |
_instance.put(DwgFace3D.class, "1314", new DwgFace3DReader1314()); |
|
295 |
_instance.put(DwgHatch.class, "1314", new DwgHatchReader1314()); |
|
296 |
_instance.put(DwgIdBuffer.class, "1314", new DwgIdBufferReader1314()); |
|
297 |
_instance.put(DwgImageDefReactor.class, "1314", new DwgImageDefReactor1314()); |
|
298 |
_instance.put(DwgImageDef.class, "1314", new DwgImageDefReader1314()); |
|
299 |
_instance.put(DwgImage.class, "1314", new DwgImageReader1314()); |
|
300 |
_instance.put(DwgInsert.class, "1314", new DwgInsertReader1314()); |
|
301 |
_instance.put(DwgLayer.class, "1314", new DwgLayerReader1314()); |
|
302 |
_instance.put(DwgLayerControl.class, "1314", new DwgLayerControlReader1314()); |
|
303 |
_instance.put(DwgLayerIndex.class, "1314", new DwgLayerIndexReader1314()); |
|
304 |
_instance.put(DwgLine.class, "1314", new DwgLineReader1314()); |
|
305 |
_instance.put(DwgLinearDimension.class, "1314", new DwgLinearDimensionReader1314()); |
|
306 |
_instance.put(DwgLwPolyline.class, "1314", new DwgLwPolylineReader1314()); |
|
307 |
_instance.put(DwgMeshPolyline.class, "1314", new DwgMeshReader1314()); |
|
308 |
_instance.put(DwgMinsert.class, "1314", new DwgMinsertReader1314()); |
|
309 |
_instance.put(DwgMText.class, "1314", new DwgMTextReader1314()); |
|
310 |
_instance.put(DwgOle2Frame.class, "1314", new DwgOle2FrameReader1314()); |
|
311 |
_instance.put(DwgPFacePolyline.class, "1314", new DwgPFaceReader1314()); |
|
312 |
_instance.put(DwgPoint.class, "1314", new DwgPointReader1314()); |
|
313 |
_instance.put(DwgPolyline2D.class, "1314", new DwgPolyline2DReader1314()); |
|
314 |
_instance.put(DwgPolyline3D.class, "1314", new DwgPolyline3DReader1314()); |
|
315 |
_instance.put(DwgRasterVariables.class, "1314", new DwgRasterVariablesReader1314()); |
|
316 |
_instance.put(DwgSeqend.class, "1314", new DwgSeqEndReader1314()); |
|
317 |
_instance.put(DwgSortEntStable.class, "1314", new DwgSortEntsTableReader1314()); |
|
318 |
// _instance.put(DwgSolid.class, "1314", new DwgSolidReader1314()); |
|
319 |
_instance.put(DwgSpline.class, "1314", new DwgSplineReader1314()); |
|
320 |
_instance.put(DwgText.class, "1314", new DwgTextReader1314()); |
|
321 |
_instance.put(DwgVertex2D.class, "1314", new DwgVertex2DReader1314()); |
|
322 |
_instance.put(DwgVertex3D.class, "1314", new DwgVertex3DReader1314()); |
|
323 |
_instance.put(DwgXRecord.class, "1314", new DwgXrecordReader1314()); |
|
324 |
_instance.put(DwgDictionary.class, "1314", new DwgDictionaryReader1314()); |
|
325 |
_instance.put(DwgVertexPFace.class, "1314", new DwgVertexPFaceReader1314()); |
|
326 |
_instance.put(DwgVertexPFaceFace.class, "1314", new DwgVertexPFaceFaceReader1314()); |
|
327 |
_instance.put(DwgVertexMesh.class, "1314", new DwgVertexMeshReader1314()); |
|
328 |
|
|
329 |
} |
|
330 |
|
|
331 |
|
|
332 |
|
|
333 |
public final static DwgObjectReaderPool getInstance(){ |
|
334 |
return _instance; |
|
335 |
} |
|
336 |
private DwgObjectReaderPool(){ |
|
337 |
obj_readers = new HashMap(); |
|
338 |
} |
|
339 |
|
|
340 |
/**Get the specific reader for an object |
|
341 |
* |
|
342 |
* @param obj Object we want to read |
|
343 |
* @param dwgVersion version of dwg file |
|
344 |
* @return The specific reader |
|
345 |
*/ |
|
346 |
public IDwgObjectReader get(DwgObject obj, String dwgVersion){ |
|
347 |
|
|
348 |
IDwgObjectReader reader = (IDwgObjectReader) obj_readers. |
|
349 |
get(obj.getClass().getName() + dwgVersion); |
|
350 |
// if(reader == null) |
|
351 |
// throw new RuntimeException("No se encuentra la clase para leer "+obj.getClass().getName()); |
|
352 |
return reader; |
|
353 |
|
|
354 |
} |
|
355 |
|
|
356 |
/** |
|
357 |
* Stores in a map the different readers for objects |
|
358 |
* @param dwgObjClass Object's class |
|
359 |
* @param dwgVersion version of dwg file |
|
360 |
* @param reader Specific reader for the object |
|
361 |
*/ |
|
362 |
public void put(Class dwgObjClass, String dwgVersion, IDwgObjectReader reader){ |
|
363 |
if(DwgObject.class.isAssignableFrom(dwgObjClass)) |
|
364 |
obj_readers.put(dwgObjClass.getName()+ dwgVersion, reader); |
|
365 |
else |
|
366 |
throw new RuntimeException("Este pool solo admite como entrada clases de entidad de dibujo gr�fica"); |
|
367 |
} |
|
368 |
|
|
369 |
} |
tags/org.gvsig.dwg-2.0.92/org.gvsig.dwg.lib/src/main/java/org/gvsig/dwg/lib/readers/v15/DwgVertexPFaceReader15.java | ||
---|---|---|
1 |
/* |
|
2 |
* Created on 19-mar-2007 |
|
3 |
* |
|
4 |
* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
5 |
* |
|
6 |
* Copyright (C) 2004 IVER T.I. 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 |
* Generalitat Valenciana |
|
25 |
* Conselleria d'Infraestructures i Transport |
|
26 |
* Av. Blasco Ib??ez, 50 |
|
27 |
* 46010 VALENCIA |
|
28 |
* SPAIN |
|
29 |
* |
|
30 |
* +34 963862235 |
|
31 |
* gvsig@gva.es |
|
32 |
* www.gvsig.gva.es |
|
33 |
* |
|
34 |
* or |
|
35 |
* |
|
36 |
* IVER T.I. S.A |
|
37 |
* Salamanca 50 |
|
38 |
* 46005 Valencia |
|
39 |
* Spain |
|
40 |
* |
|
41 |
* +34 963163400 |
|
42 |
* dac@iver.es |
|
43 |
*/ |
|
44 |
/* CVS MESSAGES: |
|
45 |
* |
|
46 |
* $Id: DwgVertexPFaceReader15.java 28969 2009-05-25 13:23:12Z jmvivo $ |
|
47 |
* $Log$ |
|
48 |
* Revision 1.1.2.1 2007-03-21 19:49:16 azabala |
|
49 |
* implementation of dwg 12, 13, 14. |
|
50 |
* |
|
51 |
* Revision 1.1 2007/03/20 19:57:08 azabala |
|
52 |
* source code cleaning |
|
53 |
* |
|
54 |
* |
|
55 |
*/ |
|
56 |
package org.gvsig.dwg.lib.readers.v15; |
|
57 |
|
|
58 |
import java.util.List; |
|
59 |
|
|
60 |
import org.gvsig.dwg.lib.CorruptedDwgEntityException; |
|
61 |
import org.gvsig.dwg.lib.DwgObject; |
|
62 |
import org.gvsig.dwg.lib.DwgUtil; |
|
63 |
import org.gvsig.dwg.lib.objects.DwgVertexPFace; |
|
64 |
|
|
65 |
|
|
66 |
public class DwgVertexPFaceReader15 extends AbstractDwg15Reader { |
|
67 |
//similar al reader de la versi?n 13-14 |
|
68 |
public void readSpecificObj(int[] data, int offset, DwgObject dwgObj) |
|
69 |
throws RuntimeException, CorruptedDwgEntityException { |
|
70 |
|
|
71 |
if(! (dwgObj instanceof DwgVertexPFace)) |
|
72 |
throw new RuntimeException("ArcReader 14 solo puede leer DwgVertexPFace"); |
|
73 |
DwgVertexPFace v = (DwgVertexPFace) dwgObj; |
|
74 |
|
|
75 |
int bitPos = offset; |
|
76 |
bitPos = headTailReader.readObjectHeader(data, bitPos, v); |
|
77 |
|
|
78 |
List val = DwgUtil.getRawChar(data, bitPos); |
|
79 |
bitPos = ((Integer) val.get(0)).intValue(); |
|
80 |
int flags = ((Integer) val.get(1)).intValue(); |
|
81 |
v.setFlags(flags); |
|
82 |
|
|
83 |
val = DwgUtil.getBitDouble(data, bitPos); |
|
84 |
bitPos = ((Integer) val.get(0)).intValue(); |
|
85 |
double x = ((Double) val.get(1)).doubleValue(); |
|
86 |
|
|
87 |
val = DwgUtil.getBitDouble(data, bitPos); |
|
88 |
bitPos = ((Integer) val.get(0)).intValue(); |
|
89 |
double y = ((Double) val.get(1)).doubleValue(); |
|
90 |
|
|
91 |
val = DwgUtil.getBitDouble(data, bitPos); |
|
92 |
bitPos = ((Integer) val.get(0)).intValue(); |
|
93 |
double z = ((Double) val.get(1)).doubleValue(); |
|
94 |
v.setPoint(new double[]{x, y, z}); |
|
95 |
|
|
96 |
bitPos = headTailReader.readObjectTailer(data, bitPos, v); |
|
97 |
} |
|
98 |
|
|
99 |
} |
|
100 |
|
|
101 |
|
|
102 |
|
tags/org.gvsig.dwg-2.0.92/org.gvsig.dwg.lib/src/main/java/org/gvsig/dwg/lib/readers/v15/DwgLayerReader15.java | ||
---|---|---|
1 |
/* |
|
2 |
* Created on 25-ene-2007 by azabala |
|
3 |
* |
|
4 |
*/ |
|
5 |
package org.gvsig.dwg.lib.readers.v15; |
|
6 |
|
|
7 |
import java.util.ArrayList; |
|
8 |
|
|
9 |
import org.gvsig.dwg.lib.CorruptedDwgEntityException; |
|
10 |
import org.gvsig.dwg.lib.DwgHandleReference; |
|
11 |
import org.gvsig.dwg.lib.DwgObject; |
|
12 |
import org.gvsig.dwg.lib.DwgUtil; |
|
13 |
import org.gvsig.dwg.lib.objects.DwgLayer; |
|
14 |
|
|
15 |
|
|
16 |
/** |
|
17 |
* @author alzabord |
|
18 |
* |
|
19 |
* TODO To change the template for this generated type comment go to |
|
20 |
* Window - Preferences - Java - Code Style - Code Templates |
|
21 |
*/ |
|
22 |
public class DwgLayerReader15 extends AbstractDwg15Reader{ |
|
23 |
|
|
24 |
/* (non-Javadoc) |
|
25 |
* @see com.iver.cit.jdwglib.dwg.readers.IDwgObjectReader#readSpecificObj(int[], int, com.iver.cit.jdwglib.dwg.DwgObject) |
|
26 |
*/ |
|
27 |
public void readSpecificObj(int[] data, int offset, DwgObject dwgObj) throws RuntimeException, CorruptedDwgEntityException { |
|
28 |
if(! (dwgObj instanceof DwgLayer)) |
|
29 |
throw new RuntimeException("LayerReader 15 solo puede leer DwgLayer"); |
|
30 |
//System.out.println("DwgLayer.readDwgLayerV15: offset = "+offset); |
|
31 |
DwgLayer lyr = (DwgLayer) dwgObj; |
|
32 |
int bitPos = offset; |
|
33 |
ArrayList v = DwgUtil.getBitLong(data, bitPos); |
|
34 |
bitPos = ((Integer)v.get(0)).intValue(); |
|
35 |
int numReactors = ((Integer)v.get(1)).intValue(); |
|
36 |
//System.out.println("DwgLayer.readDwgLayerV15: numReactors = "+numReactors); |
|
37 |
lyr.setNumReactors(numReactors); |
|
38 |
v = DwgUtil.getTextString(data, bitPos); |
|
39 |
bitPos = ((Integer)v.get(0)).intValue(); |
|
40 |
String name = (String)v.get(1); |
|
41 |
//System.out.println("DwgLayer.readDwgLayerV15: name = "+name); |
|
42 |
lyr.setName(name); |
|
43 |
v = DwgUtil.testBit(data, bitPos); |
|
44 |
bitPos = ((Integer)v.get(0)).intValue(); |
|
45 |
boolean flag = ((Boolean)v.get(1)).booleanValue(); |
|
46 |
lyr.setFlag64(flag); |
|
47 |
v = DwgUtil.getBitShort(data, bitPos); |
|
48 |
bitPos = ((Integer)v.get(0)).intValue(); |
|
49 |
int xrefplus1 = ((Integer)v.get(1)).intValue(); |
|
50 |
lyr.setXRefPlus(xrefplus1); |
|
51 |
v = DwgUtil.testBit(data, bitPos); |
|
52 |
bitPos = ((Integer)v.get(0)).intValue(); |
|
53 |
boolean xdep = ((Boolean)v.get(1)).booleanValue(); |
|
54 |
lyr.setXdep(xdep); |
|
55 |
v = DwgUtil.getBitShort(data, bitPos); |
|
56 |
bitPos = ((Integer)v.get(0)).intValue(); |
|
57 |
int flags = ((Integer)v.get(1)).intValue(); |
|
58 |
lyr.setFlags(flags); |
|
59 |
v = DwgUtil.getBitShort(data, bitPos); |
|
60 |
bitPos = ((Integer)v.get(0)).intValue(); |
|
61 |
int color = ((Integer)v.get(1)).intValue(); |
|
62 |
lyr.setColor(color); |
|
63 |
|
|
64 |
DwgHandleReference hr = new DwgHandleReference(); |
|
65 |
bitPos = hr.read(data, bitPos); |
|
66 |
lyr.setLayerControlHandle(hr); |
|
67 |
|
|
68 |
//System.out.println("DwgLayer.readDwgLayerV15: Layer Control: " + layerControlHandle); |
Also available in: Unified diff