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

[AI] Cursor object suitable for traversing all rectangles covered by an MxRegion. More...

#include <mxregion.h>

Inheritance diagram for MxRegionCursor:
Collaboration diagram for MxRegionCursor:

Public Member Functions

 MxRegionCursor (MxRegion *p_region)
 [AI] Constructs a traversal cursor for the specified region. More...
 
 ~MxRegionCursor () override
 [AI] Destructor; releases ownership of current rectangle and cursors. More...
 
virtual MxRect32Head ()
 [AI] Seeks to and returns the first (topmost, leftmost) rectangle covered by the region. More...
 
virtual MxRect32Tail ()
 [AI] Seeks to and returns the last (bottommost, rightmost) rectangle covered by the region. More...
 
virtual MxRect32Next ()
 [AI] Advances to and returns the next rectangle in region sequence. More...
 
virtual MxRect32Prev ()
 [AI] Steps backward to and returns the previous rectangle in region sequence. More...
 
virtual MxRect32Head (MxRect32 &p_rect)
 [AI] Filtered: Places at the first rectangle overlapping p_rect and returns it. More...
 
virtual MxRect32Tail (MxRect32 &p_rect)
 [AI] Filtered: Steps to last rectangle intersecting p_rect. More...
 
virtual MxRect32Next (MxRect32 &p_rect)
 [AI] Filtered: Advances to next rectangle intersecting p_rect. More...
 
virtual MxRect32Prev (MxRect32 &p_rect)
 [AI] Filtered: Steps to previous rectangle intersecting p_rect. More...
 
virtual MxRect32GetRect ()
 [AI] Returns a pointer to the currently referenced rectangle. More...
 
virtual MxBool Valid ()
 [AI] Checks if the cursor is currently referencing a valid rectangle (not at end). More...
 
virtual void Reset ()
 [AI] Resets the cursor(s) to the initial (uninitialized) state. More...
 
- Public Member Functions inherited from MxCore
 MxCore ()
 [AI] Constructs a new MxCore object and assigns it a unique id. More...
 
virtual ~MxCore ()
 [AI] Virtual destructor. Required for correct polymorphic cleanup in derived classes. More...
 
virtual MxLong Notify (MxParam &p_param)
 [AI] Virtual callback notification mechanism. More...
 
virtual MxResult Tickle ()
 [AI] Called by tickle managers to allow the object to update itself. More...
 
virtual const char * ClassName () const
 [AI] Returns the runtime class name of this object. More...
 
virtual MxBool IsA (const char *p_name) const
 [AI] Checks whether this object's class type or parents match the given name. More...
 
MxU32 GetId ()
 [AI] Gets the unique (per-process) id assigned to this object instance. More...
 

Protected Member Functions

void CreateSegmentListCursor (MxSegmentList *p_segList)
 [AI] Allocates a segment list cursor for the given segment list, replacing any previous segment cursor. More...
 
void SetRect (MxS32 p_left, MxS32 p_top, MxS32 p_right, MxS32 p_bottom)
 [AI] Initializes or updates m_rect with the specified coordinates. More...
 
void NextSpan (MxRect32 &p_rect)
 [AI] Step to the next span which overlaps p_rect (for filtered/region-clip traversal). More...
 
void PrevSpan (MxRect32 &p_rect)
 [AI] Step to the previous span (reverse traversal) intersecting p_rect. More...
 

Protected Attributes

MxRegionm_region
 [AI] The region being traversed. [AI] More...
 
MxRect32m_rect
 [AI] Current rectangle being referenced. [AI] More...
 
MxSpanListCursorm_spanListCursor
 [AI] Cursor for moving through the span list. [AI] More...
 
MxSegmentListCursorm_segListCursor
 [AI] Cursor for the current segment list. [AI] More...
 

Detailed Description

[AI] Cursor object suitable for traversing all rectangles covered by an MxRegion.

Supports both sequential and filtered (clipped) traversal. Can return rectangles in scanline order.

Definition at line 389 of file mxregion.h.

Constructor & Destructor Documentation

◆ MxRegionCursor()

MxRegionCursor::MxRegionCursor ( MxRegion p_region)

[AI] Constructs a traversal cursor for the specified region.

Parameters
p_regionThe region to be traversed. [AI]

Definition at line 112 of file mxregion.cpp.

◆ ~MxRegionCursor()

MxRegionCursor::~MxRegionCursor ( )
override

[AI] Destructor; releases ownership of current rectangle and cursors.

Definition at line 121 of file mxregion.cpp.

Member Function Documentation

◆ CreateSegmentListCursor()

void MxRegionCursor::CreateSegmentListCursor ( MxSegmentList p_segList)
protected

[AI] Allocates a segment list cursor for the given segment list, replacing any previous segment cursor.

Parameters
p_segListSegment list to navigate. [AI]

Definition at line 311 of file mxregion.cpp.

◆ GetRect()

virtual MxRect32 * MxRegionCursor::GetRect ( )
inlinevirtual

[AI] Returns a pointer to the currently referenced rectangle.

Returns
Pointer to internal MxRect32 or nullptr if at end. [AI]

