root / trunk / org.gvsig.dwg / org.gvsig.dwg.lib / src / main / java / org / gvsig / dwg / lib / objects / DwgLinearDimension.java @ 5
History | View | Annotate | Download (8.5 KB)
1 |
/* jdwglib. Java Library for reading Dwg files.
|
---|---|
2 |
*
|
3 |
* Author: Jose Morell Rama (jose.morell@gmail.com).
|
4 |
* Port from the Pythoncad Dwg library by Art Haas.
|
5 |
*
|
6 |
* Copyright (C) 2005 Jose Morell, IVER TI S.A. and Generalitat Valenciana
|
7 |
*
|
8 |
* This program is free software; you can redistribute it and/or
|
9 |
* modify it under the terms of the GNU General Public License
|
10 |
* as published by the Free Software Foundation; either version 2
|
11 |
* of the License, or (at your option) any later version.
|
12 |
*
|
13 |
* This program is distributed in the hope that it will be useful,
|
14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16 |
* GNU General Public License for more details.
|
17 |
*
|
18 |
* You should have received a copy of the GNU General Public License
|
19 |
* along with this program; if not, write to the Free Software
|
20 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
21 |
*
|
22 |
* For more information, contact:
|
23 |
*
|
24 |
* Jose Morell (jose.morell@gmail.com)
|
25 |
*
|
26 |
* or
|
27 |
*
|
28 |
* IVER TI S.A.
|
29 |
* C/Salamanca, 50
|
30 |
* 46005 Valencia
|
31 |
* Spain
|
32 |
* +34 963163400
|
33 |
* dac@iver.es
|
34 |
*/
|
35 |
package org.gvsig.dwg.lib.objects; |
36 |
|
37 |
import java.awt.geom.Point2D; |
38 |
|
39 |
import org.gvsig.dwg.lib.DwgHandleReference; |
40 |
import org.gvsig.dwg.lib.DwgObject; |
41 |
|
42 |
|
43 |
/**
|
44 |
* The DwgLinearDimension class represents a DWG Linear dimension
|
45 |
*
|
46 |
* @author jmorell
|
47 |
*/
|
48 |
public class DwgLinearDimension extends DwgObject { |
49 |
public DwgLinearDimension(int index) { |
50 |
super(index);
|
51 |
// TODO Auto-generated constructor stub
|
52 |
} |
53 |
private double[] extrusion; |
54 |
private Point2D textMidpoint; |
55 |
private double elevation; |
56 |
private int flags; |
57 |
private String text; |
58 |
private double rotation; |
59 |
private double horizDir; |
60 |
private double[] insScale; |
61 |
private double insRotation; |
62 |
private int attachmentPoint; |
63 |
private int linespaceStyle; |
64 |
private double linespaceFactor; |
65 |
private double actualMeasurement; |
66 |
private Point2D pt12; |
67 |
private double[] pt10; |
68 |
private double[] pt13; |
69 |
private double[] pt14; |
70 |
private double extRotation; |
71 |
private double dimensionRotation; |
72 |
private DwgHandleReference dimstyleHandle = null; |
73 |
private DwgHandleReference anonBlockHandle = null; |
74 |
/**
|
75 |
* @return Returns the elevation.
|
76 |
*/
|
77 |
public double getElevation() { |
78 |
return elevation;
|
79 |
} |
80 |
/**
|
81 |
* @param elevation The elevation to set.
|
82 |
*/
|
83 |
public void setElevation(double elevation) { |
84 |
this.elevation = elevation;
|
85 |
} |
86 |
|
87 |
/**
|
88 |
* @return Returns the actualMeasurement.
|
89 |
*/
|
90 |
public double getActualMeasurement() { |
91 |
return actualMeasurement;
|
92 |
} |
93 |
/**
|
94 |
* @param actualMeasurement The actualMeasurement to set.
|
95 |
*/
|
96 |
public void setActualMeasurement(double actualMeasurement) { |
97 |
this.actualMeasurement = actualMeasurement;
|
98 |
} |
99 |
/**
|
100 |
* @return Returns the anonBlockHandle.
|
101 |
*/
|
102 |
public DwgHandleReference getAnonBlockHandle() {
|
103 |
return anonBlockHandle;
|
104 |
} |
105 |
/**
|
106 |
* @param anonBlockHandle The anonBlockHandle to set.
|
107 |
*/
|
108 |
public void setAnonBlockHandle(DwgHandleReference anonBlockHandle) { |
109 |
this.anonBlockHandle = anonBlockHandle;
|
110 |
} |
111 |
/**
|
112 |
* @return Returns the attachmentPoint.
|
113 |
*/
|
114 |
public int getAttachmentPoint() { |
115 |
return attachmentPoint;
|
116 |
} |
117 |
/**
|
118 |
* @param attachmentPoint The attachmentPoint to set.
|
119 |
*/
|
120 |
public void setAttachmentPoint(int attachmentPoint) { |
121 |
this.attachmentPoint = attachmentPoint;
|
122 |
} |
123 |
/**
|
124 |
* @return Returns the dimensionRotation.
|
125 |
*/
|
126 |
public double getDimensionRotation() { |
127 |
return dimensionRotation;
|
128 |
} |
129 |
/**
|
130 |
* @param dimensionRotation The dimensionRotation to set.
|
131 |
*/
|
132 |
public void setDimensionRotation(double dimensionRotation) { |
133 |
this.dimensionRotation = dimensionRotation;
|
134 |
} |
135 |
/**
|
136 |
* @return Returns the dimstyleHandle.
|
137 |
*/
|
138 |
public DwgHandleReference getDimstyleHandle() {
|
139 |
return dimstyleHandle;
|
140 |
} |
141 |
/**
|
142 |
* @param dimstyleHandle The dimstyleHandle to set.
|
143 |
*/
|
144 |
public void setDimstyleHandle(DwgHandleReference dimstyleHandle) { |
145 |
this.dimstyleHandle = dimstyleHandle;
|
146 |
} |
147 |
/**
|
148 |
* @return Returns the extRotation.
|
149 |
*/
|
150 |
public double getExtRotation() { |
151 |
return extRotation;
|
152 |
} |
153 |
/**
|
154 |
* @param extRotation The extRotation to set.
|
155 |
*/
|
156 |
public void setExtRotation(double extRotation) { |
157 |
this.extRotation = extRotation;
|
158 |
} |
159 |
/**
|
160 |
* @return Returns the extrusion.
|
161 |
*/
|
162 |
public double[] getExtrusion() { |
163 |
return extrusion;
|
164 |
} |
165 |
/**
|
166 |
* @param extrusion The extrusion to set.
|
167 |
*/
|
168 |
public void setExtrusion(double[] extrusion) { |
169 |
this.extrusion = extrusion;
|
170 |
} |
171 |
/**
|
172 |
* @return Returns the flags.
|
173 |
*/
|
174 |
public int getFlags() { |
175 |
return flags;
|
176 |
} |
177 |
/**
|
178 |
* @param flags The flags to set.
|
179 |
*/
|
180 |
public void setFlags(int flags) { |
181 |
this.flags = flags;
|
182 |
} |
183 |
/**
|
184 |
* @return Returns the horizDir.
|
185 |
*/
|
186 |
public double getHorizDir() { |
187 |
return horizDir;
|
188 |
} |
189 |
/**
|
190 |
* @param horizDir The horizDir to set.
|
191 |
*/
|
192 |
public void setHorizDir(double horizDir) { |
193 |
this.horizDir = horizDir;
|
194 |
} |
195 |
/**
|
196 |
* @return Returns the insRotation.
|
197 |
*/
|
198 |
public double getInsRotation() { |
199 |
return insRotation;
|
200 |
} |
201 |
/**
|
202 |
* @param insRotation The insRotation to set.
|
203 |
*/
|
204 |
public void setInsRotation(double insRotation) { |
205 |
this.insRotation = insRotation;
|
206 |
} |
207 |
/**
|
208 |
* @return Returns the insScale.
|
209 |
*/
|
210 |
public double[] getInsScale() { |
211 |
return insScale;
|
212 |
} |
213 |
/**
|
214 |
* @param insScale The insScale to set.
|
215 |
*/
|
216 |
public void setInsScale(double[] insScale) { |
217 |
this.insScale = insScale;
|
218 |
} |
219 |
/**
|
220 |
* @return Returns the linespaceFactor.
|
221 |
*/
|
222 |
public double getLinespaceFactor() { |
223 |
return linespaceFactor;
|
224 |
} |
225 |
/**
|
226 |
* @param linespaceFactor The linespaceFactor to set.
|
227 |
*/
|
228 |
public void setLinespaceFactor(double linespaceFactor) { |
229 |
this.linespaceFactor = linespaceFactor;
|
230 |
} |
231 |
/**
|
232 |
* @return Returns the linespaceStyle.
|
233 |
*/
|
234 |
public int getLinespaceStyle() { |
235 |
return linespaceStyle;
|
236 |
} |
237 |
/**
|
238 |
* @param linespaceStyle The linespaceStyle to set.
|
239 |
*/
|
240 |
public void setLinespaceStyle(int linespaceStyle) { |
241 |
this.linespaceStyle = linespaceStyle;
|
242 |
} |
243 |
/**
|
244 |
* @return Returns the pt10.
|
245 |
*/
|
246 |
public double[] getPt10() { |
247 |
return pt10;
|
248 |
} |
249 |
/**
|
250 |
* @param pt10 The pt10 to set.
|
251 |
*/
|
252 |
public void setPt10(double[] pt10) { |
253 |
this.pt10 = pt10;
|
254 |
} |
255 |
/**
|
256 |
* @return Returns the pt12.
|
257 |
*/
|
258 |
public Point2D getPt12() { |
259 |
return pt12;
|
260 |
} |
261 |
/**
|
262 |
* @param pt12 The pt12 to set.
|
263 |
*/
|
264 |
public void setPt12(Point2D pt12) { |
265 |
this.pt12 = pt12;
|
266 |
} |
267 |
/**
|
268 |
* @return Returns the pt13.
|
269 |
*/
|
270 |
public double[] getPt13() { |
271 |
return pt13;
|
272 |
} |
273 |
/**
|
274 |
* @param pt13 The pt13 to set.
|
275 |
*/
|
276 |
public void setPt13(double[] pt13) { |
277 |
this.pt13 = pt13;
|
278 |
} |
279 |
/**
|
280 |
* @return Returns the pt14.
|
281 |
*/
|
282 |
public double[] getPt14() { |
283 |
return pt14;
|
284 |
} |
285 |
/**
|
286 |
* @param pt14 The pt14 to set.
|
287 |
*/
|
288 |
public void setPt14(double[] pt14) { |
289 |
this.pt14 = pt14;
|
290 |
} |
291 |
/**
|
292 |
* @return Returns the rotation.
|
293 |
*/
|
294 |
public double getRotation() { |
295 |
return rotation;
|
296 |
} |
297 |
/**
|
298 |
* @param rotation The rotation to set.
|
299 |
*/
|
300 |
public void setRotation(double rotation) { |
301 |
this.rotation = rotation;
|
302 |
} |
303 |
/**
|
304 |
* @return Returns the text.
|
305 |
*/
|
306 |
public String getText() { |
307 |
return text;
|
308 |
} |
309 |
/**
|
310 |
* @param text The text to set.
|
311 |
*/
|
312 |
public void setText(String text) { |
313 |
this.text = text;
|
314 |
} |
315 |
/**
|
316 |
* @return Returns the textMidpoint.
|
317 |
*/
|
318 |
public Point2D getTextMidpoint() { |
319 |
return textMidpoint;
|
320 |
} |
321 |
/**
|
322 |
* @param textMidpoint The textMidpoint to set.
|
323 |
*/
|
324 |
public void setTextMidpoint(Point2D textMidpoint) { |
325 |
this.textMidpoint = textMidpoint;
|
326 |
} |
327 |
/* (non-Javadoc)
|
328 |
* @see java.lang.Object#clone()
|
329 |
*/
|
330 |
public Object clone(){ |
331 |
DwgLinearDimension obj = new DwgLinearDimension(index);
|
332 |
this.fill(obj);
|
333 |
return obj;
|
334 |
} |
335 |
|
336 |
protected void fill(DwgObject obj){ |
337 |
super.fill(obj);
|
338 |
DwgLinearDimension myObj = (DwgLinearDimension)obj; |
339 |
|
340 |
myObj.setActualMeasurement(actualMeasurement); |
341 |
myObj.setAnonBlockHandle(anonBlockHandle); |
342 |
myObj.setAttachmentPoint(attachmentPoint); |
343 |
myObj.setDimensionRotation(dimensionRotation); |
344 |
myObj.setDimstyleHandle(dimstyleHandle); |
345 |
myObj.setElevation(elevation); |
346 |
myObj.setExtRotation(extRotation); |
347 |
myObj.setExtrusion(extrusion); |
348 |
myObj.setFlags(flags); |
349 |
myObj.setHorizDir(horizDir); |
350 |
myObj.setInsRotation(insRotation); |
351 |
myObj.setInsScale(insScale); |
352 |
myObj.setLinespaceFactor(linespaceFactor); |
353 |
myObj.setLinespaceStyle(linespaceStyle); |
354 |
myObj.setPt10(pt10); |
355 |
myObj.setPt12(pt12); |
356 |
myObj.setPt13(pt13); |
357 |
myObj.setPt14(pt14); |
358 |
myObj.setRotation(rotation); |
359 |
myObj.setText(text); |
360 |
myObj.setTextMidpoint(textMidpoint); |
361 |
} |
362 |
|
363 |
} |