From: mkr Date: Tue, 9 Dec 2008 12:26:44 +0000 (+0000) Subject: Access to pqMainWindowCore::compareView() from PVGUI_ProcessModuleHelper. X-Git-Tag: V2008a~9 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3637a467388397b03c104e17f12474cdfb02e1d9;p=modules%2Fparavis.git Access to pqMainWindowCore::compareView() from PVGUI_ProcessModuleHelper. --- diff --git a/src/PVGUI/PVGUI_Module.cxx b/src/PVGUI/PVGUI_Module.cxx index 28cc1c4a..9551b0b7 100644 --- a/src/PVGUI/PVGUI_Module.cxx +++ b/src/PVGUI/PVGUI_Module.cxx @@ -721,6 +721,18 @@ bool PVGUI_Module::deactivateModule( SUIT_Study* study ) return LightApp_Module::deactivateModule( study ); } +/*! + \brief Compares the contents of the window with the given reference image, + returns true if they "match" within some tolerance. +*/ +bool PVGUI_Module::compareView( const QString& ReferenceImage, double Threshold, + ostream& Output, const QString& TempDirectory ) +{ + if ( Implementation ) + return Implementation->Core.compareView( ReferenceImage, Threshold, Output, TempDirectory ); + return false; +} + /*! \fn CAM_Module* createModule(); \brief Export module instance (factory function). diff --git a/src/PVGUI/PVGUI_Module.h b/src/PVGUI/PVGUI_Module.h index 4af2b001..5afdb556 100644 --- a/src/PVGUI/PVGUI_Module.h +++ b/src/PVGUI/PVGUI_Module.h @@ -35,6 +35,8 @@ #include +#include + class QMenu; class QDockWidget; class LightApp_Selection; @@ -174,6 +176,10 @@ public: virtual bool eventFilter( QObject*, QEvent* ); + //! Compares the contents of the window with the given reference image, returns true if they "match" within some tolerance + bool compareView( const QString& ReferenceImage, double Threshold, + ostream& Output, const QString& TempDirectory ); + protected: //virtual CAM_DataModel* createDataModel(); diff --git a/src/PVGUI/PVGUI_ProcessModuleHelper.cxx b/src/PVGUI/PVGUI_ProcessModuleHelper.cxx index 213bdab6..7079c52a 100644 --- a/src/PVGUI/PVGUI_ProcessModuleHelper.cxx +++ b/src/PVGUI/PVGUI_ProcessModuleHelper.cxx @@ -4,9 +4,14 @@ // +#include "PVGUI_Module.h" #include "PVGUI_ProcessModuleHelper.h" #include "PVGUI_OutputWindowAdapter.h" +#include +#include +#include + #include #include #include @@ -49,11 +54,9 @@ void PVGUI_ProcessModuleHelper::PrintSelf(ostream& os, vtkIndent indent) 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; }