File: vectors.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 (27 lines) | stat: -rw-r--r-- 1,004 bytes parent folder | download | duplicates (4)
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
"""Displays different types of glyphs oriented and colored as per
vector data at the input points.  This is merely a convenience module
that is entirely based on the Glyph module.

"""
# Author: Prabhu Ramachandran <prabhu_r@users.sf.net>
# Copyright (c) 2005, Enthought, Inc.
# License: BSD Style.


# Local imports
from mayavi.modules.glyph import Glyph

######################################################################
# `Vectors` class.
######################################################################
class Vectors(Glyph):

    ######################################################################
    # `Module` interface
    ######################################################################
    def setup_pipeline(self):
        super(Vectors, self).setup_pipeline()
        self.glyph.trait_set(scale_mode='scale_by_vector',
                       color_mode='color_by_vector',
                       show_scale_mode=False)
        self.glyph.glyph_source.glyph_position='tail'