Isle
Loading...
Searching...
No Matches
MxSpan Class Reference

[AI] Represents a vertical span—a 1D range plus a set of contained horizontal segments, used as a row (span) of contiguous horizontal regions. More...

#include <mxregion.h>

Collaboration diagram for MxSpan:

Public Member Functions

 MxSpan (MxS32 p_min, MxS32 p_max)
 [AI] Constructs a span along the vertical axis with specified bounds. More...
 
 MxSpan (MxRect32 &p_rect)
 [AI] Constructs a span from a rectangle, vertically from top to bottom of the rectangle, containing one segment equal to the rectangle's horizontal span. More...
 
 ~MxSpan ()
 [AI] Destructor; releases the segment list and owned segments inside this span. More...
 
MxS32 GetMin ()
 [AI] Returns the vertical lower boundary of the span. More...
 
void SetMin (MxS32 p_min)
 [AI] Sets the vertical lower boundary of the span. More...
 
MxS32 GetMax ()
 [AI] Returns the vertical upper boundary of the span. More...
 
void SetMax (MxS32 p_max)
 [AI] Sets the vertical upper boundary of the span. More...
 
MxSpanClone ()
 [AI] Deep copies this span, including all its attached segments. More...
 
void Compact ()
 [AI] Compact this span, potentially merging adjacent or overlapping segments for optimal storage. More...
 
MxBool Combine (MxSpan &p_span)
 [AI] Tries to merge this span with another, if possible (must be adjacent and have matching segments). More...
 
MxBool Adjacent (MxSpan &p_span)
 [AI] Checks if this span is vertically adjacent to another (end-to-end). More...
 
MxBool HasSameSegments (MxSpan &p_span)
 [AI] Checks for pointwise segment equivalence between two spans. More...
 
MxBool IntersectsV (MxRect32 &p_rect)
 [AI] Check if this span vertically intersects a rectangle (vertical ranges overlap). More...
 
MxBool IntersectsH (MxRect32 &p_rect)
 [AI] Checks if any segment in this span horizontally overlaps with the given rectangle. More...
 
void AddSegment (MxS32 p_min, MxS32 p_max)
 [AI] Adds a horizontal segment to this span, merging with adjacent segments if required to maintain compactness. More...
 
MxBool operator== (MxSpan &p_span)
 [AI] Tests for equality (vertical bounds and segments) with another span. More...
 
MxBool operator!= (MxSpan &p_span)
 [AI] Tests for inequality with another span. More...
 

Protected Attributes

MxS32 m_min
 [AI] Lower vertical boundary (usually 'top'). [AI] More...
 
MxS32 m_max
 [AI] Upper vertical boundary (usually 'bottom'). [AI] More...
 
MxSegmentListm_segList
 [AI] List of horizontal segments covered by this vertical span. [AI] More...
 

Friends

class MxRegionCursor
 

Detailed Description

[AI] Represents a vertical span—a 1D range plus a set of contained horizontal segments, used as a row (span) of contiguous horizontal regions.

This is foundational for complex region (polygon) representation by decomposing 2D space into vertical strips, each with 1D segment lists.

Definition at line 141 of file mxregion.h.

Constructor & Destructor Documentation

◆ MxSpan() [1/2]

MxSpan::MxSpan ( MxS32  p_min,
MxS32  p_max 
)

[AI] Constructs a span along the vertical axis with specified bounds.

Parameters
p_minLower vertical boundary. [AI]
p_maxUpper vertical boundary. [AI]

Definition at line 396 of file mxregion.cpp.

◆ MxSpan() [2/2]

MxSpan::MxSpan ( MxRect32 p_rect)

[AI] Constructs a span from a rectangle, vertically from top to bottom of the rectangle, containing one segment equal to the rectangle's horizontal span.

[AI]

Parameters
p_rectRectangle whose top/bottom form the span and whose left/right constitute its initial segment. [AI]

Definition at line 405 of file mxregion.cpp.

◆ ~MxSpan()

MxSpan::~MxSpan ( )
inline

[AI] Destructor; releases the segment list and owned segments inside this span.

Definition at line 164 of file mxregion.h.

Member Function Documentation

◆ AddSegment()

void MxSpan::AddSegment ( MxS32  p_min,
MxS32  p_max 
)

[AI] Adds a horizontal segment to this span, merging with adjacent segments if required to maintain compactness.

