]> SALOME platform Git repositories - modules/visu.git/blob - doc/salome/gui/VISU/input/tui_cut_segment.doc
Salome HOME
Merge from V6_main_20120808 08Aug12
[modules/visu.git] / doc / salome / gui / VISU / input / tui_cut_segment.doc
1 /*!
2
3 \page tui_cut_segment_page Cut Segment
4
5 Create <b>Cut Segment</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 a cut segment for the first timestamp of 'VITESSE' field
26 meshName = 'LE VOLUME'
27 fieldEntity = VISU.NODE
28 fieldName = 'VITESSE'
29 myCutSegment = myVisu.CutSegmentOnField(myResult, meshName, fieldEntity, fieldName, 1)
30
31 # Set the first point of the segment
32 myCutSegment.SetPoint1(0, 0, 0)
33
34 # Set the second point of the segment
35 myCutSegment.SetPoint2(0.41, 0.0685, 1.082)
36
37 # Invert the resulting curve
38 myCutSegment.SetAllCurvesInverted(True)
39
40 # Update the object browser
41 salome.sg.updateObjBrowser(1)
42
43 # Display the newly created cut segment
44 myViewManager = myVisu.GetViewManager()
45 myView = myViewManager.Create3DView()
46
47 myView.DisplayOnly(myCutSegment)
48 myView.FitAll()
49 \endcode
50
51 <br>Please, see \ref VISU.CutSegment "CutSegment interface reference documentation" 
52 for more details.
53
54 */