From 0e2312e4b1fc3b6b09fe602d2463431b1cc1e0b5 Mon Sep 17 00:00:00 2001 From: mzn Date: Thu, 9 Sep 2010 10:55:43 +0000 Subject: [PATCH] Fix for bug 0020922: [CEA 417] VISU TUI documentation. --- doc/salome/gui/VISU/input/3d_management.doc | 1 - doc/salome/gui/VISU/input/animating.doc | 3 + doc/salome/gui/VISU/input/creating_curves.doc | 4 +- doc/salome/gui/VISU/input/creating_plot2d.doc | 4 + doc/salome/gui/VISU/input/cut_lines.doc | 3 + doc/salome/gui/VISU/input/cut_planes.doc | 3 + doc/salome/gui/VISU/input/cut_segment.doc | 3 + doc/salome/gui/VISU/input/deformed_shape.doc | 3 + doc/salome/gui/VISU/input/evolution.doc | 4 +- .../VISU/input/gauss_points_presentations.doc | 3 +- .../input/importing_exporting_tables_page.doc | 3 + .../gui/VISU/input/importing_med_objects.doc | 3 + doc/salome/gui/VISU/input/index.doc | 1 + doc/salome/gui/VISU/input/iso_surfaces.doc | 3 + doc/salome/gui/VISU/input/plot_3d.doc | 3 + doc/salome/gui/VISU/input/point_marker.doc | 4 +- .../VISU/input/presentation_of_submesh.doc | 3 + doc/salome/gui/VISU/input/python_examples.doc | 42 ++++ doc/salome/gui/VISU/input/scalar_map.doc | 3 + .../input/scalar_map_on_deformed_shape.doc | 3 + doc/salome/gui/VISU/input/stream_lines.doc | 5 +- doc/salome/gui/VISU/input/table_3d.doc | 3 +- doc/salome/gui/VISU/input/tui_animation.doc | 173 +++++++++++++++ .../gui/VISU/input/tui_creating_3d_prs.doc | 20 ++ doc/salome/gui/VISU/input/tui_cut_lines.doc | 61 ++++++ doc/salome/gui/VISU/input/tui_cut_planes.doc | 59 ++++++ doc/salome/gui/VISU/input/tui_cut_segment.doc | 54 +++++ doc/salome/gui/VISU/input/tui_datatable.doc | 11 + doc/salome/gui/VISU/input/tui_def_shape.doc | 51 +++++ .../input/tui_def_shape_and_scalar_map.doc | 53 +++++ doc/salome/gui/VISU/input/tui_evolution.doc | 48 +++-- .../gui/VISU/input/tui_gauss_points.doc | 94 +++++++++ .../gui/VISU/input/tui_import_export.doc | 59 ++++++ doc/salome/gui/VISU/input/tui_iso_surf.doc | 51 +++++ .../gui/VISU/input/tui_manage_3d_prs.doc | 12 ++ doc/salome/gui/VISU/input/tui_plot_3d.doc | 60 ++++++ .../gui/VISU/input/tui_point_marker.doc | 63 +++--- doc/salome/gui/VISU/input/tui_scalar_map.doc | 51 +++++ .../gui/VISU/input/tui_stream_lines.doc | 59 ++++++ doc/salome/gui/VISU/input/tui_submesh.doc | 64 ++++++ doc/salome/gui/VISU/input/tui_table_3d.doc | 53 +++++ .../gui/VISU/input/tui_table_curves.doc | 75 +++++++ .../gui/VISU/input/tui_table_import.doc | 67 ++++++ doc/salome/gui/VISU/input/tui_vectors.doc | 60 ++++++ doc/salome/gui/VISU/input/tui_view_3d.doc | 197 ++++++++++++++++++ doc/salome/gui/VISU/input/vectors.doc | 5 +- .../VISU/input/viewing_3d_presentations.doc | 3 + 47 files changed, 1558 insertions(+), 52 deletions(-) create mode 100644 doc/salome/gui/VISU/input/python_examples.doc create mode 100644 doc/salome/gui/VISU/input/tui_animation.doc create mode 100644 doc/salome/gui/VISU/input/tui_creating_3d_prs.doc create mode 100644 doc/salome/gui/VISU/input/tui_cut_lines.doc create mode 100644 doc/salome/gui/VISU/input/tui_cut_planes.doc create mode 100644 doc/salome/gui/VISU/input/tui_cut_segment.doc create mode 100644 doc/salome/gui/VISU/input/tui_datatable.doc create mode 100644 doc/salome/gui/VISU/input/tui_def_shape.doc create mode 100644 doc/salome/gui/VISU/input/tui_def_shape_and_scalar_map.doc create mode 100644 doc/salome/gui/VISU/input/tui_gauss_points.doc create mode 100644 doc/salome/gui/VISU/input/tui_import_export.doc create mode 100644 doc/salome/gui/VISU/input/tui_iso_surf.doc create mode 100644 doc/salome/gui/VISU/input/tui_manage_3d_prs.doc create mode 100644 doc/salome/gui/VISU/input/tui_plot_3d.doc create mode 100644 doc/salome/gui/VISU/input/tui_scalar_map.doc create mode 100644 doc/salome/gui/VISU/input/tui_stream_lines.doc create mode 100644 doc/salome/gui/VISU/input/tui_submesh.doc create mode 100644 doc/salome/gui/VISU/input/tui_table_3d.doc create mode 100644 doc/salome/gui/VISU/input/tui_table_curves.doc create mode 100644 doc/salome/gui/VISU/input/tui_table_import.doc create mode 100644 doc/salome/gui/VISU/input/tui_vectors.doc create mode 100644 doc/salome/gui/VISU/input/tui_view_3d.doc diff --git a/doc/salome/gui/VISU/input/3d_management.doc b/doc/salome/gui/VISU/input/3d_management.doc index 2b54a0cd..49e1776a 100755 --- a/doc/salome/gui/VISU/input/3d_management.doc +++ b/doc/salome/gui/VISU/input/3d_management.doc @@ -52,6 +52,5 @@ viewing the presentation. - */ diff --git a/doc/salome/gui/VISU/input/animating.doc b/doc/salome/gui/VISU/input/animating.doc index 02ad4ba3..d1298a90 100644 --- a/doc/salome/gui/VISU/input/animating.doc +++ b/doc/salome/gui/VISU/input/animating.doc @@ -139,4 +139,7 @@ to study again you get another animation in the Object Browser. Publish to Study - saves your animation in the study and presents it in the Object Browser. +
See Also a sample TUI Script of an +\ref tui_animation_page "Animation" creation. + */ diff --git a/doc/salome/gui/VISU/input/creating_curves.doc b/doc/salome/gui/VISU/input/creating_curves.doc index 71c6d5d0..61a20de7 100644 --- a/doc/salome/gui/VISU/input/creating_curves.doc +++ b/doc/salome/gui/VISU/input/creating_curves.doc @@ -72,7 +72,7 @@ be created automatically. - - +
See Also a sample TUI Script of a +\ref tui_table_curves_page "Curves creation and displaying" operation. */ diff --git a/doc/salome/gui/VISU/input/creating_plot2d.doc b/doc/salome/gui/VISU/input/creating_plot2d.doc index 1b2d275b..c5f98fc0 100755 --- a/doc/salome/gui/VISU/input/creating_plot2d.doc +++ b/doc/salome/gui/VISU/input/creating_plot2d.doc @@ -57,4 +57,8 @@ selected curve lines, will be displayed in the viewer: +See Also a sample TUI Script of a +\ref tui_table_curves_page "Curves creation and displaying" operation. + + */ diff --git a/doc/salome/gui/VISU/input/cut_lines.doc b/doc/salome/gui/VISU/input/cut_lines.doc index c5d156f5..1544970c 100644 --- a/doc/salome/gui/VISU/input/cut_lines.doc +++ b/doc/salome/gui/VISU/input/cut_lines.doc @@ -83,4 +83,7 @@ construction of a 2d plot of curves based on the scalar values from the table (see also: \ref creating_curves_page "Creating curves" and \ref creating_plot2d_page "Creating Plot 2D presentation"). +
See Also a sample TUI Script of a +\ref tui_cut_lines_page "Cut Lines creation" operation. + */ diff --git a/doc/salome/gui/VISU/input/cut_planes.doc b/doc/salome/gui/VISU/input/cut_planes.doc index 8d5f9ccf..66df5365 100644 --- a/doc/salome/gui/VISU/input/cut_planes.doc +++ b/doc/salome/gui/VISU/input/cut_planes.doc @@ -52,4 +52,7 @@ After you have finished with setting these parameters, click \b OK. Your presentation with scalar bar will be immediately displayed in the viewer. +
See Also a sample TUI Script of a +\ref tui_cut_planes_page "Cut Planes creation" operation. + */ diff --git a/doc/salome/gui/VISU/input/cut_segment.doc b/doc/salome/gui/VISU/input/cut_segment.doc index c9d29030..7e1cf9f5 100644 --- a/doc/salome/gui/VISU/input/cut_segment.doc +++ b/doc/salome/gui/VISU/input/cut_segment.doc @@ -63,4 +63,7 @@ based on the scalar values from the table (see also: \ref creating_curves_page "Creating curves" and \ref creating_plot2d_page "Creating Plot 2D presentation"). +
See Also a sample TUI Script of a +\ref tui_cut_segment_page "Cut Segment creation" operation. + */ diff --git a/doc/salome/gui/VISU/input/deformed_shape.doc b/doc/salome/gui/VISU/input/deformed_shape.doc index 028397c1..5774a57a 100644 --- a/doc/salome/gui/VISU/input/deformed_shape.doc +++ b/doc/salome/gui/VISU/input/deformed_shape.doc @@ -43,4 +43,7 @@ After you have finished with setting these parameters, click \b OK. Your presentation with scalar bar will be immediately displayed in the viewer. +
See Also a sample TUI Script of a +\ref tui_def_shape_page "Deformed Shape creation" operation. + */ \ No newline at end of file diff --git a/doc/salome/gui/VISU/input/evolution.doc b/doc/salome/gui/VISU/input/evolution.doc index 345d8203..94a0c44b 100644 --- a/doc/salome/gui/VISU/input/evolution.doc +++ b/doc/salome/gui/VISU/input/evolution.doc @@ -41,7 +41,7 @@ menu on the published object: \image html evolution_restore.png - -Our TUI Scripts provide you with \subpage tui_evolution_page script. +See Also a sample TUI Script of an +\ref tui_evolution_page "Evolution on Point" operation. */ diff --git a/doc/salome/gui/VISU/input/gauss_points_presentations.doc b/doc/salome/gui/VISU/input/gauss_points_presentations.doc index fe28655f..c27cb48f 100644 --- a/doc/salome/gui/VISU/input/gauss_points_presentations.doc +++ b/doc/salome/gui/VISU/input/gauss_points_presentations.doc @@ -29,6 +29,7 @@ Now it is possible to choose the \subpage types_of_gauss_points_presentations_pa To exit the dialog and apply choices press \b OK button, or press \b CANCEL button to quit. - +
See Also a sample TUI Script of a +\ref tui_gauss_points_page "Gauss Points creation" operation. */ \ No newline at end of file diff --git a/doc/salome/gui/VISU/input/importing_exporting_tables_page.doc b/doc/salome/gui/VISU/input/importing_exporting_tables_page.doc index b66a1176..33ed005b 100644 --- a/doc/salome/gui/VISU/input/importing_exporting_tables_page.doc +++ b/doc/salome/gui/VISU/input/importing_exporting_tables_page.doc @@ -46,4 +46,7 @@ Or you can export table to *.csv file +See Also a sample TUI Script of an +\ref tui_table_import_page "Import/Export table" operation. + */ diff --git a/doc/salome/gui/VISU/input/importing_med_objects.doc b/doc/salome/gui/VISU/input/importing_med_objects.doc index 5aa758cf..aaf1e008 100644 --- a/doc/salome/gui/VISU/input/importing_med_objects.doc +++ b/doc/salome/gui/VISU/input/importing_med_objects.doc @@ -88,4 +88,7 @@ path and change the name of the exported MED file: To complete file export click Save. +
See Also a sample TUI Script of an +\ref tui_import_export_page "Import/Export" operation. + */ diff --git a/doc/salome/gui/VISU/input/index.doc b/doc/salome/gui/VISU/input/index.doc index f6da3fe9..4190c983 100644 --- a/doc/salome/gui/VISU/input/index.doc +++ b/doc/salome/gui/VISU/input/index.doc @@ -15,5 +15,6 @@ A MED file contains the description of a \subpage med_object_page "MED object", \n The Python interface of \b Post-Pro module is described in \subpage idl_interface_page "Access to Post-Pro module functionality" page. +\n Sample Python scripts can be found in \subpage python_examples_page chapter. */ diff --git a/doc/salome/gui/VISU/input/iso_surfaces.doc b/doc/salome/gui/VISU/input/iso_surfaces.doc index 2810f218..5cb8ba03 100644 --- a/doc/salome/gui/VISU/input/iso_surfaces.doc +++ b/doc/salome/gui/VISU/input/iso_surfaces.doc @@ -45,4 +45,7 @@ After you have finished with setting these parameters, click \b OK. Your presentation with scalar bar will be immediately displayed in the viewer. +
See Also a sample TUI Script of a +\ref tui_iso_surf_page "Iso Surfaces creation" operation. + */ \ No newline at end of file diff --git a/doc/salome/gui/VISU/input/plot_3d.doc b/doc/salome/gui/VISU/input/plot_3d.doc index 13809924..1b7183e7 100644 --- a/doc/salome/gui/VISU/input/plot_3d.doc +++ b/doc/salome/gui/VISU/input/plot_3d.doc @@ -59,4 +59,7 @@ bar displayed with this presentation (\ref scalar_map_page "see also"). After you have finished with setting these parameters, click \b OK. Your presentation will be immediately displayed in the viewer. +
See Also a sample TUI Script of a +\ref tui_plot_3d_page "Plot 3D creation" operation. + */ \ No newline at end of file diff --git a/doc/salome/gui/VISU/input/point_marker.doc b/doc/salome/gui/VISU/input/point_marker.doc index c7654438..fbe6c9b0 100644 --- a/doc/salome/gui/VISU/input/point_marker.doc +++ b/doc/salome/gui/VISU/input/point_marker.doc @@ -49,8 +49,8 @@ Here is a texture file sample: \image html custom_point_marker.png "Presentation with custom point markers" - -Our TUI Scripts provide you with \subpage tui_point_marker_page script. +See Also a sample TUI Script of a +\ref tui_point_marker_page "Point Marker" functionality using. */ diff --git a/doc/salome/gui/VISU/input/presentation_of_submesh.doc b/doc/salome/gui/VISU/input/presentation_of_submesh.doc index e515cab2..ae93a623 100644 --- a/doc/salome/gui/VISU/input/presentation_of_submesh.doc +++ b/doc/salome/gui/VISU/input/presentation_of_submesh.doc @@ -14,4 +14,7 @@ object and from the pop-up menu choose Create Presentation.

