Reference » Service classes » MSize

Elgrint::MSize class

Declared in elStructs.h

Description

Describes a three-dimensional size with width, height, and depth elements.
Read more...

Data members:

Name Type Init value Description
w MSizeElem 0

Width - horizontal size element (typically in pixels).

h MSizeElem 0

Height - vertical size element (typically in pixels).

d MSizeElem 0

Depth - orthogonal, "into the screen" size element (reserved for future use).

Remarks:

  • Even though d isn't used, it still affects the validity and equality. For example, MSize(0,0,0) is not equal to MSize(0,0,1), and IsValid(MSize(0,0,None)) returns false (see operator== and IsValid)

Initializers:

Name Description
MSize() Default constructor. Sets data members (elements) to their default values.
MSize(aw,ah,ad) Init constructor. Sets data members to their initial values.

Global functions:

Name Description
operator!=(s1,s2) Logical opposite of operator==.
operator*(s,c) Multiplies a valid MSize value by scalar with overflow checking.
operator*(c,s) Multiplies a scalar by a valid MSize value with overflow checking.
operator+(s1,s2) Adds two valid MSize values with overflow checking.
operator-(s1,s2) Subtracts two valid MSize values with underflow checking.
operator/(s,c) Divides a valid MSize value by a non-zero scalar.
operator<<(s1,s2) Validates s1 using s2 and returns the result.
operator<<(str,s) Appends s to str in a "w,h,d" form.
operator<<=(s1,s2) Validates s1 using values in s2.
operator==(s1,s2) Returns true iff s1 and s2 are equal.

Details

MSize defines a 3D size type, suitable for measuring windows or other box-like 2D or 3D shapes. The measuring units depend on the context, but most often they are measured in pixels.

Unlike MLocus, MSize is not an ordered type (cannot be sorted), but it does support typical vector operations: addition, subtraction, and multiplication/division by scalar.

Remarks

Let us know

Please Contact us to report any errors on this page, or to suggest any improvements.

Miranor Home | About Miranor | About Elgrint | Create account | Login | Account settings | Contact Us | Privacy Policy | Site map

© Copyright 2014 by Miranor. All rights reserved. By using this site you agree to the Terms of Use.

Page last updated on August 10th, 2014.