Revision 27049 branches/v2_0_0_prep/libraries/libFMap_geometries/src/org/gvsig/fmap/geom/primitive/impl/AbstractPrimitive.java
AbstractPrimitive.java | ||
---|---|---|
75 | 75 |
* @author Jorge Piera Llodr? (jorge.piera@iver.es) |
76 | 76 |
*/ |
77 | 77 |
public abstract class AbstractPrimitive implements Primitive, FShape, Serializable { |
78 |
private static final long serialVersionUID = 1L;
|
|
78 |
private static final long serialVersionUID = -4334977368955260872L;
|
|
79 | 79 |
protected String id = null; |
80 | 80 |
protected IProjection projection = null; |
81 |
// protected GeometryOperationsSet operationsSet = null; |
|
82 | 81 |
|
83 | 82 |
/** |
84 | 83 |
* Constructor without arguments. It is necessary to create |
... | ... | |
93 | 92 |
super(); |
94 | 93 |
this.id = id; |
95 | 94 |
this.projection = projection; |
96 |
/* |
|
97 |
try { |
|
98 |
operationsSet = GeometryOperationsRegistry.getOperationSet(getGeometryType()); |
|
99 |
} catch (NotRegisteredOperationSetException e) { |
|
100 |
//It is not possible to do any operation with this geometry!!! |
|
101 |
}*/ |
|
102 | 95 |
} |
103 | 96 |
|
104 | 97 |
public AbstractPrimitive(IProjection projection) { |
... | ... | |
114 | 107 |
return this; |
115 | 108 |
} |
116 | 109 |
|
117 |
// /* |
|
118 |
// * (non-Javadoc) |
|
119 |
// * @see org.gvsig.geometries.iso.AbstractGeometry#getBoundary() |
|
120 |
// */ |
|
121 |
// public Envelope getEnvelope() { |
|
122 |
// return new DefaultEnvelope(getBounds2D()); |
|
123 |
// } |
|
124 |
|
|
125 | 110 |
/* (non-Javadoc) |
126 | 111 |
* @see org.gvsig.geometries.iso.AbstractGeometry#getId() |
127 | 112 |
*/ |
... | ... | |
177 | 162 |
geometry.transform(at); |
178 | 163 |
} |
179 | 164 |
|
165 |
/* |
|
166 |
* (non-Javadoc) |
|
167 |
* @see org.gvsig.fmap.geom.Geometry#fastIntersects(double, double, double, double) |
|
168 |
*/ |
|
180 | 169 |
public boolean fastIntersects(double x, double y, double w, double h) { |
181 | 170 |
return intersects(x,y,w,h); |
182 | 171 |
} |
183 |
|
|
184 |
public double[] getZs() {
|
|
185 |
return null;
|
|
186 |
}
|
|
187 |
|
|
172 |
|
|
173 |
/*
|
|
174 |
* (non-Javadoc)
|
|
175 |
* @see org.gvsig.fmap.geom.Geometry#cloneGeometry()
|
|
176 |
*/ |
|
188 | 177 |
public Geometry cloneGeometry() { |
189 | 178 |
return (Geometry)cloneFShape(); |
190 | 179 |
} |
191 | 180 |
|
181 |
/* |
|
182 |
* (non-Javadoc) |
|
183 |
* @see org.gvsig.fmap.geom.Geometry#getHandlers(int) |
|
184 |
*/ |
|
192 | 185 |
public Handler[] getHandlers(int type) { |
193 | 186 |
if (type==STRETCHINGHANDLER){ |
194 | 187 |
return getStretchingHandlers(); |
... | ... | |
198 | 191 |
return null; |
199 | 192 |
} |
200 | 193 |
|
194 |
/* |
|
195 |
* (non-Javadoc) |
|
196 |
* @see org.gvsig.fmap.geom.Geometry#isSimple() |
|
197 |
*/ |
|
201 | 198 |
public boolean isSimple() { |
202 | 199 |
return true; |
203 | 200 |
} |
204 | 201 |
|
205 |
public abstract GeometryType getGeometryType(); |
|
206 |
|
|
207 |
/** |
|
208 |
* Invokes an operation. |
|
209 |
* @param index |
|
210 |
* @return |
|
202 |
/* |
|
203 |
* (non-Javadoc) |
|
204 |
* @see org.gvsig.fmap.geom.Geometry#invokeOperation(int, org.gvsig.fmap.geom.operation.GeometryOperationContext) |
|
211 | 205 |
*/ |
212 | 206 |
public Object invokeOperation(int index, GeometryOperationContext ctx) throws GeometryOperationNotSupportedException, GeometryOperationException { |
213 | 207 |
return GeometryLocator.getGeometryManager().invokeOperation(index, this, ctx); |
214 | 208 |
} |
215 | 209 |
|
216 |
/**
|
|
217 |
* @return una de las ctes de FShape
|
|
218 |
* @deprecated use getType()
|
|
210 |
/* |
|
211 |
* (non-Javadoc)
|
|
212 |
* @see java.lang.Comparable#compareTo(T)
|
|
219 | 213 |
*/ |
220 |
public abstract int getShapeType(); |
|
221 |
|
|
222 | 214 |
public int compareTo(Object arg0) { |
223 | 215 |
// TODO Auto-generated method stub |
224 | 216 |
return -1; |
225 | 217 |
} |
226 | 218 |
|
219 |
/* |
|
220 |
* (non-Javadoc) |
|
221 |
* @see java.lang.Object#toString() |
|
222 |
*/ |
|
227 | 223 |
public String toString() { |
228 | 224 |
String name=getGeometryType().getName(); |
229 | 225 |
return name.substring(name.lastIndexOf(".")+1); |
230 | 226 |
} |
231 | 227 |
|
232 |
|
|
228 |
/* |
|
229 |
* (non-Javadoc) |
|
230 |
* @see java.lang.Object#equals(java.lang.Object) |
|
231 |
*/ |
|
233 | 232 |
public boolean equals(Object obj) { |
234 | 233 |
if (obj == null) { |
235 | 234 |
return false; |
Also available in: Unified diff