From 3637a467388397b03c104e17f12474cdfb02e1d9 Mon Sep 17 00:00:00 2001 From: mkr Date: Tue, 9 Dec 2008 12:26:44 +0000 Subject: [PATCH] Access to pqMainWindowCore::compareView() from PVGUI_ProcessModuleHelper. --- src/PVGUI/PVGUI_Module.cxx | 12 ++++++++++++ src/PVGUI/PVGUI_Module.h | 6 ++++++ src/PVGUI/PVGUI_ProcessModuleHelper.cxx | 13 ++++++++----- 3 files changed, 26 insertions(+), 5 deletions(-) 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; } -- 2.39.2