C# Class Smrf.NodeXL.Layouts.RectangleBinner

Splits a parent rectangle into "bin" rectangles.
A bin is a small square that fits into a parent rectangle. This class splits the parent into consecutive bins, running from left to right along the bottom of the parent and then moving up a row.

Pass the parent rectangle to the constructor, along with the length of the bin. Call TryGetNextBin to get the next bin, and call to get any space not occupied by the returned bins.

Inheritance: Object
ファイルを表示 Open project: 2014-sed-team3/term-project Class Usage Examples

Protected Properties

Property Type Description
m_bBinReturned System.Boolean
m_iBinLength System.Int32
m_oLastBin System.Drawing.Rectangle
m_oParent System.Drawing.Rectangle

Public Methods

Method Description
RectangleBinner ( Rectangle parent, Int32 binLength ) : System

Initializes a new instance of the RectangleBinner class.

TryGetNextBin ( Rectangle &nextBin ) : System.Boolean
TryGetRemainingRectangle ( Rectangle &remainingRectangle ) : System.Boolean

Private Methods

Method Description
AssertValid ( ) : void

Method Details

RectangleBinner() public method

Initializes a new instance of the RectangleBinner class.
public RectangleBinner ( Rectangle parent, Int32 binLength ) : System
parent System.Drawing.Rectangle /// The parent rectangle to split into bins. ///
binLength System.Int32 /// Length and width of each bin square. Must be greater than zero. ///
return System

TryGetNextBin() public method

public TryGetNextBin ( Rectangle &nextBin ) : System.Boolean
nextBin System.Drawing.Rectangle
return System.Boolean

TryGetRemainingRectangle() public method

public TryGetRemainingRectangle ( Rectangle &remainingRectangle ) : System.Boolean
remainingRectangle System.Drawing.Rectangle
return System.Boolean

Property Details

m_bBinReturned protected_oe property

protected Boolean,System m_bBinReturned
return System.Boolean

m_iBinLength protected_oe property

protected Int32,System m_iBinLength
return System.Int32

m_oLastBin protected_oe property

protected Rectangle,System.Drawing m_oLastBin
return System.Drawing.Rectangle

m_oParent protected_oe property

protected Rectangle,System.Drawing m_oParent
return System.Drawing.Rectangle