Definition at line 491 of file mxregion.h.

◆ Head() [1/2]

MxRect32 * MxRegionCursor::Head ( )
virtual

[AI] Seeks to and returns the first (topmost, leftmost) rectangle covered by the region.

Returns
Pointer to internal MxRect32 (do not delete). [AI]

Definition at line 137 of file mxregion.cpp.

◆ Head() [2/2]

MxRect32 * MxRegionCursor::Head ( MxRect32 p_rect)
virtual

[AI] Filtered: Places at the first rectangle overlapping p_rect and returns it.

Parameters
p_rectRectangle defining the filter/clipping region. [AI]
Returns
Pointer to intersection rectangle. [AI]

Definition at line 229 of file mxregion.cpp.

◆ Next() [1/2]

MxRect32 * MxRegionCursor::Next ( )
virtual

[AI] Advances to and returns the next rectangle in region sequence.

Returns
Pointer to internal MxRect32 (do not delete). [AI]

Definition at line 179 of file mxregion.cpp.

◆ Next() [2/2]

MxRect32 * MxRegionCursor::Next ( MxRect32 p_rect)
virtual

[AI] Filtered: Advances to next rectangle intersecting p_rect.

Parameters
p_rectFilter/clipping rectangle. [AI]
Returns
Pointer to intersection rectangle. [AI]

Definition at line 245 of file mxregion.cpp.

◆ NextSpan()

void MxRegionCursor::NextSpan ( MxRect32 p_rect)
protected

[AI] Step to the next span which overlaps p_rect (for filtered/region-clip traversal).

Parameters
p_rectRectangle defining the filter window for the next span. [AI]

Definition at line 334 of file mxregion.cpp.

◆ Prev() [1/2]

MxRect32 * MxRegionCursor::Prev ( )
virtual

[AI] Steps backward to and returns the previous rectangle in region sequence.

Returns
Pointer to internal MxRect32 (do not delete). [AI]

Definition at line 204 of file mxregion.cpp.

◆ Prev() [2/2]

MxRect32 * MxRegionCursor::Prev ( MxRect32 p_rect)
virtual

[AI] Filtered: Steps to previous rectangle intersecting p_rect.

Parameters
p_rectRectangle for filtering. [AI]
Returns
Pointer to intersection rectangle. [AI]

Definition at line 270 of file mxregion.cpp.

◆ PrevSpan()

void MxRegionCursor::PrevSpan ( MxRect32 p_rect)
protected

[AI] Step to the previous span (reverse traversal) intersecting p_rect.

Parameters
p_rectRectangle used for calculating intersection. [AI]

Definition at line 365 of file mxregion.cpp.

◆ Reset()

void MxRegionCursor::Reset ( )
virtual

[AI] Resets the cursor(s) to the initial (uninitialized) state.

All internal cursors are reset, and no rectangle is selected.

Definition at line 295 of file mxregion.cpp.

◆ SetRect()

void MxRegionCursor::SetRect ( MxS32  p_left,
MxS32  p_top,
MxS32  p_right,
MxS32  p_bottom 
)
protected

[AI] Initializes or updates m_rect with the specified coordinates.

Parameters
p_leftLeft boundary. [AI]
p_topTop boundary. [AI]
p_rightRight boundary. [AI]
p_bottomBottom boundary. [AI]

Definition at line 321 of file mxregion.cpp.

◆ Tail() [1/2]

MxRect32 * MxRegionCursor::Tail ( )
virtual

[AI] Seeks to and returns the last (bottommost, rightmost) rectangle covered by the region.

Returns
Pointer to internal MxRect32 (do not delete). [AI]

Definition at line 158 of file mxregion.cpp.

◆ Tail() [2/2]

MxRect32 * MxRegionCursor::Tail ( MxRect32 p_rect)
virtual

[AI] Filtered: Steps to last rectangle intersecting p_rect.

Parameters
p_rectRectangle to limit the search to. [AI]
Returns
Pointer to intersection rectangle. [AI]

Definition at line 237 of file mxregion.cpp.

◆ Valid()

virtual MxBool MxRegionCursor::Valid ( )
inlinevirtual

[AI] Checks if the cursor is currently referencing a valid rectangle (not at end).

Returns
TRUE if valid, FALSE if past end of region. [AI]

Definition at line 497 of file mxregion.h.

Member Data Documentation

◆ m_rect

MxRect32* MxRegionCursor::m_rect
protected

[AI] Current rectangle being referenced. [AI]

Definition at line 392 of file mxregion.h.

◆ m_region

MxRegion* MxRegionCursor::m_region
protected

[AI] The region being traversed. [AI]

Definition at line 391 of file mxregion.h.

◆ m_segListCursor

MxSegmentListCursor* MxRegionCursor::m_segListCursor
protected

[AI] Cursor for the current segment list. [AI]

Definition at line 394 of file mxregion.h.

◆ m_spanListCursor

MxSpanListCursor* MxRegionCursor::m_spanListCursor
protected

[AI] Cursor for moving through the span list. [AI]

Definition at line 393 of file mxregion.h.


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