From c05546c7e109966ef2f5d8304899640acbe55edc Mon Sep 17 00:00:00 2001 From: mkr Date: Thu, 15 Mar 2007 06:14:30 +0000 Subject: [PATCH] Modify YACSGui_Module, create YACSGui_Graph. --- src/QxGraph/QxGraph_View.cxx | 105 ----------------------------------- src/QxGraph/QxGraph_View.h | 67 ---------------------- 2 files changed, 172 deletions(-) delete mode 100644 src/QxGraph/QxGraph_View.cxx delete mode 100644 src/QxGraph/QxGraph_View.h diff --git a/src/QxGraph/QxGraph_View.cxx b/src/QxGraph/QxGraph_View.cxx deleted file mode 100644 index 738865b3a..000000000 --- a/src/QxGraph/QxGraph_View.cxx +++ /dev/null @@ -1,105 +0,0 @@ -// SALOME QxGraph : build Supervisor viewer into desktop -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// 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 "QxGraph_View.h" -#include "QxGraph_Canvas.h" -#include "QxGraph_CanvasView.h" - -#include -#include - -//QT Include -#include -#include - -/*! - Constructor -*/ -QxGraph_View::QxGraph_View( QWidget* theParent ): QWidget( theParent ) -{ - printf("Constructor 1 of QxGraph_View\n"); - init(theParent); -} - -/*! - Constructor -*/ -QxGraph_View::QxGraph_View( QxGraph_View* theParent ): QWidget( theParent ) -{ - printf("Constructor 2 of QxGraph_View\n"); - init(theParent); -} - -/*! - Initialization -*/ -void QxGraph_View::init( QWidget* theParent ) -{ - if ( theParent->inherits( "QMainWindow" ) ) { - ( ( QMainWindow* )theParent )->setCentralWidget( this ); - } - else { - QBoxLayout* layout = new QVBoxLayout( theParent ); - layout->addWidget( this ); - } - - initCanvas(); - initCanvasViews(); -} - -/*! - Canvas initialization -*/ -void QxGraph_View::initCanvas() -{ - myCanvas = new QxGraph_Canvas(resMgr()); -} - -/*! - Canvas views initialization -*/ -void QxGraph_View::initCanvasViews() -{ - QBoxLayout * layout = new QVBoxLayout(this); - layout->setMargin(0); - layout->setSpacing(0); - - for (int i = 0; i < 2; i++) - { - QxGraph_CanvasView* aCanvasView = new QxGraph_CanvasView( myCanvas, this ); - myCanvasViews.append(aCanvasView); - layout->addWidget(aCanvasView); - aCanvasView->hide(); - } - - // the first view is shown and is the current - myCanvasViews.first()->show(); - myCurrentView = myCanvasViews.first(); -} - -/*! - Get resource manager -*/ -SUIT_ResourceMgr* QxGraph_View::resMgr() const -{ - return SUIT_Session::session()->resourceMgr(); -} diff --git a/src/QxGraph/QxGraph_View.h b/src/QxGraph/QxGraph_View.h deleted file mode 100644 index bdc50e652..000000000 --- a/src/QxGraph/QxGraph_View.h +++ /dev/null @@ -1,67 +0,0 @@ -// SALOME QxGraph : build Supervisor viewer into desktop -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// 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 QXGRAPH_VIEW_H -#define QXGRAPH_VIEW_H - -#include "QxGraph.h" - -//#include -#include - -#ifdef WIN32 -#pragma warning ( disable:4251 ) -#endif - -class SUIT_ResourceMgr; -class QxGraph_Canvas; -class QxGraph_CanvasView; - -class QXGRAPH_EXPORT QxGraph_View : public QWidget { - Q_OBJECT - - public: - QxGraph_View(QWidget* theParent); - QxGraph_View(QxGraph_View* theParent); - - ~QxGraph_View() {}; - - SUIT_ResourceMgr* resMgr() const; - - protected: - void init(QWidget* theParent); - virtual void initCanvas(); - virtual void initCanvasViews(); - - private: - QxGraph_Canvas* myCanvas; - QPtrList myCanvasViews; - - QxGraph_CanvasView* myCurrentView; - -}; - -#ifdef WIN32 -#pragma warning ( default:4251 ) -#endif - -#endif -- 2.39.2