1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #ifndef QXGRAPH_VIEWMODEL_H
23 #define QXGRAPH_VIEWMODEL_H
27 #include "SUIT_ViewModel.h"
29 class QCanvasItem; // for addRectangleItem(...) method (can be removed in the future)
32 class QxGraph_CanvasView;
33 class QxGraph_ViewWindow;
36 class QXGRAPH_EXPORT QxGraph_Viewer: public SUIT_ViewModel
41 static QString Type() { return "QxGraphViewer"; }
44 virtual ~QxGraph_Viewer();
46 virtual SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop);
47 virtual QString getType() const { return Type(); }
49 virtual void contextMenuPopup(QPopupMenu*);
51 QxGraph_Canvas* getCanvas() const { return myCanvas; }
52 void setCanvas(QxGraph_Canvas* theCanvas) { myCanvas = theCanvas; }
53 //QPtrList<QxGraph_Canvas> getCanvases() { return myCanvases; }
54 //void setCanvases(QPtrList<QxGraph_Canvas> theCanvases) { myCanvases = theCanvases; }
56 //void addCanvas(QxGraph_Canvas* theCanvas) { myCanvases.append(theCanvas); }
57 //void removeCanvas(QxGraph_Canvas* theCanvas) { myCanvases.remove(theCanvas); }
59 QPtrList<QxGraph_CanvasView> getCanvasViews() { return myCanvasViews; }
60 void setCanvasViews(QPtrList<QxGraph_CanvasView> theViews) { myCanvasViews = theViews; }
62 void addView(QxGraph_CanvasView* theView) { myCanvasViews.append(theView); }
63 void removeView(QxGraph_CanvasView* theView) { myCanvasViews.remove(theView); }
65 QxGraph_CanvasView* getCurrentView() const { return myCurrentView; }
66 void setCurrentView(QxGraph_CanvasView* theView) { myCurrentView = theView; }
67 void setCurrentView(int theIndex);
70 void initView(QxGraph_ViewWindow* view);
74 void onChangeBgColor();
77 QxGraph_Canvas* myCanvas;
78 //QPtrList<QxGraph_Canvas> myCanvases;
79 QPtrList<QxGraph_CanvasView> myCanvasViews;
81 QxGraph_CanvasView* myCurrentView;