svn-gvsig-desktop / branches / v2_0_0_prep / libraries / libGeometries3D / src / main / java / org / gvsig / geometries3D / Polyline3D.java @ 29941
History | View | Annotate | Download (4.96 KB)
1 |
package org.gvsig.geometries3D; |
---|---|
2 |
|
3 |
import java.awt.Rectangle; |
4 |
import java.awt.geom.AffineTransform; |
5 |
import java.awt.geom.PathIterator; |
6 |
import java.awt.geom.Point2D; |
7 |
import java.awt.geom.Rectangle2D; |
8 |
import java.util.Vector; |
9 |
|
10 |
import org.cresques.cts.ICoordTrans; |
11 |
import org.cresques.cts.IProjection; |
12 |
import org.gvsig.fmap.geom.GeometryLocator; |
13 |
import org.gvsig.fmap.geom.GeometryManager; |
14 |
import org.gvsig.fmap.geom.Geometry.SUBTYPES; |
15 |
import org.gvsig.fmap.geom.Geometry.TYPES; |
16 |
import org.gvsig.fmap.geom.handler.Handler; |
17 |
import org.gvsig.fmap.geom.primitive.Curve; |
18 |
import org.gvsig.fmap.geom.primitive.Envelope; |
19 |
import org.gvsig.fmap.geom.primitive.FShape; |
20 |
import org.gvsig.fmap.geom.primitive.GeneralPathX; |
21 |
import org.gvsig.fmap.geom.primitive.Point; |
22 |
import org.gvsig.fmap.geom.primitive.impl.AbstractPrimitive; |
23 |
import org.gvsig.fmap.geom.type.GeometryType; |
24 |
|
25 |
public class Polyline3D extends AbstractPrimitive implements Curve { |
26 |
|
27 |
private static final long serialVersionUID = 1L; |
28 |
|
29 |
protected Vector<Point> _varray; |
30 |
|
31 |
public Polyline3D(GeometryType geometryType) {
|
32 |
super(geometryType);
|
33 |
_varray = new Vector<Point>(); |
34 |
} |
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
public Polyline3D(GeometryType geometryType,String id, IProjection projection){ |
41 |
super(geometryType,id, projection);
|
42 |
_varray = new Vector<Point>(); |
43 |
} |
44 |
|
45 |
public GeometryType getGeometryType() {
|
46 |
return geometryType;
|
47 |
} |
48 |
public void addVertex(Point p){ |
49 |
_varray.add(p); |
50 |
} |
51 |
public void removeVertex(int index){ |
52 |
_varray.remove(index); |
53 |
} |
54 |
public Point getVertex(int index) |
55 |
{ |
56 |
return _varray.get(index);
|
57 |
} |
58 |
public int getNumVertices(){ |
59 |
return _varray.size();
|
60 |
} |
61 |
public void insertVertex(int index, Point p){ |
62 |
_varray.insertElementAt(p, index); |
63 |
} |
64 |
|
65 |
public int getDimension() { |
66 |
return 3; |
67 |
} |
68 |
|
69 |
// public int getShapeType() {
|
70 |
// return FShape.LINE;
|
71 |
// }
|
72 |
|
73 |
|
74 |
public int getType() { |
75 |
return geometryType.getType();
|
76 |
} |
77 |
|
78 |
|
79 |
|
80 |
///CURVE INTERFACE METHODS
|
81 |
|
82 |
public double getCoordinateAt(int index, int dimension) { |
83 |
return _varray.get(index).getCoordinateAt(dimension);
|
84 |
} |
85 |
|
86 |
|
87 |
public int getNumVertex() { |
88 |
return _varray.size();
|
89 |
} |
90 |
|
91 |
|
92 |
public void setCoordinateAt(int index, int dimension, double value) { |
93 |
_varray.get(index).setCoordinateAt(dimension, value); |
94 |
} |
95 |
|
96 |
|
97 |
public void setGeneralPath(GeneralPathX generalPathX) { |
98 |
throw new UnsupportedOperationException("Method not implemented"); |
99 |
|
100 |
} |
101 |
|
102 |
|
103 |
public void setPoints(Point startPoint, Point endPoint) { |
104 |
throw new UnsupportedOperationException("Method not implemented"); |
105 |
|
106 |
} |
107 |
|
108 |
///// ABSTRACT GEOMETRY METHODS
|
109 |
|
110 |
public Rectangle2D getBounds2D() { |
111 |
// TODO Auto-generated method stub
|
112 |
throw new UnsupportedOperationException("Method not implemented"); |
113 |
} |
114 |
|
115 |
|
116 |
|
117 |
public GeneralPathX getGeneralPath() {
|
118 |
// TODO Auto-generated method stub
|
119 |
throw new UnsupportedOperationException("Method not implemented"); |
120 |
} |
121 |
|
122 |
|
123 |
public PathIterator getPathIterator(AffineTransform at) { |
124 |
// TODO Auto-generated method stub
|
125 |
throw new UnsupportedOperationException("Method not implemented"); |
126 |
} |
127 |
|
128 |
|
129 |
public PathIterator getPathIterator(AffineTransform at, double flatness) { |
130 |
// TODO Auto-generated method stub
|
131 |
throw new UnsupportedOperationException("Method not implemented"); |
132 |
} |
133 |
|
134 |
|
135 |
|
136 |
|
137 |
public boolean intersects(Rectangle2D r) { |
138 |
// TODO Auto-generated method stub
|
139 |
throw new UnsupportedOperationException("Method not implemented"); |
140 |
} |
141 |
|
142 |
|
143 |
public void reProject(ICoordTrans ct) { |
144 |
throw new UnsupportedOperationException("Method not implemented"); |
145 |
|
146 |
} |
147 |
|
148 |
|
149 |
public void transform(AffineTransform at) { |
150 |
throw new UnsupportedOperationException("Method not implemented"); |
151 |
|
152 |
} |
153 |
|
154 |
|
155 |
public boolean contains(Point2D p) { |
156 |
// TODO Auto-generated method stub
|
157 |
throw new UnsupportedOperationException("Method not implemented"); |
158 |
} |
159 |
|
160 |
|
161 |
public boolean contains(Rectangle2D r) { |
162 |
// TODO Auto-generated method stub
|
163 |
throw new UnsupportedOperationException("Method not implemented"); |
164 |
} |
165 |
|
166 |
|
167 |
public boolean contains(double x, double y) { |
168 |
// TODO Auto-generated method stub
|
169 |
throw new UnsupportedOperationException("Method not implemented"); |
170 |
} |
171 |
|
172 |
|
173 |
public boolean contains(double x, double y, double w, double h) { |
174 |
// TODO Auto-generated method stub
|
175 |
throw new UnsupportedOperationException("Method not implemented"); |
176 |
} |
177 |
|
178 |
|
179 |
public Rectangle getBounds() { |
180 |
throw new UnsupportedOperationException("Method not implemented"); |
181 |
} |
182 |
|
183 |
|
184 |
public boolean intersects(double x, double y, double w, double h) { |
185 |
throw new UnsupportedOperationException("Method not implemented"); |
186 |
} |
187 |
|
188 |
|
189 |
public FShape cloneFShape() {
|
190 |
throw new UnsupportedOperationException("Method not implemented"); |
191 |
} |
192 |
|
193 |
|
194 |
public Handler[] getSelectHandlers() { |
195 |
// TODO Auto-generated method stub
|
196 |
throw new UnsupportedOperationException("Method not implemented"); |
197 |
} |
198 |
|
199 |
|
200 |
public Handler[] getStretchingHandlers() { |
201 |
// TODO Auto-generated method stub
|
202 |
throw new UnsupportedOperationException("Method not implemented"); |
203 |
} |
204 |
public Envelope getEnvelope() {
|
205 |
// TODO Auto-generated method stub
|
206 |
return null; |
207 |
} |
208 |
|
209 |
|
210 |
|
211 |
|
212 |
|
213 |
public void setVertex(int index, Point p) { |
214 |
// TODO Auto-generated method stub
|
215 |
|
216 |
} |
217 |
|
218 |
|
219 |
} |