X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCalc%2Fgui%2FPresentationController.hxx;h=7faa1a4dc2a922910bb9325691a37d0bc94aa04e;hb=b42caeb1c5ea15a33c4085bd2cd2bf3e61f879eb;hp=fbd90737fb41f54ad8d15fde89d907d684c7877a;hpb=ee8af898695aaeca2adc5b1cd68bb7b6d1f4d1e9;p=modules%2Fmed.git diff --git a/src/MEDCalc/gui/PresentationController.hxx b/src/MEDCalc/gui/PresentationController.hxx index fbd90737f..7faa1a4dc 100644 --- a/src/MEDCalc/gui/PresentationController.hxx +++ b/src/MEDCalc/gui/PresentationController.hxx @@ -20,13 +20,24 @@ #ifndef PRESENTATION_CONTROLLER_HXX #define PRESENTATION_CONTROLLER_HXX -#include +#include #include "MEDCALCGUI.hxx" +#include "MEDEventListener_i.hxx" #include #include CORBA_SERVER_HEADER(MEDPresentationManager) +#include CORBA_CLIENT_HEADER(MEDDataManager) + +#include "XmedDataModel.hxx" +#include +#include "WidgetPresentationParameters.hxx" + +#include "PresentationEvent.hxx" class MEDModule; +class QDockWidget; +class MEDWidgetHelper; +class XmedConsoleDriver; class MEDCALCGUI_EXPORT PresentationController : public QObject { Q_OBJECT @@ -37,11 +48,67 @@ public: void createActions(); - MEDCALC::MEDPresentationViewMode getSelectedViewMode(); + MEDCALC::ViewModeType getSelectedViewMode() const; + MEDCALC::ColorMapType getSelectedColorMap() const; + MEDCALC::ScalarBarRangeType getSelectedScalarBarRange() const; + + void showDockWidgets(bool isVisible); + + std::string getPresTypeFromWidgetHelper(int presId) const; + + void setConsoleDriver(XmedConsoleDriver* driver) { _consoleDriver = driver; }; + +signals: + void presentationSignal(const PresentationEvent*); + +protected slots: + void onVisualizeMeshView(); + void onVisualizeScalarMap(); + void onVisualizeContour(); + void onVisualizeVectorField(); + void onVisualizeSlices(); + void onVisualizeDeflectionShape(); + void onVisualizePointSprite(); + + void onDeletePresentation(); + void onParavisDump(); + + void onPresentationSelected(int presId, const QString& presType, const QString& presName); + + void processWorkspaceEvent(const MEDCALC::MedEvent*); + void processPresentationEvent(const PresentationEvent*); + +private: + void visualize(PresentationEvent::EventType); + void updateTreeViewWithNewPresentation(long dataId, long presentationId); + void updateTreeViewForPresentationRemoval(long presId); + std::string _getIconName(const std::string&); + MEDWidgetHelper * findOrCreateWidgetHelper(MEDCALC::MEDPresentationManager_ptr presManager, + int presId, const std::string& type, const std::string& name); + + QString getViewModePython() const; + QString getColorMapPython() const; + QString getScalarBarRangePython() const; + QString getMeshModePython(const int mode) const; + QString getSliceOrientationPython(const int orient) const; + + void _dealWithReplaceMode(); private: MEDModule* _salomeModule; + XmedConsoleDriver* _consoleDriver; // the same as in WorkspaceController + SALOME_AppStudyEditor* _studyEditor; // borrowed to MEDModule + + QDockWidget *_dockWidget; + WidgetPresentationParameters* _widgetPresentationParameters; + + // GUI needs to talk directly to the pres manager to activate a view, get some params, print low level py dump, etc ...: + static MEDCALC::MEDPresentationManager_ptr _presManager; + + // Key: presentation ID, value MEDPresentationHelper * + std::map _presHelperMap; + MEDWidgetHelper * _currentWidgetHelper; }; #endif /* PRESENTATION_CONTROLLER_HXX */