Parameters
p_minLeftmost coordinate of the new segment. [AI]
p_maxRightmost coordinate of the new segment. [AI]

Definition at line 417 of file mxregion.cpp.

◆ Adjacent()

MxBool MxSpan::Adjacent ( MxSpan p_span)
inline

[AI] Checks if this span is vertically adjacent to another (end-to-end).

Parameters
p_spanSpan to check adjacency against. [AI]
Returns
TRUE if adjacent, FALSE otherwise. [AI]

Definition at line 211 of file mxregion.h.

◆ Clone()

MxSpan * MxSpan::Clone ( )

[AI] Deep copies this span, including all its attached segments.

Returns
Pointer to the cloned span. [AI]

Definition at line 464 of file mxregion.cpp.

◆ Combine()

MxBool MxSpan::Combine ( MxSpan p_span)

[AI] Tries to merge this span with another, if possible (must be adjacent and have matching segments).

[AI]

Parameters
p_spanSpan to merge. [AI]
Returns
TRUE if merged, FALSE otherwise. [AI]

◆ Compact()

void MxSpan::Compact ( )

[AI] Compact this span, potentially merging adjacent or overlapping segments for optimal storage.

[AI]

◆ GetMax()

MxS32 MxSpan::GetMax ( )
inline

[AI] Returns the vertical upper boundary of the span.

Definition at line 180 of file mxregion.h.

◆ GetMin()

MxS32 MxSpan::GetMin ( )
inline

[AI] Returns the vertical lower boundary of the span.

Definition at line 169 of file mxregion.h.

◆ HasSameSegments()

MxBool MxSpan::HasSameSegments ( MxSpan p_span)

[AI] Checks for pointwise segment equivalence between two spans.

[AI]

Parameters
p_spanSpan to compare with. [AI]
Returns
TRUE if the segment lists are identical, FALSE otherwise. [AI]

◆ IntersectsH()

MxBool MxSpan::IntersectsH ( MxRect32 p_rect)

[AI] Checks if any segment in this span horizontally overlaps with the given rectangle.

[AI]

Parameters
p_rectRectangle to test horizontal overlap. [AI]
Returns
TRUE if overlap exists, FALSE otherwise. [AI]

Definition at line 480 of file mxregion.cpp.

◆ IntersectsV()

MxBool MxSpan::IntersectsV ( MxRect32 p_rect)
inline

[AI] Check if this span vertically intersects a rectangle (vertical ranges overlap).

Parameters
p_rectRectangle to check against. [AI]
Returns
TRUE if vertical overlap exists, FALSE otherwise. [AI]

Definition at line 225 of file mxregion.h.

◆ operator!=()

MxBool MxSpan::operator!= ( MxSpan p_span)
inline

[AI] Tests for inequality with another span.

Parameters
p_spanSpan to compare. [AI]
Returns
TRUE if not equal, FALSE otherwise. [AI]

Definition at line 256 of file mxregion.h.

◆ operator==()

MxBool MxSpan::operator== ( MxSpan p_span)
inline

[AI] Tests for equality (vertical bounds and segments) with another span.

Parameters
p_spanSpan to test equality against. [AI]
Returns
TRUE if equal, FALSE otherwise. [AI]

Definition at line 246 of file mxregion.h.

◆ SetMax()

void MxSpan::SetMax ( MxS32  p_max)
inline

[AI] Sets the vertical upper boundary of the span.

Parameters
p_maxNew upper boundary value. [AI]

Definition at line 186 of file mxregion.h.

◆ SetMin()

void MxSpan::SetMin ( MxS32  p_min)
inline

[AI] Sets the vertical lower boundary of the span.

Parameters
p_minNew lower boundary value. [AI]

Definition at line 175 of file mxregion.h.

Friends And Related Function Documentation

◆ MxRegionCursor

friend class MxRegionCursor
friend

Definition at line 258 of file mxregion.h.

Member Data Documentation

◆ m_max

MxS32 MxSpan::m_max
protected

[AI] Upper vertical boundary (usually 'bottom'). [AI]

Definition at line 144 of file mxregion.h.

◆ m_min

MxS32 MxSpan::m_min
protected

[AI] Lower vertical boundary (usually 'top'). [AI]

Definition at line 143 of file mxregion.h.

◆ m_segList

MxSegmentList* MxSpan::m_segList
protected

[AI] List of horizontal segments covered by this vertical span. [AI]

Definition at line 145 of file mxregion.h.


The documentation for this class was generated from the following files: