File: scene_plugin.py

package info (click to toggle)
mayavi2 4.8.3-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 21,892 kB
  • sloc: python: 49,447; javascript: 32,885; makefile: 129; fortran: 60
file content (53 lines) | stat: -rw-r--r-- 1,441 bytes parent folder | download | duplicates (7)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
""" The TVTK render window scene plugin. """


# Enthought library imports.
from envisage.api import Plugin, ServiceOffer
from traits.api import List


# This module's package.
PKG = '.'.join(__name__.split('.')[:-1])


class ScenePlugin(Plugin):
    """ The TVTK render window scene plugin. """

    # Extension point Ids.
    PREFERENCES    = 'envisage.preferences'
    SERVICE_OFFERS = 'envisage.ui.workbench.service_offers'

    #### 'IPlugin' interface ##################################################

    # The plugin's name (suitable for displaying to the user).
    name = 'TVTK Scene Plugin'

    # Our ID.
    id = 'tvtk.scene'

    #### Extension points offered by this plugin ##############################

    # None.

    #### Contributions to extension points made by this plugin ################

    preferences = List(contributes_to=PREFERENCES)

    def _preferences_default(self):
        """ Trait initializer. """

        return ['pkgfile://%s/preferences.ini' % PKG]

    service_offers = List(contributes_to=SERVICE_OFFERS)

    def _service_offers_default(self):
        """ Trait initializer. """

        scene_manager_service_offer = ServiceOffer(
            protocol = PKG + '.i_scene_manager.ISceneManager',
            factory  = PKG + '.scene_manager.SceneManager',
        )

        return [scene_manager_service_offer]

#### EOF ######################################################################