Unplugged Viz
High-performance scientific visualization isn't just for the workstation anymore
Durwella.Unplugged.Viz.RangeF Class Reference

A one-dimensional range defined by two float endpoints. More...

Public Member Functions

 RangeF (float from, float to)
 Initializes a new instance of the T:Unplugged.Visualization.XForms.RangeF class. More...
 
double Clamp (double value)
 If the value is within the range, returns the value; otherwise, return Minimum or Maximum for values below and above the range, respectively. More...
 
double MapTo (RangeF destination, double value)
 Maps the value relative to this range to the corresponsing value in the destination range. For example, More...
 
double MapToClamped (RangeF destination, double value)
 Combines MapTo and Clamp; returns the value mapped and clamped to the destination range/ More...
 

Static Public Member Functions

static RangeF AboutZero (float length)
 Returns a RangeF with SignedLength == length, centered about 0. More...
 

Static Public Attributes

static readonly RangeF Normal
 The "normal" range of 0 to 1. More...
 
static readonly RangeF OfByte
 The total range of Bytes, from Byte.MinValue to Byte.MaxValue. More...
 
static readonly RangeF OfInt16
 The total range of Int16s, from Int16.MinValue to Int16.MaxValue. More...
 
static readonly RangeF OfInt32
 The total range of Int32s, from Int32.MinValue to Int32.MaxValue. More...
 

Properties

float From [get]
 The beginning of the range. More...
 
float To [get]
 The end of the range. More...
 
float SignedLength [get]
 The signed difference between To and From. More...
 
float Center [get]
 The center of the range. More...
 
float Minimum [get]
 The minimum of the range. More...
 
float Maximum [get]
 The maximum of the range. More...
 

Detailed Description

A one-dimensional range defined by two float endpoints.

Inheritance diagram for Durwella.Unplugged.Viz.RangeF:
Durwella.Unplugged.Viz.ShapeFBase

Constructor & Destructor Documentation

Durwella.Unplugged.Viz.RangeF.RangeF ( float  from,
float  to 
)

Initializes a new instance of the T:Unplugged.Visualization.XForms.RangeF class.

Parameters
fromThe beginning of the range.
toThe end of the range.

Member Function Documentation

static RangeF Durwella.Unplugged.Viz.RangeF.AboutZero ( float  length)
static

Returns a RangeF with SignedLength == length, centered about 0.

Parameters
lengthThe desired SignedLength for the returned RangeF.
double Durwella.Unplugged.Viz.RangeF.Clamp ( double  value)

If the value is within the range, returns the value; otherwise, return Minimum or Maximum for values below and above the range, respectively.

Parameters
valueThe value to be clamped
double Durwella.Unplugged.Viz.RangeF.MapTo ( RangeF  destination,
double  value 
)

Maps the value relative to this range to the corresponsing value in the destination range. For example,

new RangeF(0, 100).MapTo(new RangeF(0, 20), 20) == 4
Returns
The mapped value.
Parameters
destinationThe destination range.
valuethe value to be mapped.
double Durwella.Unplugged.Viz.RangeF.MapToClamped ( RangeF  destination,
double  value 
)

Combines MapTo and Clamp; returns the value mapped and clamped to the destination range/

Returns
The mapped and clamped value.
Parameters
destinationDestination.
valueValue.

Member Data Documentation

readonly RangeF Durwella.Unplugged.Viz.RangeF.Normal
static

The "normal" range of 0 to 1.

readonly RangeF Durwella.Unplugged.Viz.RangeF.OfByte
static

The total range of Bytes, from Byte.MinValue to Byte.MaxValue.

readonly RangeF Durwella.Unplugged.Viz.RangeF.OfInt16
static

The total range of Int16s, from Int16.MinValue to Int16.MaxValue.

readonly RangeF Durwella.Unplugged.Viz.RangeF.OfInt32
static

The total range of Int32s, from Int32.MinValue to Int32.MaxValue.

Property Documentation

float Durwella.Unplugged.Viz.RangeF.Center
get

The center of the range.

float Durwella.Unplugged.Viz.RangeF.From
get

The beginning of the range.

float Durwella.Unplugged.Viz.RangeF.Maximum
get

The maximum of the range.

float Durwella.Unplugged.Viz.RangeF.Minimum
get

The minimum of the range.

float Durwella.Unplugged.Viz.RangeF.SignedLength
get

The signed difference between To and From.

float Durwella.Unplugged.Viz.RangeF.To
get

The end of the range.


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