File: __init__.py

package info (click to toggle)
python-vispy 0.6.6-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 21,240 kB
  • sloc: python: 57,407; javascript: 6,810; makefile: 63; sh: 5
file content (34 lines) | stat: -rw-r--r-- 1,267 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# -*- coding: utf-8 -*-
# Copyright (c) Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
Provides classes representing different transform types suitable for
use with visuals and scenes.
"""


from .base_transform import BaseTransform  # noqa
from .linear import (NullTransform, STTransform,  # noqa
                     MatrixTransform,  MatrixTransform)  # noqa
from .nonlinear import LogTransform, PolarTransform  # noqa
from .interactive import PanZoomTransform
from .chain import ChainTransform  # noqa
from ._util import arg_to_array, arg_to_vec4, as_vec4, TransformCache  # noqa
from .transform_system import TransformSystem

__all__ = ['NullTransform', 'STTransform', 'MatrixTransform',
           'MatrixTransform', 'LogTransform', 'PolarTransform',
           'ChainTransform', 'TransformSystem', 'PanZoomTransform']

transform_types = {}
for o in list(globals().values()):
    try:
        if issubclass(o, BaseTransform) and o is not BaseTransform:
            name = o.__name__[:-len('Transform')].lower()
            transform_types[name] = o
    except TypeError:
        continue


def create_transform(type, *args, **kwargs):
    return transform_types[type](*args, **kwargs)