# List of targets in this project we want to make visible to the rest of the world.
# They all have to be INSTALL'd with the option "EXPORT ${PROJECT_NAME}TargetGroup"
IF(NOT SALOME_LIGHT_ONLY)
- SET(_${PROJECT_NAME}_exposed_targets SalomeIDLPARAVIS PARAVIS)
+ SET(_${PROJECT_NAME}_exposed_targets SalomeIDLPARAVIS PARAVIS PVViewer)
# Add all targets to the build-tree export set
EXPORT(TARGETS ${_${PROJECT_NAME}_exposed_targets}
${Boost_INCLUDE_DIRS}
${QT_INCLUDES}
${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/view
)
+# Process viewer:
+ADD_SUBDIRECTORY(view)
+
# additional preprocessor / compiler flags
ADD_DEFINITIONS(${CAS_DEFINITIONS})
ADD_DEFINITIONS(${KERNEL_DEFINITIONS})
SET(_link_LIBRARIES
${OMNIORB_LIBRARIES}
${QT_LIBRARIES}
- ${CAS_KERNEL}
+# ${CAS_KERNEL}
${PYTHON_LIBS}
${KERNEL_LDFLAGS} ${KERNEL_SalomeDS} ${KERNEL_SALOMELocalTrace} ${KERNEL_SalomeIDLKernel}
${KERNEL_SalomeNS} ${KERNEL_SalomeLifeCycleCORBA} ${KERNEL_SalomeContainer} ${KERNEL_TOOLSDS}
${MED_SalomeIDLMED}
${_PARAVIEW_APP_COMPO_LIB}
SalomeIDLPARAVIS
+ PVViewer
)
# --- headers ---
# header files / to be processed by moc
SET(_moc_HEADERS
PVGUI_Module.h
- PVGUI_ViewManager.h
- PVGUI_ViewModel.h
- PVGUI_ViewWindow.h
+# PVGUI_ViewManager.h
+# PVGUI_ViewModel.h
+# PVGUI_ViewWindow.h
PVGUI_ParaViewSettingsPane.h
)
# header files / no moc processing
SET(_other_HEADERS
- PVGUI_OutputWindowAdapter.h
+# PVGUI_OutputWindowAdapter.h
PVGUI_Tools.h
- #PVGUI_MatplotlibMathTextUtilities.h
PV_I.h
PARAVIS_Gen_i.hh
PV_Events.h
PVGUI_Module.cxx
PVGUI_Module_actions.cxx
PVGUI_Module_widgets.cxx
- PVGUI_ViewManager.cxx
- PVGUI_ViewModel.cxx
- PVGUI_ViewWindow.cxx
- PVGUI_OutputWindowAdapter.cxx
+# PVGUI_ViewManager.cxx
+# PVGUI_ViewModel.cxx
+# PVGUI_ViewWindow.cxx
+# PVGUI_OutputWindowAdapter.cxx
PVGUI_Tools.cxx
PVGUI_ParaViewSettingsPane.cxx
#PVGUI_MatplotlibMathTextUtilities.cxx
//----------------------------------------------------------------------------
pqPVApplicationCore* PVGUI_Module::MyCoreApp = 0;
-//PVGUI_OutputWindowAdapter* PVGUI_Module::pqImplementation::OutputWindowAdapter = 0;
-//QPointer<pqHelpWindow> PVGUI_Module::pqImplementation::helpWindow = 0;
PVGUI_Module* ParavisModule = 0;
*/
PVGUI_Module::PVGUI_Module()
: SalomeApp_Module( "PARAVIS" ),
- // Implementation( 0 ),
mySelectionControlsTb( -1 ),
mySourcesMenuId( -1 ),
myFiltersMenuId( -1 ),
*/
void PVGUI_Module::initialize( CAM_Application* app )
{
- // [ABN]: patched in ParaView's sources.
- // PVGUI_MatplotlibMathTextUtilities::Disable();
-
SalomeApp_Module::initialize( app );
// Create ParaViS actions
// Remember current state of desktop toolbars
QList<QToolBar*> foreignToolbars = aDesktop->findChildren<QToolBar*>();
- // Simulate ParaView client main window
- //Implementation = new pqImplementation( aDesktop );
-
setupDockWidgets();
pvCreateActions();
// * adds support for standard paraview views.
pgm->addInterface(new pqStandardViewModules(pgm));
- //pgm->addInterface(new pqStandardSummaryPanelImplementation(pgm));
pgm->addInterface(new pqStandardPropertyWidgetInterface(pgm));
// Load plugins distributed with application.
connect(&pqActiveObjects::instance(),
SIGNAL(representationChanged(pqRepresentation*)),
this, SLOT(onRepresentationChanged(pqRepresentation*)));
-
-// MESSAGE("initialize(): Initializing PARAVIS's Python context ...");
-// execPythonCommand("import paraview.servermanager as sm; sm.fromGUI=True", false);
-// MESSAGE("initialize(): Initialized.");
}
bool PVGUI_Module::connectToExternalPVServer()
pqApplicationCore::instance()->settings()->sync();
int aAppsNb = SUIT_Session::session()->applications().size();
if (aAppsNb == 1) {
+ deleteTemporaryFiles();
MyCoreApp->deleteLater();
}
CAM_Module::onApplicationClosed(theApp);
}
+/*!
+ \brief Deletes temporary files created during import operation from VISU
+*/
+void PVGUI_Module::deleteTemporaryFiles()
+{
+ foreach(QString aFile, myTemporaryFiles) {
+ if (QFile::exists(aFile)) {
+ QFile::remove(aFile);
+ }
+ }
+}
+
+
/*!
\brief Called when study is closed.
//void onImportFromVisu(QString theEntry);
private:
+ void deleteTemporaryFiles();
+
//! Initialize ParaView if not yet done (once per session)
static bool pvInit();
virtual void onInitTimer();
private:
- class pqImplementation;
- pqImplementation* Implementation;
-
int mySelectionControlsTb;
int mySourcesMenuId;
int myFiltersMenuId;
vtkEventQtSlotConnect *VTKConnect;
- pqPythonScriptEditor* myTraceWindow;
+ static pqPVApplicationCore* MyCoreApp;
+ static PARAVIS_ORB::PARAVIS_Gen_var myEngine;
- int myStateCounter;
- static pqPVApplicationCore* MyCoreApp;
+ pqPythonScriptEditor* myTraceWindow;
- static PARAVIS_ORB::PARAVIS_Gen_var myEngine;
+ int myStateCounter;
//! Single shot timer used to connect to the PVServer, and start the trace.
QTimer * myInitTimer;
+++ /dev/null
-// Copyright (C) 2010-2014 CEA/DEN, EDF R&D
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include "PVGUI_OutputWindowAdapter.h"
-
-#include <vtkObjectFactory.h>
-
-#include <LightApp_Application.h>
-#include <LogWindow.h>
-#include <SUIT_Session.h>
-#include <SALOME_Event.h>
-
-vtkStandardNewMacro(PVGUI_OutputWindowAdapter);
-
-
-
-/*!
- * Put the message in the log window.
- */
-class TEvent: public SALOME_Event {
- LogWindow* myWindow;
- QString myMsg;
- QColor myColor;
- int myFlags;
- public:
- TEvent( LogWindow* theWindow, const QString theMsg, const QColor theColor, const int flags) :
- myWindow ( theWindow ),
- myMsg ( theMsg ),
- myColor ( theColor ),
- myFlags (flags)
- {}
-
- virtual void Execute() {
- if(myWindow)
- myWindow->putMessage(myMsg, myColor, myFlags);
- }
-};
-
-
-PVGUI_OutputWindowAdapter::PVGUI_OutputWindowAdapter() :
- TextCount(0),
- ErrorCount(0),
- WarningCount(0),
- GenericWarningCount(0)
-{
-}
-
-PVGUI_OutputWindowAdapter::~PVGUI_OutputWindowAdapter()
-{
-}
-
-const unsigned int PVGUI_OutputWindowAdapter::getTextCount()
-{
- return this->TextCount;
-}
-
-const unsigned int PVGUI_OutputWindowAdapter::getErrorCount()
-{
- return this->ErrorCount;
-}
-
-const unsigned int PVGUI_OutputWindowAdapter::getWarningCount()
-{
- return this->WarningCount;
-}
-
-const unsigned int PVGUI_OutputWindowAdapter::getGenericWarningCount()
-{
- return this->GenericWarningCount;
-}
-
-static LogWindow* getLogWindow()
-{
- LogWindow* wnd = 0;
- LightApp_Application* anApp = dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() );
- if ( anApp )
- wnd = anApp->logWindow();
- return wnd;
-}
-
-void PVGUI_OutputWindowAdapter::DisplayText(const char* text)
-{
- ++this->TextCount;
- ProcessVoidEvent( new TEvent( getLogWindow(), text, Qt::darkGreen, LogWindow::DisplayNormal ));
-}
-
-void PVGUI_OutputWindowAdapter::DisplayErrorText(const char* text)
-{
- ++this->ErrorCount;
- ProcessVoidEvent( new TEvent( getLogWindow(), text, Qt::darkRed, LogWindow::DisplayNormal ));
-}
-
-void PVGUI_OutputWindowAdapter::DisplayWarningText(const char* text)
-{
- ++this->WarningCount;
- ProcessVoidEvent( new TEvent( getLogWindow(), text, Qt::black, LogWindow::DisplayNormal ));
-}
-
-void PVGUI_OutputWindowAdapter::DisplayGenericWarningText(const char* text)
-{
- ++this->GenericWarningCount;
- ProcessVoidEvent( new TEvent( getLogWindow() , text, Qt::black, LogWindow::DisplayNormal ));
-}
+++ /dev/null
-// Copyright (C) 2010-2014 CEA/DEN, EDF R&D
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#ifndef _PVGUI_OutputWindowAdapter_h
-#define _PVGUI_OutputWindowAdapter_h
-
-#include <vtkOutputWindow.h>
-
-/*!
-vtkOutputWindow implementation that puts VTK output messages to SALOME log window.
-
-To use, create an instance of PVGUI_OutputWindowAdapter and pass it to the
-vtkOutputWindow::setInstance() static method.
-
-This class is based on pqOutputWindow ParaView class.
-*/
-class PVGUI_OutputWindowAdapter : public vtkOutputWindow
-{
-public:
- static PVGUI_OutputWindowAdapter *New();
- vtkTypeMacro(PVGUI_OutputWindowAdapter, vtkOutputWindow);
-
- //! Returns the number of text messages received
- const unsigned int getTextCount();
- //! Returns the number of error messages received
- const unsigned int getErrorCount();
- //! Returns the number of warning messages received
- const unsigned int getWarningCount();
- //! Returns the number of generic warning messages received
- const unsigned int getGenericWarningCount();
-
-private:
- PVGUI_OutputWindowAdapter();
- PVGUI_OutputWindowAdapter(const PVGUI_OutputWindowAdapter&);
- PVGUI_OutputWindowAdapter& operator=(const PVGUI_OutputWindowAdapter&);
- ~PVGUI_OutputWindowAdapter();
-
- unsigned int TextCount;
- unsigned int ErrorCount;
- unsigned int WarningCount;
- unsigned int GenericWarningCount;
-
- virtual void DisplayText(const char*);
- virtual void DisplayErrorText(const char*);
- virtual void DisplayWarningText(const char*);
- virtual void DisplayGenericWarningText(const char*);
-};
-
-#endif // !_PVGUI_OutputWindowAdapter_h
+++ /dev/null
-// Copyright (C) 2010-2014 CEA/DEN, EDF R&D
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#include <PVGUI_ViewManager.h>
-#include <PVGUI_ViewModel.h>
-#include <PVGUI_ViewWindow.h>
-#include <pqApplicationCore.h>
-#include <pqTabbedMultiViewWidget.h>
-
-/*!
- Constructor
-*/
-PVGUI_ViewManager::PVGUI_ViewManager( SUIT_Study* study, SUIT_Desktop* desk )
-: SUIT_ViewManager( study, desk, new PVGUI_Viewer() )
-{
- setTitle( tr( "PARAVIEW_VIEW_TITLE" ) );
-}
-
-/*!
- Destructor
-*/
-PVGUI_ViewManager::~PVGUI_ViewManager()
-{
-}
-
-/*!
- \brief Returns the ParaView multi-view manager for the active view window
-*/
-pqTabbedMultiViewWidget* PVGUI_ViewManager::getMultiViewManager()
-{
- return qobject_cast<pqTabbedMultiViewWidget*>(pqApplicationCore::instance()->manager("MULTIVIEW_WIDGET"));
-}
+++ /dev/null
-// Copyright (C) 2010-2014 CEA/DEN, EDF R&D
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#ifndef PVGUI_VIEWMANAGER_H
-#define PVGUI_VIEWMANAGER_H
-
-#include <SUIT_ViewManager.h>
-
-class SUIT_Desktop;
-class SUIT_Study;
-class pqTabbedMultiViewWidget;
-
-class PVGUI_ViewManager : public SUIT_ViewManager
-{
- Q_OBJECT
-
-public:
- PVGUI_ViewManager( SUIT_Study*, SUIT_Desktop* );
- ~PVGUI_ViewManager();
-
- pqTabbedMultiViewWidget* getMultiViewManager();
-};
-
-#endif
+++ /dev/null
-// Copyright (C) 2010-2014 CEA/DEN, EDF R&D
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include "PVGUI_ViewModel.h"
-#include "PVGUI_ViewWindow.h"
-
-/*!
- Constructor
-*/
-PVGUI_Viewer::PVGUI_Viewer()
-:SUIT_ViewModel()
-{
-}
-
-/*!
- Destructor
-*/
-PVGUI_Viewer::~PVGUI_Viewer()
-{
-}
-
-/*!
- Create new instance of view window on desktop \a theDesktop.
- \retval SUIT_ViewWindow* - created view window pointer.
-*/
-SUIT_ViewWindow* PVGUI_Viewer::createView(SUIT_Desktop* theDesktop)
-{
- PVGUI_ViewWindow* aPVView = new PVGUI_ViewWindow(theDesktop, this);
- return aPVView;
-}
+++ /dev/null
-// Copyright (C) 2010-2014 CEA/DEN, EDF R&D
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-#if !defined(_PVGUI_VIEWMODEL_H)
-#define _PVGUI_VIEWMODEL_H
-
-#include <SUIT_ViewModel.h>
-
-class SUIT_ViewWindow;
-class SUIT_Desktop;
-
-class PVGUI_Viewer: public SUIT_ViewModel
-{
- Q_OBJECT
-
-public:
- static QString Type() { return "ParaView"; }
-
- PVGUI_Viewer();
- ~PVGUI_Viewer();
-
- virtual SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop);
- virtual QString getType() const { return Type(); }
-
-};
-
-#endif // !defined(_PVGUI_VIEWMODEL_H)
-
+++ /dev/null
-// Copyright (C) 2010-2014 CEA/DEN, EDF R&D
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : PVGUI_ViewWindow.cxx
-// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
-
-#include "PVGUI_ViewWindow.h"
-
-#include <SUIT_ViewManager.h>
-#include <SUIT_ResourceMgr.h>
-#include <SUIT_Session.h>
-#include <SUIT_Desktop.h>
-
-#include <pqTabbedMultiViewWidget.h>
-#include <pqApplicationCore.h>
-
-/*!
- \class PVGUI_ViewWindow
- \brief PVGUI view window.
-*/
-
-/*!
- \brief Constructor.
- \param theDesktop parent desktop window
- \param theModel plt2d view model
-*/
-PVGUI_ViewWindow::PVGUI_ViewWindow( SUIT_Desktop* theDesktop, PVGUI_Viewer* theModel )
- : SUIT_ViewWindow( theDesktop ), myPVMgr( 0 )
-{
- myModel = theModel;
- myPVMgr = qobject_cast<pqTabbedMultiViewWidget*>(pqApplicationCore::instance()->manager("MULTIVIEW_WIDGET"));
- if (myPVMgr) {
- myPVMgr->setParent( this );
- // This is mandatory, see setParent() method in Qt 4 documentation
- myPVMgr->show();
- setCentralWidget( myPVMgr );
- } else
- qDebug("No multiViewManager defined");
-}
-
-/*!
- \brief Destructor.
- As pqViewManager persists through the whole session,
- the destructor first removes it from the children of this PVGUI_ViewWindow
- to prevent its unexpected deletion.
-*/
-PVGUI_ViewWindow::~PVGUI_ViewWindow()
-{
- if ( myPVMgr ) {
- myPVMgr->setParent( 0 );
- myPVMgr->hide();
- myPVMgr = 0;
- setCentralWidget( 0 );
- }
-}
-
-/*!
- \brief Get the visual parameters of the view window.
- \return visual parameters of this view window formatted to the string
-*/
-QString PVGUI_ViewWindow::getVisualParameters()
-{
- return SUIT_ViewWindow::getVisualParameters();
-}
-
-/*!
- \brief Restore visual parameters of the view window from the formated string
- \param parameters view window visual parameters
-*/
-void PVGUI_ViewWindow::setVisualParameters( const QString& parameters )
-{
- SUIT_ViewWindow::setVisualParameters( parameters );
-}
-
-
-/*!
- \brief Returns the ParaView multi-view manager previously set with setMultiViewManager()
-*/
-pqTabbedMultiViewWidget* PVGUI_ViewWindow::getMultiViewManager() const
-{
- return myPVMgr;
-}
+++ /dev/null
-// Copyright (C) 2010-2014 CEA/DEN, EDF R&D
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File : Plot2d_ViewWindow.h
-// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
-
-#ifndef PVGUI_VIEWWINDOW_H
-#define PVGUI_VIEWWINDOW_H
-
-#include <SUIT_ViewWindow.h>
-#include <QMap>
-
-class SUIT_Desktop;
-class PVGUI_Viewer;
-class pqTabbedMultiViewWidget;
-
-class PVGUI_ViewWindow : public SUIT_ViewWindow
-{
- Q_OBJECT
-
-public:
- PVGUI_ViewWindow( SUIT_Desktop*, PVGUI_Viewer* );
- virtual ~PVGUI_ViewWindow();
-
- virtual QString getVisualParameters();
- virtual void setVisualParameters( const QString& );
-
- pqTabbedMultiViewWidget* getMultiViewManager() const;
-
-private:
- PVGUI_Viewer* myModel;
- pqTabbedMultiViewWidget* myPVMgr;
-};
-
-#endif // PLOT2D_VIEWWINDOW_H
--- /dev/null
+# Copyright (C) 2010-2014 CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+INCLUDE(UseQt4Ext)
+
+# --- options ---
+
+INCLUDE_DIRECTORIES(${GUI_INCLUDE_DIRS}
+ ${QT_INCLUDES}
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ )
+
+SET(_PARAVIEW_APP_COMPO_LIB
+ pqApplicationComponents
+ )
+
+SET(_link_LIBRARIES
+ ${KERNEL_LDFLAGS} ${KERNEL_SALOMELocalTrace}
+ ${GUI_LDFLAGS} ${GUI_LightApp} ${GUI_suit} ${GUI_Event} ${_PARAVIEW_APP_COMPO_LIB}
+)
+
+# --- headers ---
+
+# header files / to be processed by moc
+SET(_moc_HEADERS
+ PVGUI_ViewManager.h
+ PVGUI_ViewModel.h
+ PVGUI_ViewWindow.h
+)
+
+# header files / no moc processing
+SET(_other_HEADERS
+ PVGUI_OutputWindowAdapter.h
+)
+# header files / to install
+SET(PVViewer_HEADERS ${_moc_HEADERS} ${_other_HEADERS})
+
+# --- sources ---
+
+# sources / moc wrappings
+QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+
+# sources / static
+SET(_other_SOURCES
+ PVGUI_ViewManager.cxx
+ PVGUI_ViewModel.cxx
+ PVGUI_ViewWindow.cxx
+ PVGUI_OutputWindowAdapter.cxx
+ )
+
+# sources / to compile
+SET(PVViewer_SOURCES
+ ${_other_SOURCES}
+ ${_moc_SOURCES}
+ )
+
+# --- rules ---
+ADD_LIBRARY(PVViewer ${PVViewer_SOURCES})
+
+TARGET_LINK_LIBRARIES(PVViewer ${_link_LIBRARIES})
+INSTALL(TARGETS PVViewer EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
+
+# --- header and resources installation ---
+INSTALL(FILES ${PVViewer_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
--- /dev/null
+// Copyright (C) 2010-2014 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "PVGUI_OutputWindowAdapter.h"
+
+#include <vtkObjectFactory.h>
+
+#include <LightApp_Application.h>
+#include <LogWindow.h>
+#include <SUIT_Session.h>
+#include <SALOME_Event.h>
+
+vtkStandardNewMacro(PVGUI_OutputWindowAdapter);
+
+
+
+/*!
+ * Put the message in the log window.
+ */
+class TEvent: public SALOME_Event {
+ LogWindow* myWindow;
+ QString myMsg;
+ QColor myColor;
+ int myFlags;
+ public:
+ TEvent( LogWindow* theWindow, const QString theMsg, const QColor theColor, const int flags) :
+ myWindow ( theWindow ),
+ myMsg ( theMsg ),
+ myColor ( theColor ),
+ myFlags (flags)
+ {}
+
+ virtual void Execute() {
+ if(myWindow)
+ myWindow->putMessage(myMsg, myColor, myFlags);
+ }
+};
+
+
+PVGUI_OutputWindowAdapter::PVGUI_OutputWindowAdapter() :
+ TextCount(0),
+ ErrorCount(0),
+ WarningCount(0),
+ GenericWarningCount(0)
+{
+}
+
+PVGUI_OutputWindowAdapter::~PVGUI_OutputWindowAdapter()
+{
+}
+
+const unsigned int PVGUI_OutputWindowAdapter::getTextCount()
+{
+ return this->TextCount;
+}
+
+const unsigned int PVGUI_OutputWindowAdapter::getErrorCount()
+{
+ return this->ErrorCount;
+}
+
+const unsigned int PVGUI_OutputWindowAdapter::getWarningCount()
+{
+ return this->WarningCount;
+}
+
+const unsigned int PVGUI_OutputWindowAdapter::getGenericWarningCount()
+{
+ return this->GenericWarningCount;
+}
+
+static LogWindow* getLogWindow()
+{
+ LogWindow* wnd = 0;
+ LightApp_Application* anApp = dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() );
+ if ( anApp )
+ wnd = anApp->logWindow();
+ return wnd;
+}
+
+void PVGUI_OutputWindowAdapter::DisplayText(const char* text)
+{
+ ++this->TextCount;
+ ProcessVoidEvent( new TEvent( getLogWindow(), text, Qt::darkGreen, LogWindow::DisplayNormal ));
+}
+
+void PVGUI_OutputWindowAdapter::DisplayErrorText(const char* text)
+{
+ ++this->ErrorCount;
+ ProcessVoidEvent( new TEvent( getLogWindow(), text, Qt::darkRed, LogWindow::DisplayNormal ));
+}
+
+void PVGUI_OutputWindowAdapter::DisplayWarningText(const char* text)
+{
+ ++this->WarningCount;
+ ProcessVoidEvent( new TEvent( getLogWindow(), text, Qt::black, LogWindow::DisplayNormal ));
+}
+
+void PVGUI_OutputWindowAdapter::DisplayGenericWarningText(const char* text)
+{
+ ++this->GenericWarningCount;
+ ProcessVoidEvent( new TEvent( getLogWindow() , text, Qt::black, LogWindow::DisplayNormal ));
+}
--- /dev/null
+// Copyright (C) 2010-2014 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef _PVGUI_OutputWindowAdapter_h
+#define _PVGUI_OutputWindowAdapter_h
+
+#include <vtkOutputWindow.h>
+
+/*!
+vtkOutputWindow implementation that puts VTK output messages to SALOME log window.
+
+To use, create an instance of PVGUI_OutputWindowAdapter and pass it to the
+vtkOutputWindow::setInstance() static method.
+
+This class is based on pqOutputWindow ParaView class.
+*/
+class PVGUI_OutputWindowAdapter : public vtkOutputWindow
+{
+public:
+ static PVGUI_OutputWindowAdapter *New();
+ vtkTypeMacro(PVGUI_OutputWindowAdapter, vtkOutputWindow);
+
+ //! Returns the number of text messages received
+ const unsigned int getTextCount();
+ //! Returns the number of error messages received
+ const unsigned int getErrorCount();
+ //! Returns the number of warning messages received
+ const unsigned int getWarningCount();
+ //! Returns the number of generic warning messages received
+ const unsigned int getGenericWarningCount();
+
+private:
+ PVGUI_OutputWindowAdapter();
+ PVGUI_OutputWindowAdapter(const PVGUI_OutputWindowAdapter&);
+ PVGUI_OutputWindowAdapter& operator=(const PVGUI_OutputWindowAdapter&);
+ ~PVGUI_OutputWindowAdapter();
+
+ unsigned int TextCount;
+ unsigned int ErrorCount;
+ unsigned int WarningCount;
+ unsigned int GenericWarningCount;
+
+ virtual void DisplayText(const char*);
+ virtual void DisplayErrorText(const char*);
+ virtual void DisplayWarningText(const char*);
+ virtual void DisplayGenericWarningText(const char*);
+};
+
+#endif // !_PVGUI_OutputWindowAdapter_h
--- /dev/null
+// Copyright (C) 2010-2014 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#include <PVGUI_ViewManager.h>
+#include <PVGUI_ViewModel.h>
+#include <PVGUI_ViewWindow.h>
+#include <pqApplicationCore.h>
+#include <pqTabbedMultiViewWidget.h>
+
+/*!
+ Constructor
+*/
+PVGUI_ViewManager::PVGUI_ViewManager( SUIT_Study* study, SUIT_Desktop* desk )
+: SUIT_ViewManager( study, desk, new PVGUI_Viewer() )
+{
+ setTitle( tr( "PARAVIEW_VIEW_TITLE" ) );
+}
+
+/*!
+ Destructor
+*/
+PVGUI_ViewManager::~PVGUI_ViewManager()
+{
+}
+
+/*!
+ \brief Returns the ParaView multi-view manager for the active view window
+*/
+pqTabbedMultiViewWidget* PVGUI_ViewManager::getMultiViewManager()
+{
+ return qobject_cast<pqTabbedMultiViewWidget*>(pqApplicationCore::instance()->manager("MULTIVIEW_WIDGET"));
+}
--- /dev/null
+// Copyright (C) 2010-2014 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#ifndef PVGUI_VIEWMANAGER_H
+#define PVGUI_VIEWMANAGER_H
+
+#include <SUIT_ViewManager.h>
+
+class SUIT_Desktop;
+class SUIT_Study;
+class pqTabbedMultiViewWidget;
+
+class PVGUI_ViewManager : public SUIT_ViewManager
+{
+ Q_OBJECT
+
+public:
+ PVGUI_ViewManager( SUIT_Study*, SUIT_Desktop* );
+ ~PVGUI_ViewManager();
+
+ pqTabbedMultiViewWidget* getMultiViewManager();
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2010-2014 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "PVGUI_ViewModel.h"
+#include "PVGUI_ViewWindow.h"
+#include "utilities.h"
+
+/*!
+ Constructor
+*/
+PVGUI_Viewer::PVGUI_Viewer()
+:SUIT_ViewModel()
+{
+ MESSAGE("PVGUI_Viewer: creating view ...");
+}
+
+
+/*!
+ Destructor
+*/
+PVGUI_Viewer::~PVGUI_Viewer()
+{
+}
+
+/*!
+ Create new instance of view window on desktop \a theDesktop.
+ \retval SUIT_ViewWindow* - created view window pointer.
+*/
+SUIT_ViewWindow* PVGUI_Viewer::createView(SUIT_Desktop* theDesktop)
+{
+ PVGUI_ViewWindow* aPVView = new PVGUI_ViewWindow(theDesktop, this);
+ return aPVView;
+}
--- /dev/null
+// Copyright (C) 2010-2014 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+#if !defined(_PVGUI_VIEWMODEL_H)
+#define _PVGUI_VIEWMODEL_H
+
+#include <SUIT_ViewModel.h>
+
+class SUIT_ViewWindow;
+class SUIT_Desktop;
+
+class PVGUI_Viewer: public SUIT_ViewModel
+{
+ Q_OBJECT
+
+public:
+ static QString Type() { return "ParaView"; }
+
+ PVGUI_Viewer();
+ ~PVGUI_Viewer();
+
+ virtual SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop);
+ virtual QString getType() const { return Type(); }
+
+};
+
+#endif // !defined(_PVGUI_VIEWMODEL_H)
+
--- /dev/null
+// Copyright (C) 2010-2014 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File : PVGUI_ViewWindow.cxx
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
+
+#include "PVGUI_ViewWindow.h"
+
+#include <SUIT_ViewManager.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+#include <SUIT_Desktop.h>
+
+#include <pqTabbedMultiViewWidget.h>
+#include <pqApplicationCore.h>
+
+/*!
+ \class PVGUI_ViewWindow
+ \brief PVGUI view window.
+*/
+
+/*!
+ \brief Constructor.
+ \param theDesktop parent desktop window
+ \param theModel plt2d view model
+*/
+PVGUI_ViewWindow::PVGUI_ViewWindow( SUIT_Desktop* theDesktop, PVGUI_Viewer* theModel )
+ : SUIT_ViewWindow( theDesktop ), myPVMgr( 0 )
+{
+ myModel = theModel;
+ myPVMgr = qobject_cast<pqTabbedMultiViewWidget*>(pqApplicationCore::instance()->manager("MULTIVIEW_WIDGET"));
+ if (myPVMgr) {
+ myPVMgr->setParent( this );
+ // This is mandatory, see setParent() method in Qt 4 documentation
+ myPVMgr->show();
+ setCentralWidget( myPVMgr );
+ } else
+ qDebug("No multiViewManager defined");
+}
+
+/*!
+ \brief Destructor.
+ As pqViewManager persists through the whole session,
+ the destructor first removes it from the children of this PVGUI_ViewWindow
+ to prevent its unexpected deletion.
+*/
+PVGUI_ViewWindow::~PVGUI_ViewWindow()
+{
+ if ( myPVMgr ) {
+ myPVMgr->setParent( 0 );
+ myPVMgr->hide();
+ myPVMgr = 0;
+ setCentralWidget( 0 );
+ }
+}
+
+/*!
+ \brief Get the visual parameters of the view window.
+ \return visual parameters of this view window formatted to the string
+*/
+QString PVGUI_ViewWindow::getVisualParameters()
+{
+ return SUIT_ViewWindow::getVisualParameters();
+}
+
+/*!
+ \brief Restore visual parameters of the view window from the formated string
+ \param parameters view window visual parameters
+*/
+void PVGUI_ViewWindow::setVisualParameters( const QString& parameters )
+{
+ SUIT_ViewWindow::setVisualParameters( parameters );
+}
+
+
+/*!
+ \brief Returns the ParaView multi-view manager previously set with setMultiViewManager()
+*/
+pqTabbedMultiViewWidget* PVGUI_ViewWindow::getMultiViewManager() const
+{
+ return myPVMgr;
+}
--- /dev/null
+// Copyright (C) 2010-2014 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// File : Plot2d_ViewWindow.h
+// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
+//
+
+#ifndef PVGUI_VIEWWINDOW_H
+#define PVGUI_VIEWWINDOW_H
+
+#include <SUIT_ViewWindow.h>
+#include <QMap>
+
+class SUIT_Desktop;
+class PVGUI_Viewer;
+class pqTabbedMultiViewWidget;
+
+class PVGUI_ViewWindow : public SUIT_ViewWindow
+{
+ Q_OBJECT
+
+public:
+ PVGUI_ViewWindow( SUIT_Desktop*, PVGUI_Viewer* );
+ virtual ~PVGUI_ViewWindow();
+
+ virtual QString getVisualParameters();
+ virtual void setVisualParameters( const QString& );
+
+ pqTabbedMultiViewWidget* getMultiViewManager() const;
+
+private:
+ PVGUI_Viewer* myModel;
+ pqTabbedMultiViewWidget* myPVMgr;
+};
+
+#endif // PLOT2D_VIEWWINDOW_H
}
catch(INTERP_KERNEL::Exception& e)
{
- std::cerr << "Exception has been thrown in vtkMEDReader::RequestInformation : " << e.what() << std::endl;
+ std::cerr << "Exception has been thrown in vtkMEDReader::RequestData : " << e.what() << std::endl;
return 0;
}
return 1;