File: iso_surface.py

package info (click to toggle)
mayavi2 4.8.3-1
  • 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,961 bytes parent folder | download | duplicates (3)
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
"""
Traits View definition file.

The view trait of the parent class has been extracted from the model
definition file.  This file can either be exec()ed or imported.  See
core/base.py:Base.trait_view() for what is currently used.  Using exec()
allows view changes without needing to restart Mayavi, but is slower than
importing.
"""
# Authors: Prabhu Ramachandran <prabhu_r@users.sf.net>
#          Judah De Paula <judah@enthought.com>
# Copyright (c) 2005-2020, Enthought, Inc.
# License: BSD Style.

from traitsui.api import Item, Group, View, InstanceEditor
from mayavi.components.ui.actor import actor_view, texture_view

view = View(Group(
                Group(
                     Item( name  = 'contour',
                           style = 'custom' ),
                     show_labels = False,
                     show_border = True,
                     label       = 'Contours' ),
                 Group(
                     Item( name = 'compute_normals' ),
                     Item( name         = 'normals',
                           style        = 'custom',
                           show_label   = False,
                           enabled_when = 'compute_normals' ),
                     show_border = True,
                     label       = 'Normals' ),
                 label='Contours',
             ),
             Group(Item('actor',
                        resizable=True,
                        style='custom',
                        editor=InstanceEditor(view=actor_view)
                        ),
                   label='Actor',
                   show_labels=False,
             ),
             Group(Item('actor',
                        resizable=True,
                        style='custom',
                        editor=InstanceEditor(view=texture_view)
                    ),
                    label='Texturing',
                    show_labels=False,
                ),
            resizable=True
            )