23 #include <geos/export.h>
24 #include <geos/geom/Location.h>
25 #include <geos/geomgraph/TopologyLocation.h>
61 friend std::ostream& operator<< (std::ostream&,
const Label&);
71 for(uint32_t i = 0; i < 2; i++) {
72 lineLabel.setLocation(i, label.getLocation(i));
96 assert(geomIndex < 2);
97 elt[geomIndex].setLocation(onLoc);
136 elt[geomIndex].setLocations(onLoc, leftLoc, rightLoc);
140 operator=(
const Label& l)
161 for(
int i = 0; i < 2; i++) {
162 elt[i].merge(lbl.elt[i]);
166 int getGeometryCount()
const
169 if(!elt[0].isNull()) {
172 if(!elt[1].isNull()) {
178 geom::Location getLocation(uint32_t geomIndex, uint32_t posIndex)
const
180 assert(geomIndex < 2);
181 return elt[geomIndex].get(posIndex);
186 assert(geomIndex < 2);
187 return elt[geomIndex].get(Position::ON);
190 void setLocation(uint32_t geomIndex, uint32_t posIndex,
geom::Location location)
192 assert(geomIndex < 2);
193 elt[geomIndex].setLocation(posIndex, location);
198 assert(geomIndex < 2);
199 elt[geomIndex].setLocation(Position::ON, location);
204 assert(geomIndex < 2);
205 elt[geomIndex].setAllLocations(location);
208 void setAllLocationsIfNull(uint32_t geomIndex,
geom::Location location)
210 assert(geomIndex < 2);
211 elt[geomIndex].setAllLocationsIfNull(location);
216 setAllLocationsIfNull(0, location);
217 setAllLocationsIfNull(1, location);
220 bool isNull(uint32_t geomIndex)
const
222 assert(geomIndex < 2);
223 return elt[geomIndex].isNull();
228 return elt[0].isNull() && elt[1].isNull();
231 bool isAnyNull(uint32_t geomIndex)
const
233 assert(geomIndex < 2);
234 return elt[geomIndex].isAnyNull();
239 return elt[0].isArea() || elt[1].isArea();
242 bool isArea(uint32_t geomIndex)
const
244 assert(geomIndex < 2);
245 return elt[geomIndex].isArea();
248 bool isLine(uint32_t geomIndex)
const
250 assert(geomIndex < 2);
251 return elt[geomIndex].isLine();
254 bool isEqualOnSide(
const Label& lbl, uint32_t side)
const
256 return elt[0].isEqualOnSide(lbl.elt[0], side)
257 && elt[1].isEqualOnSide(lbl.elt[1], side);
260 bool allPositionsEqual(uint32_t geomIndex,
geom::Location loc)
const
262 assert(geomIndex < 2);
263 return elt[geomIndex].allPositionsEqual(loc);
271 assert(geomIndex < 2);
272 if(elt[geomIndex].isArea()) {
277 std::string toString()
const;
285 std::ostream& operator<< (std::ostream&,
const Label&);