This presentation will be displayed in the viewer. +
See Also a sample TUI Script of a +\ref tui_submesh_page "Submesh presentation creation" operation. + */ \ No newline at end of file diff --git a/doc/salome/gui/VISU/input/python_examples.doc b/doc/salome/gui/VISU/input/python_examples.doc new file mode 100644 index 00000000..e5837996 --- /dev/null +++ b/doc/salome/gui/VISU/input/python_examples.doc @@ -0,0 +1,42 @@ +python_examples_page + +/*! + +\page python_examples_page Examples of Python scripts + +By the links below you can find sample scripts for operations +provided by Post-Pro module. + + + +*/ \ No newline at end of file diff --git a/doc/salome/gui/VISU/input/scalar_map.doc b/doc/salome/gui/VISU/input/scalar_map.doc index 510585ca..71a03471 100644 --- a/doc/salome/gui/VISU/input/scalar_map.doc +++ b/doc/salome/gui/VISU/input/scalar_map.doc @@ -177,4 +177,7 @@ OK. The presentation will be immediately displayed in the viewer: \image html scalar_map_on_cells.png "Scalar map on Cell Mesh" +See Also a sample TUI Script of a +\ref tui_scalar_map_page "Scalar Map creation" operation. + */ diff --git a/doc/salome/gui/VISU/input/scalar_map_on_deformed_shape.doc b/doc/salome/gui/VISU/input/scalar_map_on_deformed_shape.doc index f5fac0df..dd5eb89f 100755 --- a/doc/salome/gui/VISU/input/scalar_map_on_deformed_shape.doc +++ b/doc/salome/gui/VISU/input/scalar_map_on_deformed_shape.doc @@ -45,4 +45,7 @@ You can compire result presentation with \ref scalar_map_page "Scalar Map" prese \image html scalar_map_on_cells.png "Example of Scalar Map presentation" +See Also a sample TUI Script of a +\ref tui_def_shape_and_scalar_map_page "Deformed Shape and Scalar Map creation" operation. + */ \ No newline at end of file diff --git a/doc/salome/gui/VISU/input/stream_lines.doc b/doc/salome/gui/VISU/input/stream_lines.doc index b040a287..82979ffd 100644 --- a/doc/salome/gui/VISU/input/stream_lines.doc +++ b/doc/salome/gui/VISU/input/stream_lines.doc @@ -79,6 +79,9 @@ displayed with this presentation (\ref scalar_map_page "see also"). After you have finished with setting these parameters, click \b OK. Your presentation with scalar bar will be immediately displayed in -the viewer: +the viewer. + +
See Also a sample TUI Script of a +\ref tui_stream_lines_page "Stream Lines creation" operation. */ \ No newline at end of file diff --git a/doc/salome/gui/VISU/input/table_3d.doc b/doc/salome/gui/VISU/input/table_3d.doc index eb6798f2..7fd97b9c 100644 --- a/doc/salome/gui/VISU/input/table_3d.doc +++ b/doc/salome/gui/VISU/input/table_3d.doc @@ -45,6 +45,7 @@ bar displayed with this presentation (\ref scalar_map_page "see also"). It is also possible to choose \b Wireframe or \b Shading \b Representation type, change such properties as \b Opacity and Line Width and Translate the presentation using the context menu. - +
See Also a sample TUI Script of a +\ref tui_table_3d_page "Table 3D presentation creation" operation. */ diff --git a/doc/salome/gui/VISU/input/tui_animation.doc b/doc/salome/gui/VISU/input/tui_animation.doc new file mode 100644 index 00000000..44166efe --- /dev/null +++ b/doc/salome/gui/VISU/input/tui_animation.doc @@ -0,0 +1,173 @@ +/*! + +\page tui_animation_page Animation + +Successive Animation example: + +\code +import os +from time import sleep + +import salome + +import VISU +from visu_gui import * + +# Directory containing MED files +datadir = os.getenv("DATA_DIR") + +# Import MED file +medFile = datadir + "/TimeStamps.med" +myResult = myVisu.ImportFile(medFile) + +# Create 3D view +myViewManager = myVisu.GetViewManager() +myView = myViewManager.Create3DView() +myView.SetTitle("Animation view") + +# Create animation instance +fieldName = "vitesse" + +myAnimation = myVisu.CreateAnimation(myView); + +# Set successive animation mode +myAnimation.setAnimationMode(VISU.Animation.SUCCESSIVE) + +# Set animation properties: + +# Add one field on which timestamps the animation will be performed +fieldName = "vitesse, m/s" +fieldSO = salome.myStudy.FindObject(fieldName) +myAnimation.addField(fieldSO) + +# Set presentation type for the first and sole field +myAnimation.setPresentationType(0, VISU.TDEFORMEDSHAPEANDSCALARMAP) + +# Generate presentations +myAnimation.generatePresentations(0) + +# Create the pattern of Deformed Shape and Scalar Map presentation +meshName = "dom" +fieldName = "vitesse" +fieldEntity = VISU.NODE +timestampId = 1 +myDefShapeScalarMap = myVisu.DeformedShapeAndScalarMapOnField(myResult, meshName, fieldEntity, fieldName, timestampId) +myDefShapeScalarMap.SetScale(0.75) + +# Apply the pattern properties to all generated presentations +myAnimation.ApplyProperties(0, myDefShapeScalarMap) + +# Generate frames +myAnimation.generateFrames() + +# Publisj animation object in study +myAnimation.publishInStudy() + +# Set speed +myAnimation.setSpeed(80) + +# Save animation after changing the speed +myAnimation.saveAnimation() + +# Fit All +myView.FitAll() + +# Start animation +myAnimation.startAnimation() + +# Rewind to the first frame +sleep(10) +myAnimation.firstFrame() + +# Update object browser +salome.sg.updateObjBrowser(1) +\endcode + +
Parallel Animation example: + +\code +import os +from time import sleep + +import salome + +import VISU +from visu_gui import * + +# Directory containing MED files +datadir = os.getenv("DATA_DIR") + +# Import MED file +medFile = datadir + "/TimeStamps.med" +myResult = myVisu.ImportFile(medFile) + +# Create 3D view +myViewManager = myVisu.GetViewManager() +myView = myViewManager.Create3DView() +myView.SetTitle("Animation view") + +# Create animation instance +fieldName = "vitesse" + +myAnimation = myVisu.CreateAnimation(myView); + +# Set successive animation mode +myAnimation.setAnimationMode(VISU.Animation.PARALLEL) + +# Set animation properties: + +# Add two fields on which timestamps the animation will be performed +fieldName1 = "vitesse, m/s" +fieldSO1 = salome.myStudy.FindObject(fieldName1) +fieldName2 = "temperature, K" +fieldSO2 = salome.myStudy.FindObject(fieldName2) + +myAnimation.addField(fieldSO1) +myAnimation.addField(fieldSO2) + +# Set presentation type for the first field +myAnimation.setPresentationType(0, VISU.TVECTORS) + +# Set presentation type for the second field +myAnimation.setPresentationType(1, VISU.TSCALARMAP) + +# Generate presentations for all fields +nbFileds = myAnimation.getNbFields() +for i in range(0, nbFileds): + myAnimation.generatePresentations(i) + +# Create the pattern of Vectors presentation +meshName = "dom" +fieldName = "vitesse" +fieldEntity = VISU.NODE +timestampId = 1 +myVectors = myVisu.VectorsOnField(myResult, meshName, fieldEntity, fieldName, timestampId) +myVectors.SetScale(1) +myVectors.ShowColored(True) + +# Apply the vectors pattern properties to all presentations generated for 'vitesse' field +myAnimation.ApplyProperties(0, myVectors) + +# Generate frames +myAnimation.generateFrames() + +# Publisj animation object in study +myAnimation.publishInStudy() + +# Set speed +myAnimation.setSpeed(95) + +# Fit All +myView.FitAll() + +# Start animation +myAnimation.startAnimation() + +# Update object browser +salome.sg.updateObjBrowser(1) +\endcode + +
Please, see \ref VISU.Animation "Animation interface reference documentation" +for more details. + +*/ diff --git a/doc/salome/gui/VISU/input/tui_creating_3d_prs.doc b/doc/salome/gui/VISU/input/tui_creating_3d_prs.doc new file mode 100644 index 00000000..c5fb94a4 --- /dev/null +++ b/doc/salome/gui/VISU/input/tui_creating_3d_prs.doc @@ -0,0 +1,20 @@ +/*! + +\page tui_creating_3d_prs_page Creating 3D presentations + + + +*/ \ No newline at end of file diff --git a/doc/salome/gui/VISU/input/tui_cut_lines.doc b/doc/salome/gui/VISU/input/tui_cut_lines.doc new file mode 100644 index 00000000..45f5feb1 --- /dev/null +++ b/doc/salome/gui/VISU/input/tui_cut_lines.doc @@ -0,0 +1,61 @@ +/*! + +\page tui_cut_lines_page Cut Lines + +Create Cut Lines on the field of the imported MED file: + +\code +import os + +import salome + +import VISU +import visu_gui + +# Directory containing MED files +datadir = os.getenv("DATA_DIR") + +# Get VISU engine +myVisu = visu_gui.myVisu + +# Import MED file +medFile = datadir + "/fra.med" +myResult = myVisu.ImportFile(medFile) + +# Create cut lines for the first timestamp of 'VITESSE' field +meshName = 'LE VOLUME' +fieldEntity = VISU.NODE +fieldName = 'VITESSE' +myCutLines = myVisu.CutLinesOnField(myResult, meshName, fieldEntity, fieldName, 1) + +# Set orientation of the base plane (parallel to ZX) +myCutLines.SetOrientation(VISU.CutPlanes.ZX, 0, 0) + +# Set orientation of the cutting planes (parallel to ZX) +myCutLines.SetOrientation2(VISU.CutPlanes.XY, 0, 0) + +# Set number of lines +myCutLines.SetNbLines(12) + +# Set displacement of the base plane +myCutLines.SetDisplacement(0) + +# Set custom position for the first line +newPos = (myCutLines.GetLinePosition(1) - myCutLines.GetLinePosition(0))/2 +myCutLines.SetLinePosition(0, newPos) + +# Update object browser +salome.sg.updateObjBrowser(1) + +# Display just created cut lines +myViewManager = myVisu.GetViewManager() +myView = myViewManager.Create3DView() + +myView.DisplayOnly(myCutLines) +myView.FitAll() +\endcode + +
Please, see \ref VISU.CutLines "CutLines interface reference documentation" +for more details. + +*/ \ No newline at end of file diff --git a/doc/salome/gui/VISU/input/tui_cut_planes.doc b/doc/salome/gui/VISU/input/tui_cut_planes.doc new file mode 100644 index 00000000..1057c5d2 --- /dev/null +++ b/doc/salome/gui/VISU/input/tui_cut_planes.doc @@ -0,0 +1,59 @@ +/*! + +\page tui_cut_planes_page Cut Planes + +Create Cut Planes on the field of the imported MED file: + +\code +import os + +import salome + +import VISU +import visu_gui + +# Directory containing MED files +datadir = os.getenv("DATA_DIR") + +# Get VISU engine +myVisu = visu_gui.myVisu + +# Import MED file +medFile = datadir + "/fra.med" +myResult = myVisu.ImportFile(medFile) + +# Create cut planes for the first timestamp of 'VITESSE' field +meshName = 'LE VOLUME' +fieldEntity = VISU.NODE +fieldName = 'VITESSE' +myCutPlanes = myVisu.CutPlanesOnField(myResult, meshName, fieldEntity, fieldName, 1) + +# Set number of planes +myCutPlanes.SetNbPlanes(15) + +# Set orientation of the planes (parallel to XY), set rotation around Y to 0.5 radian +myCutPlanes.SetOrientation(VISU.CutPlanes.XY, 0, 0.5) + +# Set scale +myCutPlanes.UseDeformation(True) +myCutPlanes.SetVectorialField(fieldEntity, fieldName) +myCutPlanes.SetScale(0.05) + +# Set displacement +myCutPlanes.SetDisplacement(0.1) + +# Update object browser +salome.sg.updateObjBrowser(1) + +# Display just created cut planes +myViewManager = myVisu.GetViewManager() +myView = myViewManager.Create3DView() + +myView.DisplayOnly(myCutPlanes) +myView.FitAll() +\endcode + +
Please, see \ref VISU.CutPlanes "CutPlanes interface reference documentation" +for more details. + +*/ \ No newline at end of file diff --git a/doc/salome/gui/VISU/input/tui_cut_segment.doc b/doc/salome/gui/VISU/input/tui_cut_segment.doc new file mode 100644 index 00000000..e9c31713 --- /dev/null +++ b/doc/salome/gui/VISU/input/tui_cut_segment.doc @@ -0,0 +1,54 @@ +/*! + +\page tui_cut_segment_page Cut Segment + +Create Cut Segment on the field of the imported MED file: + +\code +import os + +import salome + +import VISU +import visu_gui + +# Directory containing MED files +datadir = os.getenv("DATA_DIR") + +# Get VISU engine +myVisu = visu_gui.myVisu + +# Import MED file +medFile = datadir + "/fra.med" +myResult = myVisu.ImportFile(medFile) + +# Create cut segment for the first timestamp of 'VITESSE' field +meshName = 'LE VOLUME' +fieldEntity = VISU.NODE +fieldName = 'VITESSE' +myCutSegment = myVisu.CutSegmentOnField(myResult, meshName, fieldEntity, fieldName, 1) + +# Set the first point of the segment +myCutSegment.SetPoint1(0, 0, 0) + +# Set the second point of the segment +myCutSegment.SetPoint2(0.41, 0.0685, 1.082) + +# Invert the resulting curve +myCutSegment.SetAllCurvesInverted(True) + +# Update object browser +salome.sg.updateObjBrowser(1) + +# Display just created cut segment +myViewManager = myVisu.GetViewManager() +myView = myViewManager.Create3DView() + +myView.DisplayOnly(myCutSegment) +myView.FitAll() +\endcode + +
Please, see \ref VISU.CutSegment "CutSegment interface reference documentation" +for more details. + +*/ \ No newline at end of file diff --git a/doc/salome/gui/VISU/input/tui_datatable.doc b/doc/salome/gui/VISU/input/tui_datatable.doc new file mode 100644 index 00000000..4d48f444 --- /dev/null +++ b/doc/salome/gui/VISU/input/tui_datatable.doc @@ -0,0 +1,11 @@ +/*! + +\page tui_datatable_page DataTable + + + +*/ \ No newline at end of file diff --git a/doc/salome/gui/VISU/input/tui_def_shape.doc b/doc/salome/gui/VISU/input/tui_def_shape.doc new file mode 100644 index 00000000..0729c29a --- /dev/null +++ b/doc/salome/gui/VISU/input/tui_def_shape.doc @@ -0,0 +1,51 @@ +/*! + +\page tui_def_shape_page Deformed Shape + +Create Deformed Shape on the field of the imported MED file: + +\code +import os + +import salome + +import VISU +import visu_gui + +# Directory containing MED files +datadir = os.getenv("DATA_DIR") + +# Get VISU engine +myVisu = visu_gui.myVisu + +# Import MED file +medFile = datadir + "/fra.med" +myResult = myVisu.ImportFile(medFile) + +# Create deformed shape for the first timestamp of 'VITESSE' field +meshName = 'LE VOLUME' +fieldEntity = VISU.NODE +fieldName = 'VITESSE' +myDefShape = myVisu.DeformedShapeOnField(myResult, meshName, fieldEntity, fieldName, 1) + +# Set scale factor +myDefShape.SetScale(0.25) + +# Set magnitude coloring +myDefShape.ShowColored(True) + +# Update object browser +salome.sg.updateObjBrowser(1) + +# Display just created deformed shape +myViewManager = myVisu.GetViewManager() +myView = myViewManager.Create3DView() + +myView.DisplayOnly(myDefShape) +myView.FitAll() +\endcode + +
Please, see \ref VISU.DeformedShape "DeformedShape interface reference documentation" +for more details. + +*/ \ No newline at end of file diff --git a/doc/salome/gui/VISU/input/tui_def_shape_and_scalar_map.doc b/doc/salome/gui/VISU/input/tui_def_shape_and_scalar_map.doc new file mode 100644 index 00000000..c0cca6a4 --- /dev/null +++ b/doc/salome/gui/VISU/input/tui_def_shape_and_scalar_map.doc @@ -0,0 +1,53 @@ +/*! + +\page tui_def_shape_and_scalar_map_page Deformed Shape and Scalar Map + +Create Deformed Shape and Scalar Map presentation on the field of the imported MED file: + +\code +import os + +import salome + +import VISU +import visu_gui + +# Directory containing MED files +datadir = os.getenv("DATA_DIR") + +# Get VISU engine +myVisu = visu_gui.myVisu + +# Import MED file +medFile = datadir + "/fra.med" +myResult = myVisu.ImportFile(medFile) + +# Create deformed shape and scalar map for the first timestamp of 'VITESSE' field +meshName = 'LE VOLUME' +fieldEntity = VISU.NODE +fieldName = 'VITESSE' +myDefShapeScalarMap = myVisu.DeformedShapeAndScalarMapOnField(myResult, meshName, fieldEntity, fieldName, 1) + +# Set scale +myDefShapeScalarMap.SetScale(0.25) + +# Set 'TAUX_DE_VIDE' as scalar field, use first timestamp +fieldName = 'TAUX_DE_VIDE' +myDefShapeScalarMap.SetScalarField(VISU.NODE, fieldName, 1) + +# Update object browser +salome.sg.updateObjBrowser(1) + +# Display just created presentation +myViewManager = myVisu.GetViewManager() +myView = myViewManager.Create3DView() + +myView.DisplayOnly(myDefShapeScalarMap) +myView.FitAll() +\endcode + +
Please, see \ref VISU.DeformedShapeAndScalarMap +"DeformedShapeAndScalarMap interface reference documentation" +for more details. + +*/ \ No newline at end of file diff --git a/doc/salome/gui/VISU/input/tui_evolution.doc b/doc/salome/gui/VISU/input/tui_evolution.doc index ea149e33..7a56652f 100644 --- a/doc/salome/gui/VISU/input/tui_evolution.doc +++ b/doc/salome/gui/VISU/input/tui_evolution.doc @@ -1,38 +1,54 @@ /*! -\page tui_evolution_page Example of Evolution on Point +\page tui_evolution_page Evolution on Point + +Example of Evolution on Point: \code import os + +import salome + import VISU from visu_gui import * -myViewManager = myVisu.GetViewManager(); +# Directory containing MED files +datadir = os.getenv("DATA_DIR") + +# Import MED file +medFile = datadir + "/TimeStamps.med" +myResult = myVisu.ImportFile(medFile) +# Create 2D viewer for the evolution graph: +myViewManager = myVisu.GetViewManager(); myView = myViewManager.CreateXYPlot(); myView.SetTitle("The viewer for Evolution") -print "myViewManager.CreateXYPlot()" - -medFile = "TimeStamps.med" -medFile = os.getenv('DATA_DIR') + '/MedFiles/' + medFile -myResult = myVisu.ImportFile(medFile) -anEvolution = myVisu.CreateEvolution(myView); +# Create evolution instance, use just created view +myEvolution = myVisu.CreateEvolution(myView); +# Get 'vitesse' field sobject aSObj = myStudy.FindObjectIOR(myResult.GetID()) -aSObj = aSObj.FindSubObject(1)[1] # dom +aSObj = aSObj.FindSubObject(1)[1] # 'dom' mesh aSObj = aSObj.FindSubObject(3)[1] # Fields -aSObj = aSObj.FindSubObject(2)[1] # vitesse -print "setField : ", anEvolution.setField(aSObj) +vitesseSO = aSObj.FindSubObject(2)[1] # 'vitesse' field +myEvolution.setField(vitesseSO) -anEvolution.setComponentId(1) # x component +# Set "x" as a component +myEvolution.setComponentId(1) -anEvolution.setPointId(500) - -print "Show Evolution" -anEvolution.showEvolution() +# Set point via identifier +myEvolution.setPointId(500) +# Show Evolution +myEvolution.showEvolution() myView.FitAll() + +# Update object browser +salome.sg.updateObjBrowser(1) \endcode +
Please, see \ref VISU.Evolution "Evolution interface reference documentation" +for more details. + */ diff --git a/doc/salome/gui/VISU/input/tui_gauss_points.doc b/doc/salome/gui/VISU/input/tui_gauss_points.doc new file mode 100644 index 00000000..397ccbf1 --- /dev/null +++ b/doc/salome/gui/VISU/input/tui_gauss_points.doc @@ -0,0 +1,94 @@ +/*! + +\page tui_gauss_points_page Gauss Points + +Create Gauss Points presentation on the field of the imported MED file: + +\code +import os +from time import sleep + +import salome +import SALOMEDS + +import VISU +import visu_gui + +# Directory containing MED files +datadir = os.getenv("DATA_DIR") + +# Get VISU engine +myVisu = visu_gui.myVisu + +# Import MED file +medFile = datadir + "/pointe.med" +myResult = myVisu.ImportFile(medFile) + +# Create gauss points for the first timestamp of 'fieldcelldoublevector' field +meshName = 'maa1' +fieldEntity = VISU.CELL +fieldName = 'fieldcelldoublevector' + +# Create Gauss Points presentation of the first type: +# Results at Gauss Points +myGaussPoints1 = myVisu.GaussPointsOnField(myResult, meshName, fieldEntity, fieldName, 1) + +# Set range values (5-50%): +myGaussPoints1.SetMinSize(0.05) +myGaussPoints1.SetMaxSize(0.5) + +# Set OpenGL Points as a primitive type +myGaussPoints1.SetPrimitiveType(VISU.GaussPoints.POINT) + +# Set points maximum size +myGaussPoints1.SetClamp(32) + +# Create Gauss Points presentation of the second type: +# Gauss Points on Geometry +myGaussPoints2 = myVisu.GaussPointsOnField(myResult, meshName, fieldEntity, fieldName, 1) +myGaussPoints2.SetIsColored(False) + +# Set magnification to 200% +myGaussPoints2.SetMagnification(2) + +# Set magnification ratio +myGaussPoints2.SetMagnificationIncrement(4) + +# Set size of points +myGaussPoints2.SetGeomSize(0.25) + +# Set color of points +myGaussPoints2.SetColor(SALOMEDS.Color(255, 90, 255)) + +# Create Gauss Points presentation of the third type: +# Gauss Points on Deformed Shape +myGaussPoints3 = myVisu.GaussPointsOnField(myResult, meshName, fieldEntity, fieldName, 1) + +# Apply deformation +myGaussPoints3.SetIsDeformed(True) +myGaussPoints3.SetScaleFactor(0.4) + +# Set geometrical sphere as a primitive type +myGaussPoints3.SetPrimitiveType(VISU.GaussPoints.SPHERE) + +# Set sphere resolution +myGaussPoints3.SetResolution(5) + +# Update object browser +salome.sg.updateObjBrowser(1) + +# Display just created presentations one by one +myViewManager = myVisu.GetViewManager() +myView = myViewManager.Create3DView() + +prsList = [myGaussPoints1, myGaussPoints2, myGaussPoints3] +for prs in prsList: + myView.DisplayOnly(prs) + myView.FitAll() + sleep(5) +\endcode + +
Please, see \ref VISU.GaussPoints "GaussPoints interface reference documentation" +for more details. + +*/ \ No newline at end of file diff --git a/doc/salome/gui/VISU/input/tui_import_export.doc b/doc/salome/gui/VISU/input/tui_import_export.doc new file mode 100644 index 00000000..27d84c6a --- /dev/null +++ b/doc/salome/gui/VISU/input/tui_import_export.doc @@ -0,0 +1,59 @@ +/*! + +\page tui_import_export_page Import/Export MED + +Import MED file: + +\code +import os + +import salome + +import visu_gui + +# Directory containing MED files +datadir = os.getenv("DATA_DIR") + +# Get VISU engine +myVisu = visu_gui.myVisu + +# MED file path +medFile = datadir + "/fra.med" + +# Import MED file +myResult = myVisu.ImportFile(medFile) + +# Update object browser +salome.sg.updateObjBrowser(1) +\endcode + +
Export to MED file: + +\code +import os + +import salome + +import visu_gui + +# Directory containing MED files +datadir = os.getenv("DATA_DIR") + +# Get VISU engine +myVisu = visu_gui.myVisu + +# MED file path +medFile = datadir + "/fra.med" + +# Import MED file +myResult = myVisu.ImportFile(medFile) + +# Export MED file +newFileName = datadir + "/fra_copy.med" +myResult.ExportMED(newFileName) + +# Update object browser +salome.sg.updateObjBrowser(1) +\endcode + +*/ \ No newline at end of file diff --git a/doc/salome/gui/VISU/input/tui_iso_surf.doc b/doc/salome/gui/VISU/input/tui_iso_surf.doc new file mode 100644 index 00000000..6a00ccda --- /dev/null +++ b/doc/salome/gui/VISU/input/tui_iso_surf.doc @@ -0,0 +1,51 @@ +/*! + +\page tui_iso_surf_page Iso Surfaces + +Create Iso Surfaces on the field of the imported MED file: + +\code +import os + +import salome + +import VISU +import visu_gui + +# Directory containing MED files +datadir = os.getenv("DATA_DIR") + +# Get VISU engine +myVisu = visu_gui.myVisu + +# Import MED file +medFile = datadir + "/fra.med" +myResult = myVisu.ImportFile(medFile) + +# Create iso surfaces for the first timestamp of 'VITESSE' field +meshName = 'LE VOLUME' +fieldEntity = VISU.NODE +fieldName = 'VITESSE' +myIsoSurfaces = myVisu.IsoSurfacesOnField(myResult, meshName, fieldEntity, fieldName, 1) + +# Set number of surfaces +myIsoSurfaces.SetNbSurfaces(12) + +# Show two value labels per surface +myIsoSurfaces.ShowLabels(True, 2) + +# Update object browser +salome.sg.updateObjBrowser(1) + +# Display just created iso surfaces +myViewManager = myVisu.GetViewManager() +myView = myViewManager.Create3DView() + +myView.DisplayOnly(myIsoSurfaces) +myView.FitAll() +\endcode + +
Please, see \ref VISU.IsoSurfaces "IsoSurfaces interface reference documentation" +for more details. + +*/ \ No newline at end of file diff --git a/doc/salome/gui/VISU/input/tui_manage_3d_prs.doc b/doc/salome/gui/VISU/input/tui_manage_3d_prs.doc new file mode 100644 index 00000000..6b7a298e --- /dev/null +++ b/doc/salome/gui/VISU/input/tui_manage_3d_prs.doc @@ -0,0 +1,12 @@ +/*! + +\page tui_manage_3d_prs_page Managing 3D Presentations + + + +*/ \ No newline at end of file diff --git a/doc/salome/gui/VISU/input/tui_plot_3d.doc b/doc/salome/gui/VISU/input/tui_plot_3d.doc new file mode 100644 index 00000000..a2997d56 --- /dev/null +++ b/doc/salome/gui/VISU/input/tui_plot_3d.doc @@ -0,0 +1,60 @@ +/*! + +\page tui_plot_3d_page Plot 3D + +Create Plot 3D presentation on the field of the imported MED file: + +\code +import os + +import salome + +import VISU +import visu_gui + +# Directory containing MED files +datadir = os.getenv("DATA_DIR") + +# Get VISU engine +myVisu = visu_gui.myVisu + +# Import MED file +medFile = datadir + "/fra.med" +myResult = myVisu.ImportFile(medFile) + +# Create plot 3d for the first timestamp of 'VITESSE' field +meshName = 'LE VOLUME' +fieldEntity = VISU.NODE +fieldName = 'VITESSE' +myPlot3D = myVisu.Plot3DOnField(myResult, meshName, fieldEntity, fieldName, 1) + +# Set cut plane orientation +myPlot3D.SetOrientation(VISU.Plot3D.ZX, 0, 0) + +# Set relative position of the plane +myPlot3D.SetPlanePosition(0.8, True) + +# Set scale factor +myPlot3D.SetScaleFactor(0.25) + +# Set contour as a presentation type +myPlot3D.SetContourPrs(True) + +# Set number of contours +myPlot3D.SetNbOfContours(100) + +# Update object browser +salome.sg.updateObjBrowser(1) + +# Display just created plot 3d presentation +myViewManager = myVisu.GetViewManager() +myView = myViewManager.Create3DView() + +myView.DisplayOnly(myPlot3D) +myView.FitAll() +\endcode + +
Please, see \ref VISU.Plot3D "Plot3D interface reference documentation" +for more details. + +*/ \ No newline at end of file diff --git a/doc/salome/gui/VISU/input/tui_point_marker.doc b/doc/salome/gui/VISU/input/tui_point_marker.doc index 1199dc9a..b11938be 100644 --- a/doc/salome/gui/VISU/input/tui_point_marker.doc +++ b/doc/salome/gui/VISU/input/tui_point_marker.doc @@ -1,48 +1,61 @@ /*! -\page tui_point_marker_page Example of using Point Markers +\page tui_point_marker_page Point Marker + +Example of using Point Markers: \code import os -import time +from time import sleep + +import salome + import VISU from visu_gui import * -data_dir = os.getenv("DATA_DIR") -sleep_delay = 2 +# Directory containing MED files +datadir = os.getenv("DATA_DIR") -myViewManager = myVisu.GetViewManager(); +# Import MED file +medFile = datadir + "/fra.med" +myResult = myVisu.ImportFile(medFile) -myView = myViewManager.Create3DView() -myView.SetTitle("The viewer for Point Marker Example") -print "myViewManager.Create3DView()" +# Create scalar map for the first timestamp of 'VITESSE' field +meshName = "LE VOLUME" +fieldEntity = VISU.NODE +fieldName = "VITESSE" +timeStampId = 1 -medFile = "fra.med" -medFile = data_dir + '/MedFiles/' + medFile -myResult = myVisu.ImportFile(medFile) +myScalarMap = myVisu.ScalarMapOnField(myResult, meshName, fieldEntity, fieldName, timeStampId) -aMeshName ="LE VOLUME" -anEntity = VISU.NODE -aFieldName = "VITESSE"; -aTimeStampId = 1 +# Create 3D view +myViewManager = myVisu.GetViewManager(); +myView = myViewManager.Create3DView() +myView.SetTitle("The viewer for Point Marker example") -aScalarMap = myVisu.ScalarMapOnField(myResult,aMeshName,anEntity,aFieldName,aTimeStampId) -myView.Display(aScalarMap); +# Display just created scalar map +myView.DisplayOnly(myScalarMap); myView.FitAll(); -print "Set representation type to Point" -myView.SetPresentationType(aScalarMap, VISU.POINT) +# Set the scalar map representation type to point +myView.SetPresentationType(myScalarMap, VISU.POINT) -print "Set standard marker" -aScalarMap.SetMarkerStd(VISU.MT_PLUS, VISU.MS_25) +# Set standard marker +myScalarMap.SetMarkerStd(VISU.MT_O_PLUS, VISU.MS_25) myView.Update() -time.sleep(sleep_delay) +sleep(5) -print "Set custom marker" -custom_texture = myVisu.LoadTexture(os.path.join(data_dir, "Textures", "texture1.dat")) -aScalarMap.SetMarkerTexture(custom_texture) +# Set custom marker +textureFile = os.path.join(datadir, "Textures", "texture1.dat") +custom_texture = myVisu.LoadTexture(textureFile) +myScalarMap.SetMarkerTexture(custom_texture) myView.Update() +# Update object browser +salome.sg.updateObjBrowser(1) \endcode +
Please, see \ref VISU.Prs3d "Prs3d interface reference documentation" +for more details. + */ diff --git a/doc/salome/gui/VISU/input/tui_scalar_map.doc b/doc/salome/gui/VISU/input/tui_scalar_map.doc new file mode 100644 index 00000000..2a20306e --- /dev/null +++ b/doc/salome/gui/VISU/input/tui_scalar_map.doc @@ -0,0 +1,51 @@ +/*! + +\page tui_scalar_map_page Scalar Map + +Create Scalar Map on the field of the imported MED file: + +\code +import os + +import salome + +import VISU +import visu_gui + +# Directory containing MED files +datadir = os.getenv("DATA_DIR") + +# Get VISU engine +myVisu = visu_gui.myVisu + +# Import MED file +medFile = datadir + "/pointe.med" +myResult = myVisu.ImportFile(medFile) + +# Create scalar map for the first timestamp of 'fieldcelldoublevector' field +meshName = 'maa1' +fieldEntity = VISU.CELL +fieldName = 'fieldcelldoublevector' +myScalarMap = myVisu.ScalarMapOnField(myResult, meshName, fieldEntity, fieldName, 1) + +# Set logarithmic scaling +myScalarMap.SetScaling(VISU.LOGARITHMIC) + +# Set scalar range to [2, 5] +myScalarMap.SetRange(2, 5) + +# Update object browser +salome.sg.updateObjBrowser(1) + +# Display just created scalar map +myViewManager = myVisu.GetViewManager() +myView = myViewManager.Create3DView() + +myView.DisplayOnly(myScalarMap) +myView.FitAll() +\endcode + +
Please, see \ref VISU.ScalarMap "ScalarMap interface reference documentation" +for more details. + +*/ \ No newline at end of file diff --git a/doc/salome/gui/VISU/input/tui_stream_lines.doc b/doc/salome/gui/VISU/input/tui_stream_lines.doc new file mode 100644 index 00000000..9a035c5e --- /dev/null +++ b/doc/salome/gui/VISU/input/tui_stream_lines.doc @@ -0,0 +1,59 @@ +/*! + +\page tui_stream_lines_page Stream Lines + +Create Stream Lines on the field of the imported MED file: + +\code +import os + +import salome + +import VISU +import visu_gui + +# Directory containing MED files +datadir = os.getenv("DATA_DIR") + +# Get VISU engine +myVisu = visu_gui.myVisu + +# Import MED file +medFile = datadir + "/fra.med" +myResult = myVisu.ImportFile(medFile) + +# Create stream lines for the first timestamp of 'VITESSE' field +meshName = 'LE VOLUME' +fieldEntity = VISU.NODE +fieldName = 'VITESSE' +myStreamLines = myVisu.StreamLinesOnField(myResult, meshName, fieldEntity, fieldName, 1) + +# Set stream lines parameters +integrationStep = 0.003 +propagationTime = 1.5 +stepLength = 0.015 +# Mesh on nodes +prs3D = myVisu.MeshOnEntity(myResult, meshName, VISU.NODE) +pointsPercents = 0.05 +direction = VISU.StreamLines.FORWARD + +myStreamLines.SetParams(integrationStep, propagationTime, stepLength, prs3D, pointsPercents, direction) + +# Set magnitude coloring +myStreamLines.ShowColored(True) + +# Update object browser +salome.sg.updateObjBrowser(1) + +# Display just created stream lines +myViewManager = myVisu.GetViewManager() +myView = myViewManager.Create3DView() + +myView.DisplayOnly(myStreamLines) +myView.FitAll() +\endcode + +
Please, see \ref VISU.StreamLines "StreamLines interface reference documentation" +for more details. + +*/ \ No newline at end of file diff --git a/doc/salome/gui/VISU/input/tui_submesh.doc b/doc/salome/gui/VISU/input/tui_submesh.doc new file mode 100644 index 00000000..5dde8dd7 --- /dev/null +++ b/doc/salome/gui/VISU/input/tui_submesh.doc @@ -0,0 +1,64 @@ +/*! + +\page tui_submesh_page Submesh presentation + +Display different submeshes of the imported MED file: + +\code +import os +from time import sleep + +import salome +import SALOMEDS + +import VISU +import visu_gui + +# Directory containing MED files +datadir = os.getenv("DATA_DIR") + +# Get VISU engine +myVisu = visu_gui.myVisu + +# Import MED file +medFile = datadir + "/pointe.med" +myResult = myVisu.ImportFile(medFile) + +# Create submesh presentations +meshName = 'maa1' +cellEntity = VISU.CELL +nodeEntity = VISU.NODE + +mySubMeshes = [] + +# Submesh on nodes +myOnNodes = myVisu.MeshOnEntity(myResult, meshName, nodeEntity) +mySubMeshes.append(myOnNodes) + +# Submesh on family (one cell) +familyName = 'FAMILLE_ELEMENT_1' +myOnFamily = myVisu.FamilyMeshOnEntity(myResult, meshName, cellEntity, familyName) +mySubMeshes.append(myOnFamily) + +# Submesh on group (several cells) +groupName = 'groupe1' +myOnGroup = myVisu.GroupMesh(myResult, meshName, groupName) +mySubMeshes.append(myOnGroup) + +# Update object browser +salome.sg.updateObjBrowser(1) + +# Display just created presentations one by one +myViewManager = myVisu.GetViewManager() +myView = myViewManager.Create3DView() + +for submesh in mySubMeshes: + myView.DisplayOnly(submesh) + myView.FitAll() + sleep(5) +\endcode + +
Please, see \ref VISU.Mesh "Mesh interface reference documentation" +for more details. + +*/ \ No newline at end of file diff --git a/doc/salome/gui/VISU/input/tui_table_3d.doc b/doc/salome/gui/VISU/input/tui_table_3d.doc new file mode 100644 index 00000000..183f3455 --- /dev/null +++ b/doc/salome/gui/VISU/input/tui_table_3d.doc @@ -0,0 +1,53 @@ +/*! + +\page tui_table_3d_page Table 3D presentation + +Create and display Table 3D presentation: + +\code +import os + +import salome + +import visu_gui + +# Directory containing data table files +datadir = os.getenv("DATA_DIR") + +# Get VISU engine +myVisu = visu_gui.myVisu + +# Import tables from file +tableFile = datadir + '/table_test.xls' +myTablesSO = myVisu.ImportTables(tableFile, False) + +# Create table presentation +table = None +anIsFound, aTableSO = myTablesSO.FindSubObject(1) +if anIsFound: + anID = aTableSO.GetID() + table = myVisu.CreateTable(anID) + # Set 'Contour' presentation type + table.SetContourPrs(1) + # Set number od contours + table.SetNbOfContours(1024) + # Set scale factor + table.SetScaleFactor(0.2) + +# Show table presentation +if (table is not None): + # Display just created tabel presentation + myViewManager = myVisu.GetViewManager() + myView = myViewManager.Create3DView() + + myView.DisplayOnly(table) + myView.FitAll() + +# Update object browser +salome.sg.updateObjBrowser(1) +\endcode + +
Please, see \ref VISU.Table "Table interface reference documentation" +for more details. + +*/ \ No newline at end of file diff --git a/doc/salome/gui/VISU/input/tui_table_curves.doc b/doc/salome/gui/VISU/input/tui_table_curves.doc new file mode 100644 index 00000000..4e83e25b --- /dev/null +++ b/doc/salome/gui/VISU/input/tui_table_curves.doc @@ -0,0 +1,75 @@ +/*! + +\page tui_table_curves_page Curves + +Create and display curves using the imported table: + +\code +import os +from time import sleep + +import salome + +import VISU +import visu_gui + +# Directory containing data table files +datadir = os.getenv("DATA_DIR") + +# Get VISU engine +myVisu = visu_gui.myVisu + +# Import tables from file +tableFile = datadir + '/table_test.xls' +myTablesSO = myVisu.ImportTables(tableFile, False) + +# Get table +anIsFound, myTableSO = myTablesSO.FindSubObject(1) +anID = myTableSO.GetID() +myTable = myVisu.CreateTable(anID) + +# Create table view +myViewManager = myVisu.GetViewManager() +myTableView = myViewManager.CreateTableView(myTable) +myTableView.SetTitle('My Curves') + +# Create container for a set of curves +myContainer = myVisu.CreateContainer() + +# Create curves +aNbCurves = myTable.GetNbRows() +aCurve = None +for i in range(1, aNbCurves): + aCurve = myVisu.CreateCurve( myTable, 1, i ) + myContainer.AddCurve(aCurve) + +# Update object browser +salome.sg.updateObjBrowser(1) + +# Create Plot 2D view +myView = myViewManager.CreateXYPlot(); +myView.SetTitle("The viewer for My Curves") + +# Display all curves (i.e. container) +myView.Display(myContainer) +sleep(5) + +# Set curves displaying mode +myView.SetCurveType(VISU.XYPlot.SPLINE) +# Set marker size +myView.SetMarkerSize(15) + +# Change display parameters of the last created curve +# Marker type +aCurve.SetMarker(VISU.Curve.CIRCLE) +# Line type and width +aCurve.SetLine(VISU.Curve.SOLIDLINE, 4) + +# Display only the last created curve +myView.DisplayOnly(aCurve) +\endcode + +
Please, see \ref VISU.Curve "Curve interface reference documentation" and +\ref VISU.XYPlot "XYPlot interface reference documentation" for more details. + +*/ \ No newline at end of file diff --git a/doc/salome/gui/VISU/input/tui_table_import.doc b/doc/salome/gui/VISU/input/tui_table_import.doc new file mode 100644 index 00000000..6ebef473 --- /dev/null +++ b/doc/salome/gui/VISU/input/tui_table_import.doc @@ -0,0 +1,67 @@ +/*! + +\page tui_table_import_page Import/Export table + +Import tables from file: + +\code +import os + +import salome + +import visu_gui + +# Directory containing data table files +datadir = os.getenv("DATA_DIR") + +# Get VISU engine +myVisu = visu_gui.myVisu + +# Import tables from file +tableFile = datadir + '/tables_test.xls' +myTablesSO = myVisu.ImportTables(tableFile, False) + +# Print table names +print "\nNames of the imported tables:" +iter = salome.myStudy.NewChildIterator(myTablesSO) +while iter.More(): + aTableSO = iter.Value() + if aTableSO: + aTable = aTableSO.GetObject() + print "\n", aTable.GetTitle() + iter.Next() + +# Update object browser +salome.sg.updateObjBrowser(1) +\endcode + +
Export table to the file: + +\code +import os + +import salome + +import visu_gui + +# Directory containing data table files +datadir = os.getenv("DATA_DIR") + +# Get VISU engine +myVisu = visu_gui.myVisu + +# Import tables from file +tableFile = datadir + '/tables_test.xls' +myTablesSO = myVisu.ImportTables(tableFile, False) + +# Export first of the imported tables to the new file +expTableFile = datadir + '/sinus_table.txt' + +sinusTableSO = salome.myStudy.FindObject("sinus") +myVisu.ExportTableToFile(sinusTableSO, expTableFile) + +# Update object browser +salome.sg.updateObjBrowser(1) +\endcode + +*/ \ No newline at end of file diff --git a/doc/salome/gui/VISU/input/tui_vectors.doc b/doc/salome/gui/VISU/input/tui_vectors.doc new file mode 100644 index 00000000..6792e812 --- /dev/null +++ b/doc/salome/gui/VISU/input/tui_vectors.doc @@ -0,0 +1,60 @@ +/*! + +\page tui_vectors_page Vectors + +Create Vectors on the field of the imported MED file: + +\code +import os + +import salome + +import VISU +import visu_gui + +# Directory containing MED files +datadir = os.getenv("DATA_DIR") + +# Get VISU engine +myVisu = visu_gui.myVisu + +# Import MED file +medFile = datadir + "/fra.med" +myResult = myVisu.ImportFile(medFile) + +# Create vectors for the first timestamp of 'VITESSE' field +meshName = 'LE VOLUME' +fieldEntity = VISU.NODE +fieldName = 'VITESSE' +myVectors = myVisu.VectorsOnField(myResult, meshName, fieldEntity, fieldName, 1) + +# Set scale factor +myVectors.SetScale(0.1) + +# Set magnitude coloring +myVectors.ShowColored(True) + +# Set line width +myVectors.SetLineWidth(2) + +# Set the type of representation of the vector head (arrow) +myVectors.SetGlyphType(VISU.Vectors.ARROW) + +# Set the position of the vector head (center) +myVectors.SetGlyphPos(VISU.Vectors.CENTER) + +# Update object browser +salome.sg.updateObjBrowser(1) + +# Display just created vectors +myViewManager = myVisu.GetViewManager() +myView = myViewManager.Create3DView() + +myView.DisplayOnly(myVectors) +myView.FitAll() +\endcode + +
Please, see \ref VISU.Vectors "Vectors interface reference documentation" +for more details. + +*/ \ No newline at end of file diff --git a/doc/salome/gui/VISU/input/tui_view_3d.doc b/doc/salome/gui/VISU/input/tui_view_3d.doc new file mode 100644 index 00000000..69d0bb96 --- /dev/null +++ b/doc/salome/gui/VISU/input/tui_view_3d.doc @@ -0,0 +1,197 @@ +/*! + +\page tui_view_3d_page Viewing 3D presentations + +Examples of using 3D viewer functionaly from Python: + +\code +import os +from time import sleep + +import salome + +import VISU +from visu_gui import * + +# Delay +delay = 4 + +# Directory containing MED files +datadir = os.getenv("DATA_DIR") + +# Create temporary 3D view +print "Create temporary 3D view..." +myViewManager = myVisu.GetViewManager() +myTempView = myViewManager.Create3DView() +myTempView.SetTitle("The window will be soon destroyed!") +sleep(delay) + +# Destroy the view +print "Destroy the view..." +myViewManager.Destroy(myTempView) +sleep(delay) + +# Import MED file +medFile = datadir + "/fra.med" +myResult = myVisu.ImportFile(medFile) + +# Create scalar map +meshName = 'LE VOLUME' +fieldEntity = VISU.NODE +fieldName = 'VITESSE' +timestampId = 1 +myScalarMap = myVisu.ScalarMapOnField(myResult, meshName, fieldEntity, fieldName, timestampId) + +# Create new 3D view +print "Create new 3D view..." +myView = myViewManager.Create3DView() + +# Set background +print "Set blue background..." +bgColor = SALOMEDS.Color(0.0, 0.3, 1.0) +myView.SetBackground(bgColor) +myView.Update() +sleep(delay) + +# Display just created scalar map +print "Display scalar map..." +myView.Display(myScalarMap) +sleep(delay) + +# Fit all +print "Fit all..." +myView.FitAll() +sleep(delay) + +# Set the point of sight of the camera +print "Set the point of sight of the camera..." +myView.SetFocalPoint([1,5,10]) +myView.Update() +sleep(delay) + +# Fit all +print "Fit all..." +myView.FitAll() +sleep(delay) + +# Change scalar map range +print "Change scalar map range..." +myScalarMap.SetRange(0.2, 0.9) +sleep(delay) + +# Update the view +print "Update the view..." +myView.Update() +sleep(delay) + +# Scale view +print "Scale view..." +myView.ScaleView(VISU.View3D.YAxis,10.0) +myView.ScaleView(VISU.View3D.XAxis,3.0) +myView.Update() +sleep(delay) + +# Set the position of the camera in 3D space +print "Set the position of the camera in 3D space..." +myView.SetPointOfView([0.01, 0.05, 0.03]) +myView.Update() +sleep(delay) + +# Fit all +print "Fit all..." +myView.FitAll() +sleep(delay) + +# Store view parameters +stateName = "State1" +myView.SaveViewParams(stateName) + +# Remove scaling +print "Remove scale..." +myView.RemoveScale() +sleep(delay) + +# Change background +print "Set dark background..." +bgColor = SALOMEDS.Color(0.0, 0.1, 0.2) +myView.SetBackground(bgColor) +sleep(delay) + +# Update view +print "Update view..." +myView.Update() +sleep(delay) + +# Set top view +print "Set top view..." +myView.SetView(VISU.View3D.TOP) +sleep(delay) + +# Zoomig out +print "Zoomig out..." +aScale = myView.GetParallelScale() +for i in range(0,50) : + aScale = aScale + 0.05 + myView.SetParallelScale(aScale) + myView.Update() + +sleep(delay) + +# Zooming in +print "Zooming in..." +for i in range(0,75) : + aScale = aScale - 0.05 + myView.SetParallelScale(aScale) + myView.Update() + +sleep(delay) + +# Set the vertical line of the camera in 3D space +print "Set the vertical line of the camera in 3D space..." +aViewUp = myView.GetViewUp() +for i in range(0,40) : + aViewUp[0] = aViewUp[0] + 0.1 + myView.SetViewUp(aViewUp) + myView.Update() + +sleep(delay) + +# Rotating Y +print "Rotating Y..." +aPoint = myView.GetPointOfView() +for i in range(0,150) : + aPoint[1] = aPoint[1] + 1 + myView.SetPointOfView(aPoint) + myView.Update() + +sleep(delay) + +# Restore view parameters +print "Restore view parameters..." +myView.RestoreViewParams(stateName) +sleep(delay) + +# Change presentation parameters: + +# Make the scalar map shrinked +print "Make the scalar map shrinked..." +myView.SetShrinked(myScalarMap, True) +sleep(delay) + +# Set presentation type +print "Set presentation type to SURFACEFRAME..." +myView.SetPresentationType(myScalarMap, VISU.SURFACEFRAME) +sleep(delay) + +print "Set presentation type to FEATURE_EDGES..." +myView.SetPresentationType(myScalarMap, VISU.FEATURE_EDGES) +sleep(delay) + +# Update object browser +salome.sg.updateObjBrowser(1) +\endcode + +
Please, see \ref VISU.View3D "View3D interface reference documentation" +for more details. + +*/ diff --git a/doc/salome/gui/VISU/input/vectors.doc b/doc/salome/gui/VISU/input/vectors.doc index 4b250995..2eff2223 100644 --- a/doc/salome/gui/VISU/input/vectors.doc +++ b/doc/salome/gui/VISU/input/vectors.doc @@ -43,6 +43,9 @@ scalar bar displayed with this presentation (\ref scalar_map_page "see also").See Also a sample TUI Script of a +\ref tui_vectors_page "Vectors creation" operation. */ diff --git a/doc/salome/gui/VISU/input/viewing_3d_presentations.doc b/doc/salome/gui/VISU/input/viewing_3d_presentations.doc index 0ea0cecc..8b15e2bf 100644 --- a/doc/salome/gui/VISU/input/viewing_3d_presentations.doc +++ b/doc/salome/gui/VISU/input/viewing_3d_presentations.doc @@ -160,4 +160,7 @@ the pop-up menu select Merge Scalar Range. To restore separate bars and scales for each module select Use Field Range from the same menu. +
See Also a sample TUI Script of a +\ref tui_view_3d_page "Viewing 3D presentations". + */ -- 2.39.2