Salome HOME
#28928 [CEA] FIELDS : developer documentation for the simplified visualisation
authorrnv <rnv@opencascade.com>
Mon, 28 Mar 2022 12:08:20 +0000 (15:08 +0300)
committervsr <vsr@opencascade.com>
Mon, 11 Apr 2022 11:37:03 +0000 (14:37 +0300)
24 files changed:
doc/dev/sphinx/fields_arch_corba_services.rst [new file with mode: 0644]
doc/dev/sphinx/fields_arch_gui.rst [new file with mode: 0644]
doc/dev/sphinx/fields_arch_implementation_layer.rst [new file with mode: 0644]
doc/dev/sphinx/fields_arch_introduction.rst [new file with mode: 0644]
doc/dev/sphinx/fields_arch_med_presentation_manager.rst [new file with mode: 0644]
doc/dev/sphinx/fields_arch_med_presentation_manager_impl.rst [new file with mode: 0644]
doc/dev/sphinx/fields_arch_med_presentation_plot3d.rst [new file with mode: 0644]
doc/dev/sphinx/fields_arch_med_presentation_py.rst [new file with mode: 0644]
doc/dev/sphinx/fields_arch_medcalc_py.rst [new file with mode: 0644]
doc/dev/sphinx/fields_arch_medwidget_helper_plot3d.rst [new file with mode: 0644]
doc/dev/sphinx/fields_arch_plot3d_implementation_example.rst [new file with mode: 0644]
doc/dev/sphinx/fields_arch_presentation_controller.rst [new file with mode: 0644]
doc/dev/sphinx/fields_arch_presentation_event.rst [new file with mode: 0644]
doc/dev/sphinx/fields_arch_widget_presentation_parameters.rst [new file with mode: 0644]
doc/dev/sphinx/images/image_fields_arch.png [new file with mode: 0644]
doc/dev/sphinx/images/image_helpers_hierarchy.png [new file with mode: 0644]
doc/dev/sphinx/images/image_implementation_layer_hierarchy.png [new file with mode: 0644]
doc/dev/sphinx/images/image_ui_designer_prs_panel.png [new file with mode: 0644]
doc/dev/sphinx/index.rst
idl/MEDPresentationManager.idl
src/MEDCalc/cmp/MEDPresentationManager_i.cxx
src/MEDCalc/gui/PresentationController.cxx
src/MEDCalc/gui/dialogs/WidgetPresentationParameters.cxx
src/MEDCalc/tui/medpresentation.py

