Revision 1607 branches/v02_desarrollo/libraries/libCq CMS for java.old/src/org/cresques/px/dxf/DxfArc.java
DxfArc.java | ||
---|---|---|
13 | 13 |
import org.cresques.cts.ICoordTrans; |
14 | 14 |
import org.cresques.cts.IProjection; |
15 | 15 |
import org.cresques.geo.ViewPortData; |
16 |
import org.cresques.io.DxfGroup; |
|
16 | 17 |
import org.cresques.px.Extent; |
17 | 18 |
|
18 | 19 |
/** |
19 | 20 |
* Entidad TEXT de AutoCAD |
20 |
* |
|
21 |
* jmorell: Definici?n de atributos para arcos necesaria para el piloto de CAD y |
|
22 |
* implementaci?n de su escritura en formato DXF2000. |
|
21 | 23 |
* @author "Luis W. Sevilla" <sevilla_lui@gva.es>* @author administrador |
22 | 24 |
*/ |
23 | 25 |
public class DxfArc extends DxfEntity { |
... | ... | |
26 | 28 |
Point2D [] pts; |
27 | 29 |
GeneralPath gp = null; |
28 | 30 |
boolean closed = false; |
29 |
|
|
31 |
private Point2D centralPoint; |
|
32 |
private Point2D init; |
|
33 |
private Point2D end; |
|
34 |
private Point2D center; |
|
35 |
private double radius; |
|
36 |
private double initAngle; |
|
37 |
private double endAngle; |
|
38 |
|
|
30 | 39 |
public DxfArc(IProjection proj, DxfLayer layer, Point2D[] pts) { |
31 | 40 |
super(proj, layer); |
32 | 41 |
this.pts = pts; |
... | ... | |
96 | 105 |
gp.closePath(); |
97 | 106 |
} |
98 | 107 |
} |
99 |
/* (non-Javadoc) |
|
100 |
* @see org.cresques.px.dxf.DxfEntity#toDxfFileString() |
|
108 |
|
|
109 |
/** |
|
110 |
* 050223, jmorell: Escritura de arcos en un fichero DXF2000. |
|
101 | 111 |
*/ |
102 | 112 |
public String toDxfString() { |
103 |
// TODO Auto-generated method stub |
|
104 |
return ""; |
|
113 |
StringBuffer sb = null; |
|
114 |
sb = new StringBuffer( DxfGroup.toString(0, "ARC") ); |
|
115 |
sb.append( DxfGroup.toString(5, getHandle()) ); |
|
116 |
sb.append( DxfGroup.toString(100, "AcDbEntity") ); |
|
117 |
sb.append( DxfGroup.toString(8, layer.getName()) ); |
|
118 |
sb.append( DxfGroup.toString(62, dxfColor) ); |
|
119 |
sb.append( DxfGroup.toString(100, "AcDbCircle") ); |
|
120 |
sb.append( DxfGroup.toString(10, getCenter().getX(), 6)); |
|
121 |
sb.append( DxfGroup.toString(20, getCenter().getY(), 6) ); |
|
122 |
sb.append( DxfGroup.toString(40, getRadius(), 6) ); |
|
123 |
sb.append( DxfGroup.toString(100, "AcDbArc") ); |
|
124 |
sb.append( DxfGroup.toString(50, getInitAngle(), 6) ); |
|
125 |
sb.append( DxfGroup.toString(51, getEndAngle(), 6) ); |
|
126 |
return sb.toString(); |
|
105 | 127 |
} |
106 | 128 |
/** |
107 | 129 |
* @return |
... | ... | |
118 | 140 |
return (GeneralPath) gp.clone(); |
119 | 141 |
}*/ |
120 | 142 |
|
143 |
/** |
|
144 |
* @return Returns the center. |
|
145 |
*/ |
|
146 |
public Point2D getCenter() { |
|
147 |
return center; |
|
148 |
} |
|
149 |
/** |
|
150 |
* @param center The center to set. |
|
151 |
*/ |
|
152 |
public void setCenter(Point2D center) { |
|
153 |
this.center = center; |
|
154 |
} |
|
155 |
/** |
|
156 |
* @return Returns the end. |
|
157 |
*/ |
|
158 |
public Point2D getEnd() { |
|
159 |
return end; |
|
160 |
} |
|
161 |
/** |
|
162 |
* @param end The end to set. |
|
163 |
*/ |
|
164 |
public void setEnd(Point2D end) { |
|
165 |
this.end = end; |
|
166 |
} |
|
167 |
/** |
|
168 |
* @return Returns the init. |
|
169 |
*/ |
|
170 |
public Point2D getInit() { |
|
171 |
return init; |
|
172 |
} |
|
173 |
/** |
|
174 |
* @param init The init to set. |
|
175 |
*/ |
|
176 |
public void setInit(Point2D init) { |
|
177 |
this.init = init; |
|
178 |
} |
|
179 |
/** |
|
180 |
* @return Returns the centralPoint. |
|
181 |
*/ |
|
182 |
public Point2D getCentralPoint() { |
|
183 |
return centralPoint; |
|
184 |
} |
|
185 |
/** |
|
186 |
* @param centralPoint The centralPoint to set. |
|
187 |
*/ |
|
188 |
public void setCentralPoint(Point2D centralPoint) { |
|
189 |
this.centralPoint = centralPoint; |
|
190 |
} |
|
191 |
/** |
|
192 |
* @return Returns the endAngle. |
|
193 |
*/ |
|
194 |
public double getEndAngle() { |
|
195 |
return endAngle; |
|
196 |
} |
|
197 |
/** |
|
198 |
* @param endAngle The endAngle to set. |
|
199 |
*/ |
|
200 |
public void setEndAngle(double endAngle) { |
|
201 |
this.endAngle = endAngle; |
|
202 |
} |
|
203 |
/** |
|
204 |
* @return Returns the initAngle. |
|
205 |
*/ |
|
206 |
public double getInitAngle() { |
|
207 |
return initAngle; |
|
208 |
} |
|
209 |
/** |
|
210 |
* @param initAngle The initAngle to set. |
|
211 |
*/ |
|
212 |
public void setInitAngle(double initAngle) { |
|
213 |
this.initAngle = initAngle; |
|
214 |
} |
|
215 |
/** |
|
216 |
* @return Returns the radius. |
|
217 |
*/ |
|
218 |
public double getRadius() { |
|
219 |
return radius; |
|
220 |
} |
|
221 |
/** |
|
222 |
* @param radius The radius to set. |
|
223 |
*/ |
|
224 |
public void setRadius(double radius) { |
|
225 |
this.radius = radius; |
|
226 |
} |
|
121 | 227 |
} |
Also available in: Unified diff