- 1 Integer Range
- 1.1 IntRange Interface
This file defines an interface and exotype, for storing a range of integer values. The values can be stored as comma seperated values, a range of values or a combination of the two. This is ideal for working with things like frame numbers.
The ILxIntRange interface is used by the IntRange ExoType. Ranges are entered as strings, and are inclusive: "1-5" matches 1, 2, 3, 4 and 5. A dash is used to specify ranges, such as "1-20", commas add more ranges or specific integers, such as "1-20,30,45-55", leading and trailing ellipses to mark all before and all after, such as "...1-10,20-30", and can be used to specify an exclusive range with something like "...0,11...". "..." by itself matches everything. Negative numbers are supported, such as "-1", "-1--30" or "-1-1". Whites space is automatically skipped, making negative numbers easier to read as "-1 - -30" or "-1 - 1", for example. Numbers can be in reverse order, such as "10-20,5-10" or "20-10". The range can be read in lowest to highest numerical order or in the order the of the string.
A range that does not follow the rules, such as an ellipses in the middle of the string, a dash without a number on the left side, no dash or comma between nubmers, or any illegal characters, is considered failed and will return false to all requests.
(1) SDK: LXu_INTRANGE, etc. defines
These return true LXe_TRUE if there are leading or trailing ellipses, and LXe_FALSE if not.
(2) SDK: IntRange::AllBefore, etc.
These functions allow the integer range to be walked. The basic walking functions are Next() and Prev() and increment the current position. What is considered "next" and "previous" is determined by if the list is being walked in numerical or user order. When there are no more integers left, the methods fail.
(3) SDK: IntRange::Next, etc.
Numerical order starts at lowest integer in the range and goes to the highest integer. Example uses are print ranges, where you always want to print from the first page to the last page.
User order starts from the first integer the user specified to the last, including reversed ranges. This is useful for things such as rendering sequences backward.
In both cases, each integer will be returned only once. Note that these functions will fail if the range consists entirely of "...", as there is no meaningful beginning or end to the range.
Min() and Max() are used to get the lowest or highest integer and set the mode to numerical order.
(4) SDK: IntRange::Min, etc.
First() and Last() are used to get the first or last integer and set the mode to user order.
(5) SDK: IntRange::First, etc.
This gets the current integer.
(6) SDK: IntRange::Current
It is often useful to be able to simply test to see if an integer is within the range. This returns LXe_TRUE if in range. This does not affect the current position used to walk the range.
(7) SDK: IntRange::Test
Empty IntRange Python user class.
(8) PY: empty IntRange user class