diff --git a/doc/dev/sphinx/fields_arch_corba_services.rst b/doc/dev/sphinx/fields_arch_corba_services.rst
new file mode 100644 (file)
index 0000000..0175315
--- /dev/null
@@ -0,0 +1,20 @@
+.. _fields_arch_corba_services_page:
+
+****************************
+FIELDS module CORBA services 
+****************************
+
+To manage presentations in the FIELDS module, the following CORBA components and services are implemented:
+
+* ``MED_ORB::MED_Gen`` is a CORBA engine of FIELDS module; it inherits ``Engine::EngineComponent`` from KERNEL module. It is aimed for
+  
+  * publishing of a structure of MED file (mesh, fields and timesteps) in *SALOMEDS*,
+  * registering of presentations.
+
+* ``MEDCALC::MEDFactory`` is another CORBA ``Engine::EngineComponent`` interface (it means that it can be retrieved in the CORBA context using the ``SALOME_LifeCycleCorba`` registry).
+  It provides access to the CORBA services, which are used to manage FIELDS presentations:
+     
+    * ``MEDCALC::MEDDataManager`` - reads structure of the MED file; internally it uses *MEDCoupling* library for that purpose,
+    * ``MEDCALC::MEDCommandsHistoryManager`` - collects a history of Python commands which are executed in the Python console in the FIELDS module and provides access to the sequence of commands,
+    * ``MEDCALC::MEDPresentationManager`` - main service for creating FIELDS presentations and managing their parameters; it is used in :ref:`FIELDS GUI<fields_arch_gui_page>` to retrieve parameters of presentations 
+      and :ref:`medcalc<fields_arch_medcacl_py_page>` Python package to create and update FIELDS presentations.
diff --git a/doc/dev/sphinx/fields_arch_gui.rst b/doc/dev/sphinx/fields_arch_gui.rst
new file mode 100644 (file)
index 0000000..0acbe0a
--- /dev/null
@@ -0,0 +1,79 @@
+.. _fields_arch_gui_page:
+
+*****************
+FIELDS module GUI 
+*****************
+
+FIELDS module uses the following components to manage and display presentations:
+
+* Standard SALOME *Object browser* represents structure of MED file within FIELDS module. When MED file is loaded, the following steps are performed:
+
+  #. Reading structure of MED file. For these purpose, ``MEDCALC::MedDataManager`` CORBA service (which uses *MEDCoupling* library) is used.
+  #. Creating structure of MED file (full path to MED file, name of a mesh, name and type (``ON_NODES`` or ``ON_CELLS``) of each field in MED file, and all timesteps for each field).
+     ``MED_ORB::MED`` CORBA component is used for that, and each item of the data tree structure is represented via standard SALOME data object ``SObject``.
+
+* *Presentation Parameters* panel allows managing parameters of presentations. This panel is implemented in the following way:
+
+  #. Interface of *Presentation Parameters* panel is described via `Qt Designer tool <https://doc.qt.io/qt-5/qtdesigner-manual.html>`__;
+     for details see ``WidgetPresentationParameters.ui`` (UI form) and ``WidgetPresentationParameters.cxx`` (C++ wrapping of UI) files.
+     The UI file contains all needed GUI controls which are used to manage parameters of all FIELDS presentations, i.e. single UI file is used for all types of presentations.
+     All these parameters are hidden by default; and parameters, required for specific presentation are shown at first usage, for example:
+     
+      .. code-block:: cpp
+
+        void WidgetPresentationParameters::setSliceOrientation(MEDCALC::SliceOrientationType orient) {
+           ...
+           // Show the widgets:
+           _ui.labelSliceOrient->show();
+           _ui.comboBoxSliceOrient->show();
+           ...
+           ...
+           ...    
+        }
+
+     Widget which contains all these parameters is displayed inside the dockable window which is created during the initialization of FIELDS module.
+
+  #. Interaction between GUI controls and ``medcalc`` Python package is implemented via several helper classes. The hierarchy of these classes is presented on the following diagram:
+
+      .. image:: images/image_helpers_hierarchy.png
+         :align: center
+    
+    * ``MEDWidgetHelper`` - base abstract class to manage common parameters of all FIELDS presentations.
+    * ``MEDWidgetHelperComponent`` - base abstract class to manage parameters of all presentations having only one component to change.
+
+      These base classes contain one pure virtual method 
+
+       .. code-block:: cpp
+        
+          virtual std::string getPythonTag() const = 0;
+
+      This method must be implemented in all descendant classes; it should return the type of a presentation ("ScalarMap", "Slices" and etc.)
+
+    * All other classes (such as ``MEDWidgetHelperScalarMap``, ``MEDWidgetHelperSlices`` etc.) are descendants of classes ``MEDWidgetHelper`` or ``MEDWidgetHelperComponent``.
+
+    Helper classes send ``PresentationEvent`` event via emitting ``presentationUpdateSignal`` signal on any user action made in *Presentation Parameters* panel.
+
+  #. ``PresentationController`` class is aimed for 
+     
+    * Converting ``PresentationEvent`` events to calls of ``medcalc`` Python package API, and executing related commands in the embedded Python console, for example:
+
+      .. code-block:: cpp
+       
+          QStringList commands;
+          ...
+          if ( event->eventtype == PresentationEvent::EVENT_CHANGE_COMPONENT ) {
+           
+            // Get presentation type by calling getPythonTag() method
+            std::string typ = getPresTypeFromWidgetHelper(event->presentationId); 
+
+            // Convert 'PresentationEvent' to set of python commands
+            commands += QString("params = medcalc.Get%1Parameters(%2)").arg(QString::fromStdString(typ)).arg(event->presentationId);
+            commands += QString("params.displayedComponent = '%1'").arg(QString::fromStdString(event->aString));
+            commands += QString("medcalc.Update%1(%2, params)").arg(QString::fromStdString(typ)).arg(event->presentationId);
+          }
+          ...
+          _consoleDriver->exec(commands); 
+
+    * Updating content of *Presentation Parameters* panel according to the presentation, selected in the *Object browser*.
+
+* Standard SALOME *Displayer* mechanism is used to manage visiblity of FIELDS presentations in the ParaView viewer.
diff --git a/doc/dev/sphinx/fields_arch_implementation_layer.rst b/doc/dev/sphinx/fields_arch_implementation_layer.rst
new file mode 100644 (file)
index 0000000..df78c40
--- /dev/null
@@ -0,0 +1,18 @@
+.. _fields_arch_implementation_layer_page:
+
+**********************************
+FIELDS module implementation layer
+**********************************
+
+FIELDS module uses Python API of the ParaVis module to build presentations. Internally any presentation of the FIELDS module is implemented as a particular pipeline of the ParaVis filters, which always starts with the *MEDReader*.
+At the implementation level, a pipeline which represents presentation is built via a sequence of the Python commands. These command are executed in the builtin Python interpreter.
+
+The hierarchical structure of the presentation classes is shown on the diagram:
+
+.. image:: images/image_implementation_layer_hierarchy.png
+   :align: center
+
+The base class for all presentations is ``MEDPresentation``; it contains base functionalities for all presentations. All others classes implement functionalities of particular presentations.
+
+
+
diff --git a/doc/dev/sphinx/fields_arch_introduction.rst b/doc/dev/sphinx/fields_arch_introduction.rst
new file mode 100644 (file)
index 0000000..fcd677a
--- /dev/null
@@ -0,0 +1,29 @@
+.. _fields_arch_introduction_page:
+
+******************************************
+Introduction to FIELDS module architecture
+******************************************
+
+.. image:: images/image_fields_arch.png
+   :align: center
+
+
+Generally FIELDS module architecture is presented on the scheme above.
+FIELDS module is used for analysis and post-processing of numerical simulation results. It is based upon ParaVis module, MEDReader ParaVis module plugin and MEDCoupling library.
+FIELDS module uses Python API of the ParaVis module to build presentations. Any presentation in the FIELDS module is a pipeline of the ParaVis filters, which always starts with MEDReader. 
+ParaVis module API is used via medcalc Python module and CORBA services.
+
+In the FIELDS module architecture, the following parts can be distinguished:
+
+.. toctree::
+
+   fields_arch_gui.rst 
+   fields_arch_medcalc_py.rst
+   fields_arch_corba_services.rst
+   fields_arch_implementation_layer.rst
+
+See also:
+
+.. toctree::
+
+   fields_arch_plot3d_implementation_example.rst
diff --git a/doc/dev/sphinx/fields_arch_med_presentation_manager.rst b/doc/dev/sphinx/fields_arch_med_presentation_manager.rst
new file mode 100644 (file)
index 0000000..05bc045
--- /dev/null
@@ -0,0 +1,50 @@
+:orphan:
+
+.. _fields_arch_med_presentation_manager_page:
+
+*******************************
+MEDCALC::MEDPresentationManager
+*******************************
+
+Plot3D presentation parameters
+------------------------------
+
+.. literalinclude:: ../../../idl/MEDPresentationManager.idl
+   :language: cpp
+   :start-after: begin of plot3d params
+   :end-before: end of plot3d params
+
+Methods to create and update Plot3D presentation
+------------------------------------------------
+
+.. code-block:: cpp
+
+   interface MEDPresentationManager : SALOME::GenericObj
+   {
+     ...
+     long                 makePlot3D(in Plot3DParameters params, in ViewModeType viewMode)  raises (SALOME::SALOME_Exception);
+     Plot3DParameters     getPlot3DParameters(in long presId);
+     void                 updatePlot3D (in long presId, in Plot3DParameters params)         raises (SALOME::SALOME_Exception);
+     ...
+   }
+
+* Method ``makePlot3D`` takes as parameters:
+
+  #. ``Plot3DParameters`` structure.
+  #. ``ViewModeType`` enumerator which can have the following values:
+
+    * **VIEW_MODE_OVERLAP**: a newly created presentation is published in the *Object browser* and displayed in the active 3D Viewer.
+      All previously created presentations are deleted.
+    * **VIEW_MODE_REPLACE**: a newly created presentation is added into *Object browser* and displayed in the active 3D Viewer.
+      All previously created presentations are kept as is.
+    * **VIEW_MODE_NEW_LAYOUT**: a newly created presentation is added into *Object browser*. New 3D Viewer (layout) is created and
+      presentation is displayed in this new 3D Viewer. All previously created presentations are kept as is.
+    * **VIEW_MODE_SPLIT_VIEW**: a newly created presentation is added into *Object browser*. An active 3D Viewer (layout) is split,
+      and a new 3D Viewer is added to the layout. Newly created presentation is displayed in this new 3D Viewer;
+      all previously created presentations are kept as is.
+
+    This method returns ID of a newly created presentation.
+
+* Method ``getPlot3DParameters`` takes single parameter which is an ID of presentation; it returns ``Plot3DParameters`` structure.
+
+* Method ``updatePlot3D`` takes as parameters a presentation ID and ``Plot3DParameters`` structure.
diff --git a/doc/dev/sphinx/fields_arch_med_presentation_manager_impl.rst b/doc/dev/sphinx/fields_arch_med_presentation_manager_impl.rst
new file mode 100644 (file)
index 0000000..8079d48
--- /dev/null
@@ -0,0 +1,28 @@
+:orphan:
+
+.. _fields_arch_med_presentation_manager_impl_page:
+
+**********************************************
+MEDCALC::MEDPresentationManager implementation
+**********************************************
+
+.. literalinclude:: ../../../src/MEDCalc/cmp/MEDPresentationManager_i.cxx
+   :language: cpp
+   :start-after: begin of makePlot3D
+   :end-before: end of makePlot3D
+
+Method ``_makePresentation`` is a private template method of ``MEDPresentationManager_i`` class; it calls the constructor of particular presentation class, in this case ``MEDPresentationPlot3D::MEDPresentationPlot3D``.
+
+.. literalinclude:: ../../../src/MEDCalc/cmp/MEDPresentationManager_i.cxx
+   :language: cpp
+   :start-after: begin of getPlot3DParameters
+   :end-before: end of getPlot3DParameters
+
+Method ``_getParameters`` is a private template method of ``MEDPresentationManager_i`` class; it calls ``getParameters`` method of particular presentation instance, in this case ``MEDPresentationPlot3D::getParameters``.
+
+.. literalinclude:: ../../../src/MEDCalc/cmp/MEDPresentationManager_i.cxx
+   :language: cpp
+   :start-after: begin of updatePlot3D
+   :end-before: end of updatePlot3D
+
+Method ``_updatePresentation`` is a private template method of ``MEDPresentationManager_i`` class, it calls ``updatePipeline`` of particular presentation instance, in this case ``MEDPresentationPlot3D::updatePipeline``.
diff --git a/doc/dev/sphinx/fields_arch_med_presentation_plot3d.rst b/doc/dev/sphinx/fields_arch_med_presentation_plot3d.rst
new file mode 100644 (file)
index 0000000..09b9402
--- /dev/null
@@ -0,0 +1,10 @@
+:orphan:
+
+.. _fields_arch_med_presentation_plot3d_page:
+
+*********************
+MEDPresentationPlot3D
+*********************
+
+.. literalinclude:: ../../../src/MEDCalc/cmp/MEDPresentationPlot3D.cxx
+   :language: cpp
diff --git a/doc/dev/sphinx/fields_arch_med_presentation_py.rst b/doc/dev/sphinx/fields_arch_med_presentation_py.rst
new file mode 100644 (file)
index 0000000..88d66f6
--- /dev/null
@@ -0,0 +1,26 @@
+:orphan:
+
+.. _fields_arch_med_presentation_py_page:
+
+******************************
+``medpresentation`` Python API
+******************************
+
+.. literalinclude:: ../../../src/MEDCalc/tui/medpresentation.py
+   :language: python
+   :start-after: begin of MakePlot3D
+   :end-before: end of MakePlot3D
+
+.. literalinclude:: ../../../src/MEDCalc/tui/medpresentation.py
+   :language: python
+   :start-after: begin of GetPlot3DParameters
+   :end-before: end of GetPlot3DParameters
+
+Method ``__GetGENERICParameters`` is an internal helper method that calls ``getPlot3DParameters`` function of ``MEDPresentationManager`` CORBA service.
+
+.. literalinclude:: ../../../src/MEDCalc/tui/medpresentation.py
+   :language: python
+   :start-after: begin of UpdatePlot3D
+   :end-before: end of UpdatePlot3D
+
+Method ``__GetGENERICParameters`` is an internal helper method that calls ``updatePlot3D`` function of ``MEDPresentationManager`` CORBA service.
diff --git a/doc/dev/sphinx/fields_arch_medcalc_py.rst b/doc/dev/sphinx/fields_arch_medcalc_py.rst
new file mode 100644 (file)
index 0000000..829feab
--- /dev/null
@@ -0,0 +1,15 @@
+.. _fields_arch_medcacl_py_page:
+
+*****************************
+FIELDS medcalc python package
+*****************************
+
+The ``medcalc`` python package contains several modules, but only three of them are used directly to manage FIELDS presentations:
+
+* ``medcorba.py`` - performs initialization of the :ref:`FIELDS module's CORBA stuff<fields_arch_corba_services_page>`.
+
+* ``medevents.py`` - implements mechanism of notifications from FIELDS ``medcalc`` python package to :ref:`FIELDS GUI<fields_arch_gui_page>`.
+  This mechanism allows synchronizing changes made in Python, with the GUI; for example, when a parameter is changed via Python command, 
+  the corresponding GUI item is updated in the *Presenation Parameters* panel.
+
+* ``medpresentation.py`` - provides functionality for creating and updating FIELDS presentations.
diff --git a/doc/dev/sphinx/fields_arch_medwidget_helper_plot3d.rst b/doc/dev/sphinx/fields_arch_medwidget_helper_plot3d.rst
new file mode 100644 (file)
index 0000000..50c787f
--- /dev/null
@@ -0,0 +1,10 @@
+:orphan:
+
+.. _fields_arch_medwidget_helper_plot3d_page:
+
+*********************
+MEDWidgetHelperPlot3D
+*********************
+
+.. literalinclude:: ../../../src/MEDCalc/gui/MEDWidgetHelperPlot3D.cxx
+   :language: cpp
diff --git a/doc/dev/sphinx/fields_arch_plot3d_implementation_example.rst b/doc/dev/sphinx/fields_arch_plot3d_implementation_example.rst
new file mode 100644 (file)
index 0000000..4cce151
--- /dev/null
@@ -0,0 +1,79 @@
+.. _fields_arch_plot3d_implementation_example_page:
+
+*******************************************
+Implementation example: Plot3D presentation
+*******************************************
+
+This section describes how a FIELDS presentation is implemented using Plot3D presentation as an example.
+
+General description of Plot3D presentation
+------------------------------------------
+
+Plot3D is a presentation of scalar values of meshes lying on a cutting plane.
+The relief and coloring of the resulting presentation both correspond to the values applied to the cells of a mesh.
+
+In general this presentation can be built using the following sequence of the ParaVis filters:
+
+**MedReadear** -> **Slice** -> **Calculator** -> **WarpByScalar**
+
+* **MedReadear** is used to read a MED file.
+
+* **Slice** filter defines a cutting plane within the 3D mesh, on the basis of which the relief presentation is built. 
+  This plane is a 2D mesh with values (scalar or vector) applied to the cells of a plane. If initial mesh is a 2D mesh, then **Slice** filter is unnecessary.
+
+* **Calculator** filter converts vector values on cells to the scalar values. In case of scalar values **Calculator** filter is unnecessary.
+
+* Finally, **WarpByScalar** filter is applied to the 2D mesh with scalar values on cells to build colored relief presentation.
+
+Currently, only two parameters can be changed for this type of presentation, namely:
+
+* *Position of a cutting plane* allows selecting the position of the cutting plane within the bounding box of a mesh (ranging from 0 to 1). This it is a property of **Slice** filter.
+* *Cutting plane normal* allows specifying an orientation of the cut plane in 3D space. This is also a property of **Slice** filter. 
+
+All other parameters are inherited from the parent presentation class.
+
+GUI controls
+------------
+
+First step consists in implementing the corresponging GUI controls. This step includes the following actions:
+
+* Add needed controls to UI using Qt *Designer*
+
+  .. image:: images/image_ui_designer_prs_panel.png
+     :align: center
+
+* Implement C++ wrappings for newly created GUI controls and add corresponding signal-slot connections: see :ref:`code <fields_arch_widget_presentation_parameters_page>`.
+
+* Add new types of events into :ref:`PresentationEvent.hxx<fields_arch_presentation_event_page>` file:
+
+   .. code-block:: cpp
+
+      ... 
+      EVENT_VIEW_OBJECT_PLOT3D,
+      ...
+      EVENT_CHANGE_NORMAL,
+      EVENT_CHANGE_PLANE_POS,
+
+* Implement :ref:`MEDWidgetHelperPlot3D<fields_arch_medwidget_helper_plot3d_page>` class. This class sends events to ``PresentationController`` on each user action in the *Presentation Parameters*
+  panel and updates a content of the *Presentation Parameters* panel in case if changes in a presentation were made, via the ``medcalc`` Python API.
+
+* Modify ``PresentationController`` class. This class is used to add items into the *Presentations* menu and toolbar, and to translate GUI events into the ``medcalc`` Python API: see :ref:`code<fields_arch_presentation_controller_page>`.
+
+Extend ``MEDCALC::MEDPresentationManager``
+------------------------------------------
+
+Next step consists in extending of the ``MEDCALC::MEDPresentationManager`` CORBA service; it assumes the following actions:
+
+* :ref:`Extend<fields_arch_med_presentation_manager_page>` ``MEDPresentationManager`` IDL interface.
+
+* :ref:`Implement<fields_arch_med_presentation_manager_impl_page>` methods, declared in the IDL interface.
+
+Extend ``medcalc`` API
+----------------------
+
+Next step consists in :ref:`extending<fields_arch_med_presentation_py_page>` ``medcalc`` Python API, by adding functions to make and update Plot3D presentation and retrieve parameters of Plot3D presentations.
+
+Implement pipeline
+------------------
+
+Final step consists in building the pipeline, described above, in the frames of the ``MEDPresentationPlot3D`` :ref:`class<fields_arch_med_presentation_plot3d_page>`.
diff --git a/doc/dev/sphinx/fields_arch_presentation_controller.rst b/doc/dev/sphinx/fields_arch_presentation_controller.rst
new file mode 100644 (file)
index 0000000..b44467d
--- /dev/null
@@ -0,0 +1,34 @@
+:orphan:
+
+.. _fields_arch_presentation_controller_page:
+
+**********************
+PresentationController
+**********************
+
+Create Plot3D menu and toolbar items
+------------------------------------
+
+.. literalinclude:: ../../../src/MEDCalc/gui/PresentationController.cxx
+   :language: cpp
+   :start-after: begin of plot3d gui items 
+   :end-before: end of plot3d gui items
+
+.. literalinclude:: ../../../src/MEDCalc/gui/PresentationController.cxx
+   :language: cpp
+   :start-after: begin of onVisualizePlot3D
+   :end-before: end of onVisualizePlot3D
+
+Translate GUI events into ``medcalc`` Python API
+------------------------------------------------
+
+.. literalinclude:: ../../../src/MEDCalc/gui/PresentationController.cxx
+   :language: cpp
+   :start-after: begin of plot3d prs creation
+   :end-before: end of plot3d prs creation
+
+.. literalinclude:: ../../../src/MEDCalc/gui/PresentationController.cxx
+   :language: cpp
+   :start-after: begin of plot3d prs update
+   :end-before: end of plot3d prs update
+
diff --git a/doc/dev/sphinx/fields_arch_presentation_event.rst b/doc/dev/sphinx/fields_arch_presentation_event.rst
new file mode 100644 (file)
index 0000000..8983f18
--- /dev/null
@@ -0,0 +1,10 @@
+:orphan:
+
+.. _fields_arch_presentation_event_page:
+
+*********************
+PresentationEvent.hxx 
+*********************
+
+.. literalinclude:: ../../../src/MEDCalc/gui/PresentationEvent.hxx 
+   :language: cpp
diff --git a/doc/dev/sphinx/fields_arch_widget_presentation_parameters.rst b/doc/dev/sphinx/fields_arch_widget_presentation_parameters.rst
new file mode 100644 (file)
index 0000000..7148fdc
--- /dev/null
@@ -0,0 +1,41 @@
+:orphan:
+
+.. _fields_arch_widget_presentation_parameters_page:
+
+*****************************************************
+Plot3D presentation's parameters panel implementation
+*****************************************************
+
+Functions to access the cutting plane normal
+--------------------------------------------
+
+.. literalinclude:: ../../../src/MEDCalc/gui/dialogs/WidgetPresentationParameters.cxx
+   :language: cpp
+   :start-after: begin of setNormal
+   :end-before: end of setNormal
+
+.. literalinclude:: ../../../src/MEDCalc/gui/dialogs/WidgetPresentationParameters.cxx
+   :language: cpp
+   :start-after: begin of getNormal
+   :end-before: end of getNormal
+
+Functions to access the cutting plane position
+----------------------------------------------
+
+.. literalinclude:: ../../../src/MEDCalc/gui/dialogs/WidgetPresentationParameters.cxx
+   :language: cpp
+   :start-after: begin of setNormal
+   :end-before: end of setNormal
+
+.. literalinclude:: ../../../src/MEDCalc/gui/dialogs/WidgetPresentationParameters.cxx
+   :language: cpp
+   :start-after: begin of getNormal
+   :end-before: end of getNormal
+
+Signal-slot connections
+-----------------------
+
+.. literalinclude:: ../../../src/MEDCalc/gui/dialogs/WidgetPresentationParameters.cxx
+   :language: cpp
+   :start-after: begin of normal and plane connections
+   :end-before: end of normal and plane connections
diff --git a/doc/dev/sphinx/images/image_fields_arch.png b/doc/dev/sphinx/images/image_fields_arch.png
new file mode 100644 (file)
index 0000000..7a23a58
Binary files /dev/null and b/doc/dev/sphinx/images/image_fields_arch.png differ
diff --git a/doc/dev/sphinx/images/image_helpers_hierarchy.png b/doc/dev/sphinx/images/image_helpers_hierarchy.png
new file mode 100644 (file)
index 0000000..648e387
Binary files /dev/null and b/doc/dev/sphinx/images/image_helpers_hierarchy.png differ
diff --git a/doc/dev/sphinx/images/image_implementation_layer_hierarchy.png b/doc/dev/sphinx/images/image_implementation_layer_hierarchy.png
new file mode 100644 (file)
index 0000000..86e9445
Binary files /dev/null and b/doc/dev/sphinx/images/image_implementation_layer_hierarchy.png differ
diff --git a/doc/dev/sphinx/images/image_ui_designer_prs_panel.png b/doc/dev/sphinx/images/image_ui_designer_prs_panel.png
new file mode 100644 (file)
index 0000000..04316db
Binary files /dev/null and b/doc/dev/sphinx/images/image_ui_designer_prs_panel.png differ
index cd0d21bc845e355c2f7d8dead46cc195376badd3..560c8405fb31a9763462b7bf8ab94f8e3197c7db 100644 (file)
@@ -19,6 +19,13 @@ References
    medcalc-userguide-gui.rst
    medcalc-userguide-api.rst
 
