root / trunk / libraries / libFMap / src / com / iver / cit / gvsig / fmap / core / Polyline3D.java @ 240
History | View | Annotate | Download (3.3 KB)
1 |
package com.iver.cit.gvsig.fmap.core; |
---|---|
2 |
|
3 |
import org.geotools.geometry.Geometry; |
4 |
|
5 |
import org.geotools.renderer.style.Style2D; |
6 |
|
7 |
import com.iver.cit.gvsig.fmap.ViewPort; |
8 |
|
9 |
import java.awt.Color; |
10 |
import java.awt.Graphics2D; |
11 |
import java.awt.Rectangle; |
12 |
import java.awt.geom.AffineTransform; |
13 |
import java.awt.geom.PathIterator; |
14 |
import java.awt.geom.Point2D; |
15 |
import java.awt.geom.Rectangle2D; |
16 |
|
17 |
|
18 |
/**
|
19 |
* Polilinea 3D.
|
20 |
*
|
21 |
* @author Vicente Caballero Navarro
|
22 |
*
|
23 |
*/
|
24 |
public class Polyline3D implements FGeometry { |
25 |
private GeneralPathX gp = null; |
26 |
double[] pZ = null; |
27 |
|
28 |
/**
|
29 |
* Crea un nuevo Polyline3D.
|
30 |
*
|
31 |
* @param gpx DOCUMENT ME!
|
32 |
* @param pZ DOCUMENT ME!
|
33 |
*/
|
34 |
public Polyline3D(GeneralPathX gpx, double[] pZ) { |
35 |
gp = gpx; |
36 |
this.pZ = pZ;
|
37 |
} |
38 |
|
39 |
/**
|
40 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#draw(java.awt.Graphics2D,
|
41 |
* ViewPort, org.geotools.renderer.style.Style2D)
|
42 |
*/
|
43 |
public void draw(Graphics2D g, ViewPort vp, Style2D symbol) { |
44 |
gp.transform(vp.getAffineTransform()); |
45 |
|
46 |
//g.setPaint(Color.red);
|
47 |
//g.fill(gp);
|
48 |
g.setPaint(Color.black);
|
49 |
g.draw(gp); |
50 |
} |
51 |
|
52 |
|
53 |
/**
|
54 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#getType()
|
55 |
*/
|
56 |
public int getType() { |
57 |
return FGeometry.LINE;
|
58 |
} |
59 |
|
60 |
/**
|
61 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#toJTSGeometry()
|
62 |
*/
|
63 |
public Geometry toJTSGeometry() {
|
64 |
return null; |
65 |
} |
66 |
|
67 |
/**
|
68 |
* @see com.iver.cit.gvsig.fmap.core.FGeometry#createLabels(int, boolean)
|
69 |
*/
|
70 |
public FGeometry[] createLabels(int position, boolean duplicates) { |
71 |
return null; |
72 |
} |
73 |
|
74 |
/**
|
75 |
* @see java.awt.Shape#contains(double, double)
|
76 |
*/
|
77 |
public boolean contains(double x, double y) { |
78 |
return gp.contains(x,y);
|
79 |
} |
80 |
|
81 |
/**
|
82 |
* @see java.awt.Shape#contains(double, double, double, double)
|
83 |
*/
|
84 |
public boolean contains(double x, double y, double w, double h) { |
85 |
return gp.contains(x,y,w,h);
|
86 |
} |
87 |
|
88 |
/**
|
89 |
* @see java.awt.Shape#intersects(double, double, double, double)
|
90 |
*/
|
91 |
public boolean intersects(double x, double y, double w, double h) { |
92 |
return gp.intersects(x,y,w,h);
|
93 |
} |
94 |
|
95 |
/**
|
96 |
* @see java.awt.Shape#getBounds()
|
97 |
*/
|
98 |
public Rectangle getBounds() { |
99 |
return gp.getBounds();
|
100 |
} |
101 |
|
102 |
/**
|
103 |
* @see java.awt.Shape#contains(java.awt.geom.Point2D)
|
104 |
*/
|
105 |
public boolean contains(Point2D p) { |
106 |
return gp.contains(p);
|
107 |
} |
108 |
|
109 |
/**
|
110 |
* @see java.awt.Shape#getBounds2D()
|
111 |
*/
|
112 |
public Rectangle2D getBounds2D() { |
113 |
return gp.getBounds2D();
|
114 |
} |
115 |
|
116 |
/**
|
117 |
* @see java.awt.Shape#contains(java.awt.geom.Rectangle2D)
|
118 |
*/
|
119 |
public boolean contains(Rectangle2D r) { |
120 |
return gp.contains(r);
|
121 |
} |
122 |
|
123 |
/**
|
124 |
* @see java.awt.Shape#intersects(java.awt.geom.Rectangle2D)
|
125 |
*/
|
126 |
public boolean intersects(Rectangle2D r) { |
127 |
return gp.intersects(r);
|
128 |
} |
129 |
|
130 |
/**
|
131 |
* @see java.awt.Shape#getPathIterator(java.awt.geom.AffineTransform)
|
132 |
*/
|
133 |
public PathIterator getPathIterator(AffineTransform at) { |
134 |
return gp.getPathIterator(at);
|
135 |
} |
136 |
|
137 |
/**
|
138 |
* @see java.awt.Shape#getPathIterator(java.awt.geom.AffineTransform,
|
139 |
* double)
|
140 |
*/
|
141 |
public PathIterator getPathIterator(AffineTransform at, double d) { |
142 |
return gp.getPathIterator(at,d);
|
143 |
} |
144 |
} |