Revision 24
org.gvsig.dgn/tags/org.gvsig.dgn-2.0.17/org.gvsig.dgn.provider/src/test/java/org/gvsig/fmap/dal/store/dgn/TestDGN.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.fmap.dal.store.dgn; |
|
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 TestDGN extends BaseTestFeatureStore { |
|
38 |
|
|
39 |
public static final File file_prueba = new File(TestDGN.class.getResource( |
|
40 |
"data/prueba.dgn").getFile()); |
|
41 |
|
|
42 |
/* |
|
43 |
* (non-Javadoc) |
|
44 |
* |
|
45 |
* @see |
|
46 |
* org.gvsig.fmap.dal.feature.BaseTestFeatureStore#getDefaultDataStoreParameters |
|
47 |
* () |
|
48 |
*/ |
|
49 |
public DataStoreParameters getDefaultDataStoreParameters() |
|
50 |
throws DataException { |
|
51 |
DGNStoreParameters dgnParameters = null; |
|
52 |
|
|
53 |
dgnParameters = (DGNStoreParameters) dataManager |
|
54 |
.createStoreParameters(DGNStoreProvider.NAME); |
|
55 |
|
|
56 |
dgnParameters.setFile(file_prueba.getAbsolutePath()); |
|
57 |
dgnParameters.setCRS("EPSG:23030"); |
|
58 |
return dgnParameters; |
|
59 |
} |
|
60 |
|
|
61 |
/* |
|
62 |
* (non-Javadoc) |
|
63 |
* |
|
64 |
* @see org.gvsig.fmap.dal.feature.BaseTestFeatureStore#hasExplorer() |
|
65 |
*/ |
|
66 |
public boolean hasExplorer() { |
|
67 |
// TODO Auto-generated method stub |
|
68 |
return false; |
|
69 |
} |
|
70 |
|
|
71 |
public boolean usesResources() { |
|
72 |
return true; |
|
73 |
} |
|
74 |
|
|
75 |
|
|
76 |
public void testLegendAndLabeling() throws Exception { |
|
77 |
FeatureStore store = (FeatureStore) dataManager |
|
78 |
.createStore(getDefaultDataStoreParameters()); |
|
79 |
|
|
80 |
assertNotNull(store.invokeDynMethod("getLegend", null)); |
|
81 |
assertNotNull(store.invokeDynMethod("getLabeling", null)); |
|
82 |
store.dispose(); |
|
83 |
} |
|
84 |
} |
org.gvsig.dgn/tags/org.gvsig.dgn-2.0.17/org.gvsig.dgn.provider/src/main/java/org/gvsig/fmap/dal/store/dgn/LegendBuilder.java | ||
---|---|---|
1 |
package org.gvsig.fmap.dal.store.dgn; |
|
2 |
|
|
3 |
import org.gvsig.fmap.dal.feature.spi.FeatureProvider; |
|
4 |
import org.gvsig.fmap.dal.feature.spi.FeatureStoreProvider; |
|
5 |
import org.gvsig.fmap.dal.store.dgn.lib.DGNReader; |
|
6 |
|
|
7 |
|
|
8 |
public interface LegendBuilder { |
|
9 |
|
|
10 |
final public static String DYNMETHOD_BUILDER_NAME = "getLegendBuilder"; |
|
11 |
final public static String DYNMETHOD_GETLEGEND_NAME = "getLegend"; |
|
12 |
final public static String DYNMETHOD_GETLABELING_NAME = "getLabeling"; |
|
13 |
|
|
14 |
public LegendBuilder initialize(FeatureStoreProvider store); |
|
15 |
|
|
16 |
public void begin(); |
|
17 |
|
|
18 |
public void process(FeatureProvider feature, DGNReader dgnReader); |
|
19 |
|
|
20 |
public void end(); |
|
21 |
|
|
22 |
public Object getLegend(); |
|
23 |
public Object getLabeling(); |
|
24 |
|
|
25 |
} |
org.gvsig.dgn/tags/org.gvsig.dgn-2.0.17/org.gvsig.dgn.provider/src/main/java/org/gvsig/fmap/dal/store/dgn/lib/tagValueUnion.java | ||
---|---|---|
1 |
/* |
|
2 |
* Created on 21-jul-2003 |
|
3 |
* |
|
4 |
* Copyright (c) 2003 |
|
5 |
* Francisco José Peñarrubia Martínez |
|
6 |
* IVER Tecnologías de la Información S.A. |
|
7 |
* Salamanca 50 |
|
8 |
* 46005 Valencia ( SPAIN ) |
|
9 |
* +34 963163400 |
|
10 |
* mailto:fran@iver.es |
|
11 |
* http://www.iver.es |
|
12 |
*/ |
|
13 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
14 |
* |
|
15 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
16 |
* |
|
17 |
* This program is free software; you can redistribute it and/or |
|
18 |
* modify it under the terms of the GNU General Public License |
|
19 |
* as published by the Free Software Foundation; either version 2 |
|
20 |
* of the License, or (at your option) any later version. |
|
21 |
* |
|
22 |
* This program is distributed in the hope that it will be useful, |
|
23 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
24 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
25 |
* GNU General Public License for more details. |
|
26 |
* |
|
27 |
* You should have received a copy of the GNU General Public License |
|
28 |
* along with this program; if not, write to the Free Software |
|
29 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
30 |
* |
|
31 |
* For more information, contact: |
|
32 |
* |
|
33 |
* Generalitat Valenciana |
|
34 |
* Conselleria d'Infraestructures i Transport |
|
35 |
* Av. Blasco Ib??ez, 50 |
|
36 |
* 46010 VALENCIA |
|
37 |
* SPAIN |
|
38 |
* |
|
39 |
* +34 963862235 |
|
40 |
* gvsig@gva.es |
|
41 |
* www.gvsig.gva.es |
|
42 |
* |
|
43 |
* or |
|
44 |
* |
|
45 |
* IVER T.I. S.A |
|
46 |
* Salamanca 50 |
|
47 |
* 46005 Valencia |
|
48 |
* Spain |
|
49 |
* |
|
50 |
* +34 963163400 |
|
51 |
* dac@iver.es |
|
52 |
*/ |
|
53 |
package org.gvsig.fmap.dal.store.dgn.lib; |
|
54 |
|
|
55 |
/** |
|
56 |
* Uni?n del valor del tag. |
|
57 |
* |
|
58 |
* @author Vicente Caballero Navarro |
|
59 |
*/ |
|
60 |
public class tagValueUnion { |
|
61 |
public char[] string; |
|
62 |
public long integer; |
|
63 |
public double real; |
|
64 |
} |
org.gvsig.dgn/tags/org.gvsig.dgn-2.0.17/org.gvsig.dgn.provider/src/main/java/org/gvsig/fmap/dal/store/dgn/lib/DGNFileHeader.java | ||
---|---|---|
1 |
/* |
|
2 |
* Created on 16-jul-2003 |
|
3 |
* |
|
4 |
* Copyright (c) 2003 |
|
5 |
* Francisco José Peñarrubia Martínez |
|
6 |
* IVER Tecnologías de la Información S.A. |
|
7 |
* Salamanca 50 |
|
8 |
* 46005 Valencia ( SPAIN ) |
|
9 |
* +34 963163400 |
|
10 |
* mailto:fran@iver.es |
|
11 |
* http://www.iver.es |
|
12 |
*/ |
|
13 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
14 |
* |
|
15 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
16 |
* |
|
17 |
* This program is free software; you can redistribute it and/or |
|
18 |
* modify it under the terms of the GNU General Public License |
|
19 |
* as published by the Free Software Foundation; either version 2 |
|
20 |
* of the License, or (at your option) any later version. |
|
21 |
* |
|
22 |
* This program is distributed in the hope that it will be useful, |
|
23 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
24 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
25 |
* GNU General Public License for more details. |
|
26 |
* |
|
27 |
* You should have received a copy of the GNU General Public License |
|
28 |
* along with this program; if not, write to the Free Software |
|
29 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
30 |
* |
|
31 |
* For more information, contact: |
|
32 |
* |
|
33 |
* Generalitat Valenciana |
|
34 |
* Conselleria d'Infraestructures i Transport |
|
35 |
* Av. Blasco Ib??ez, 50 |
|
36 |
* 46010 VALENCIA |
|
37 |
* SPAIN |
|
38 |
* |
|
39 |
* +34 963862235 |
|
40 |
* gvsig@gva.es |
|
41 |
* www.gvsig.gva.es |
|
42 |
* |
|
43 |
* or |
|
44 |
* |
|
45 |
* IVER T.I. S.A |
|
46 |
* Salamanca 50 |
|
47 |
* 46005 Valencia |
|
48 |
* Spain |
|
49 |
* |
|
50 |
* +34 963163400 |
|
51 |
* dac@iver.es |
|
52 |
*/ |
|
53 |
package org.gvsig.fmap.dal.store.dgn.lib; |
|
54 |
|
|
55 |
import java.nio.MappedByteBuffer; |
|
56 |
|
|
57 |
|
|
58 |
/** |
|
59 |
* Clase Header del DGN. |
|
60 |
* |
|
61 |
* @author Vicente Caballero Navarro |
|
62 |
*/ |
|
63 |
public class DGNFileHeader { |
|
64 |
/** DGNElemCore style: Element uses DGNElemCore structure */ |
|
65 |
public static final int DGNST_CORE = 1; |
|
66 |
|
|
67 |
/** DGNElemCore style: Element uses DGNElemMultiPoint structure */ |
|
68 |
public static final int DGNST_MULTIPOINT = 2; |
|
69 |
|
|
70 |
/** DGNElemCore style: Element uses DGNElemColorTable structure */ |
|
71 |
public static final int DGNST_COLORTABLE = 3; |
|
72 |
|
|
73 |
/** DGNElemCore style: Element uses DGNElemTCB structure */ |
|
74 |
public static final int DGNST_TCB = 4; |
|
75 |
|
|
76 |
/** DGNElemCore style: Element uses DGNElemArc structure */ |
|
77 |
public static final int DGNST_ARC = 5; |
|
78 |
|
|
79 |
/** DGNElemCore style: Element uses DGNElemText structure */ |
|
80 |
public static final int DGNST_TEXT = 6; |
|
81 |
|
|
82 |
/** DGNElemCore style: Element uses DGNElemComplexHeader structure */ |
|
83 |
public static final int DGNST_COMPLEX_HEADER = 7; |
|
84 |
|
|
85 |
/** DGNElemCore style: Element uses DGNElemCellHeader structure */ |
|
86 |
public static final int DGNST_CELL_HEADER = 8; |
|
87 |
|
|
88 |
/** DGNElemCore style: Element uses DGNElemTagValue structure */ |
|
89 |
public static final int DGNST_TAG_VALUE = 9; |
|
90 |
|
|
91 |
/** DGNElemCore style: Element uses DGNElemTagSet structure */ |
|
92 |
public static final int DGNST_TAG_SET = 10; |
|
93 |
|
|
94 |
/** DGNElemCore style: Element uses DGNElemCellLibrary structure */ |
|
95 |
public static final int DGNST_CELL_LIBRARY = 11; |
|
96 |
|
|
97 |
/** DGNElemCore style: Element uses DGNElemGroup structure */ |
|
98 |
public static final int DGNST_GROUP_DATA = 12; |
|
99 |
public static final int DGNST_SHARED_CELL_DEFN = 13; |
|
100 |
|
|
101 |
/* -------------------------------------------------------------------- */ |
|
102 |
/* Element types */ |
|
103 |
/* -------------------------------------------------------------------- */ |
|
104 |
public static final int DGNT_NULL = 0; |
|
105 |
public static final int DGNT_CELL_LIBRARY = 1; |
|
106 |
public static final int DGNT_CELL_HEADER = 2; |
|
107 |
public static final int DGNT_LINE = 3; |
|
108 |
public static final int DGNT_LINE_STRING = 4; |
|
109 |
public static final int DGNT_GROUP_DATA = 5; |
|
110 |
public static final int DGNT_SHAPE = 6; |
|
111 |
public static final int DGNT_TEXT_NODE = 7; |
|
112 |
public static final int DGNT_DIGITIZER_SETUP = 8; |
|
113 |
public static final int DGNT_TCB = 9; |
|
114 |
public static final int DGNT_LEVEL_SYMBOLOGY = 10; |
|
115 |
public static final int DGNT_CURVE = 11; |
|
116 |
public static final int DGNT_COMPLEX_CHAIN_HEADER = 12; |
|
117 |
public static final int DGNT_COMPLEX_SHAPE_HEADER = 14; |
|
118 |
public static final int DGNT_ELLIPSE = 15; |
|
119 |
public static final int DGNT_ARC = 16; |
|
120 |
public static final int DGNT_TEXT = 17; |
|
121 |
public static final int DGNT_BSPLINE = 21; |
|
122 |
public static final int DGNT_SHARED_CELL_DEFN = 34; |
|
123 |
public static final int DGNT_SHARED_CELL_ELEM = 35; // REVISAR |
|
124 |
public static final int DGNT_TAG_VALUE = 37; |
|
125 |
public static final int DGNT_APPLICATION_ELEM = 66; |
|
126 |
|
|
127 |
/* -------------------------------------------------------------------- */ |
|
128 |
/* Line Styles */ |
|
129 |
/* -------------------------------------------------------------------- */ |
|
130 |
public static final int DGNS_SOLID = 0; |
|
131 |
public static final int DGNS_DOTTED = 1; |
|
132 |
public static final int DGNS_MEDIUM_DASH = 2; |
|
133 |
public static final int DGNS_LONG_DASH = 3; |
|
134 |
public static final int DGNS_DOT_DASH = 4; |
|
135 |
public static final int DGNS_SHORT_DASH = 5; |
|
136 |
public static final int DGNS_DASH_DOUBLE_DOT = 6; |
|
137 |
public static final int DGNS_LONG_DASH_SHORT_DASH = 7; |
|
138 |
|
|
139 |
/* -------------------------------------------------------------------- */ |
|
140 |
/* Class */ |
|
141 |
/* -------------------------------------------------------------------- */ |
|
142 |
public static final int DGNC_PRIMARY = 0; |
|
143 |
public static final int DGNC_PATTERN_COMPONENT = 1; |
|
144 |
public static final int DGNC_CONSTRUCTION_ELEMENT = 2; |
|
145 |
public static final int DGNC_DIMENSION_ELEMENT = 3; |
|
146 |
public static final int DGNC_PRIMARY_RULE_ELEMENT = 4; |
|
147 |
public static final int DGNC_LINEAR_PATTERNED_ELEMENT = 5; |
|
148 |
public static final int DGNC_CONSTRUCTION_RULE_ELEMENT = 6; |
|
149 |
|
|
150 |
/* -------------------------------------------------------------------- */ |
|
151 |
/* Group Data level numbers. */ |
|
152 |
/* */ |
|
153 |
/* These are symbolic values for the typ 5 (DGNT_GROUP_DATA) */ |
|
154 |
/* level values that have special meanings. */ |
|
155 |
/* -------------------------------------------------------------------- */ |
|
156 |
public static final int DGN_GDL_COLOR_TABLE = 1; |
|
157 |
public static final int DGN_GDL_NAMED_VIEW = 3; |
|
158 |
public static final int DGN_GDL_REF_FILE = 9; |
|
159 |
|
|
160 |
/* -------------------------------------------------------------------- */ |
|
161 |
/* Word 17 property flags. */ |
|
162 |
/* -------------------------------------------------------------------- */ |
|
163 |
public static final int DGNPF_HOLE = 0x8000; |
|
164 |
public static final int DGNPF_SNAPPABLE = 0x4000; |
|
165 |
public static final int DGNPF_PLANAR = 0x2000; |
|
166 |
public static final int DGNPF_ORIENTATION = 0x1000; |
|
167 |
public static final int DGNPF_ATTRIBUTES = 0x0800; |
|
168 |
public static final int DGNPF_MODIFIED = 0x0400; |
|
169 |
public static final int DGNPF_NEW = 0x0200; |
|
170 |
public static final int DGNPF_LOCKED = 0x0100; |
|
171 |
public static final int DGNPF_CLASS = 0x000f; |
|
172 |
|
|
173 |
/* -------------------------------------------------------------------- */ |
|
174 |
/* DGNElementInfo flag values. */ |
|
175 |
/* -------------------------------------------------------------------- */ |
|
176 |
public static final int DGNEIF_DELETED = 0x01; |
|
177 |
public static final int DGNEIF_COMPLEX = 0x02; |
|
178 |
|
|
179 |
/* -------------------------------------------------------------------- */ |
|
180 |
/* Justifications */ |
|
181 |
/* -------------------------------------------------------------------- */ |
|
182 |
public static final int DGNJ_LEFT_TOP = 0; |
|
183 |
public static final int DGNJ_LEFT_CENTER = 1; |
|
184 |
public static final int DGNJ_LEFT_BOTTOM = 2; |
|
185 |
public static final int DGNJ_LEFTMARGIN_TOP = 3; |
|
186 |
|
|
187 |
/* text node header only */ |
|
188 |
public static final int DGNJ_LEFTMARGIN_CENTER = 4; |
|
189 |
|
|
190 |
/* text node header only */ |
|
191 |
public static final int DGNJ_LEFTMARGIN_BOTTOM = 5; |
|
192 |
|
|
193 |
/* text node header only */ |
|
194 |
public static final int DGNJ_CENTER_TOP = 6; |
|
195 |
public static final int DGNJ_CENTER_CENTER = 6; |
|
196 |
public static final int DGNJ_CENTER_BOTTOM = 8; |
|
197 |
public static final int DGNJ_RIGHTMARGIN_TOP = 9; |
|
198 |
|
|
199 |
/* text node header only */ |
|
200 |
public static final int DGNJ_RIGHTMARGIN_CENTER = 10; |
|
201 |
|
|
202 |
/* text node header only */ |
|
203 |
public static final int DGNJ_RIGHTMARGIN_BOTTOM = 11; |
|
204 |
|
|
205 |
/* text node header only */ |
|
206 |
public static final int DGNJ_RIGHT_TOP = 12; |
|
207 |
public static final int DGNJ_RIGHT_CENTER = 13; |
|
208 |
public static final int DGNJ_RIGHT_BOTTOM = 14; |
|
209 |
|
|
210 |
/* -------------------------------------------------------------------- */ |
|
211 |
/* DGN file reading options. */ |
|
212 |
/* -------------------------------------------------------------------- */ |
|
213 |
public static final int DGNO_CAPTURE_RAW_DATA = 0x01; |
|
214 |
|
|
215 |
/* -------------------------------------------------------------------- */ |
|
216 |
/* Known attribute linkage types, including my synthetic ones. */ |
|
217 |
/* -------------------------------------------------------------------- */ |
|
218 |
public static final int DGNLT_DMRS = 0x0000; |
|
219 |
public static final int DGNLT_INFORMIX = 0x3848; |
|
220 |
public static final int DGNLT_ODBC = 0x5e62; |
|
221 |
public static final int DGNLT_ORACLE = 0x6091; |
|
222 |
public static final int DGNLT_RIS = 0x71FB; |
|
223 |
public static final int DGNLT_SYBASE = 0x4f58; |
|
224 |
public static final int DGNLT_XBASE = 0x1971; |
|
225 |
public static final int DGNLT_SHAPE_FILL = 0x0041; |
|
226 |
public static final int DGNLT_ASSOC_ID = 0x7D2F; |
|
227 |
|
|
228 |
/* -------------------------------------------------------------------- */ |
|
229 |
/* File creation options. */ |
|
230 |
/* -------------------------------------------------------------------- */ |
|
231 |
public static final int DGNCF_USE_SEED_UNITS = 0x01; |
|
232 |
public static final int DGNCF_USE_SEED_ORIGIN = 0x02; |
|
233 |
public static final int DGNCF_COPY_SEED_FILE_COLOR_TABLE = 0x04; |
|
234 |
public static final int DGNCF_COPY_WHOLE_SEED_FILE = 0x08; |
|
235 |
public static final int SIZE_LONG = 4; |
|
236 |
|
|
237 |
/* |
|
238 |
int offset; |
|
239 |
int size; |
|
240 |
int element_id; |
|
241 |
int stype; |
|
242 |
int level; |
|
243 |
int type; |
|
244 |
int complex; |
|
245 |
int deleted; |
|
246 |
int graphic_group; |
|
247 |
int properties; |
|
248 |
int color; |
|
249 |
int weight; |
|
250 |
int style; |
|
251 |
int attr_bytes; |
|
252 |
byte attr_data; |
|
253 |
int raw_bytes; |
|
254 |
byte raw_data; |
|
255 |
//} DGNElemCore; |
|
256 |
*/ |
|
257 |
|
|
258 |
/** File Length; */ |
|
259 |
int myFileLength = 0; |
|
260 |
|
|
261 |
/** Version of the file. */ |
|
262 |
int myVersion = 1000; |
|
263 |
|
|
264 |
/* |
|
265 |
public static final int SHAPE_NULL = 0; |
|
266 |
public static final int SHAPE_POINT = 1; |
|
267 |
public static final int SHAPE_POLYLINE = 3; |
|
268 |
public static final int SHAPE_POLYGON = 5; |
|
269 |
public static final int SHAPE_MULTIPOINT = 8; |
|
270 |
public static final int SHAPE_POINTZ = 11; |
|
271 |
public static final int SHAPE_POLYLINEZ = 13; |
|
272 |
public static final int SHAPE_POLYGONZ = 15; |
|
273 |
public static final int SHAPE_MULTIPOINTZ = 18; |
|
274 |
public static final int SHAPE_POINTM = 21; |
|
275 |
public static final int SHAPE_POLYLINEM = 23; |
|
276 |
public static final int SHAPE_POLYGONM = 25; |
|
277 |
public static final int SHAPE_MULTIPOINTM = 28; |
|
278 |
public static final int SHAPE_MULTIPATCH = 31; |
|
279 |
*/ |
|
280 |
int myDGNType = 0; |
|
281 |
double myXmin = 0; |
|
282 |
double myYmin = 0; |
|
283 |
double myXmax = 0; |
|
284 |
double myYmax = 0; |
|
285 |
double myZmin = 0; |
|
286 |
double myZmax = 0; |
|
287 |
double myMmin = 0; |
|
288 |
double myMmax = 0; |
|
289 |
|
|
290 |
// notify about warnings. |
|
291 |
private boolean myWarning = true; |
|
292 |
|
|
293 |
/** |
|
294 |
* ShapeFileHeader constructor comment. |
|
295 |
*/ |
|
296 |
public DGNFileHeader() { |
|
297 |
super(); |
|
298 |
} |
|
299 |
|
|
300 |
/** |
|
301 |
* Return the version of the file. |
|
302 |
* |
|
303 |
* @return DOCUMENT ME! |
|
304 |
*/ |
|
305 |
public int getVersion() { |
|
306 |
return myVersion; |
|
307 |
} |
|
308 |
|
|
309 |
/** |
|
310 |
* Devuelve el rect?ngulo del fichero. |
|
311 |
* |
|
312 |
* @return DOCUMENT ME! |
|
313 |
*/ |
|
314 |
public java.awt.geom.Rectangle2D.Double getFileExtents() { |
|
315 |
return new java.awt.geom.Rectangle2D.Double(myXmin, myYmin, |
|
316 |
myXmax - myXmin, myYmax - myYmin); |
|
317 |
} |
|
318 |
|
|
319 |
/** |
|
320 |
* Print warnings to system.out. |
|
321 |
* |
|
322 |
* @param inWarning DOCUMENT ME! |
|
323 |
*/ |
|
324 |
public void setWarnings(boolean inWarning) { |
|
325 |
myWarning = inWarning; |
|
326 |
} |
|
327 |
|
|
328 |
/** |
|
329 |
* Return the length of the header in 16 bit words.. |
|
330 |
* |
|
331 |
* @return DOCUMENT ME! |
|
332 |
*/ |
|
333 |
public int getHeaderLength() { |
|
334 |
return 50; |
|
335 |
} |
|
336 |
|
|
337 |
/** |
|
338 |
* Return the number of 16 bit words in the shape file as recorded in the |
|
339 |
* header |
|
340 |
* |
|
341 |
* @return DOCUMENT ME! |
|
342 |
*/ |
|
343 |
public int getFileLength() { |
|
344 |
return myFileLength; |
|
345 |
} |
|
346 |
|
|
347 |
/** |
|
348 |
* Read the header from the shape file. |
|
349 |
* |
|
350 |
* @param in DOCUMENT ME! |
|
351 |
*/ |
|
352 |
public void readHeader(MappedByteBuffer in) { |
|
353 |
//in.order(ByteOrder.BIG_ENDIAN); |
|
354 |
|
|
355 |
/* |
|
356 |
offset=in.getInt(); |
|
357 |
System.out.println("offset "+offset); |
|
358 |
size=in.getInt(); |
|
359 |
System.out.println("size "+size); |
|
360 |
element_id=in.getInt(); |
|
361 |
System.out.println("element_id "+element_id); |
|
362 |
stype=in.getInt(); |
|
363 |
System.out.println("stype "+stype); |
|
364 |
level=in.getInt(); |
|
365 |
System.out.println("level "+level); |
|
366 |
type=in.getInt(); |
|
367 |
System.out.println("type "+type); |
|
368 |
complex=in.getInt(); |
|
369 |
System.out.println("complex "+complex); |
|
370 |
deleted=in.getInt(); |
|
371 |
System.out.println("deleted "+deleted); |
|
372 |
graphic_group=in.getInt(); |
|
373 |
System.out.println("graphic_group "+graphic_group); |
|
374 |
properties=in.getInt(); |
|
375 |
System.out.println("properties "+properties); |
|
376 |
color=in.getInt(); |
|
377 |
System.out.println("color "+color); |
|
378 |
weight=in.getInt(); |
|
379 |
System.out.println("weight "+weight); |
|
380 |
style=in.getInt(); |
|
381 |
System.out.println("style "+style); |
|
382 |
attr_bytes=in.getInt(); |
|
383 |
System.out.println("attr_bytes "+attr_bytes); |
|
384 |
//attr_data=in.get(attr_bytes); |
|
385 |
//System.out.println("attr_data "+attr_data); |
|
386 |
raw_bytes=in.getInt(); |
|
387 |
System.out.println("raw_bytes "+raw_bytes); |
|
388 |
//raw_data=in.get(raw_bytes); |
|
389 |
//System.out.println("raw_data "+raw_data); |
|
390 |
*/ |
|
391 |
|
|
392 |
// the first four bytes are integers |
|
393 |
// in.setLittleEndianMode(false); |
|
394 |
|
|
395 |
/* in.order(ByteOrder.BIG_ENDIAN); |
|
396 |
myFileCode = in.getInt(); |
|
397 |
if (myFileCode != 9994) warn("File Code = "+myFileCode+" Not equal to 9994"); |
|
398 |
// From 4 to 8 are unused. |
|
399 |
myUnused1 = in.getInt(); |
|
400 |
// From 8 to 12 are unused. |
|
401 |
myUnused2 = in.getInt(); |
|
402 |
// From 12 to 16 are unused. |
|
403 |
myUnused3 = in.getInt(); |
|
404 |
// From 16 to 20 are unused. |
|
405 |
myUnused4 = in.getInt(); |
|
406 |
// From 20 to 24 are unused. |
|
407 |
myUnused5 = in.getInt(); |
|
408 |
// From 24 to 28 are the file length. |
|
409 |
myFileLength = in.getInt(); |
|
410 |
// From 28 to 32 are the File Version. |
|
411 |
in.order(ByteOrder.LITTLE_ENDIAN); |
|
412 |
myVersion = in.getInt(); |
|
413 |
// From 32 to 36 are the Shape Type. |
|
414 |
myShapeType = in.getInt(); |
|
415 |
// From 36 to 44 are Xmin. |
|
416 |
myXmin = in.getDouble(); // Double.longBitsToDouble(in.getLong()); |
|
417 |
// From 44 to 52 are Ymin. |
|
418 |
myYmin = in.getDouble(); |
|
419 |
// From 52 to 60 are Xmax. |
|
420 |
myXmax = in.getDouble(); |
|
421 |
// From 60 to 68 are Ymax. |
|
422 |
myYmax = in.getDouble(); |
|
423 |
// From 68 to 76 are Zmin. |
|
424 |
myZmin = in.getDouble(); |
|
425 |
// From 76 to 84 are Zmax. |
|
426 |
myZmax = in.getDouble(); |
|
427 |
// From 84 to 92 are Mmin. |
|
428 |
myMmin = in.getDouble(); |
|
429 |
// From 92 to 100 are Mmax. |
|
430 |
myMmax = in.getDouble(); |
|
431 |
// that is all 100 bytes of the header. |
|
432 |
*/ |
|
433 |
} |
|
434 |
|
|
435 |
/** |
|
436 |
* Muestra por consola el warning. |
|
437 |
* |
|
438 |
* @param inWarn DOCUMENT ME! |
|
439 |
*/ |
|
440 |
private void warn(String inWarn) { |
|
441 |
if (myWarning) { |
|
442 |
System.out.print("WARNING: "); |
|
443 |
System.out.println(inWarn); |
|
444 |
} |
|
445 |
} |
|
446 |
} |
org.gvsig.dgn/tags/org.gvsig.dgn-2.0.17/org.gvsig.dgn.provider/src/main/java/org/gvsig/fmap/dal/store/dgn/lib/DGNPoint.java | ||
---|---|---|
1 |
/* |
|
2 |
* Created on 17-jul-2003 |
|
3 |
* |
|
4 |
* Copyright (c) 2003 |
|
5 |
* Francisco José Peñarrubia Martínez |
|
6 |
* IVER Tecnologías de la Información S.A. |
|
7 |
* Salamanca 50 |
|
8 |
* 46005 Valencia ( SPAIN ) |
|
9 |
* +34 963163400 |
|
10 |
* mailto:fran@iver.es |
|
11 |
* http://www.iver.es |
|
12 |
*/ |
|
13 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
14 |
* |
|
15 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
16 |
* |
|
17 |
* This program is free software; you can redistribute it and/or |
|
18 |
* modify it under the terms of the GNU General Public License |
|
19 |
* as published by the Free Software Foundation; either version 2 |
|
20 |
* of the License, or (at your option) any later version. |
|
21 |
* |
|
22 |
* This program is distributed in the hope that it will be useful, |
|
23 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
24 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
25 |
* GNU General Public License for more details. |
|
26 |
* |
|
27 |
* You should have received a copy of the GNU General Public License |
|
28 |
* along with this program; if not, write to the Free Software |
|
29 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
30 |
* |
|
31 |
* For more information, contact: |
|
32 |
* |
|
33 |
* Generalitat Valenciana |
|
34 |
* Conselleria d'Infraestructures i Transport |
|
35 |
* Av. Blasco Ib??ez, 50 |
|
36 |
* 46010 VALENCIA |
|
37 |
* SPAIN |
|
38 |
* |
|
39 |
* +34 963862235 |
|
40 |
* gvsig@gva.es |
|
41 |
* www.gvsig.gva.es |
|
42 |
* |
|
43 |
* or |
|
44 |
* |
|
45 |
* IVER T.I. S.A |
|
46 |
* Salamanca 50 |
|
47 |
* 46005 Valencia |
|
48 |
* Spain |
|
49 |
* |
|
50 |
* +34 963163400 |
|
51 |
* dac@iver.es |
|
52 |
*/ |
|
53 |
package org.gvsig.fmap.dal.store.dgn.lib; |
|
54 |
|
|
55 |
/** |
|
56 |
* Punto 3D. |
|
57 |
* |
|
58 |
* @author Vicente Caballero Navarro |
|
59 |
*/ |
|
60 |
public class DGNPoint { |
|
61 |
public double x; /*!< X (normally eastwards) coordinate. */ |
|
62 |
public double y; /*!< y (normally northwards) coordinate. */ |
|
63 |
public double z; /*!< z, up coordinate. Zero for 2D objects. */ |
|
64 |
} |
org.gvsig.dgn/tags/org.gvsig.dgn-2.0.17/org.gvsig.dgn.provider/src/main/java/org/gvsig/fmap/dal/store/dgn/lib/DGNElemColorTable.java | ||
---|---|---|
1 |
/* |
|
2 |
* Created on 17-jul-2003 |
|
3 |
* |
|
4 |
* Copyright (c) 2003 |
|
5 |
* Francisco José Peñarrubia Martínez |
|
6 |
* IVER Tecnologías de la Información S.A. |
|
7 |
* Salamanca 50 |
|
8 |
* 46005 Valencia ( SPAIN ) |
|
9 |
* +34 963163400 |
|
10 |
* mailto:fran@iver.es |
|
11 |
* http://www.iver.es |
|
12 |
*/ |
|
13 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
14 |
* |
|
15 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
16 |
* |
|
17 |
* This program is free software; you can redistribute it and/or |
|
18 |
* modify it under the terms of the GNU General Public License |
|
19 |
* as published by the Free Software Foundation; either version 2 |
|
20 |
* of the License, or (at your option) any later version. |
|
21 |
* |
|
22 |
* This program is distributed in the hope that it will be useful, |
|
23 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
24 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
25 |
* GNU General Public License for more details. |
|
26 |
* |
|
27 |
* You should have received a copy of the GNU General Public License |
|
28 |
* along with this program; if not, write to the Free Software |
|
29 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
30 |
* |
|
31 |
* For more information, contact: |
|
32 |
* |
|
33 |
* Generalitat Valenciana |
|
34 |
* Conselleria d'Infraestructures i Transport |
|
35 |
* Av. Blasco Ib??ez, 50 |
|
36 |
* 46010 VALENCIA |
|
37 |
* SPAIN |
|
38 |
* |
|
39 |
* +34 963862235 |
|
40 |
* gvsig@gva.es |
|
41 |
* www.gvsig.gva.es |
|
42 |
* |
|
43 |
* or |
|
44 |
* |
|
45 |
* IVER T.I. S.A |
|
46 |
* Salamanca 50 |
|
47 |
* 46005 Valencia |
|
48 |
* Spain |
|
49 |
* |
|
50 |
* +34 963163400 |
|
51 |
* dac@iver.es |
|
52 |
*/ |
|
53 |
package org.gvsig.fmap.dal.store.dgn.lib; |
|
54 |
|
|
55 |
/** |
|
56 |
* Clase utilizada para guardar un elemento de tipo ColorTable. |
|
57 |
* |
|
58 |
* @author Vicente Caballero Navarro |
|
59 |
*/ |
|
60 |
public class DGNElemColorTable extends DGNElemCore { |
|
61 |
//DGNElemCore core=new DGNElemCore(); |
|
62 |
public int screen_flag; |
|
63 |
public byte[][] color_info = new byte[256][3]; |
|
64 |
|
|
65 |
//256 3 /*!< Color table, 256 colors by red (0), green(1) and blue(2) component. */ |
|
66 |
} |
org.gvsig.dgn/tags/org.gvsig.dgn-2.0.17/org.gvsig.dgn.provider/src/main/java/org/gvsig/fmap/dal/store/dgn/lib/DGNTagDef.java | ||
---|---|---|
1 |
/* |
|
2 |
* Created on 22-jul-2003 |
|
3 |
* |
|
4 |
* Copyright (c) 2003 |
|
5 |
* Francisco José Peñarrubia Martínez |
|
6 |
* IVER Tecnologías de la Información S.A. |
|
7 |
* Salamanca 50 |
|
8 |
* 46005 Valencia ( SPAIN ) |
|
9 |
* +34 963163400 |
|
10 |
* mailto:fran@iver.es |
|
11 |
* http://www.iver.es |
|
12 |
*/ |
|
13 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
14 |
* |
|
15 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
16 |
* |
|
17 |
* This program is free software; you can redistribute it and/or |
|
18 |
* modify it under the terms of the GNU General Public License |
|
19 |
* as published by the Free Software Foundation; either version 2 |
|
20 |
* of the License, or (at your option) any later version. |
|
21 |
* |
|
22 |
* This program is distributed in the hope that it will be useful, |
|
23 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
24 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
25 |
* GNU General Public License for more details. |
|
26 |
* |
|
27 |
* You should have received a copy of the GNU General Public License |
|
28 |
* along with this program; if not, write to the Free Software |
|
29 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
30 |
* |
|
31 |
* For more information, contact: |
|
32 |
* |
|
33 |
* Generalitat Valenciana |
|
34 |
* Conselleria d'Infraestructures i Transport |
|
35 |
* Av. Blasco Ib??ez, 50 |
|
36 |
* 46010 VALENCIA |
|
37 |
* SPAIN |
|
38 |
* |
|
39 |
* +34 963862235 |
|
40 |
* gvsig@gva.es |
|
41 |
* www.gvsig.gva.es |
|
42 |
* |
|
43 |
* or |
|
44 |
* |
|
45 |
* IVER T.I. S.A |
|
46 |
* Salamanca 50 |
|
47 |
* 46005 Valencia |
|
48 |
* Spain |
|
49 |
* |
|
50 |
* +34 963163400 |
|
51 |
* dac@iver.es |
|
52 |
*/ |
|
53 |
package org.gvsig.fmap.dal.store.dgn.lib; |
|
54 |
|
|
55 |
/** |
|
56 |
* Definici?n de Tag. |
|
57 |
* |
|
58 |
* @author Vicente Caballero Navarro |
|
59 |
*/ |
|
60 |
public class DGNTagDef { |
|
61 |
public char[] name; /*!< Name of this tag. */ |
|
62 |
public int id; /*!< Tag index/identifier. */ |
|
63 |
public char[] prompt; /*!< User prompt when requesting value. */ |
|
64 |
public int type; |
|
65 |
|
|
66 |
/*!< Tag type (one of DGNTT_STRING(1), DGNTT_INTEGER(3) or DGNTT_FLOAT(4). */ |
|
67 |
public tagValueUnion defaultValue; /*!< Default tag value */ |
|
68 |
} |
org.gvsig.dgn/tags/org.gvsig.dgn-2.0.17/org.gvsig.dgn.provider/src/main/java/org/gvsig/fmap/dal/store/dgn/lib/DGNElemTagSet.java | ||
---|---|---|
1 |
/* |
|
2 |
* Created on 22-jul-2003 |
|
3 |
* |
|
4 |
* Copyright (c) 2003 |
|
5 |
* Francisco José Peñarrubia Martínez |
|
6 |
* IVER Tecnologías de la Información S.A. |
|
7 |
* Salamanca 50 |
|
8 |
* 46005 Valencia ( SPAIN ) |
|
9 |
* +34 963163400 |
|
10 |
* mailto:fran@iver.es |
|
11 |
* http://www.iver.es |
|
12 |
*/ |
|
13 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
14 |
* |
|
15 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
16 |
* |
|
17 |
* This program is free software; you can redistribute it and/or |
|
18 |
* modify it under the terms of the GNU General Public License |
|
19 |
* as published by the Free Software Foundation; either version 2 |
|
20 |
* of the License, or (at your option) any later version. |
|
21 |
* |
|
22 |
* This program is distributed in the hope that it will be useful, |
|
23 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
24 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
25 |
* GNU General Public License for more details. |
|
26 |
* |
|
27 |
* You should have received a copy of the GNU General Public License |
|
28 |
* along with this program; if not, write to the Free Software |
|
29 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
30 |
* |
|
31 |
* For more information, contact: |
|
32 |
* |
|
33 |
* Generalitat Valenciana |
|
34 |
* Conselleria d'Infraestructures i Transport |
|
35 |
* Av. Blasco Ib??ez, 50 |
|
36 |
* 46010 VALENCIA |
|
37 |
* SPAIN |
|
38 |
* |
|
39 |
* +34 963862235 |
|
40 |
* gvsig@gva.es |
|
41 |
* www.gvsig.gva.es |
|
42 |
* |
|
43 |
* or |
|
44 |
* |
|
45 |
* IVER T.I. S.A |
|
46 |
* Salamanca 50 |
|
47 |
* 46005 Valencia |
|
48 |
* Spain |
|
49 |
* |
|
50 |
* +34 963163400 |
|
51 |
* dac@iver.es |
|
52 |
*/ |
|
53 |
package org.gvsig.fmap.dal.store.dgn.lib; |
|
54 |
|
|
55 |
/** |
|
56 |
* Clase utilizada para guardar un elemento de tipo TagSet. |
|
57 |
* |
|
58 |
* @author Vicente Caballero Navarro |
|
59 |
*/ |
|
60 |
public class DGNElemTagSet extends DGNElemCore { |
|
61 |
//DGNElemCore core=new DGNElemCore(); |
|
62 |
public int tagCount; /*!< Number of tags in tagList. */ |
|
63 |
public int tagSet; /*!< Tag set index. */ |
|
64 |
public int flags; /*!< Tag flags - not too much known. */ |
|
65 |
public char[] tagSetName; |
|
66 |
public DGNTagDef[] tagList; /*!< List of tag definitions in this set. */ |
|
67 |
} |
org.gvsig.dgn/tags/org.gvsig.dgn-2.0.17/org.gvsig.dgn.provider/src/main/java/org/gvsig/fmap/dal/store/dgn/lib/DGNElemCore.java | ||
---|---|---|
1 |
/* |
|
2 |
* Created on 17-jul-2003 |
|
3 |
* |
|
4 |
* Copyright (c) 2003 |
|
5 |
* Francisco José Peñarrubia Martínez |
|
6 |
* IVER Tecnologías de la Información S.A. |
|
7 |
* Salamanca 50 |
|
8 |
* 46005 Valencia ( SPAIN ) |
|
9 |
* +34 963163400 |
|
10 |
* mailto:fran@iver.es |
|
11 |
* http://www.iver.es |
|
12 |
*/ |
|
13 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
14 |
* |
|
15 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
16 |
* |
|
17 |
* This program is free software; you can redistribute it and/or |
|
18 |
* modify it under the terms of the GNU General Public License |
|
19 |
* as published by the Free Software Foundation; either version 2 |
|
20 |
* of the License, or (at your option) any later version. |
|
21 |
* |
|
22 |
* This program is distributed in the hope that it will be useful, |
|
23 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
24 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
25 |
* GNU General Public License for more details. |
|
26 |
* |
|
27 |
* You should have received a copy of the GNU General Public License |
|
28 |
* along with this program; if not, write to the Free Software |
|
29 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
30 |
* |
|
31 |
* For more information, contact: |
|
32 |
* |
|
33 |
* Generalitat Valenciana |
|
34 |
* Conselleria d'Infraestructures i Transport |
|
35 |
* Av. Blasco Ib??ez, 50 |
|
36 |
* 46010 VALENCIA |
|
37 |
* SPAIN |
|
38 |
* |
|
39 |
* +34 963862235 |
|
40 |
* gvsig@gva.es |
|
41 |
* www.gvsig.gva.es |
|
42 |
* |
|
43 |
* or |
|
44 |
* |
|
45 |
* IVER T.I. S.A |
|
46 |
* Salamanca 50 |
|
47 |
* 46005 Valencia |
|
48 |
* Spain |
|
49 |
* |
|
50 |
* +34 963163400 |
|
51 |
* dac@iver.es |
|
52 |
*/ |
|
53 |
package org.gvsig.fmap.dal.store.dgn.lib; |
|
54 |
|
|
55 |
/** |
|
56 |
* Clase utilizada para guardar un elemento de tipo Base del cual extienden los |
|
57 |
* dem?s tipos. |
|
58 |
* |
|
59 |
* @author Vicente Caballero Navarro |
|
60 |
*/ |
|
61 |
public class DGNElemCore { |
|
62 |
public int offset; |
|
63 |
public int size; |
|
64 |
public int element_id; /*!< Element number (zero based) */ |
|
65 |
public int stype; /*!< Structure type: (DGNST_*) */ |
|
66 |
public int level; /*!< Element Level: 0-63 */ |
|
67 |
public int type; /*!< Element type (DGNT_) */ |
|
68 |
public int complex; /*!< Is element complex? */ |
|
69 |
public int deleted; /*!< Is element deleted? */ |
|
70 |
public int graphic_group; /*!< Graphic group number */ |
|
71 |
public int properties; /*!< Properties: ORing of DGNPF_ flags */ |
|
72 |
public int color; /*!< Color index (0-255) */ |
|
73 |
public int weight; /*!< Line Weight (0-31) */ |
|
74 |
public int style; /*!< Line Style: One of DGNS_* values */ |
|
75 |
public int attr_bytes; /*!< Bytes of attribute data, usually zero. */ |
|
76 |
public byte[] attr_data; /*!< Raw attribute data */ |
|
77 |
public int raw_bytes; /*!< Bytes of raw data, usually zero. */ |
|
78 |
public byte[] raw_data; /*!< All raw element data including header. */ |
|
79 |
} |
org.gvsig.dgn/tags/org.gvsig.dgn-2.0.17/org.gvsig.dgn.provider/src/main/java/org/gvsig/fmap/dal/store/dgn/lib/DGNInfo.java | ||
---|---|---|
1 |
/* |
|
2 |
* Created on 17-jul-2003 |
|
3 |
* |
|
4 |
* Copyright (c) 2003 |
|
5 |
* Francisco José Peñarrubia Martínez |
|
6 |
* IVER Tecnologías de la Información S.A. |
|
7 |
* Salamanca 50 |
|
8 |
* 46005 Valencia ( SPAIN ) |
|
9 |
* +34 963163400 |
|
10 |
* mailto:fran@iver.es |
|
11 |
* http://www.iver.es |
|
12 |
*/ |
|
13 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
14 |
* |
|
15 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
16 |
* |
|
17 |
* This program is free software; you can redistribute it and/or |
|
18 |
* modify it under the terms of the GNU General Public License |
|
19 |
* as published by the Free Software Foundation; either version 2 |
|
20 |
* of the License, or (at your option) any later version. |
|
21 |
* |
|
22 |
* This program is distributed in the hope that it will be useful, |
|
23 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
24 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
25 |
* GNU General Public License for more details. |
|
26 |
* |
|
27 |
* You should have received a copy of the GNU General Public License |
|
28 |
* along with this program; if not, write to the Free Software |
|
29 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
30 |
* |
|
31 |
* For more information, contact: |
|
32 |
* |
|
33 |
* Generalitat Valenciana |
|
34 |
* Conselleria d'Infraestructures i Transport |
|
35 |
* Av. Blasco Ib??ez, 50 |
|
36 |
* 46010 VALENCIA |
|
37 |
* SPAIN |
|
38 |
* |
|
39 |
* +34 963862235 |
|
40 |
* gvsig@gva.es |
|
41 |
* www.gvsig.gva.es |
|
42 |
* |
|
43 |
* or |
|
44 |
* |
|
45 |
* IVER T.I. S.A |
|
46 |
* Salamanca 50 |
|
47 |
* 46005 Valencia |
|
48 |
* Spain |
|
49 |
* |
|
50 |
* +34 963163400 |
|
51 |
* dac@iver.es |
|
52 |
*/ |
|
53 |
package org.gvsig.fmap.dal.store.dgn.lib; |
|
54 |
|
|
55 |
/** |
|
56 |
* Clase que almacena informaci?n del elemento. |
|
57 |
* |
|
58 |
* @author Vicente Caballero Navarro |
|
59 |
*/ |
|
60 |
public class DGNInfo { |
|
61 |
public String fp; |
|
62 |
public int ftall; |
|
63 |
public int next_element_id; |
|
64 |
public int nElemBytes; |
|
65 |
public byte[] abyElem = new byte[131076]; //131076 |
|
66 |
|
|
67 |
//byte[] temporal=new byte[4]; |
|
68 |
public int got_tcb; |
|
69 |
public int dimension; |
|
70 |
public int options; |
|
71 |
public double scale; |
|
72 |
public double origin_x; |
|
73 |
public double origin_y; |
|
74 |
public double origin_z; |
|
75 |
public int index_built; |
|
76 |
public int element_count; |
|
77 |
public int max_element_count; |
|
78 |
public DGNElementInfo[] element_index; |
|
79 |
public int got_color_table; |
|
80 |
public byte[][] color_table = new byte[256][3]; //256 3 |
|
81 |
public int got_bounds; |
|
82 |
public double min_x; |
|
83 |
public double min_y; |
|
84 |
public double min_z; |
|
85 |
public double max_x; |
|
86 |
public double max_y; |
|
87 |
public double max_z; |
|
88 |
public int has_spatial_filter; |
|
89 |
public int sf_converted_to_uor; |
|
90 |
public int select_complex_group; |
|
91 |
public int in_complex_group; |
|
92 |
public long sf_min_x; |
|
93 |
public long sf_min_y; |
|
94 |
public long sf_max_x; |
|
95 |
public long sf_max_y; |
|
96 |
public double sf_min_x_geo; |
|
97 |
public double sf_min_y_geo; |
|
98 |
public double sf_max_x_geo; |
|
99 |
public double sf_max_y_geo; |
|
100 |
} |
org.gvsig.dgn/tags/org.gvsig.dgn-2.0.17/org.gvsig.dgn.provider/src/main/java/org/gvsig/fmap/dal/store/dgn/lib/DGNElemCellHeader.java | ||
---|---|---|
1 |
/* |
|
2 |
* Created on 17-jul-2003 |
|
3 |
* |
|
4 |
* Copyright (c) 2003 |
|
5 |
* Francisco José Peñarrubia Martínez |
|
6 |
* IVER Tecnologías de la Información S.A. |
|
7 |
* Salamanca 50 |
|
8 |
* 46005 Valencia ( SPAIN ) |
|
9 |
* +34 963163400 |
|
10 |
* mailto:fran@iver.es |
|
11 |
* http://www.iver.es |
|
12 |
*/ |
|
13 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
14 |
* |
|
15 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
16 |
* |
|
17 |
* This program is free software; you can redistribute it and/or |
|
18 |
* modify it under the terms of the GNU General Public License |
|
19 |
* as published by the Free Software Foundation; either version 2 |
|
20 |
* of the License, or (at your option) any later version. |
|
21 |
* |
|
22 |
* This program is distributed in the hope that it will be useful, |
|
23 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
24 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
25 |
* GNU General Public License for more details. |
|
26 |
* |
|
27 |
* You should have received a copy of the GNU General Public License |
|
28 |
* along with this program; if not, write to the Free Software |
|
29 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
30 |
* |
|
31 |
* For more information, contact: |
|
32 |
* |
|
33 |
* Generalitat Valenciana |
|
34 |
* Conselleria d'Infraestructures i Transport |
|
35 |
* Av. Blasco Ib??ez, 50 |
|
36 |
* 46010 VALENCIA |
|
37 |
* SPAIN |
|
38 |
* |
|
39 |
* +34 963862235 |
|
40 |
* gvsig@gva.es |
|
41 |
* www.gvsig.gva.es |
|
42 |
* |
|
43 |
* or |
|
44 |
* |
|
45 |
* IVER T.I. S.A |
|
46 |
* Salamanca 50 |
|
47 |
* 46005 Valencia |
|
48 |
* Spain |
|
49 |
* |
|
50 |
* +34 963163400 |
|
51 |
* dac@iver.es |
|
52 |
*/ |
|
53 |
package org.gvsig.fmap.dal.store.dgn.lib; |
|
54 |
|
|
55 |
/** |
|
56 |
* Clase utilizada para guardar un elemento de tipo CellHeader. |
|
57 |
* |
|
58 |
* @author Vicente Caballero Navarro |
|
59 |
*/ |
|
60 |
public class DGNElemCellHeader extends DGNElemCore { |
|
61 |
//DGNElemCore core; |
|
62 |
public int totlength; /*!< Total length of cell */ |
|
63 |
public byte[] name = new byte[7]; //7 /*!< Cell name */ |
|
64 |
public int cclass; /*!< Class bitmap */ |
|
65 |
public int[] levels = new int[4]; //4 /*!< Levels used in cell */ |
|
66 |
public DGNPoint rnglow = new DGNPoint(); /*!< X/Y/Z minimums for cell */ |
|
67 |
public DGNPoint rnghigh = new DGNPoint(); /*!< X/Y/Z minimums for cell */ |
|
68 |
public double[] trans = new double[9]; |
|
69 |
|
|
70 |
//9 /*!< 2D/3D Transformation Matrix */ |
|
71 |
public DGNPoint origin = new DGNPoint(); /*!< Cell Origin */ |
|
72 |
public double xscale; |
|
73 |
public double yscale; |
|
74 |
public double rotation; |
|
75 |
} |
org.gvsig.dgn/tags/org.gvsig.dgn-2.0.17/org.gvsig.dgn.provider/src/main/java/org/gvsig/fmap/dal/store/dgn/lib/ByteUtils.java | ||
---|---|---|
1 |
/* |
|
2 |
* Created on 21-jul-2003 |
|
3 |
* |
|
4 |
* Copyright (c) 2003 |
|
5 |
* Francisco José Peñarrubia Martínez |
|
6 |
* IVER Tecnologías de la Información S.A. |
|
7 |
* Salamanca 50 |
|
8 |
* 46005 Valencia ( SPAIN ) |
|
9 |
* +34 963163400 |
|
10 |
* mailto:fran@iver.es |
|
11 |
* http://www.iver.es |
|
12 |
*/ |
|
13 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
14 |
* |
|
15 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
16 |
* |
|
17 |
* This program is free software; you can redistribute it and/or |
|
18 |
* modify it under the terms of the GNU General Public License |
|
19 |
* as published by the Free Software Foundation; either version 2 |
|
20 |
* of the License, or (at your option) any later version. |
|
21 |
* |
|
22 |
* This program is distributed in the hope that it will be useful, |
|
23 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
24 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
25 |
* GNU General Public License for more details. |
|
26 |
* |
|
27 |
* You should have received a copy of the GNU General Public License |
|
28 |
* along with this program; if not, write to the Free Software |
|
29 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
30 |
* |
|
31 |
* For more information, contact: |
|
32 |
* |
|
33 |
* Generalitat Valenciana |
|
34 |
* Conselleria d'Infraestructures i Transport |
|
35 |
* Av. Blasco Ib??ez, 50 |
|
36 |
* 46010 VALENCIA |
|
37 |
* SPAIN |
|
38 |
* |
|
39 |
* +34 963862235 |
|
40 |
* gvsig@gva.es |
|
41 |
* www.gvsig.gva.es |
|
42 |
* |
|
43 |
* or |
|
44 |
* |
|
45 |
* IVER T.I. S.A |
|
46 |
* Salamanca 50 |
|
47 |
* 46005 Valencia |
|
48 |
* Spain |
|
49 |
* |
|
50 |
* +34 963163400 |
|
51 |
* dac@iver.es |
|
52 |
*/ |
|
53 |
package org.gvsig.fmap.dal.store.dgn.lib; |
|
54 |
|
|
55 |
import java.math.BigInteger; |
|
56 |
|
|
57 |
|
|
58 |
/** |
|
59 |
* Clase que engloba m?todos para trabajar con bytes. |
|
60 |
* |
|
61 |
* @author Vicente Caballero Navarro |
|
62 |
*/ |
|
63 |
public class ByteUtils { |
|
64 |
public static final int SIZE_BOOL = 1; |
|
65 |
public static final int SIZE_SHORT = 2; |
|
66 |
public static final int SIZE_INT = 4; |
|
67 |
public static final int SIZE_LONG = 8; |
|
68 |
public static final int SIZE_DOUBLE = 8; |
|
69 |
|
|
70 |
/** A nibble->char mapping for printing out bytes. */ |
|
71 |
public static final char[] digits = { |
|
72 |
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', |
|
73 |
'e', 'f' |
|
74 |
}; |
|
75 |
|
|
76 |
/** |
|
77 |
* Return the <code>int</code> represented by the bytes in |
|
78 |
* <code>data</code> staring at offset <code>offset[0]</code>. |
|
79 |
* |
|
80 |
* @param data the array from which to read |
|
81 |
* @param offset A single element array whose first element is the index in |
|
82 |
* data from which to begin reading on function entry, and which on |
|
83 |
* function exit has been incremented by the number of bytes read. |
|
84 |
* |
|
85 |
* @return the value of the <code>int</code> decoded |
|
86 |
*/ |
|
87 |
public static final int bytesToInt(byte[] data, int[] offset) { |
|
88 |
/** |
|
89 |
* TODO: We use network-order within OceanStore, but temporarily |
|
90 |
* supporting intel-order to work with some JNI code until JNI code is |
|
91 |
* set to interoperate with network-order. |
|
92 |
*/ |
|
93 |
int result = 0; |
|
94 |
|
|
95 |
for (int i = 0; i < SIZE_INT; ++i) { |
|
96 |
result <<= 8; |
|
97 |
result |= byteToUnsignedInt(data[offset[0]++]); |
|
98 |
} |
|
99 |
|
|
100 |
return result; |
|
101 |
} |
|
102 |
|
|
103 |
/** |
|
104 |
* Write the bytes representing <code>i</code> into the byte array |
|
105 |
* <code>data</code>, starting at index <code>offset [0]</code>, and |
|
106 |
* increment <code>offset [0]</code> by the number of bytes written; if |
|
107 |
* <code>data == null</code>, increment <code>offset [0]</code> by the |
|
108 |
* number of bytes that would have been written otherwise. |
|
109 |
* |
|
110 |
* @param i the <code>int</code> to encode |
|
111 |
* @param data The byte array to store into, or <code>null</code>. |
|
112 |
* @param offset A single element array whose first element is the index in |
|
113 |
* data to begin writing at on function entry, and which on |
|
114 |
* function exit has been incremented by the number of bytes |
|
115 |
* written. |
|
116 |
*/ |
|
117 |
public static final void intToBytes(int i, byte[] data, int[] offset) { |
|
118 |
/** |
|
119 |
* TODO: We use network-order within OceanStore, but temporarily |
|
120 |
* supporting intel-order to work with some JNI code until JNI code is |
|
121 |
* set to interoperate with network-order. |
|
122 |
*/ |
|
123 |
if (data != null) { |
|
124 |
for (int j = (offset[0] + SIZE_INT) - 1; j >= offset[0]; --j) { |
|
125 |
data[j] = (byte) i; |
|
126 |
i >>= 8; |
|
127 |
} |
|
128 |
} |
|
129 |
|
|
130 |
offset[0] += SIZE_INT; |
|
131 |
} |
|
132 |
|
|
133 |
/** |
|
134 |
* Return the <code>short</code> represented by the bytes in |
|
135 |
* <code>data</code> staring at offset <code>offset[0]</code>. |
|
136 |
* |
|
137 |
* @param data the array from which to read |
|
138 |
* @param offset A single element array whose first element is the index in |
|
139 |
* data from which to begin reading on function entry, and which on |
|
140 |
* function exit has been incremented by the number of bytes read. |
|
141 |
* |
|
142 |
* @return the value of the <code>short</code> decoded |
|
143 |
*/ |
|
144 |
public static final short bytesToShort(byte[] data, int[] offset) { |
|
145 |
/** |
|
146 |
* TODO: We use network-order within OceanStore, but temporarily |
|
147 |
* supporting intel-order to work with some JNI code until JNI code is |
|
148 |
* set to interoperate with network-order. |
|
149 |
*/ |
|
150 |
short result = 0; |
|
151 |
|
|
152 |
for (int i = 0; i < SIZE_SHORT; ++i) { |
|
153 |
result <<= 8; |
|
154 |
result |= (short) byteToUnsignedInt(data[offset[0]++]); |
|
155 |
} |
|
156 |
|
|
157 |
return result; |
|
158 |
} |
|
159 |
|
|
160 |
/** |
|
161 |
* Write the bytes representing <code>s</code> into the byte array |
|
162 |
* <code>data</code>, starting at index <code>offset [0]</code>, and |
|
163 |
* increment <code>offset [0]</code> by the number of bytes written; if |
|
164 |
* <code>data == null</code>, increment <code>offset [0]</code> by the |
|
165 |
* number of bytes that would have been written otherwise. |
|
166 |
* |
|
167 |
* @param s the <code>short</code> to encode |
|
168 |
* @param data The byte array to store into, or <code>null</code>. |
|
169 |
* @param offset A single element array whose first element is the index in |
|
170 |
* data to begin writing at on function entry, and which on |
|
171 |
* function exit has been incremented by the number of bytes |
|
172 |
* written. |
|
173 |
*/ |
|
174 |
public static final void shortToBytes(short s, byte[] data, int[] offset) { |
|
175 |
/** |
|
176 |
* TODO: We use network-order within OceanStore, but temporarily |
|
177 |
* supporting intel-order to work with some JNI code until JNI code is |
|
178 |
* set to interoperate with network-order. |
|
179 |
*/ |
|
180 |
if (data != null) { |
|
181 |
data[offset[0] + 1] = (byte) s; |
|
182 |
data[offset[0]] = (byte) (s >> 8); |
|
183 |
} |
|
184 |
|
|
185 |
offset[0] += SIZE_SHORT; |
|
186 |
} |
|
187 |
|
|
188 |
/** |
|
189 |
* Return the <code>long</code> represented by the bytes in |
|
190 |
* <code>data</code> staring at offset <code>offset[0]</code>. |
|
191 |
* |
|
192 |
* @param data the array from which to read |
|
193 |
* @param offset A single element array whose first element is the index in |
|
194 |
* data from which to begin reading on function entry, and which |
|
195 |
* on function exit has been incremented by the number of bytes |
|
196 |
* read. |
|
197 |
* |
|
198 |
* @return the value of the <code>long</code> decoded |
|
199 |
*/ |
|
200 |
public static final long bytesToLong(byte[] data, int[] offset) { |
|
201 |
long result = 0; |
|
202 |
|
|
203 |
for (int i = 0; i < SIZE_LONG; ++i) { |
|
204 |
result <<= 8; |
|
205 |
|
|
206 |
int res = byteToUnsignedInt(data[offset[0]++]); |
|
207 |
result = result | res; |
|
208 |
} |
|
209 |
|
|
210 |
return result; |
|
211 |
} |
|
212 |
|
|
213 |
/** |
|
214 |
* Write the bytes representing <code>l</code> into the byte array |
|
215 |
* <code>data</code>, starting at index <code>offset [0]</code>, and |
|
216 |
* increment <code>offset [0]</code> by the number of bytes written; if |
|
217 |
* <code>data == null</code>, increment <code>offset [0]</code> by the |
|
218 |
* number of bytes that would have been written otherwise. |
|
219 |
* |
|
220 |
* @param l the <code>long</code> to encode |
|
221 |
* @param data The byte array to store into, or <code>null</code>. |
|
222 |
* @param offset A single element array whose first element is the index in |
|
223 |
* data to begin writing at on function entry, and which on |
|
224 |
* function exit has been incremented by the number of bytes |
|
225 |
* written. |
|
226 |
*/ |
|
227 |
public static final void longToBytes(long l, byte[] data, int[] offset) { |
|
228 |
/** |
|
229 |
* TODO: We use network-order within OceanStore, but temporarily |
|
230 |
* supporting intel-order to work with some JNI code until JNI code is |
|
231 |
* set to interoperate with network-order. |
|
232 |
*/ |
|
233 |
if (data != null) { |
|
234 |
for (int j = (offset[0] + SIZE_LONG) - 1; j >= offset[0]; --j) { |
|
235 |
data[j] = (byte) l; |
|
236 |
l >>= 8; |
|
237 |
} |
|
238 |
} |
|
239 |
|
|
240 |
offset[0] += SIZE_LONG; |
|
241 |
} |
|
242 |
|
|
243 |
/** |
|
244 |
* Return the <code>double</code> represented by the bytes in |
|
245 |
* <code>data</code> staring at offset <code>offset[0]</code>. |
|
246 |
* |
|
247 |
* @param data the array from which to read |
|
248 |
* @param offset A single element array whose first element is the index in |
|
249 |
* data from which to begin reading on function entry, and which |
|
250 |
* on function exit has been incremented by the number of bytes |
|
251 |
* read. |
|
252 |
* |
|
253 |
* @return the value of the <code>double</code> decoded |
|
254 |
*/ |
|
255 |
public static final double bytesToDouble(byte[] data, int[] offset) { |
|
256 |
long bits = bytesToLong(data, offset); |
|
257 |
|
|
258 |
return Double.longBitsToDouble(bits); |
|
259 |
} |
|
260 |
|
|
261 |
/** |
|
262 |
* Write the bytes representing <code>d</code> into the byte array |
|
263 |
* <code>data</code>, starting at index <code>offset [0]</code>, and |
|
264 |
* increment <code>offset [0]</code> by the number of bytes written; if |
|
265 |
* <code>data == null</code>, increment <code>offset [0]</code> by the |
|
266 |
* number of bytes that would have been written otherwise. |
|
267 |
* |
|
268 |
* @param d the <code>double</code> to encode |
|
269 |
* @param data The byte array to store into, or <code>null</code>. |
|
270 |
* @param offset A single element array whose first element is the index in |
|
271 |
* data to begin writing at on function entry, and which on |
|
272 |
* function exit has been incremented by the number of bytes |
|
273 |
* written. |
|
274 |
*/ |
|
275 |
public static final void doubleToBytes(double d, byte[] data, int[] offset) { |
|
276 |
long bits = Double.doubleToLongBits(d); |
|
277 |
longToBytes(bits, data, offset); |
|
278 |
} |
|
279 |
|
|
280 |
/** |
|
281 |
* Return the <code>String</code> represented by the bytes in |
|
282 |
* <code>data</code> staring at offset <code>offset[0]</code>. This method |
|
283 |
* relies on the user using the corresponding <code>stringToBytes</code> |
|
284 |
* method to encode the <code>String</code>, so that it may properly |
|
285 |
* retrieve the <code>String</code> length. |
|
286 |
* |
|
287 |
* @param data the array from which to read |
|
288 |
* @param offset A single element array whose first element is the index in |
|
289 |
* data from which to begin reading on function entry, and which on |
|
290 |
* function exit has been incremented by the number of bytes read. |
|
291 |
* |
|
292 |
* @return the value of the <code>String</code> decoded |
|
293 |
*/ |
Also available in: Unified diff