+**Technical documentation** (**in english**):
+
+.. toctree::
+   :maxdepth: 1
+
+   fields_arch_introduction.rst
+
 **Technical documentation** (**in french**):
 
 .. toctree::
index ee99d38a94d1a10580716aaace67243e73383612..9088298182d21d7fc49e2850c240d5817de85086 100644 (file)
@@ -187,6 +187,7 @@ module MEDCALC
     boolean hideDataOutsideCustomRange;
   };
 
+  // sphinx doc: begin of plot3d params
   struct Plot3DParameters {
     long fieldHandlerId;
     ScalarBarRangeType scalarBarRange;
@@ -198,6 +199,7 @@ module MEDCALC
     DoubleArray planeNormal;
     double planePos;
   };
+  // sphinx doc: end of plot3d params
 
   struct StreamLinesParameters {
     long fieldHandlerId;
index e39c46c1b7ebe16f76b793276908599f471c61e2..3d300ff8c00ab4f8cb3a15d2903917b6e42ac5db 100644 (file)
@@ -193,11 +193,13 @@ MEDPresentationManager_i::makePointSprite(const MEDCALC::PointSpriteParameters&
   return _makePresentation<MEDPresentationPointSprite>(params, viewMode);
 }
 
+// sphinx doc: begin of makePlot3D
 MEDPresentation::TypeID
 MEDPresentationManager_i::makePlot3D(const MEDCALC::Plot3DParameters& params, const MEDCALC::ViewModeType viewMode)
 {
   return _makePresentation<MEDPresentationPlot3D>(params, viewMode);
 }
+// sphinx doc: end of makePlot3D
 
 MEDPresentation::TypeID
 MEDPresentationManager_i::makeStreamLines(const MEDCALC::StreamLinesParameters& params, const MEDCALC::ViewModeType viewMode)
@@ -266,6 +268,7 @@ MEDPresentationManager_i::getPointSpriteParameters(MEDPresentation::TypeID prese
   return tmp._retn();
 }
 
+// sphinx doc: begin of getPlot3DParameters
 MEDCALC::Plot3DParameters*
 MEDPresentationManager_i::getPlot3DParameters(MEDPresentation::TypeID presentationID)
 {
@@ -274,6 +277,7 @@ MEDPresentationManager_i::getPlot3DParameters(MEDPresentation::TypeID presentati
   MEDCALC::Plot3DParameters_var tmp(p);
   return tmp._retn();
 }
+// sphinx doc: end of getPlot3DParameters
 
 MEDCALC::StreamLinesParameters*
 MEDPresentationManager_i::getStreamLinesParameters(MEDPresentation::TypeID presentationID)
@@ -345,11 +349,13 @@ MEDPresentationManager_i::updatePointSprite(MEDPresentation::TypeID presentation
   return _updatePresentation<MEDPresentationPointSprite>(presentationID, params);
 }
 
+// sphinx doc: begin of updatePlot3D
 void
 MEDPresentationManager_i::updatePlot3D(MEDPresentation::TypeID presentationID, const MEDCALC::Plot3DParameters& params)
 {
   return _updatePresentation<MEDPresentationPlot3D>(presentationID, params);
 }
+// sphinx doc: end of updatePlot3D
 
 void
 MEDPresentationManager_i::updateStreamLines(MEDPresentation::TypeID presentationID, const MEDCALC::StreamLinesParameters& params)
index 6ed54700e2b17b743b88cbb64ae0dd252926cca3..93c5eef0c191c752a5adb6654b1f59368f789503 100644 (file)
@@ -238,6 +238,7 @@ PresentationController::createActions()
   _salomeModule->action(actionId)->setIconVisibleInMenu(true);
   _salomeModule->createMenu(actionId, presentationMenuId);
 
+  // sphinx doc: begin of plot3d gui items
   label   = tr("LAB_PRESENTATION_PLOT3D");
   tooltip = tr("TIP_PRESENTATION_PLOT3D");
   icon    = tr(_getIconName("ICO_PRESENTATION_PLOT3D").c_str());
@@ -246,6 +247,7 @@ PresentationController::createActions()
   _salomeModule->createTool(actionId, presentationToolbarId);
   _salomeModule->action(actionId)->setIconVisibleInMenu(true);
   _salomeModule->createMenu(actionId, presentationMenuId);
+  // sphinx doc: end of plot3d gui items
 
   label   = tr("LAB_PRESENTATION_STREAM_LINES");
   tooltip = tr("TIP_PRESENTATION_STREAM_LINES");
@@ -422,11 +424,13 @@ PresentationController::onVisualizePointSprite()
   this->visualize(PresentationEvent::EVENT_VIEW_OBJECT_POINT_SPRITE);
 }
 
+// sphinx doc: begin of onVisualizePlot3D
 void
 PresentationController::onVisualizePlot3D()
 {
   this->visualize(PresentationEvent::EVENT_VIEW_OBJECT_PLOT3D);
 }
+// sphinx doc: end of onVisualizePlot3D
 
 void
 PresentationController::onVisualizeStreamLines()
@@ -605,11 +609,13 @@ PresentationController::processPresentationEvent(const PresentationEvent* event)
               .arg(fieldHandler->id).arg(viewMode).arg(scalarBarRange).arg(colorMap);
       commands += QString("presentation_id");
   }
