Hide menu
Loading...
Searching...
No Matches
cadex.Drawing.Ratio Class Reference

Holds the ratio of 2 positive integers in the form of \((n:m)\). More...

Inherits global.SystemIDisposable.

Public Member Functions

 Ratio (global::System.IntPtr cPtr, bool cMemoryOwn)
 
void Dispose ()
 
 Ratio ()
 Default constructor. Initializes with ratio \((1:1)\).
 
 Ratio (uint theNumerator, uint theDenominator)
 Constructor. Initializes with user-defined ratio.
 
uint Numerator ()
 Returns the numerator of the ratio (i.e. \(n\) from \((n:m)\)).
 
void SetNumerator (uint theNumerator)
 Sets the numerator of the ratio (i.e. \(n\) from \((n:m)\)).
 
uint Denominator ()
 Returns the denominator of the ratio (i.e. \(m\) from \((n:m)\)).
 
void SetDenominator (uint theDenominator)
 Sets the denominator of the ratio (i.e. \(m\) from \((n:m)\)).
 
double ToDouble ()
 Converts the ratio to double floating-point number.
 
bool IsEqual (cadex.Drawing.Ratio theOther)
 
bool IsNotEqual (cadex.Drawing.Ratio theOther)
 

Protected Member Functions

virtual void Dispose (bool disposing)
 

Detailed Description

Holds the ratio of 2 positive integers in the form of \((n:m)\).

Can be used to define the scale factor in certain situations. The numerator and denominator are not reduced, they are stored as is.

See also
View.Scale()

Constructor & Destructor Documentation

◆ Ratio()

cadex.Drawing.Ratio.Ratio ( uint theNumerator,
uint theDenominator )
inline

Constructor. Initializes with user-defined ratio.

Warning
0 does not make sense for and should not be passed to either of the parameters.

Member Function Documentation

◆ SetDenominator()

void cadex.Drawing.Ratio.SetDenominator ( uint theDenominator)
inline

Sets the denominator of the ratio (i.e. \(m\) from \((n:m)\)).

Warning
0 does not make sense for and should not be supplied to this parameter.

◆ SetNumerator()

void cadex.Drawing.Ratio.SetNumerator ( uint theNumerator)
inline

Sets the numerator of the ratio (i.e. \(n\) from \((n:m)\)).

Warning
0 does not make sense for and should not be supplied to this parameter.