--- /dev/null
+.. _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.
--- /dev/null
+.. _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.
--- /dev/null
+.. _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.
+
+
+
--- /dev/null
+.. _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
--- /dev/null
+: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.
--- /dev/null
+: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``.
--- /dev/null
+:orphan:
+
+.. _fields_arch_med_presentation_plot3d_page:
+
+*********************
+MEDPresentationPlot3D
+*********************
+
+.. literalinclude:: ../../../src/MEDCalc/cmp/MEDPresentationPlot3D.cxx
+ :language: cpp
--- /dev/null
+: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.
--- /dev/null
+.. _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.
--- /dev/null
+:orphan:
+
+.. _fields_arch_medwidget_helper_plot3d_page:
+
+*********************
+MEDWidgetHelperPlot3D
+*********************
+
+.. literalinclude:: ../../../src/MEDCalc/gui/MEDWidgetHelperPlot3D.cxx
+ :language: cpp
--- /dev/null
+.. _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>`.
--- /dev/null
+: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
+
--- /dev/null
+:orphan:
+
+.. _fields_arch_presentation_event_page:
+
+*********************
+PresentationEvent.hxx
+*********************
+
+.. literalinclude:: ../../../src/MEDCalc/gui/PresentationEvent.hxx
+ :language: cpp
--- /dev/null
+: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
medcalc-userguide-gui.rst
medcalc-userguide-api.rst
+**Technical documentation** (**in english**):
+
+.. toctree::
+ :maxdepth: 1
+
+ fields_arch_introduction.rst
+
**Technical documentation** (**in french**):
.. toctree::
boolean hideDataOutsideCustomRange;
};
+ // sphinx doc: begin of plot3d params
struct Plot3DParameters {
long fieldHandlerId;
ScalarBarRangeType scalarBarRange;
DoubleArray planeNormal;
double planePos;
};
+ // sphinx doc: end of plot3d params
struct StreamLinesParameters {
long fieldHandlerId;
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)
return tmp._retn();
}
+// sphinx doc: begin of getPlot3DParameters
MEDCALC::Plot3DParameters*
MEDPresentationManager_i::getPlot3DParameters(MEDPresentation::TypeID presentationID)
{
MEDCALC::Plot3DParameters_var tmp(p);
return tmp._retn();
}
+// sphinx doc: end of getPlot3DParameters
MEDCALC::StreamLinesParameters*
MEDPresentationManager_i::getStreamLinesParameters(MEDPresentation::TypeID presentationID)
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)
_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());
_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");
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()
.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);
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);
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);
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()),
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);
_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)
_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)
{
_ui.spinNormalZ->setValue(normZ);
_blockSig = false;
}
+// sphinx doc: end of setNormal
void WidgetPresentationParameters::getCutPoint1(double* arr) 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;
_ui.spinPlanePos->setValue(pos);
_blockSig = false;
}
+// sphinx doc: begin of setPlanePosition
bool WidgetPresentationParameters::getScalarBarVisibility() const {
return _ui.checkBoxShowScalarBar->isChecked();
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,
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,
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)
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)