+  // sphinx doc: begin of plot3d prs creation
   else if ( event->eventtype == PresentationEvent::EVENT_VIEW_OBJECT_PLOT3D ) {
       commands += QString("presentation_id = medcalc.MakePlot3D(accessField(%1), viewMode=%2, scalarBarRange=%3, colorMap=%4)")
               .arg(fieldHandler->id).arg(viewMode).arg(scalarBarRange).arg(colorMap);
       commands += QString("presentation_id");
   }
+  // sphinx doc: end of plot3d prs creation
   else if ( event->eventtype == PresentationEvent::EVENT_VIEW_OBJECT_STREAM_LINES ) {
       commands += QString("presentation_id = medcalc.MakeStreamLines(accessField(%1), viewMode=%2, scalarBarRange=%3, colorMap=%4)")
               .arg(fieldHandler->id).arg(viewMode).arg(scalarBarRange).arg(colorMap);
@@ -680,6 +686,7 @@ PresentationController::processPresentationEvent(const PresentationEvent* event)
       commands += QString("params.orientation = %1").arg(getSliceOrientationPython(event->anInteger));
       commands += QString("medcalc.UpdateSlices(%1, params)").arg(event->presentationId);
   }
+  // sphinx doc: begin of plot3d prs update
   else if ( event->eventtype == PresentationEvent::EVENT_CHANGE_PLANE_POS ) {
       std::string typ = getPresTypeFromWidgetHelper(event->presentationId);
       commands += QString("params = medcalc.GetPlot3DParameters(%2)").arg(event->presentationId);
@@ -692,6 +699,7 @@ PresentationController::processPresentationEvent(const PresentationEvent* event)
       commands += QString("params.planeNormal = [%1, %2, %3]").arg(event->aDoubleN[0]).arg(event->aDoubleN[1]).arg(event->aDoubleN[2]);
       commands += QString("medcalc.UpdatePlot3D(%1, params)").arg(event->presentationId);
   }
