15 m_boundingRect =
MxRect32(INT_MAX, INT_MAX, -1, -1);
42 while (!rect.
Empty() && cursor.
Next(span)) {
97 while (cursor.
Next(span)) {
423 while (a.
Next(segment) && segment->
GetMax() < p_min) {
428 if (p_min > segment->
GetMin()) {
429 p_min = segment->
GetMin();
432 while (segment->
GetMin() < p_max) {
433 if (p_max < segment->
GetMax()) {
434 p_max = segment->
GetMax();
471 while (cursor.
Next(segment)) {
485 while (cursor.
Next(segment)) {
void Prepend(T p_newobj)
[AI]
MxBool Last(T &p_obj)
[AI]
MxBool Current(T &p_obj)
[AI]
MxBool First(T &p_obj)
[AI]
[AI] Rectangle using 32-bit signed integer coordinates.
void SetLeft(T p_left)
[AI] Set the left edge.
MxBool Empty() const
[AI] Returns whether the rectangle is empty or not.
T GetTop() const
[AI] Get the top edge.
MxBool Intersects(const MxRect &p_r) const
[AI] Returns whether this rectangle intersects another.
void SetBottom(T p_bottom)
[AI] Set the bottom edge.
T GetRight() const
[AI] Get the right edge.
T GetLeft() const
[AI] Get the left edge.
void SetTop(T p_top)
[AI] Set the top edge.
T GetBottom() const
[AI] Get the bottom edge.
void SetRight(T p_right)
[AI] Set the right edge.
[AI] Cursor object suitable for traversing all rectangles covered by an MxRegion.
void PrevSpan(MxRect32 &p_rect)
[AI] Step to the previous span (reverse traversal) intersecting p_rect.
virtual void Reset()
[AI] Resets the cursor(s) to the initial (uninitialized) state.
virtual MxRect32 * Prev()
[AI] Steps backward to and returns the previous rectangle in region sequence.
void SetRect(MxS32 p_left, MxS32 p_top, MxS32 p_right, MxS32 p_bottom)
[AI] Initializes or updates m_rect with the specified coordinates.
MxRegion * m_region
[AI] The region being traversed. [AI]
MxSegmentListCursor * m_segListCursor
[AI] Cursor for the current segment list. [AI]
virtual MxRect32 * Head()
[AI] Seeks to and returns the first (topmost, leftmost) rectangle covered by the region.
void CreateSegmentListCursor(MxSegmentList *p_segList)
[AI] Allocates a segment list cursor for the given segment list, replacing any previous segment curso...
MxSpanListCursor * m_spanListCursor
[AI] Cursor for moving through the span list. [AI]
MxRect32 * m_rect
[AI] Current rectangle being referenced. [AI]
void NextSpan(MxRect32 &p_rect)
[AI] Step to the next span which overlaps p_rect (for filtered/region-clip traversal).
~MxRegionCursor() override
[AI] Destructor; releases ownership of current rectangle and cursors.
virtual MxRect32 * Next()
[AI] Advances to and returns the next rectangle in region sequence.
MxRegionCursor(MxRegion *p_region)
[AI] Constructs a traversal cursor for the specified region.
virtual MxRect32 * Tail()
[AI] Seeks to and returns the last (bottommost, rightmost) rectangle covered by the region.
[AI] Represents a 2D region as a set of vertical spans each containing one or more horizontal segment...
virtual void Reset()
[AI] Removes all spans and resets the bounding rectangle to an empty state.
MxSpanList * m_spanList
[AI] List of vertical spans for the region. [AI]
virtual void AddRect(MxRect32 &p_rect)
[AI] Adds a rectangle to this region, merging or splitting spans and segments as necessary.
~MxRegion() override
[AI] Destructor; destroys all spans and contained segments.
virtual MxBool Intersects(MxRect32 &p_rect)
[AI] Checks if this region intersects with a given rectangle (any overlap between the region's covere...
MxRect32 m_boundingRect
[AI] Cached bounding rectangle for the whole region. [AI]
[AI] Cursor for traversing an MxSegmentList; allows sequential access through the segments.
[AI] List container for segments; stores pointers to MxSegment objects and may take ownership dependi...
[AI] Represents a 1D segment defined by a minimum and maximum integer value.
MxBool IntersectsH(MxRect32 &p_rect)
[AI] Determines if this segment horizontally intersects a given rectangle, interpreted as an interval...
MxSegment * Clone()
[AI] Creates a copy of the current segment.
MxS32 GetMin()
[AI] Returns the lower boundary of the segment (inclusive).
MxS32 GetMax()
[AI] Returns the upper boundary of the segment (exclusive).
[AI] Cursor for traversing an MxSpanList, to sequentially access all spans in the list.
[AI] List container for spans; holds MxSpan pointers and may automatically destroy them.
[AI] Represents a vertical span—a 1D range plus a set of contained horizontal segments,...
MxS32 m_max
[AI] Upper vertical boundary (usually 'bottom'). [AI]
MxS32 GetMax()
[AI] Returns the vertical upper boundary of the span.
MxS32 GetMin()
[AI] Returns the vertical lower boundary of the span.
MxBool IntersectsH(MxRect32 &p_rect)
[AI] Checks if any segment in this span horizontally overlaps with the given rectangle.
void AddSegment(MxS32 p_min, MxS32 p_max)
[AI] Adds a horizontal segment to this span, merging with adjacent segments if required to maintain c...
void SetMin(MxS32 p_min)
[AI] Sets the vertical lower boundary of the span.
void SetMax(MxS32 p_max)
[AI] Sets the vertical upper boundary of the span.
MxSegmentList * m_segList
[AI] List of horizontal segments covered by this vertical span. [AI]
MxSpan * Clone()
[AI] Deep copies this span, including all its attached segments.
MxBool IntersectsV(MxRect32 &p_rect)
[AI] Check if this span vertically intersects a rectangle (vertical ranges overlap).
MxSpan(MxS32 p_min, MxS32 p_max)
[AI] Constructs a span along the vertical axis with specified bounds.
MxS32 m_min
[AI] Lower vertical boundary (usually 'top'). [AI]
#define DECOMP_SIZE_ASSERT(T, S)
#define NULL
[AI] Null pointer value (C/C++ semantics).