/[escript]/trunk/pyvisi/py_src/constant.py
ViewVC logotype

Contents of /trunk/pyvisi/py_src/constant.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1153 - (show annotations)
Thu May 17 06:33:54 2007 UTC (13 years, 1 month ago) by jongui
File MIME type: text/x-python
File size: 4098 byte(s)
Made some minor modifications and fixed minor bugs. Most tests appear to pass on the Altix although there are two tests which occasionally throw an error related to memory corruption.
1 class Color:
2 """
3 Constants that define the colors using RGB values.
4
5 @cvar RED: Constant representing red color
6 @cvar GREEN: Constant representing green color
7 @cvar BLUE: Constant representing blue color
8 @cvar BLACK: Constant representing black color
9 @cvar WHITE: Constant representing white color
10 @cvar YELLOW: Constant representing yellow color
11 @cvar PINK: Constant represnting pink color
12 @cvar ORANGE: Constant representing orange color
13 @cvar PURPLE: Constant representing purple color
14 @cvar GREY: Constant representing grey color
15 @cvar BROWN: Constant representing brown color
16 """
17
18 RED = [1, 0, 0]
19 GREEN = [0, 1, 0]
20 BLUE = [0, 0, 1]
21 BLACK = [0, 0, 0]
22 WHITE = [1, 1, 1]
23 YELLOW = [1,1,0]
24 PINK = [1, 0.0784, 0.4588]
25 ORANGE = [1, 0.2706, 0]
26 PURPLE = [0.5412, 0.1680, 0.8828]
27 GREY = [0.6602, 0.6602, 0.6602]
28 BROWN = [0.5430, 0.2700, 0.0742]
29
30 class Viewport:
31 """
32 Constants that define the four viewports in a window.
33
34 @cvar SOUTH_WEST: Constant representing the bottom-left viewport of a
35 window
36 @cvar NORTH_WEST: Constant representing the upper-left viewport of a
37 window
38 @cvar NORTH_EAST: Constatnt representing the upper-right viewport of a
39 window
40 @cvar SOUTH_EAST: Constant representing the bottom-right viewport of a window
41 """
42
43 SOUTH_WEST = 0
44 NORTH_WEST = 1
45 NORTH_EAST = 2
46 SOUTH_EAST = 3
47
48 class Source:
49 """
50 Constants that define the source type.
51
52 @cvar XML: Constant representing xml as the source type
53 @cvar ESCRIPT: Constant representing escript data objects as source
54 """
55
56 XML = "xml"
57 ESCRIPT = "escript"
58
59 class Renderer:
60 """
61 Constants that define the renderer type.
62
63 @cvar ONLINE: Constant representing the online renderer
64 @cvar OFFLINE_JPG: Constant representing the JPG offline renderer
65 @cvar OFFLINE_BMP: Constant representing the BMP offline renderer
66 @cvar OFFLINE_PNM: Constant representing the PNM offline renderer
67 @cvar OFFLINE_PNG: Constant representing the PNG offline renderer
68 @cvar OFFLINE_TIF: Constant representing the TIF offline renderer
69 @cvar OFFLINE_PS: Constant representing the PS offline renderer
70 """
71
72 ONLINE = "online"
73 ONLINE_JPG = "online_jpg"
74 ONLINE_BMP = "online_bmp"
75 ONLINE_PNM = "online_pnm"
76 ONLINE_PNG = "online_png"
77 ONLINE_TIF = "online_tif"
78 ONLINE_PS = "online_ps"
79
80 OFFLINE_JPG = "offline_jpg"
81 OFFLINE_BMP = "offline_bmp"
82 OFFLINE_PNM = "offline_pnm"
83 OFFLINE_PNG = "offline_png"
84 OFFLINE_TIF = "offline_tif"
85 OFFLINE_PS = "offline_ps"
86
87 DISPLAY = "display"
88 DISPLAY_JPG = "display_jpg"
89 DISPLAY_BMP = "display_bmp"
90 DISPLAY_PNM = "display_pnm"
91 DISPLAY_PNG = "display_png"
92 DISPLAY_TIF = "display_tif"
93 DISPLAY_PS = "display_ps"
94
95 class Arrow:
96 """
97 Constants that define the arrow type.
98
99 @cvar TWO_D: Constant representing the two dimensional arrow type
100 @cvar THREE_D: Constant representing the three dimensional arrow type
101 """
102
103 TWO_D = "2d"
104 THREE_D = "3d"
105
106 class ColorMode:
107 """
108 Constants that define the color mode used to color the data.
109
110 @cvar VECTOR: Constant representing the vector color mode
111 @cvar SCALAR: Constant representing the scalar color mode
112 """
113
114 VECTOR = "vector"
115 SCALAR = "scalar"
116
117 class WarpMode:
118 """
119 Constants that define the warp mode used to deform the scalar data.
120
121 @cvar VECTOR: Constant representing the vector deformation mode
122 @cvar SCALAR: Constant representing the scalar deformation mode
123 """
124
125 VECTOR = "vector"
126 SCALAR = "scalar"
127
128 class ImageFormat:
129 """
130 Constants that define the image formats.
131
132 @cvar JPG: Constant representing the JPG image format
133 @cvar BMP: Constant representing the BMP image format
134 @cvar PNM: Constant representing the PNM image format
135 @cvar PNG: Constant representing the PNG image format
136 @cvar TIF: Constant representing the TIF image format
137 """
138
139 JPG = "jpg"
140 BMP = "bmp"
141 PNM = "pnm"
142 PNG = "png"
143 TIF = "tif"
144
145 class Lut:
146 """
147 Constants that define the type of color mapping scheme for the lookup
148 table.
149
150 @cvar COLOR: Constant representing the color scheme
151 @cvar GREY_SCALE: Constant representing the grey scale scheme
152 """
153
154 COLOR = "color"
155 GREY_SCALE = "grey_scale"
156

  ViewVC Help
Powered by ViewVC 1.1.26