+  // sphinx doc: end of plot3d prs update
   else if ( event->eventtype == PresentationEvent::EVENT_CHANGE_CUT_POINT1 ) {
       std::string typ = getPresTypeFromWidgetHelper(event->presentationId);
       commands += QString("params = medcalc.GetCutSegmentParameters(%2)").arg(event->presentationId);
index 839e78174584d400eaf06b46a3bed62f398d7dd3..d7d3f8b5f004ac6b5124459217da51838f0d51a1 100644 (file)
@@ -66,12 +66,16 @@ WidgetPresentationParameters::WidgetPresentationParameters(QWidget* parent)
                      this,                     SLOT(onSpinboxScaleFactorChanged()));
   QObject::connect(_ui.checkBoxHideDataOutsideCR, SIGNAL(stateChanged(int)),
                      this,                        SLOT(onCheckboxHideDataOutsideCustomRangeChanged(int)));
+  // sphinx doc: begin of normal and plane connections
   QObject::connect(_ui.spinNormalX,            SIGNAL(editingFinished()),
                      this,                     SLOT(onSpinNormalEditingFinished()) );
   QObject::connect(_ui.spinNormalY,            SIGNAL(editingFinished()),
                      this,                     SLOT(onSpinNormalEditingFinished()) );
   QObject::connect(_ui.spinNormalZ,            SIGNAL(editingFinished()),
                      this,                     SLOT(onSpinNormalEditingFinished()) );
