Revision 1607 branches/v02_desarrollo/libraries/libCq CMS for java.old/src/org/cresques/px/dxf/DxfCircle.java
DxfCircle.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 el piloto de CAD e implementaci?n de |
|
22 |
* la escritura en formato DXF2000. |
|
21 | 23 |
* @author "Luis W. Sevilla" <sevilla_lui@gva.es>* @author administrador |
22 | 24 |
*/ |
23 | 25 |
public class DxfCircle extends DxfEntity { |
... | ... | |
26 | 28 |
Point2D [] pts; |
27 | 29 |
GeneralPath gp = null; |
28 | 30 |
boolean closed = true; |
31 |
private Point2D center; |
|
32 |
private double radius; |
|
29 | 33 |
|
30 | 34 |
public DxfCircle(IProjection proj, DxfLayer layer, Point2D[] pts) { |
31 | 35 |
super(proj, layer); |
... | ... | |
94 | 98 |
gp.closePath(); |
95 | 99 |
} |
96 | 100 |
} |
97 |
/* (non-Javadoc)
|
|
98 |
* @see org.cresques.px.dxf.DxfEntity#toDxfFileString()
|
|
101 |
/**
|
|
102 |
* Escritura de c?rculos en un DXF2000.
|
|
99 | 103 |
*/ |
100 | 104 |
public String toDxfString() { |
101 |
// TODO Auto-generated method stub |
|
102 |
return ""; |
|
105 |
StringBuffer sb = null; |
|
106 |
sb = new StringBuffer( DxfGroup.toString(0, "CIRCLE") ); |
|
107 |
sb.append( DxfGroup.toString(5, getHandle()) ); |
|
108 |
sb.append( DxfGroup.toString(100, "AcDbEntity") ); |
|
109 |
sb.append( DxfGroup.toString(8, layer.getName()) ); |
|
110 |
sb.append( DxfGroup.toString(62, dxfColor) ); |
|
111 |
sb.append( DxfGroup.toString(100, "AcDbCircle") ); |
|
112 |
sb.append( DxfGroup.toString(10, getCenter().getX(), 6)); |
|
113 |
sb.append( DxfGroup.toString(20, getCenter().getY(), 6) ); |
|
114 |
sb.append( DxfGroup.toString(40, getRadius(), 6) ); |
|
115 |
return sb.toString(); |
|
103 | 116 |
} |
104 | 117 |
/** |
105 | 118 |
* @return |
... | ... | |
116 | 129 |
return (GeneralPath) gp.clone(); |
117 | 130 |
}*/ |
118 | 131 |
|
132 |
/** |
|
133 |
* @return Returns the radius. |
|
134 |
*/ |
|
135 |
public double getRadius() { |
|
136 |
return radius; |
|
137 |
} |
|
138 |
/** |
|
139 |
* @param radius The radius to set. |
|
140 |
*/ |
|
141 |
public void setRadius(double radius) { |
|
142 |
this.radius = radius; |
|
143 |
} |
|
144 |
/** |
|
145 |
* @return Returns the center. |
|
146 |
*/ |
|
147 |
public Point2D getCenter() { |
|
148 |
return center; |
|
149 |
} |
|
150 |
/** |
|
151 |
* @param center The center to set. |
|
152 |
*/ |
|
153 |
public void setCenter(Point2D center) { |
|
154 |
this.center = center; |
|
155 |
} |
|
119 | 156 |
} |
Also available in: Unified diff