93 int aDim = DIM_NOT_PART;
98 int bDim = DIM_NOT_PART;
104 std::string dimensionSymbol(
int dim)
const;
105 void locationString(uint8_t index,
bool isForward, std::ostream& os)
const;
110 static constexpr Location LOC_UNKNOWN = Location::NONE;
123 , aLocLeft(LOC_UNKNOWN)
124 , aLocRight(LOC_UNKNOWN)
125 , aLocLine(LOC_UNKNOWN)
128 , bLocLeft(LOC_UNKNOWN)
129 , bLocRight(LOC_UNKNOWN)
130 , bLocLine(LOC_UNKNOWN) {};
141 initBoundary(p_index, p_locLeft, p_locRight, p_isHole);
144 int dimension(uint8_t index)
const {
return index == 0 ? aDim : bDim; };
145 void initBoundary(uint8_t index,
Location locLeft,
Location locRight,
bool p_isHole);
146 void initCollapse(uint8_t index,
bool p_isHole);
147 void initLine(uint8_t index);
148 void initNotPart(uint8_t index);
160 void setLocationAll(uint8_t index,
Location loc);
161 void setLocationCollapse(uint8_t index);
170 return aDim == DIM_LINE || bDim == DIM_LINE;
173 bool isLine(uint8_t index)
const
175 return index == 0 ? aDim == DIM_LINE : bDim == DIM_LINE;
178 bool isLinear(uint8_t index)
const
181 return aDim == DIM_LINE || aDim == DIM_COLLAPSE;
183 return bDim == DIM_LINE || bDim == DIM_COLLAPSE;
186 bool isKnown(uint8_t index)
const
189 return aDim != DIM_UNKNOWN;
191 return bDim != DIM_UNKNOWN;
194 bool isNotPart(uint8_t index)
const
197 return aDim == DIM_NOT_PART;
199 return bDim == DIM_NOT_PART;
202 bool isBoundaryEither()
const
204 return aDim == DIM_BOUNDARY || bDim == DIM_BOUNDARY;
207 bool isBoundaryBoth()
const
209 return aDim == DIM_BOUNDARY && bDim == DIM_BOUNDARY;
221 if (isLine())
return false;
222 return ! isBoundaryBoth();
231 return isBoundaryBoth() &&
232 getLocation(0, Position::RIGHT,
true) != getLocation(1, Position::RIGHT,
true);
235 bool isBoundary(uint8_t index)
const
238 return aDim == DIM_BOUNDARY;
240 return bDim == DIM_BOUNDARY;
243 bool isLineLocationUnknown(
int index)
const
246 return aLocLine == LOC_UNKNOWN;
249 return bLocLine == LOC_UNKNOWN;
259 if (aDim == DIM_BOUNDARY && bDim == DIM_NOT_PART) {
263 if (bDim == DIM_BOUNDARY && aDim == DIM_NOT_PART) {
278 return aLocLine == Location::INTERIOR;
280 return bLocLine == Location::INTERIOR;
283 bool isHole(uint8_t index)
const
293 bool isCollapse(uint8_t index)
const
295 return dimension(index) == DIM_COLLAPSE;
298 Location getLineLocation(uint8_t index)
const
314 if (aDim == DIM_COLLAPSE && aLocLine == Location::INTERIOR)
316 if (bDim == DIM_COLLAPSE && bLocLine == Location::INTERIOR)
337 return aLocLine == Location::INTERIOR;
339 return bLocLine == Location::INTERIOR;
356 bool isForward)
const
358 if (isBoundary(index)) {
359 return getLocation(index, position, isForward);
361 return getLineLocation(index);
377 Location getLocation(uint8_t index,
int position,
bool isForward)
const;
379 bool hasSides(uint8_t index)
const {
381 return aLocLeft != LOC_UNKNOWN
382 || aLocRight != LOC_UNKNOWN;
384 return bLocLeft != LOC_UNKNOWN
385 || bLocRight != LOC_UNKNOWN;
388 OverlayLabel copy()
const
390 OverlayLabel lbl = *
this;
394 friend std::ostream& operator<<(std::ostream& os,
const OverlayLabel& ol);
395 void toString(
bool isForward, std::ostream& os)
const;