+  QObject::connect(_ui.spinPlanePos,           SIGNAL(editingFinished()),
+                     this,                     SLOT(onSpinPlanePosEditingFinished()) );
+  // sphinx doc: end of normal and plane connections
   QObject::connect(_ui.spinPoint1_X,           SIGNAL(editingFinished()),
                      this,                     SLOT(onSpinCutPoint1EditingFinished()) );
   QObject::connect(_ui.spinPoint1_Y,           SIGNAL(editingFinished()),
@@ -84,8 +88,6 @@ WidgetPresentationParameters::WidgetPresentationParameters(QWidget* parent)
                      this,                     SLOT(onSpinCutPoint2EditingFinished()) );
   QObject::connect(_ui.spinPoint2_Z,           SIGNAL(editingFinished()),
                      this,                     SLOT(onSpinCutPoint2EditingFinished()) );
-  QObject::connect(_ui.spinPlanePos,           SIGNAL(editingFinished()),
-                     this,                     SLOT(onSpinPlanePosEditingFinished()) );
 
    // Disable Custom Range Spin boxes
   _ui.spinCustomRangeMax->setEnabled(false);
@@ -106,11 +108,13 @@ WidgetPresentationParameters::WidgetPresentationParameters(QWidget* parent)
   _ui.spinPlanePos->setRange(0.0, 1.0);
 }
 
