PVGUI_Module.h \
PVGUI_Module.cxx \
PVGUI_ProcessModuleHelper.h \
- PVGUI_ProcessModuleHelper.cxx
+ PVGUI_ProcessModuleHelper.cxx \
+ PVGUI_ViewManager.h \
+ PVGUI_ViewManager.cxx \
+ PVGUI_ViewModel.h \
+ PVGUI_ViewModel.cxx \
+ PVGUI_ViewWindow.h \
+ PVGUI_ViewWindow.cxx
# MOC pre-processing
MOC_FILES = \
- PVGUI_Module_moc.cxx
+ PVGUI_Module_moc.cxx \
+ PVGUI_ViewManager_moc.cxx \
+ PVGUI_ViewModel_moc.cxx \
+ PVGUI_ViewWindow_moc.cxx
nodist_libPARAVIS_la_SOURCES = $(MOC_FILES)
#include "PVGUI_Module.h"
#include "PVGUI_ProcessModuleHelper.h"
+#include "PVGUI_ViewModel.h"
+#include "PVGUI_ViewManager.h"
#include <SUIT_MessageBox.h>
#include <SUIT_Desktop.h>
+#include <SUIT_Session.h>
#include <LightApp_Application.h>
#include <LightApp_SelectionMgr.h>
-#include <LightApp_Selection.h>
-#include <OCCViewer_ViewManager.h>
-#include <SOCC_ViewModel.h>
-#include <SOCC_Prs.h>
#include <QApplication>
#include <QInputDialog>
SUIT_Desktop* desk = application()->desktop();
+ /*
+ int i = 1;
+ while( i ){
+ i = i;
+ }
+ */
+
if ( pvInit() ) {
pvCreateActions();
}
{
// TODO...
}
+
+/*!
+ \brief Shows (toShow = true) or hides ParaView view window
+*/
+void PVGUI_Module::showView( bool toShow )
+{
+ // TODO: check if ParaView view already exists
+ LightApp_Application* anApp = getApp();
+ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+ PVGUI_ViewManager* viewMgr = new PVGUI_ViewManager( anApp->activeStudy(), anApp->desktop() );
+ anApp->addViewManager( viewMgr );
+ connect( viewMgr, SIGNAL( lastViewClosed( SUIT_ViewManager* ) ),
+ anApp, SLOT( onCloseView( SUIT_ViewManager* ) ) );
+ //connect( viewMgr, SIGNAL( viewCreated( SUIT_ViewWindow* ) ), vm, SLOT( onViewCreated( SUIT_ViewWindow* ) ) );
+ //connect( viewMgr, SIGNAL( deleteView( SUIT_ViewWindow* ) ), this, SLOT( onViewDeleted( SUIT_ViewWindow* ) ) );
+ SUIT_ViewWindow* wnd = viewMgr->createViewWindow();
+}
/*!
\brief Create actions for ParaView GUI operations
setMenuShown( true );
+ showView( true );
+
return isDone;
}
//! Create actions for ParaView GUI operations
//! duplicating menus and toolbars in pqMainWindow ParaView class
- void pvCreateActions();
+ void pvCreateActions();
+
+ //! Shows or hides ParaView view window
+ void showView( bool );
public slots:
virtual bool activateModule( SUIT_Study* );
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA 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.
+//
+// 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>
+
+
+/*!
+ 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()
+{
+}
+
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA 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.
+//
+// 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 PVGUI_ViewManager : public SUIT_ViewManager
+{
+ Q_OBJECT
+
+public:
+ PVGUI_ViewManager( SUIT_Study*, SUIT_Desktop* );
+ ~PVGUI_ViewManager();
+};
+
+#endif
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA 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.
+//
+// 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
+//
+// Plot2d_ViewModel.cxx: implementation of the Plot2d_ViewModel class.
+
+#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) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA 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.
+//
+// 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) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA 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.
+//
+// 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 <pqViewManager.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 = new pqViewManager( this );
+
+ setCentralWidget( myPVMgr );
+
+ myPVMgr->installEventFilter( this );
+}
+
+/*!
+ \brief Destructor.
+*/
+PVGUI_ViewWindow::~PVGUI_ViewWindow()
+{
+}
+
+/*!
+ \brief Custom event filter.
+ \param watched event receiver object
+ \param e event
+ \return \c true if further event processing should be stopped
+*/
+bool PVGUI_ViewWindow::eventFilter( QObject* watched, QEvent* e )
+{
+ return SUIT_ViewWindow::eventFilter( watched, e );
+}
+
+
+/*!
+ \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 );
+}
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA 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.
+//
+// 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 pqViewManager;
+
+class PVGUI_ViewWindow : public SUIT_ViewWindow
+{
+ Q_OBJECT
+
+public:
+ PVGUI_ViewWindow( SUIT_Desktop*, PVGUI_Viewer* );
+ virtual ~PVGUI_ViewWindow();
+
+
+ virtual bool eventFilter( QObject*, QEvent* );
+
+ virtual QString getVisualParameters();
+ virtual void setVisualParameters( const QString& );
+
+
+private:
+ PVGUI_Viewer* myModel;
+ pqViewManager* myPVMgr;
+};
+
+#endif // PLOT2D_VIEWWINDOW_H