62 friend std::ostream& operator<< (std::ostream&,
const Label&);
71 Label lineLabel(geom::Location::NONE);
72 for(uint32_t i = 0; i < 2; i++) {
73 lineLabel.setLocation(i, label.getLocation(i));
97 assert(geomIndex < 2);
98 elt[geomIndex].setLocation(onLoc);
135 elt[0] =
TopologyLocation(geom::Location::NONE, geom::Location::NONE, geom::Location::NONE);
136 elt[1] =
TopologyLocation(geom::Location::NONE, geom::Location::NONE, geom::Location::NONE);
137 elt[geomIndex].setLocations(onLoc, leftLoc, rightLoc);
141 operator=(
const Label& l)
162 for(
int i = 0; i < 2; i++) {
163 elt[i].merge(lbl.elt[i]);
167 int getGeometryCount()
const
170 if(!elt[0].isNull()) {
173 if(!elt[1].isNull()) {
179 geom::Location getLocation(uint32_t geomIndex, uint32_t posIndex)
const
181 assert(geomIndex < 2);
182 return elt[geomIndex].get(posIndex);
185 geom::Location getLocation(uint32_t geomIndex)
const
187 assert(geomIndex < 2);
188 return elt[geomIndex].get(Position::ON);
191 void setLocation(uint32_t geomIndex, uint32_t posIndex, geom::Location location)
193 assert(geomIndex < 2);
194 elt[geomIndex].setLocation(posIndex, location);
197 void setLocation(uint32_t geomIndex, geom::Location location)
199 assert(geomIndex < 2);
200 elt[geomIndex].setLocation(Position::ON, location);
203 void setAllLocations(uint32_t geomIndex, geom::Location location)
205 assert(geomIndex < 2);
206 elt[geomIndex].setAllLocations(location);
209 void setAllLocationsIfNull(uint32_t geomIndex, geom::Location location)
211 assert(geomIndex < 2);
212 elt[geomIndex].setAllLocationsIfNull(location);
215 void setAllLocationsIfNull(geom::Location location)
217 setAllLocationsIfNull(0, location);
218 setAllLocationsIfNull(1, location);
221 bool isNull(uint32_t geomIndex)
const
223 assert(geomIndex < 2);
224 return elt[geomIndex].isNull();
229 return elt[0].isNull() && elt[1].isNull();
232 bool isAnyNull(uint32_t geomIndex)
const
234 assert(geomIndex < 2);
235 return elt[geomIndex].isAnyNull();
240 return elt[0].isArea() || elt[1].isArea();
243 bool isArea(uint32_t geomIndex)
const
245 assert(geomIndex < 2);
246 return elt[geomIndex].isArea();
249 bool isLine(uint32_t geomIndex)
const
251 assert(geomIndex < 2);
252 return elt[geomIndex].isLine();
255 bool isEqualOnSide(
const Label& lbl, uint32_t side)
const
257 return elt[0].isEqualOnSide(lbl.elt[0], side)
258 && elt[1].isEqualOnSide(lbl.elt[1], side);
261 bool allPositionsEqual(uint32_t geomIndex, geom::Location loc)
const
263 assert(geomIndex < 2);
264 return elt[geomIndex].allPositionsEqual(loc);
272 assert(geomIndex < 2);
273 if(elt[geomIndex].isArea()) {
278 std::string toString()
const;
Label(geom::Location onLoc, geom::Location leftLoc, geom::Location rightLoc)
Construct a Label with On, Left and Right locations for both Geometries.
Definition Label.h:106
Label(uint32_t geomIndex, geom::Location onLoc, geom::Location leftLoc, geom::Location rightLoc)
Construct a Label with On, Left and Right locations for the given Geometries. Initialize the location...
Definition Label.h:133