Revision 18995 trunk/libraries/libTopology/src/org/gvsig/topology/topologyrules/jtsisvalidrules/GeometryMustHaveValidCoordinates.java
GeometryMustHaveValidCoordinates.java | ||
---|---|---|
55 | 55 |
import org.gvsig.topology.Topology; |
56 | 56 |
import org.gvsig.topology.TopologyError; |
57 | 57 |
import org.gvsig.topology.TopologyRuleDefinitionException; |
58 |
import org.gvsig.topology.topologyrules.JtsValidRule; |
|
58 | 59 |
|
59 | 60 |
import com.iver.cit.gvsig.fmap.core.Handler; |
60 | 61 |
import com.iver.cit.gvsig.fmap.core.IFeature; |
... | ... | |
68 | 69 |
* |
69 | 70 |
*/ |
70 | 71 |
public class GeometryMustHaveValidCoordinates extends AbstractTopologyRule{ |
72 |
|
|
73 |
private JtsValidRule parentRule; |
|
74 |
|
|
75 |
|
|
71 | 76 |
/** |
72 | 77 |
* Constructor |
73 | 78 |
* @param topology |
... | ... | |
97 | 102 |
Point2D pt = handlers[i].getPoint(); |
98 | 103 |
if(! isValid(pt)){ |
99 | 104 |
IGeometry fgeo = feature.getGeometry(); |
100 |
TopologyError topologyError = |
|
101 |
new TopologyError(fgeo, this, feature, topology); |
|
105 |
AbstractTopologyRule violatedRule = null; |
|
106 |
if(this.parentRule != null) |
|
107 |
violatedRule = parentRule; |
|
108 |
else |
|
109 |
violatedRule = this; |
|
110 |
TopologyError topologyError = |
|
111 |
new TopologyError(fgeo, violatedRule, feature, topology); |
|
112 |
|
|
102 | 113 |
errorContainer.addTopologyError(topologyError); |
103 | 114 |
} |
104 | 115 |
}//for |
... | ... | |
111 | 122 |
if (Double.isInfinite(coord.getY())) return false; |
112 | 123 |
return true; |
113 | 124 |
} |
125 |
|
|
126 |
public JtsValidRule getParentRule() { |
|
127 |
return parentRule; |
|
128 |
} |
|
129 |
|
|
130 |
public void setParentRule(JtsValidRule parentRule) { |
|
131 |
this.parentRule = parentRule; |
|
132 |
} |
|
114 | 133 |
} |
115 | 134 |
|
Also available in: Unified diff