X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPVGUI%2FPVGUI_ProcessModuleHelper.cxx;h=642c46acfed130222723bbf5ae53dfa062a65872;hb=0f9c3a16952f077e2cd32193d6ce940e0af45cbf;hp=cf03dc254b8369a189585686917d0b43d7ab9598;hpb=131810238c451ca45f00ed844144c2b46272df2b;p=modules%2Fparavis.git diff --git a/src/PVGUI/PVGUI_ProcessModuleHelper.cxx b/src/PVGUI/PVGUI_ProcessModuleHelper.cxx index cf03dc25..642c46ac 100644 --- a/src/PVGUI/PVGUI_ProcessModuleHelper.cxx +++ b/src/PVGUI/PVGUI_ProcessModuleHelper.cxx @@ -4,17 +4,38 @@ // +#include "PVGUI_Module.h" #include "PVGUI_ProcessModuleHelper.h" +#include "PVGUI_OutputWindowAdapter.h" + +#include +#include +#include -//#include #include -//#include +#include +#include vtkStandardNewMacro(PVGUI_ProcessModuleHelper); vtkCxxRevisionMacro(PVGUI_ProcessModuleHelper, "$Revision$"); +class PVGUI_ProcessModuleHelper::pqImplementation +{ +public: + pqImplementation() : + OutputWindowAdapter(vtkSmartPointer::New()) + {} + + ~pqImplementation() + {} + + //! Displays VTK debug output in SALOME log window + vtkSmartPointer OutputWindowAdapter; +}; + //----------------------------------------------------------------------------- PVGUI_ProcessModuleHelper::PVGUI_ProcessModuleHelper() + : Implementation(new pqImplementation()) { } @@ -30,67 +51,80 @@ void PVGUI_ProcessModuleHelper::PrintSelf(ostream& os, vtkIndent indent) } //----------------------------------------------------------------------------- +/*! + \brief Used by ParaView testing capabilities, not usable in SALOME. + */ bool PVGUI_ProcessModuleHelper::compareView(const QString& ReferenceImage, double Threshold, ostream& Output, const QString& TempDirectory) { - // TODO: to be implemented... - //if(MainWindow* const main_window = qobject_cast(this->GetMainWindow())) - //{ - // return main_window->compareView(ReferenceImage, Threshold, Output, TempDirectory); - //} + if ( CAM_Application* anApp = dynamic_cast( SUIT_Session::session()->activeApplication() ) ) + if ( PVGUI_Module* aPVM = dynamic_cast( anApp->module("ParaVis") ) ) + return aPVM->compareView( ReferenceImage, Threshold, Output, TempDirectory ); return false; } //----------------------------------------------------------------------------- +/*! + \brief Reimplemented to suppress default ParaView client behavior. Does nothing. +*/ void PVGUI_ProcessModuleHelper::showOutputWindow() { // Do nothing here } //----------------------------------------------------------------------------- +/*! + \brief Reimplemented to suppress default ParaView client behavior. Does nothing. +*/ void PVGUI_ProcessModuleHelper::showWindow() { } //----------------------------------------------------------------------------- +/*! + \brief Reimplemented to suppress default ParaView client behavior. Does nothing. +*/ void PVGUI_ProcessModuleHelper::hideWindow() { } //----------------------------------------------------------------------------- +/*! + \brief Calls the base implementation and redirects ParaView output to PVGUI_OutputWindowAdapter instance. + \sa PVGUI_OutputWindowAdapter +*/ int PVGUI_ProcessModuleHelper::InitializeApplication(int argc, char** argv) { if ( pqProcessModuleGUIHelper::InitializeApplication( argc, argv ) ){ - // TODO: Redirect VTK debug output to SALOME GUI message console ... - /*this->Implementation->OutputWindow = new pqOutputWindow(0); - this->Implementation->OutputWindow->setAttribute(Qt::WA_QuitOnClose, false); - this->Implementation->OutputWindow->connect(this->Implementation->OutputWindowAdapter, - SIGNAL(displayText(const QString&)), SLOT(onDisplayText(const QString&))); - this->Implementation->OutputWindow->connect(this->Implementation->OutputWindowAdapter, - SIGNAL(displayErrorText(const QString&)), SLOT(onDisplayErrorText(const QString&))); - this->Implementation->OutputWindow->connect(this->Implementation->OutputWindowAdapter, - SIGNAL(displayWarningText(const QString&)), SLOT(onDisplayWarningText(const QString&))); - this->Implementation->OutputWindow->connect(this->Implementation->OutputWindowAdapter, - SIGNAL(displayGenericWarningText(const QString&)), SLOT(onDisplayGenericWarningText(const QString&))); - vtkOutputWindow::SetInstance(Implementation->OutputWindowAdapter);*/ + // Redirect VTK debug output to SALOME GUI message console + vtkOutputWindow::SetInstance(Implementation->OutputWindowAdapter); } return 1; } //----------------------------------------------------------------------------- +/*! + \brief Reimplemented to suppress default ParaView client behavior and not to run Qt event loop. Does nothing. +*/ int PVGUI_ProcessModuleHelper::appExec() { return 0; } +/*! + \brief Reimplemented to suppress default ParaView client behavior and not to exit after the client initalization. Does nothing. +*/ //----------------------------------------------------------------------------- int PVGUI_ProcessModuleHelper::postAppExec() { return 0; } +/*! + \brief Reimplemented to suppress default ParaView client behavior. Does nothing. +*/ //----------------------------------------------------------------------------- QWidget* PVGUI_ProcessModuleHelper::CreateMainWindow() { @@ -98,6 +132,9 @@ QWidget* PVGUI_ProcessModuleHelper::CreateMainWindow() } //----------------------------------------------------------------------------- +/*! + \brief Reimplemented to suppress default ParaView client behavior. Does nothing. +*/ void PVGUI_ProcessModuleHelper::ExitApplication() { // Cannot exit here, so do nothing