3.1.9.4. Interval

class PyDvi.Tools.Interval.Interval(*args)[source]

Bases: object

One-dimension Interval

Initialise an interval

  • Interval(inf, sup)
  • else args must support the __getitem__ interface, e.g.:
  • Interval((inf, sup))
  • Interval([inf, sup])
  • Interval(interval_instance)
_check_arguments(args)[source]
static _intersection(i1, i2)[source]
static _union(i1, i2)[source]
copy()[source]

Return a clone of the interval

enlarge(dx)[source]

Enlarge the interval of dx

intersect(i1, i2)[source]

Does the interval intersect with i2?

is_empty()[source]
is_included_in(i1, i2)[source]

Is the interval included in i1?

length()[source]

Return sup - inf

middle()[source]

Return interval middle

print_object()[source]

Print the interval

zero_length()[source]

Return sup == inf

class PyDvi.Tools.Interval.IntervalInt(*args)[source]

Bases: PyDvi.Tools.Interval.Interval

One-dimension Integer Interval

Initialise an interval

array must support the __getitem__ interface

length()[source]

Return sup - inf +1

class PyDvi.Tools.Interval.Interval2D(x, y)[source]

Bases: object

Two-dimension Interval

Initialise a 2D interval

x and y must support the __getitem__ interface

area()[source]

Return the area

bounding_box()[source]

Return the corresponding bounding box (x.inf, y.inf, x.sup, y.sup)

copy()[source]

Return a clone of the interval

enlarge(dx)[source]

Enlarge the interval of dx

intersect(i2)[source]

Does the interval intersect with i2?

is_empty()[source]
is_included_in(i2)[source]

Is the interval included in i2?

middle()[source]

Return interval middle

print_object()[source]

Print the interval

size()[source]

Return the horizontal and vertical size

class PyDvi.Tools.Interval.IntervalInt2D(x, y)[source]

Bases: PyDvi.Tools.Interval.Interval2D

Two-dimension Integer Interval

Initialise a 2D Integer interval

x and y must support the __getitem__ interface

Previous topic

3.1.9.3. FuncTools

Next topic

3.1.9.5. Logging

This Page