Revision 42316
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.geometry/org.gvsig.fmap.geometry.jts/src/main/java/org/gvsig/fmap/geom/jts/aggregate/DefaultMultiCurve.java | ||
---|---|---|
97 | 97 |
* @see org.gvsig.fmap.geom.Geometry#toPoints() |
98 | 98 |
*/ |
99 | 99 |
public MultiPoint toPoints() throws GeometryException { |
100 |
// TODO Auto-generated method stub |
|
101 |
return null; |
|
100 |
MultiPoint multipoint = null; |
|
101 |
for (int i = 0; i < this.getPrimitivesNumber(); i++) { |
|
102 |
if(multipoint==null){ |
|
103 |
multipoint = this.getPrimitiveAt(i).toPoints(); |
|
104 |
} else { |
|
105 |
MultiPoint points = (MultiPoint)this.getPrimitiveAt(i).toPoints(); |
|
106 |
for (int j = 0; j < points.getPrimitivesNumber(); j++) { |
|
107 |
multipoint.addPrimitive(points.getPrimitiveAt(j)); |
|
108 |
} |
|
109 |
} |
|
110 |
} |
|
111 |
return multipoint; |
|
102 | 112 |
} |
103 | 113 |
|
104 | 114 |
/* (non-Javadoc) |
105 | 115 |
* @see org.gvsig.fmap.geom.Geometry#toLines() |
106 | 116 |
*/ |
107 | 117 |
public MultiLine toLines() throws GeometryException { |
108 |
// TODO Auto-generated method stub |
|
109 |
return null; |
|
118 |
MultiLine multiline = null; |
|
119 |
for (int i = 0; i < this.getPrimitivesNumber(); i++) { |
|
120 |
if(multiline==null){ |
|
121 |
multiline = this.getPrimitiveAt(i).toLines(); |
|
122 |
} else { |
|
123 |
MultiLine lines = (MultiLine)this.getPrimitiveAt(i).toLines(); |
|
124 |
for (int j = 0; j < lines.getPrimitivesNumber(); j++) { |
|
125 |
multiline.addPrimitive(lines.getPrimitiveAt(j)); |
|
126 |
} |
|
127 |
} |
|
128 |
} |
|
129 |
return multiline; |
|
110 | 130 |
} |
111 | 131 |
|
112 | 132 |
/* (non-Javadoc) |
113 | 133 |
* @see org.gvsig.fmap.geom.Geometry#toPolygons() |
114 | 134 |
*/ |
115 | 135 |
public MultiPolygon toPolygons() throws GeometryException { |
116 |
// TODO Auto-generated method stub |
|
117 |
return null; |
|
136 |
MultiPolygon multipolygon = null; |
|
137 |
for (int i = 0; i < this.getPrimitivesNumber(); i++) { |
|
138 |
if(multipolygon==null){ |
|
139 |
multipolygon = this.getPrimitiveAt(i).toPolygons(); |
|
140 |
} else { |
|
141 |
MultiPolygon polygons = (MultiPolygon)this.getPrimitiveAt(i).toPolygons(); |
|
142 |
for (int j = 0; j < polygons.getPrimitivesNumber(); j++) { |
|
143 |
multipolygon.addPrimitive(polygons.getPrimitiveAt(j)); |
|
144 |
} |
|
145 |
} |
|
146 |
} |
|
147 |
return multipolygon; |
|
118 | 148 |
} |
119 | 149 |
|
120 | 150 |
/* (non-Javadoc) |
121 | 151 |
* @see org.gvsig.fmap.geom.jts.GeometryJTS#flip() |
122 | 152 |
*/ |
123 | 153 |
public void flip() throws GeometryOperationNotSupportedException, GeometryOperationException { |
124 |
// TODO Auto-generated method stub |
|
125 |
|
|
154 |
for (int i = 0; i < this.getPrimitivesNumber(); i++) { |
|
155 |
this.getPrimitiveAt(i).flip(); |
|
156 |
} |
|
126 | 157 |
} |
127 | 158 |
|
128 | 159 |
|
Also available in: Unified diff