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

[AI] Represents a 1D segment defined by a minimum and maximum integer value. More...

#include <mxregion.h>

Public Member Functions

 MxSegment (MxS32 p_min, MxS32 p_max)
 [AI] Constructs a new segment with the specified minimum and maximum boundaries. More...
 
MxS32 GetMin ()
 [AI] Returns the lower boundary of the segment (inclusive). More...
 
MxS32 GetMax ()
 [AI] Returns the upper boundary of the segment (exclusive). More...
 
MxSegmentClone ()
 [AI] Creates a copy of the current segment. More...
 
MxBool Combine (MxSegment &p_seg)
 [AI] Attempt to merge this segment with the specified segment, if they are adjacent or overlapping. More...
 
MxBool Adjacent (MxSegment &p_seg)
 [AI] Checks if this segment is adjacent to another (i.e., ends where the other begins or vice versa). More...
 
MxBool IntersectsH (MxRect32 &p_rect)
 [AI] Determines if this segment horizontally intersects a given rectangle, interpreted as an interval comparison. More...
 
MxBool operator== (MxSegment &p_seg)
 [AI] Equality operator: checks if this segment has identical boundaries to the specified segment. More...
 
MxBool operator!= (MxSegment &p_seg)
 [AI] Inequality operator: checks if this segment differs from the specified segment by its boundaries. More...
 

Protected Attributes

MxS32 m_min
 [AI] Lower boundary of the segment (inclusive). [AI] More...
 
MxS32 m_max
 [AI] Upper boundary of the segment (exclusive). [AI] More...
 

Detailed Description

[AI] Represents a 1D segment defined by a minimum and maximum integer value.

This class is used in region and span decomposition to denote contiguous or adjacent ranges along one axis.

Definition at line 13 of file mxregion.h.

Constructor & Destructor Documentation

◆ MxSegment()

MxSegment::MxSegment ( MxS32  p_min,
MxS32  p_max 
)
inline

[AI] Constructs a new segment with the specified minimum and maximum boundaries.

Parameters
p_minLower bound of the segment (inclusive). [AI]
p_maxUpper bound of the segment (exclusive). [AI]

Definition at line 24 of file mxregion.h.

Member Function Documentation

◆ Adjacent()

MxBool MxSegment::Adjacent ( MxSegment p_seg)
inline

[AI] Checks if this segment is adjacent to another (i.e., ends where the other begins or vice versa).

Parameters
p_segReference to the segment to check adjacency with. [AI]
Returns
TRUE if segments are adjacent, FALSE otherwise. [AI]

Definition at line 60 of file mxregion.h.

◆ Clone()

MxSegment * MxSegment::Clone ( )
inline

[AI] Creates a copy of the current segment.

Returns
A pointer to the newly created MxSegment instance. [AI]

Definition at line 46 of file mxregion.h.

◆ Combine()

MxBool MxSegment::Combine ( MxSegment p_seg)

[AI] Attempt to merge this segment with the specified segment, if they are adjacent or overlapping.

Parameters
p_segReference to a segment to attempt to merge. [AI]
Returns
TRUE if segments were merged, FALSE otherwise. [AI]

◆ GetMax()

MxS32 MxSegment::GetMax ( )
inline

[AI] Returns the upper boundary of the segment (exclusive).

Returns
The maximum boundary value. [AI]

Definition at line 40 of file mxregion.h.

◆ GetMin()

MxS32 MxSegment::GetMin ( )
inline

[AI] Returns the lower boundary of the segment (inclusive).

Returns
The minimum boundary value. [AI]

Definition at line 34 of file mxregion.h.

◆ IntersectsH()

MxBool MxSegment::IntersectsH ( MxRect32 p_rect)
inline

[AI] Determines if this segment horizontally intersects a given rectangle, interpreted as an interval comparison.

Parameters
p_rectRectangle whose horizontal range is compared. [AI]
Returns
TRUE if there is an overlap, FALSE otherwise. [AI]

Definition at line 67 of file mxregion.h.

◆ operator!=()

MxBool MxSegment::operator!= ( MxSegment p_seg)
inline

[AI] Inequality operator: checks if this segment differs from the specified segment by its boundaries.

Parameters
p_segReference to segment for the comparison. [AI]
Returns
TRUE if the segments differ, FALSE otherwise. [AI]

Definition at line 81 of file mxregion.h.

◆ operator==()

MxBool MxSegment::operator== ( MxSegment p_seg)
inline

[AI] Equality operator: checks if this segment has identical boundaries to the specified segment.

Parameters
p_segReference to segment for the comparison. [AI]
Returns
TRUE if the segments are equal, FALSE otherwise. [AI]

Definition at line 74 of file mxregion.h.

Member Data Documentation

◆ m_max

MxS32 MxSegment::m_max
protected

[AI] Upper boundary of the segment (exclusive). [AI]

Definition at line 16 of file mxregion.h.

◆ m_min

MxS32 MxSegment::m_min
protected

[AI] Lower boundary of the segment (inclusive). [AI]

Definition at line 15 of file mxregion.h.


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