61 friend std::ostream& operator<< (std::ostream&,
const Label&);
70 Label lineLabel(geom::Location::NONE);
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);
134 elt[0] =
TopologyLocation(geom::Location::NONE, geom::Location::NONE, geom::Location::NONE);
135 elt[1] =
TopologyLocation(geom::Location::NONE, geom::Location::NONE, geom::Location::NONE);
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);
184 geom::Location getLocation(uint32_t geomIndex)
const
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);
196 void setLocation(uint32_t geomIndex, geom::Location location)
198 assert(geomIndex < 2);
199 elt[geomIndex].setLocation(Position::ON, location);
202 void setAllLocations(uint32_t geomIndex, geom::Location 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);
214 void setAllLocationsIfNull(geom::Location 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;
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:105
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:132