]> SALOME platform Git repositories - modules/visu.git/blob - doc/salome/gui/VISU/input/tui_stream_lines.doc
Salome HOME
Merge from V6_main_20120808 08Aug12
[modules/visu.git] / doc / salome / gui / VISU / input / tui_stream_lines.doc
1 /*!
2
3 \page tui_stream_lines_page Stream Lines
4
5 Create <b> Stream Lines</b> presentation on a field of the imported MED file:
6
7 \code
8 import os
9
10 import salome
11
12 import VISU
13 import visu_gui
14
15 # The directory containing MED files
16 datadir = os.getenv("DATA_DIR")
17
18 # Get VISU engine
19 myVisu = visu_gui.myVisu
20
21 # Import a MED file
22 medFile = os.path.join(datadir,"MedFiles","fra.med")
23 myResult = myVisu.ImportFile(medFile)
24
25 # Create stream lines for the first timestamp of 'VITESSE' field
26 meshName = 'LE VOLUME'
27 fieldEntity = VISU.NODE
28 fieldName = 'VITESSE'
29 myStreamLines = myVisu.StreamLinesOnField(myResult, meshName, fieldEntity, fieldName, 1)
30
31 # Set stream lines parameters
32 integrationStep = 0.003
33 propagationTime = 1.5
34 stepLength = 0.015
35 # Mesh on nodes
36 prs3D = myVisu.MeshOnEntity(myResult, meshName, VISU.NODE) 
37 pointsPercents = 0.05
38 direction = VISU.StreamLines.FORWARD
39
40 myStreamLines.SetParams(integrationStep, propagationTime, stepLength, prs3D, pointsPercents, direction)
41
42 # Set magnitude coloring
43 myStreamLines.ShowColored(True)
44
45 # Update the object browser
46 salome.sg.updateObjBrowser(1)
47
48 # Display the newly created stream lines
49 myViewManager = myVisu.GetViewManager()
50 myView = myViewManager.Create3DView()
51
52 myView.DisplayOnly(myStreamLines)
53 myView.FitAll()
54 \endcode
55
56 <br>Please, see \ref VISU.StreamLines "StreamLines interface reference documentation" 
57 for more details.
58
59 */