+// for sphinx doc: start of onComboCompoIndexChanged
 void
 WidgetPresentationParameters::onComboCompoIndexChanged(int idx)
 {
   if (!_blockSig) emit comboCompoIndexChanged(idx);
 }
+// for sphinx doc: end of onComboCompoIndexChanged
 
 void
 WidgetPresentationParameters::onComboOrientIndexChanged(int idx)
@@ -751,13 +755,16 @@ void WidgetPresentationParameters::setScaleFactor(double scale) {
   _blockSig = false;
 }
 
+// sphinx doc: begin of getNormal
 void WidgetPresentationParameters::getNormal(double* arr) const
 {
   arr[0] = _ui.spinNormalX->value();
   arr[1] = _ui.spinNormalY->value();
   arr[2] = _ui.spinNormalZ->value();
 }
+// sphinx doc: end of getNormal
 
+// sphinx doc: begin of setNormal
 void
 WidgetPresentationParameters::setNormal(const double normX, const double normY, const double normZ)
 {
@@ -771,6 +778,7 @@ WidgetPresentationParameters::setNormal(const double normX, const double normY,
   _ui.spinNormalZ->setValue(normZ);
   _blockSig = false;
 }
+// sphinx doc: end of setNormal
 
 void WidgetPresentationParameters::getCutPoint1(double* arr) const
 {
@@ -814,11 +822,14 @@ WidgetPresentationParameters::setCutPoint2(const double x, const double y, const
   _blockSig = false;
 }
 
+// sphinx doc: begin of getPlanePosition
 double WidgetPresentationParameters::getPlanePosition() const
 {
   return _ui.spinPlanePos->value();
 }
+// sphinx doc: begin of getPlanePosition
 
+// sphinx doc: begin of setPlanePosition
 void WidgetPresentationParameters::setPlanePosition(double pos)
 {
   _blockSig = true;
@@ -827,6 +838,7 @@ void WidgetPresentationParameters::setPlanePosition(double pos)
   _ui.spinPlanePos->setValue(pos);
   _blockSig = false;
 }
+// sphinx doc: begin of setPlanePosition
 
 bool WidgetPresentationParameters::getScalarBarVisibility() const {
   return _ui.checkBoxShowScalarBar->isChecked();
index 487f7f7b061ecf01edde5ff257ee4ef44965e6a5..e423433ade18a38bc65c4142bb984bbfeaabafbd 100644 (file)
@@ -190,7 +190,7 @@ def MakePointSprite(proxy,
     notifyGui_error("An error occurred while creating the point sprite:\n" + e.details.text)
     raise Exception(e.details.text)
 
-
+# sphinx doc: begin of MakePlot3D
 def MakePlot3D(proxy,
               viewMode=MEDCALC.VIEW_MODE_DEFAULT,
               scalarBarRange=MEDCALC.SCALAR_BAR_RANGE_DEFAULT,
@@ -214,7 +214,7 @@ def MakePlot3D(proxy,
   except SALOME.SALOME_Exception as e:
     notifyGui_error("An error occurred while creating the Plot3D:\n" + e.details.text)
     raise Exception(e.details.text)
-
+# sphinx doc: end of MakePlot3D
 
 def MakeStreamLines(proxy,
               viewMode=MEDCALC.VIEW_MODE_DEFAULT,
@@ -280,7 +280,9 @@ GetSlicesParameters = lambda pres_id: __GetGENERICParameters("Slices", pres_id)
 GetPointSpriteParameters = lambda pres_id: __GetGENERICParameters("PointSprite", pres_id)
 GetVectorFieldParameters = lambda pres_id: __GetGENERICParameters("VectorField", pres_id)
 GetDeflectionShapeParameters = lambda pres_id: __GetGENERICParameters("DeflectionShape", pres_id)
+# sphinx doc: begin of GetPlot3DParameters
 GetPlot3DParameters = lambda pres_id: __GetGENERICParameters("Plot3D", pres_id)
+# sphinx doc: end of GetPlot3DParameters
 GetStreamLinesParameters = lambda pres_id: __GetGENERICParameters("StreamLines", pres_id)
 GetCutSegmentParameters = lambda pres_id: __GetGENERICParameters("CutSegment", pres_id)
 
@@ -300,7 +302,9 @@ UpdateSlices = lambda pres_id, params: __UpdateGENERIC("Slices", pres_id, params
 UpdateVectorField = lambda pres_id, params: __UpdateGENERIC("VectorField", pres_id, params)
 UpdatePointSprite = lambda pres_id, params: __UpdateGENERIC("PointSprite", pres_id, params)
 UpdateDeflectionShape = lambda pres_id, params: __UpdateGENERIC("DeflectionShape", pres_id, params)
+# sphinx doc: begin of UpdatePlot3D
 UpdatePlot3D = lambda pres_id, params: __UpdateGENERIC("Plot3D", pres_id, params)
+# sphinx doc: end of UpdatePlot3D
 UpdateStreamLines = lambda pres_id, params: __UpdateGENERIC("StreamLines", pres_id, params)
 UpdateCutSegment = lambda pres_id, params: __UpdateGENERIC("CutSegment", pres_id, params)