94 int aDim = DIM_NOT_PART;
99 int bDim = DIM_NOT_PART;
100 bool bIsHole =
false;
105 std::string dimensionSymbol(
int dim)
const;
106 void locationString(uint8_t index,
bool isForward, std::ostream& os)
const;
111 static constexpr Location LOC_UNKNOWN = Location::NONE;
124 , aLocLeft(LOC_UNKNOWN)
125 , aLocRight(LOC_UNKNOWN)
126 , aLocLine(LOC_UNKNOWN)
129 , bLocLeft(LOC_UNKNOWN)
130 , bLocRight(LOC_UNKNOWN)
131 , bLocLine(LOC_UNKNOWN) {};
142 initBoundary(p_index, p_locLeft, p_locRight, p_isHole);
145 int dimension(uint8_t index)
const {
return index == 0 ? aDim : bDim; };
146 void initBoundary(uint8_t index,
Location locLeft,
Location locRight,
bool p_isHole);
147 void initCollapse(uint8_t index,
bool p_isHole);
148 void initLine(uint8_t index);
149 void initNotPart(uint8_t index);
161 void setLocationAll(uint8_t index,
Location loc);
162 void setLocationCollapse(uint8_t index);
171 return aDim == DIM_LINE || bDim == DIM_LINE;
174 bool isLine(uint8_t index)
const
176 return index == 0 ? aDim == DIM_LINE : bDim == DIM_LINE;
179 bool isLinear(uint8_t index)
const
182 return aDim == DIM_LINE || aDim == DIM_COLLAPSE;
184 return bDim == DIM_LINE || bDim == DIM_COLLAPSE;
187 bool isKnown(uint8_t index)
const
190 return aDim != DIM_UNKNOWN;
192 return bDim != DIM_UNKNOWN;
195 bool isNotPart(uint8_t index)
const
198 return aDim == DIM_NOT_PART;
200 return bDim == DIM_NOT_PART;
203 bool isBoundaryEither()
const
205 return aDim == DIM_BOUNDARY || bDim == DIM_BOUNDARY;
208 bool isBoundaryBoth()
const
210 return aDim == DIM_BOUNDARY && bDim == DIM_BOUNDARY;
222 if (isLine())
return false;
223 return ! isBoundaryBoth();
232 return isBoundaryBoth() &&
233 getLocation(0, Position::RIGHT,
true) != getLocation(1, Position::RIGHT,
true);
236 bool isBoundary(uint8_t index)
const
239 return aDim == DIM_BOUNDARY;
241 return bDim == DIM_BOUNDARY;
244 bool isLineLocationUnknown(
int index)
const
247 return aLocLine == LOC_UNKNOWN;
250 return bLocLine == LOC_UNKNOWN;
260 if (aDim == DIM_BOUNDARY && bDim == DIM_NOT_PART) {
264 if (bDim == DIM_BOUNDARY && aDim == DIM_NOT_PART) {
279 return aLocLine == Location::INTERIOR;
281 return bLocLine == Location::INTERIOR;
284 bool isHole(uint8_t index)
const
294 bool isCollapse(uint8_t index)
const
296 return dimension(index) == DIM_COLLAPSE;
299 Location getLineLocation(uint8_t index)
const
315 if (aDim == DIM_COLLAPSE && aLocLine == Location::INTERIOR)
317 if (bDim == DIM_COLLAPSE && bLocLine == Location::INTERIOR)
338 return aLocLine == Location::INTERIOR;
340 return bLocLine == Location::INTERIOR;
357 bool isForward)
const
359 if (isBoundary(index)) {
360 return getLocation(index, position, isForward);
362 return getLineLocation(index);
378 Location getLocation(uint8_t index,
int position,
bool isForward)
const;
380 bool hasSides(uint8_t index)
const {
382 return aLocLeft != LOC_UNKNOWN
383 || aLocRight != LOC_UNKNOWN;
385 return bLocLeft != LOC_UNKNOWN
386 || bLocRight != LOC_UNKNOWN;
389 OverlayLabel copy()
const
391 OverlayLabel lbl = *
this;
395 friend std::ostream& operator<<(std::ostream& os,
const OverlayLabel& ol);
396 void toString(
bool isForward, std::ostream& os)
const;