Public Member Functions | Public Attributes | List of all members
Range Class Reference

Inherits ScriptObject, and UnitConsumer.

Public Member Functions

 Range ()
 
 Range (Number a, Number b, Actuator actuator=Actuator::ACTUATOR_ROTATIONAL)
 
Boolean isNonRange ()
 
Number getMinimum ()
 
Number getMaximum ()
 
Number getSpan ()
 
Number getMiddle ()
 
 grow (Number offset)
 
 reduce (Number offset)
 
 translate (Number offset)
 
 expandTo (Number value)
 
 expandToRange (Range value)
 
Number getU (Number value)
 
Boolean isWithin (Number value)
 
Number clamp (Number value)
 
String toString ()
 

Public Attributes

Number minimum
 The minimum coordinate of the range.
 
Number maximum
 The maximum coordinate of the range.
 
Number span
 The span of the range.
 
Number middle
 The middle of the range.
 

Detailed Description

A 2D range specified by an minimum and maximum value.

Constructor & Destructor Documentation

◆ Range() [1/2]

Range ( )

Constructs the range as uninitialized.

◆ Range() [2/2]

Range ( Number  a,
Number  b,
Actuator  actuator = Actuator::ACTUATOR_ROTATIONAL 
)

Constructs the range from the specified values.

Parameters
aOuter value for the range.
bOuter value for the range.
actuatorThe actuator type (ie. either "linear" or "rotational"). The default is "rotational".

Member Function Documentation

◆ clamp()

Number clamp ( Number  value)

Returns the nearest value which is in the range.

◆ expandTo()

expandTo ( Number  value)

Expands the range to include the specified value.

◆ expandToRange()

expandToRange ( Range  value)

Expands the range to include the specified range.

◆ getMaximum()

Number getMaximum ( )

Returns the maximum value.

◆ getMiddle()

Number getMiddle ( )

Returns the middle of the range.

◆ getMinimum()

Number getMinimum ( )

Returns the minimum value.

◆ getSpan()

Number getSpan ( )

Returns the span of the range.

◆ getU()

Number getU ( Number  value)

Returns the U coordinate for the specified value. 0 and 1 corresponds to the minimum and maximum, respectively.

◆ grow()

grow ( Number  offset)

Grows the range by the specified offset.

◆ isNonRange()

Boolean isNonRange ( )

Returns true if the range is a non-range.

◆ isWithin()

Boolean isWithin ( Number  value)

Returns true if the specified value is within the range.

◆ reduce()

reduce ( Number  offset)

Reduces the range by the specified offset. Returns the middle of the range if the range collapses.

◆ toString()

String toString ( )

Converts the range to a string (e.g. [-10.5; 5.75]).

◆ translate()

translate ( Number  offset)

Translates the range.



Generated by Autodesk, Inc. 19 April 2024
Copyright (c) 2012-2024 by Autodesk, Inc.