File: Switch

package info (click to toggle)
dxsamples 4.4.0-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 26,348 kB
  • ctags: 1,513
  • sloc: ansic: 10,079; sh: 8,445; java: 1,772; makefile: 1,101
file content (36 lines) | stat: -rw-r--r-- 966 bytes parent folder | download | duplicates (5)
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

// This macro shows either object1, object2, or object3, depending on
// the setting of "which"
macro ShowWhichOne(which,object1, object2, object3)
{
    whichone = Switch(which, object1, object2, object3);
    Display(whichone,camera);
}


// Import the electron density field
electrondensity = Import("watermolecule");

// Partition for parallelism
electrondensity = Partition(electrondensity);

// Create a camera
camera = AutoCamera(electrondensity);

// Create an isosurface at the value 0.3
isosurface = Isosurface(electrondensity, 0.3);

// Create a colored maptoplane through the data
plane = MapToPlane(electrondensity);
plane = AutoColor(plane);

// Create a set of contour lines on the plane
lines = Isosurface(plane,number = 10);
lines = AutoColor(lines);

// Show the isosurface
ShowWhichOne(1, isosurface, plane, lines);
// Show the plane
ShowWhichOne(2, isosurface, plane, lines);
// Show the contour lines
ShowWhichOne(3, isosurface, plane, lines);