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

[AI] Represents a 2D region as a set of vertical spans each containing one or more horizontal segments. More...

#include <mxregion.h>

Inheritance diagram for MxRegion:
Collaboration diagram for MxRegion:

Public Member Functions

 MxRegion ()
 [AI] Constructs an (initially empty) region. More...
 
 ~MxRegion () override
 [AI] Destructor; destroys all spans and contained segments. More...
 
MxRect32GetBoundingRect ()
 [AI] Returns a reference to the current bounding rectangle for the region. More...
 
virtual void Reset ()
 [AI] Removes all spans and resets the bounding rectangle to an empty state. More...
 
virtual void AddRect (MxRect32 &p_rect)
 [AI] Adds a rectangle to this region, merging or splitting spans and segments as necessary. More...
 
virtual MxBool Intersects (MxRect32 &p_rect)
 [AI] Checks if this region intersects with a given rectangle (any overlap between the region's covered area and p_rect). More...
 
virtual MxBool IsEmpty ()
 [AI] Returns TRUE if the region contains zero spans (i.e., is empty). More...
 
void Compact ()
 [AI] Compacts the region's internal structure, merging adjacent/overlapping spans and segments when possible. 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 Attributes

MxSpanListm_spanList
 [AI] List of vertical spans for the region. [AI] More...
 
MxRect32 m_boundingRect
 [AI] Cached bounding rectangle for the whole region. [AI] More...
 

Friends

class MxRegionCursor
 

Detailed Description

[AI] Represents a 2D region as a set of vertical spans each containing one or more horizontal segments.

Used to describe complex areas for rasterization or clipping. Internally implemented as a list of spans, each containing their horizontal segments, forming an efficient structure for union, intersection, and decomposition.

Definition at line 327 of file mxregion.h.

Constructor & Destructor Documentation

◆ MxRegion()

MxRegion::MxRegion ( )

[AI] Constructs an (initially empty) region.

[AI]

Definition at line 12 of file mxregion.cpp.

◆ ~MxRegion()

MxRegion::~MxRegion ( )
override

[AI] Destructor; destroys all spans and contained segments.

Definition at line 20 of file mxregion.cpp.

Member Function Documentation

◆ AddRect()

void MxRegion::AddRect ( MxRect32 p_rect)
virtual

[AI] Adds a rectangle to this region, merging or splitting spans and segments as necessary.

[AI]

Parameters
p_rectRectangle to be added. [AI]

Definition at line 35 of file mxregion.cpp.

◆ Compact()

void MxRegion::Compact ( )

[AI] Compacts the region's internal structure, merging adjacent/overlapping spans and segments when possible.

◆ GetBoundingRect()

MxRect32 & MxRegion::GetBoundingRect ( )
inline

[AI] Returns a reference to the current bounding rectangle for the region.

[AI]

Definition at line 346 of file mxregion.h.

◆ Intersects()

MxBool MxRegion::Intersects ( MxRect32 p_rect)
virtual

[AI] Checks if this region intersects with a given rectangle (any overlap between the region's covered area and p_rect).

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

Definition at line 88 of file mxregion.cpp.

◆ IsEmpty()

virtual MxBool MxRegion::IsEmpty ( )
inlinevirtual

[AI] Returns TRUE if the region contains zero spans (i.e., is empty).

Definition at line 369 of file mxregion.h.

◆ Reset()

void MxRegion::Reset ( )
virtual

[AI] Removes all spans and resets the bounding rectangle to an empty state.

[AI]

Definition at line 27 of file mxregion.cpp.

Friends And Related Function Documentation

◆ MxRegionCursor

friend class MxRegionCursor
friend

Definition at line 376 of file mxregion.h.

Member Data Documentation

◆ m_boundingRect

MxRect32 MxRegion::m_boundingRect
protected

[AI] Cached bounding rectangle for the whole region. [AI]

Definition at line 330 of file mxregion.h.

◆ m_spanList

MxSpanList* MxRegion::m_spanList
protected

[AI] List of vertical spans for the region. [AI]

Definition at line 329 of file mxregion.h.


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