1 |
\chapter{The module \pyvisi} |
2 |
\label{PYVISI CHAP} |
3 |
|
4 |
\declaremodule{extension}{pyvisi} |
5 |
\modulesynopsis{Python visualization interface} |
6 |
|
7 |
\pyvisi provides an easy to use interface to the \VTK visualization |
8 |
tool. The module provides the following features: |
9 |
|
10 |
\begin{itemize} |
11 |
\item \Scene: Shows a scene in which components are to be displayed. |
12 |
\item \DataCollector: Deals with data for visualization. |
13 |
\item \Camera: Controls the camera manipulation. |
14 |
\item \Map: Shows a scalar field by color on the domain surface. |
15 |
\item \MapOnPlane: Shows a scalar field by color on a given plane. |
16 |
\item \MapOnClip: Shows a scalar field by color on a given clip. |
17 |
\item \Arrows: Shows a vector field by arrows. |
18 |
\item \ArrowsOnPlane: Shows a vector field by arrows on a given plane. |
19 |
\item \ArrowsOnClip: Shows a vector field by arrows on a given clip. |
20 |
\item \IsoSurface: Shows a scalar field for a given value by |
21 |
an isosurface. |
22 |
\item \IsoSurfaceOnPlane: Shows a scalar field for a given value by |
23 |
an isosurfaceon a given plane. |
24 |
\item \IsoSurfaceOnClip: Shows a scalar field for a given vlaue by |
25 |
an isosurface on a given clip. |
26 |
\item \Contour: Shows a scalar field by contour surfaces. |
27 |
\item \ContourOnPlane: Shows a scalar field by contour surfaces on |
28 |
a given plane. |
29 |
\item \ContourOnClip: Shows a scalar field by contour surfaces on |
30 |
a given clip. |
31 |
\item \TensorC: Shows a tensor field by ellipsoids. |
32 |
\item \TensorOnPlane: Shows a tensor field by ellipsoids on |
33 |
a given plane. |
34 |
\item \TensorOnClip: Shows a tensor field by ellipsoids on a given clip. |
35 |
\item \StreamLines: Shows the path of particles in a vector field. |
36 |
\item \Carpet: Shows a scalar field as plane deformated along |
37 |
the plane normal. |
38 |
\item \Image: Shows an image. |
39 |
\item \Text: Shows some 2D text. |
40 |
\item \Position: Defines the x,y and z coordinates rendered object. |
41 |
\item \Transform: Defines the orientation of rendered object. |
42 |
\item \Style: Defines the style of text. |
43 |
\item \BlueToRed: Defines a map spectrum from blue to red. |
44 |
\item \RedToBlue: Defines a map spectrum from red to blue. |
45 |
\end{itemize} |
46 |
|
47 |
\section{\Scene class} |
48 |
\begin{classdesc}{Scene}{renderer, x_size = 500, y_size = 500} |
49 |
A \Scene object creates a window onto which objects are to be displayed. |
50 |
\end{classdesc} |
51 |
|
52 |
The following are the methods available: |
53 |
\begin{methoddesc}[Scene]{saveImage}{image_name} |
54 |
Save the rendered object as an image off-screen. |
55 |
\end{methoddesc} |
56 |
|
57 |
\begin{methoddesc}[Scene]{render}{} |
58 |
Render the object on-screen. |
59 |
\end{methoddesc} |
60 |
|
61 |
The following is a sample code using the \Scene class: |
62 |
\verbatiminput{../examples/driverscene.py} |
63 |
|
64 |
\section{\DataCollector class} |
65 |
\begin{classdesc}{DataCollector}{scene, outline = True, cube_axes = False} |
66 |
A \DataCollector object deals with the data for visualization. |
67 |
\end{classdesc} |
68 |
|
69 |
The following are the methods available: |
70 |
\begin{methoddesc}[DataCollector]{setFileName}{file_name} |
71 |
Set the file name from which data is to be read. |
72 |
\end{methoddesc} |
73 |
|
74 |
The following is a sample code using the \DataCollector class. |
75 |
\fig{fig:datacollector.1} shows the corresponding output. |
76 |
\verbatiminput{../examples/driverdatacollector.py} |
77 |
|
78 |
\begin{figure}[ht] |
79 |
\begin{center} |
80 |
\includegraphics[width=40mm]{figures/DataCollector} |
81 |
\end{center} |
82 |
\caption{Datacollector generating an outline with cube axes.} |
83 |
\label{fig:datacollector.1} |
84 |
\end{figure} |
85 |
|
86 |
\section{\Camera class} |
87 |
\begin{classdesc}{Camera}{scene, data_collector} |
88 |
A \Camera object controls the camera's settings. |
89 |
\end{classdesc} |
90 |
|
91 |
The following are some of the methods available: |
92 |
\begin{methoddesc}[Camera]{setFocalPoint}{position} |
93 |
Set the focal point of the camera. |
94 |
\end{methoddesc} |
95 |
|
96 |
\begin{methoddesc}[Camera]{setPosition}{position} |
97 |
Set the position of the camera. |
98 |
\end{methoddesc} |
99 |
|
100 |
\begin{methoddesc}[Camera]{azimuth}{angle} |
101 |
Rotate the camera to the left and right. |
102 |
\end{methoddesc} |
103 |
|
104 |
\begin{methoddesc}[Camera]{elevation}{angle} |
105 |
Rotate the camera to the top and bottom. |
106 |
\end{methoddesc} |
107 |
|
108 |
\begin{methoddesc}[Camera]{roll}{angle} |
109 |
Roll the camera to the left and right. |
110 |
\end{methoddesc} |
111 |
|
112 |
\begin{methoddesc}[Camera]{backView}{} |
113 |
View the back of the rendered object. |
114 |
\end{methoddesc} |
115 |
|
116 |
\begin{methoddesc}[Camera]{topView}{} |
117 |
View the top of the rendered object. |
118 |
\end{methoddesc} |
119 |
|
120 |
\begin{methoddesc}[Camera]{bottomView}{} |
121 |
View the bottom of the rendered object. |
122 |
\end{methoddesc} |
123 |
|
124 |
\begin{methoddesc}[Camera]{leftView}{} |
125 |
View the left side of the rendered object. |
126 |
\end{methoddesc} |
127 |
|
128 |
\begin{methoddesc}[Camera]{rightView}{} |
129 |
View the right side of the rendered object. |
130 |
\end{methoddesc} |
131 |
|
132 |
\begin{methoddesc}[Camera]{isometricView}{} |
133 |
View the isometric side of the rendered object. |
134 |
\end{methoddesc} |
135 |
|
136 |
The following is a sample code using the \Camera class. |
137 |
\fig{fig:camera.1} shows the corresponding output. |
138 |
\verbatiminput{../examples/drivercamera.py} |
139 |
|
140 |
\begin{figure}[ht] |
141 |
\begin{center} |
142 |
\includegraphics[width=30mm]{figures/Camera} |
143 |
\end{center} |
144 |
\caption{Camera manipulation} |
145 |
\label{fig:camera.1} |
146 |
\end{figure} |
147 |
|
148 |
\section{\Map class} |
149 |
\begin{classdesc}{Map}{scene, data_collector, lut = None} |
150 |
A \Map object shows a scalar field by color on the domain surface. |
151 |
\end{classdesc} |
152 |
|
153 |
The following is a sample code using the \Map class. |
154 |
\fig{fig:map.1} shows the corresponding output. |
155 |
\verbatiminput{../examples/drivermap.py} |
156 |
|
157 |
\begin{figure}[ht] |
158 |
\begin{center} |
159 |
\includegraphics[width=40mm]{figures/Map} |
160 |
\end{center} |
161 |
\caption{Surface map} |
162 |
\label{fig:map.1} |
163 |
\end{figure} |
164 |
|
165 |
\section{\MapOnPlane class} |
166 |
\begin{classdesc}{MapOnPlane}{scene, data_collector, transform, lut = None} |
167 |
A \MapOnPlane object show a scalar field by color on a given plane. |
168 |
\end{classdesc} |
169 |
|
170 |
The following is a sample code using the \MapOnPlane class. |
171 |
\fig{fig:maponplane.1} shows the corresponding output. |
172 |
\verbatiminput{../examples/drivermaponplane.py} |
173 |
|
174 |
\begin{figure}[ht] |
175 |
\begin{center} |
176 |
\includegraphics[width=40mm]{figures/MapOnPlane} |
177 |
\end{center} |
178 |
\caption{Surface map on a plane} |
179 |
\label{fig:maponplane.1} |
180 |
\end{figure} |
181 |
|
182 |
\section{\MapOnClip class} |
183 |
\begin{classdesc}{MapOnClip}{scene, data_collector, transform, lut = None} |
184 |
A \MapOnClip object show a scalar field by color on a given clip. |
185 |
\end{classdesc} |
186 |
|
187 |
The following is a sample code using the \MapOnClip class. |
188 |
\fig{fig:maponclip.1} shows the corresponding output. |
189 |
\verbatiminput{../examples/drivermaponclip.py} |
190 |
|
191 |
\begin{figure}[ht] |
192 |
\begin{center} |
193 |
\includegraphics[width=40mm]{figures/MapOnClip} |
194 |
\end{center} |
195 |
\caption{Surface map on a clip} |
196 |
\label{fig:maponclip.1} |
197 |
\end{figure} |
198 |
|
199 |
\section{\Arrows class} |
200 |
\begin{classdesc}{Arrows}{scene, data_collector, lut = None} |
201 |
A \Arrows object shows a vector field by arrows. |
202 |
\end{classdesc} |
203 |
|
204 |
The following are the methods available: |
205 |
\begin{methoddesc}[Arrows]{setVectorMode}{vector_mode} |
206 |
Set the arrows vector mode. |
207 |
\end{methoddesc} |
208 |
|
209 |
\begin{methoddesc}[Arrows]{setScaleMode}{scale_mode} |
210 |
Set the arrows scale mode. |
211 |
\end{methoddesc} |
212 |
|
213 |
\begin{methoddesc}[Arrows]{setScaleFactor}{scale_factor} |
214 |
Set the arrows scale factor. |
215 |
\end{methoddesc} |
216 |
|
217 |
\begin{methoddesc}[Arrows]{setColorMode}{color_mode} |
218 |
Set the arrows color mode. |
219 |
\end{methoddesc} |
220 |
|
221 |
The following is a sample code using the \Arrows class. |
222 |
\fig{fig:arrows.1} shows the corresponding output. |
223 |
\verbatiminput{../examples/driverarrows.py} |
224 |
|
225 |
\begin{figure}[ht] |
226 |
\begin{center} |
227 |
\includegraphics[width=40mm]{figures/Arrows} |
228 |
\end{center} |
229 |
\caption{Arrows} |
230 |
\label{fig:arrows.1} |
231 |
\end{figure} |
232 |
|
233 |
\section{\ArrowsOnPlane class} |
234 |
\begin{classdesc}{ArrowsOnPlane}{scene, data_collector, transform, lut = None} |
235 |
A \ArrowsOnPlane object shows a vector field by arrows on a given plane. |
236 |
\end{classdesc} |
237 |
|
238 |
The following is a sample code using the \ArrowsOnPlane class. |
239 |
\fig{fig:arrowsonplane.1} shows the corresponding output. |
240 |
\verbatiminput{../examples/driverarrowsonplane.py} |
241 |
|
242 |
\begin{figure}[ht] |
243 |
\begin{center} |
244 |
\includegraphics[width=40mm]{figures/ArrowsOnPlane} |
245 |
\end{center} |
246 |
\caption{Arrows on a plane} |
247 |
\label{fig:arrowsonplane.1} |
248 |
\end{figure} |
249 |
|
250 |
\section{\ArrowsOnClip class} |
251 |
\begin{classdesc}{ArrowsOnClip}{scene, data_collector, transform, lut = None} |
252 |
A \ArrowsOnClip object shows a vector field by arrows on a given clip. |
253 |
\end{classdesc} |
254 |
|
255 |
The following is a sample code using the \ArrowsOnClip class. |
256 |
\fig{fig:arrowsonclip.1} shows the corresponding output. |
257 |
\verbatiminput{../examples/driverarrowsonclip.py} |
258 |
|
259 |
\begin{figure}[ht] |
260 |
\begin{center} |
261 |
\includegraphics[width=40mm]{figures/ArrowsOnClip} |
262 |
\end{center} |
263 |
\caption{Arrows on a clip} |
264 |
\label{fig:arrowsonclip.1} |
265 |
\end{figure} |
266 |
|
267 |
|
268 |
\section{\IsoSurface class} |
269 |
\begin{classdesc}{IsoSurface}{scene, data_collector, lut = None} |
270 |
An \IsoSurface object shows a scalar field for a given value by an isosurface. |
271 |
\end{classdesc} |
272 |
|
273 |
The following is the method available: |
274 |
|
275 |
\begin{methoddesc}[IsoSurface]{setValue}{contour_number, value} |
276 |
Set the contour number and value. |
277 |
\end{methoddesc} |
278 |
|
279 |
The following is a sample code using the \IsoSurface class. |
280 |
\fig{fig:isosurface.1} shows the corresponding output. |
281 |
\verbatiminput{../examples/driverisosurface.py} |
282 |
|
283 |
\begin{figure}[ht] |
284 |
\begin{center} |
285 |
\includegraphics[width=40mm]{figures/IsoSurface} |
286 |
\end{center} |
287 |
\caption{IsoSurface} |
288 |
\label{fig:isosurface.1} |
289 |
\end{figure} |
290 |
|
291 |
\section{\IsoSurfaceOnPlane class} |
292 |
\begin{classdesc}{IsoSurfaceOnPlane}{scene, data_collector, transform, |
293 |
lut = None} |
294 |
An \IsoSurfaceOnPlane object shows a scalar field for a given value |
295 |
by an isosurface on a given plane. |
296 |
\end{classdesc} |
297 |
|
298 |
The following is a sample code using the \IsoSurfaceOnPlane class. |
299 |
\fig{fig:isosurfaceonplane.1} shows the corresponding output. |
300 |
\verbatiminput{../examples/driverisosurfaceonplane.py} |
301 |
|
302 |
\begin{figure}[ht] |
303 |
\begin{center} |
304 |
\includegraphics[width=40mm]{figures/IsoSurfaceOnPlane} |
305 |
\end{center} |
306 |
\caption{IsoSurface on a plane} |
307 |
\label{fig:isosurfaceonplane.1} |
308 |
\end{figure} |
309 |
|
310 |
\section{\IsoSurfaceOnClip class} |
311 |
\begin{classdesc}{IsoSurfaceOnClip}{scene, data_collector, transform, |
312 |
lut = None} |
313 |
An \IsoSurfaceOnClip object shows a scalar field for a given value |
314 |
by an isosurface on a given clip. |
315 |
\end{classdesc} |
316 |
|
317 |
The following is a sample code using the \IsoSurfaceOnClip class. |
318 |
\fig{fig:isosurfaceonclip.1} shows the corresponding output. |
319 |
\verbatiminput{../examples/driverisosurfaceonclip.py} |
320 |
|
321 |
\begin{figure}[ht] |
322 |
\begin{center} |
323 |
\includegraphics[width=40mm]{figures/IsoSurfaceOnClip} |
324 |
\end{center} |
325 |
\caption{IsoSurface on a clip} |
326 |
\label{fig:isosurfaceonclip.1} |
327 |
\end{figure} |
328 |
|
329 |
\section{\Contour class} |
330 |
\begin{classdesc}{Contour}{scene, data_collector, lut = None} |
331 |
A \Contour object shows a scalar field contour surfaces. |
332 |
\end{classdesc} |
333 |
|
334 |
The following is the method available: |
335 |
\begin{methoddesc}[Contour]{generateValues}{number_contours, min_range, |
336 |
max_range} |
337 |
Generate the specified number of contours within the specified range. |
338 |
\end{methoddesc} |
339 |
|
340 |
The following is a sample code using the \Contour class. |
341 |
\fig{fig:contour.1} shows the corresponding output. |
342 |
\verbatiminput{../examples/drivercontour.py} |
343 |
|
344 |
\begin{figure}[ht] |
345 |
\begin{center} |
346 |
\includegraphics[width=40mm]{figures/Contour} |
347 |
\end{center} |
348 |
\caption{Contour} |
349 |
\label{fig:contour.1} |
350 |
\end{figure} |
351 |
|
352 |
\section{\ContourOnPlane class} |
353 |
\begin{classdesc}{ContourOnPlane}{scene, data_collector, transform, lut = None} |
354 |
A \ContourOnPlane object shows a scalar field contour surfaces on a given plane. |
355 |
\end{classdesc} |
356 |
|
357 |
The following is a sample code using the \ContourOnPlane class. |
358 |
\fig{fig:contouronplane.1} shows the corresponding output. |
359 |
\verbatiminput{../examples/drivercontouronplane.py} |
360 |
|
361 |
\begin{figure}[ht] |
362 |
\begin{center} |
363 |
\includegraphics[width=40mm]{figures/ContourOnPlane} |
364 |
\end{center} |
365 |
\caption{Contour on a plane} |
366 |
\label{fig:contouronplane.1} |
367 |
\end{figure} |
368 |
|
369 |
\section{\ContourOnClip class} |
370 |
\begin{classdesc}{ContourOnClip}{scene, data_collector, transform, lut = None} |
371 |
A \ContourOnClip object shows a scalar field contour surfaces on a given clip. |
372 |
\end{classdesc} |
373 |
|
374 |
The following is a sample code using the \ContourOnClip class. |
375 |
\fig{fig:contouronclip.1} shows the corresponding output. |
376 |
\verbatiminput{../examples/drivercontouronclip.py} |
377 |
|
378 |
\begin{figure}[ht] |
379 |
\begin{center} |
380 |
\includegraphics[width=40mm]{figures/ContourOnClip} |
381 |
\end{center} |
382 |
\caption{Contour on a clip} |
383 |
\label{fig:contouronclip.1} |
384 |
\end{figure} |
385 |
|
386 |
\section{\TensorC class} |
387 |
\begin{classdesc}{Tensor}{scene, data_collector, lut = None} |
388 |
A \TensorC object shows a tensor field by ellipsoids. |
389 |
\end{classdesc} |
390 |
|
391 |
The following are the methods available: |
392 |
\begin{methoddesc}[Tensor]{setThetaResolution}{resolution} |
393 |
Set the number of points in the longitude direction. |
394 |
\end{methoddesc} |
395 |
|
396 |
\begin{methoddesc}[Tensor]{setPhiResolution}{resolution} |
397 |
Set the number of points in the latitude direction. |
398 |
\end{methoddesc} |
399 |
|
400 |
\begin{methoddesc}[Tensor]{setScaleFactor}{scale_factor} |
401 |
Set the tensor scale factor. |
402 |
\end{methoddesc} |
403 |
|
404 |
\begin{methoddesc}[Tensor]{setMaxScaleFactor}{max_scale_factor} |
405 |
Set the maximum allowable scale factor. |
406 |
\end{methoddesc} |
407 |
|
408 |
The following is a sample code using the \TensorC class. |
409 |
\fig{fig:tensor.1} shows the corresponding output. |
410 |
\verbatiminput{../examples/drivertensor.py} |
411 |
|
412 |
\begin{figure}[ht] |
413 |
\begin{center} |
414 |
\includegraphics[width=40mm]{figures/Tensor} |
415 |
\end{center} |
416 |
\caption{Tensor} |
417 |
\label{fig:tensor.1} |
418 |
\end{figure} |
419 |
|
420 |
\section{\TensorOnPlane class} |
421 |
\begin{classdesc}{TensorOnPlane}{scene, data_collector, transform, lut = None} |
422 |
A \TensorOnPlane object shows a tensor field by ellipsoids on a given plane. |
423 |
\end{classdesc} |
424 |
|
425 |
The following is a sample code using the \TensorOnPlane class. |
426 |
\fig{fig:tensoronplane.1} shows the corresponding output. |
427 |
\verbatiminput{../examples/drivertensoronplane.py} |
428 |
|
429 |
\begin{figure}[ht] |
430 |
\begin{center} |
431 |
\includegraphics[width=40mm]{figures/TensorOnPlane} |
432 |
\end{center} |
433 |
\caption{Tensor on a plane} |
434 |
\label{fig:tensoronplane.1} |
435 |
\end{figure} |
436 |
|
437 |
\section{\TensorOnClip class} |
438 |
\begin{classdesc}{TensorOnClip}{scene, data_collector, transform, lut = None} |
439 |
A \TensorOnClip object shows a tensor field by ellipsoids on a given clip. |
440 |
\end{classdesc} |
441 |
|
442 |
The following is a sample code using the \TensorOnClip class. |
443 |
\fig{fig:tensoronclip.1} shows the corresponding output. |
444 |
\verbatiminput{../examples/drivertensoronclip.py} |
445 |
|
446 |
\begin{figure}[ht] |
447 |
\begin{center} |
448 |
\includegraphics[width=40mm]{figures/TensorOnClip} |
449 |
\end{center} |
450 |
\caption{Tensor on a clip} |
451 |
\label{fig:tensoronclip.1} |
452 |
\end{figure} |
453 |
|
454 |
\section{\StreamLines class} |
455 |
\begin{classdesc}{StreamLines}{scene, data_collector, lut = None} |
456 |
A \StreamLines object show the path of particles (within a specified cloud |
457 |
of points) in a vector field. |
458 |
\end{classdesc} |
459 |
|
460 |
The following are the methods available: |
461 |
\begin{methoddesc}[StreamLines]{setCloudRadius}{radius} |
462 |
Set the radius for the cloud of points. |
463 |
\end{methoddesc} |
464 |
|
465 |
\begin{methoddesc}[StreamLines]{setCenter}{position} |
466 |
Set the center for the cloud of points. |
467 |
\end{methoddesc} |
468 |
|
469 |
\begin{methoddesc}[StreamLines]{setNumberOfPoints}{points} |
470 |
Set the number of points to generate for the cloud of points. |
471 |
\end{methoddesc} |
472 |
|
473 |
\begin{methoddesc}[StreamLines]{setMaximumPropagationTime}{time} |
474 |
Set the maximum length for the streamlines in unit of time. |
475 |
\end{methoddesc} |
476 |
|
477 |
\begin{methoddesc}[StreamLines]{setStreamLinesSize}{stream_lines_size} |
478 |
Set the size of the steamlines. |
479 |
\end{methoddesc} |
480 |
|
481 |
\begin{methoddesc}[StreamLines]{setAccuracy}{accuracy} |
482 |
Set the accuracy for the streamlines. |
483 |
\end{methoddesc} |
484 |
|
485 |
\begin{methoddesc}[StreamLines]{setIntegrationToBothDirections}{} |
486 |
Set the integration to occur in both directions. |
487 |
\end{methoddesc} |
488 |
|
489 |
\begin{methoddesc}[StreamLines]{setTubeRadius}{radius} |
490 |
Set the minimum radius of the tube. |
491 |
\end{methoddesc} |
492 |
|
493 |
\begin{methoddesc}[StreamLines]{setNumberOfSides}{sides} |
494 |
Set the number of sides for the tube. |
495 |
\end{methoddesc} |
496 |
|
497 |
\begin{methoddesc}[StreamLines]{setVaryRadiusByVector}{} |
498 |
Set the variation of the tube radius with vector data. |
499 |
\end{methoddesc} |
500 |
|
501 |
The following is a sample code using the \StreamLines class. |
502 |
\fig{fig:streamlines.1} shows the corresponding output. |
503 |
\verbatiminput{../examples/driverstreamlines.py} |
504 |
|
505 |
\begin{figure}[ht] |
506 |
\begin{center} |
507 |
\includegraphics[width=40mm]{figures/StreamLines} |
508 |
\end{center} |
509 |
\caption{StreamLines} |
510 |
\label{fig:streamlines.1} |
511 |
\end{figure} |
512 |
|
513 |
\section{\Carpet class} |
514 |
\begin{classdesc}{Carpet}{scene, data_collector, transform, lut = None, |
515 |
deform = None} |
516 |
A \Carpet object shows a scalar field as a plane deformated along the plane |
517 |
normal. |
518 |
\end{classdesc} |
519 |
|
520 |
The following is the method available: |
521 |
\begin{methoddesc}[Carpet]{setScaleFactor}{scale_factor} |
522 |
Set the displancement scale factor. |
523 |
\end{methoddesc} |
524 |
|
525 |
The following is a sample code using the \Carpet class. |
526 |
\fig{fig:carpet.1} shows the corresponding output. |
527 |
\verbatiminput{../examples/drivercarpet.py} |
528 |
|
529 |
\begin{figure}[ht] |
530 |
\begin{center} |
531 |
\includegraphics[width=40mm]{figures/Carpet} |
532 |
\end{center} |
533 |
\caption{Carpet} |
534 |
\label{fig:carpet.1} |
535 |
\end{figure} |
536 |
|
537 |
\section{\Image class} |
538 |
\begin{classdesc}{Image}{scene, format} |
539 |
An \Image object shows an image. |
540 |
\end{classdesc} |
541 |
|
542 |
The following is the method available: |
543 |
\begin{methoddesc}[Image]{setFileName}{file_name} |
544 |
Set the file name. |
545 |
\end{methoddesc} |
546 |
|
547 |
The following is a sample code using the \Image class. |
548 |
\fig{fig:image.1} shows the corresponding output. |
549 |
\verbatiminput{../examples/driverimage.py} |
550 |
|
551 |
\begin{figure}[ht] |
552 |
\begin{center} |
553 |
\includegraphics[width=40mm]{figures/Image} |
554 |
\end{center} |
555 |
\caption{Image} |
556 |
\label{fig:image.1} |
557 |
\end{figure} |
558 |
|
559 |
\section{\Text class} |
560 |
\begin{classdesc}{Text}{scene} |
561 |
A \Text object shows 2D text. |
562 |
\end{classdesc} |
563 |
|
564 |
The following are the methods available: |
565 |
\begin{methoddesc}[Text]{setText}{text} |
566 |
Set the text. |
567 |
\end{methoddesc} |
568 |
|
569 |
\begin{methoddesc}[Text]{setPosition}{x_coor, y_coor} |
570 |
Set the display position of the text. |
571 |
\end{methoddesc} |
572 |
|
573 |
\begin{methoddesc}[Text]{setStyle}{style} |
574 |
Set the style of the text. |
575 |
\end{methoddesc} |
576 |
|
577 |
The following is a sample code using the \Text class. |
578 |
\fig{fig:text.1} shows the corresponding output. |
579 |
\verbatiminput{../examples/drivertext.py} |
580 |
|
581 |
\begin{figure}[ht] |
582 |
\begin{center} |
583 |
\includegraphics[width=40mm]{figures/Text} |
584 |
\end{center} |
585 |
\caption{2D text} |
586 |
\label{fig:text.1} |
587 |
\end{figure} |
588 |
|
589 |
\section{\Position class} |
590 |
\begin{classdesc}{Position}{x_coor, y_coor, z_coor} |
591 |
A \Position object defines the x, y and z coordinates of rendered object. |
592 |
\end{classdesc} |
593 |
|
594 |
\section{\Transform class} |
595 |
\begin{classdesc}{Transform}{} |
596 |
A \Transform object defines the orientation of rendered object. |
597 |
\end{classdesc} |
598 |
|
599 |
The following are some of the methods available: |
600 |
\begin{methoddesc}[Transform]{translate}{x_offset, y_offset, z_offset} |
601 |
Translate the rendered object along the x, y and z-axes. |
602 |
\end{methoddesc} |
603 |
|
604 |
\begin{methoddesc}[Transform]{rotateX}{angle} |
605 |
Rotate the rendered object along the x-axis. |
606 |
\end{methoddesc} |
607 |
|
608 |
\begin{methoddesc}[Transform]{rotateY}{angle} |
609 |
Rotate the rendered object along the y-axis. |
610 |
\end{methoddesc} |
611 |
|
612 |
\begin{methoddesc}[Transform]{rotateZ}{angle} |
613 |
Rotate the rendered object along the z-axis. |
614 |
\end{methoddesc} |
615 |
|
616 |
\begin{methoddesc}[Transform]{xyPlane}{offset = 0} |
617 |
Set the plane orthogonal to the z-axis. |
618 |
\end{methoddesc} |
619 |
|
620 |
\begin{methoddesc}[Transform]{yzPlane}{offset = 0} |
621 |
Set the plane orthogonal to the x-axis. |
622 |
\end{methoddesc} |
623 |
|
624 |
\begin{methoddesc}[Transform]{xzPlane}{offset = 0} |
625 |
Set the plane orthogonal to the y-axis. |
626 |
\end{methoddesc} |
627 |
|
628 |
\section{\Style class} |
629 |
\begin{classdesc}{Style}{} |
630 |
A \Style object defines the style of text. |
631 |
\end{classdesc} |
632 |
|
633 |
The following are the methods available: |
634 |
\begin{methoddesc}[Style]{setFontFamily}{family} |
635 |
Set the font family (i.e. Times) |
636 |
\end{methoddesc} |
637 |
|
638 |
\begin{methoddesc}[Style]{boldOn}{} |
639 |
Bold the text. |
640 |
\end{methoddesc} |
641 |
|
642 |
\begin{methoddesc}[Style]{italicOn}{} |
643 |
Italize the text. |
644 |
\end{methoddesc} |
645 |
|
646 |
\begin{methoddesc}[Style]{shadowOn}{} |
647 |
Apply shadows on the text. |
648 |
\end{methoddesc} |
649 |
|
650 |
\begin{methoddesc}[Style]{setColor}{} |
651 |
Set the text color. |
652 |
\end{methoddesc} |
653 |
|
654 |
\section{\BlueToRed class} |
655 |
\begin{classdesc}{BlueToRed}{} |
656 |
A \BlueToRed object defines a map spectrum from blue to red. |
657 |
\end{classdesc} |
658 |
|
659 |
\section{\RedToBlue class} |
660 |
\begin{classdesc}{RedToBlue}{} |
661 |
A \RedToBlue object defines a map spectrum from red to blue. |
662 |
\end{classdesc} |
663 |
|
664 |
|