@COMMENCE@
-EXPORT_HEADERS = QxGraph_Canvas.h \
+EXPORT_HEADERS = QxGraph_ActiveItem.h \
+ QxGraph_Prs.h \
+ QxGraph_Canvas.h \
QxGraph_CanvasView.h \
QxGraph_ViewWindow.h \
QxGraph_ViewManager.h \
# Libraries targets
LIB = libQxGraph.la
-LIB_SRC = QxGraph_Canvas.cxx \
+LIB_SRC = QxGraph_Prs.cxx \
+ QxGraph_Canvas.cxx \
QxGraph_CanvasView.cxx \
QxGraph_ViewWindow.cxx \
QxGraph_ViewManager.cxx \
- QxGraph_ViewModel.cxx
+ QxGraph_ViewModel.cxx
LIB_MOC = QxGraph_Canvas_moc.cxx \
QxGraph_CanvasView_moc.cxx \
--- /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 QXGRAPH_ACTIVEITEM_H
+#define QXGRAPH_ACTIVEITEM_H
+
+#include "QxGraph.h"
+
+class QXGRAPH_EXPORT QxGraph_ActiveItem
+{
+ public:
+ QxGraph_ActiveItem() {}
+ ~QxGraph_ActiveItem() {}
+
+ virtual void hilight() = 0;
+ virtual void select() = 0;
+ virtual void showPopup() = 0;
+};
+
+#endif
#include "QxGraph_Canvas.h"
#include "QxGraph_Def.h"
+#include "QxGraph_Prs.h"
#include <SUIT_ResourceMgr.h>
QCanvas::addView(theView);
theView->setPaletteBackgroundColor(backgroundColor().light(120));
}
+
+/*!
+ Get Prs object with index theIndex
+*/
+QxGraph_Prs* QxGraph_Canvas::getPrs(int theIndex)
+{
+ QxGraph_Prs* aRetPrs = 0;
+ if ( theIndex >= 0 && theIndex < myPrsList.count() )
+ aRetPrs = myPrsList.at(theIndex);
+ return aRetPrs;
+}
#include "QxGraph.h"
#include <qcanvas.h>
+#include <qptrlist.h>
class SUIT_ResourceMgr;
+class QxGraph_Prs;
class QXGRAPH_EXPORT QxGraph_Canvas : public QCanvas {
Q_OBJECT
void addView(QCanvasView* theView);
+ QPtrList<QxGraph_Prs> getPrsList() const { return myPrsList; }
+ QxGraph_Prs* getPrs(int theIndex = 0);
+ void addPrs(QxGraph_Prs* thePrs) { myPrsList.append(thePrs); }
+
private:
+ QPtrList<QxGraph_Prs> myPrsList;
};
--- /dev/null
+// 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_Prs.h"
+
+#include "QxGraph_Canvas.h"
+#include "QxGraph_Def.h" // for debug only
+
+#include "SUIT_Session.h" // for debug only
+
+/*!
+ Constructor
+*/
+QxGraph_Prs::QxGraph_Prs(QxGraph_Canvas* theCanvas):
+ myCanvas(theCanvas),
+ myDMode(0)
+{
+ myCanvas->addPrs(this);
+}
+
+/*!
+ Destructor
+*/
+QxGraph_Prs::~QxGraph_Prs()
+{
+
+}
+
+/*!
+ Add item to display in the view with index theDMode
+*/
+void QxGraph_Prs::addItem(QCanvasItem* theItem, int theDMode)
+{
+ if ( theDMode == -1 ) // add item for the current display mode
+ myDisplayMap[myDMode].append(theItem);
+ else
+ myDisplayMap[theDMode].append(theItem);
+}
+
+/*!
+ Add a QCanvasRectangle item for display mode DMode
+*/
+QCanvasItem* QxGraph_Prs::addRectangleItem(QRect theRect, int theDMode)
+{
+ QCanvasRectangle* aRectItem;
+ if ( myCanvas )
+ {
+ QCanvasRectangle* aRectItem = new QCanvasRectangle(theRect, myCanvas);
+ aRectItem->setZ(0);
+ aRectItem->show();
+ myCanvas->update();
+
+ // test drawing features: brush, pen ...
+ QBrush aBr(SUIT_Session::session()->resourceMgr()->colorValue( "QxGraph", "NodeBody", RECTANGLE_BODY ));
+ aRectItem->setBrush(aBr);
+ }
+ addItem(aRectItem);
+ return aRectItem;
+}
+
+/*!
+ Add a QCanvasPolygon item for display mode DMode
+*/
+QCanvasItem* QxGraph_Prs::addPolygonItem(QPointArray thePA, int theDMode)
+{
+ QCanvasPolygon* aPolyItem;
+ if ( myCanvas )
+ {
+ aPolyItem = new QCanvasPolygon(myCanvas);
+ aPolyItem->setZ(0);
+ aPolyItem->setPoints(thePA);
+ aPolyItem->show();
+ myCanvas->update();
+
+ // test drawing features: brush, pen ...
+ QBrush aBr(SUIT_Session::session()->resourceMgr()->colorValue( "QxGraph", "NodeBody", RECTANGLE_BODY ));
+ aPolyItem->setBrush(aBr);
+ QPen aPen(Qt::black,2);
+ aPolyItem->setPen(aPen);
+ }
+ addItem(aPolyItem);
+ return aPolyItem;
+}
+
+/*!
+ Add a QCanvasLine item for display mode DMode
+*/
+QCanvasItem* QxGraph_Prs::addLineItem(QPoint theStart, QPoint theEnd, int theDMode)
+{
+ QCanvasLine* aLineItem;
+ if ( myCanvas )
+ {
+ aLineItem = new QCanvasLine(myCanvas);
+ aLineItem->setZ(0);
+ aLineItem->setPoints(theStart.x(), theStart.y(), theEnd.x(), theEnd.y());
+ aLineItem->show();
+ myCanvas->update();
+
+ // test drawing features: brush, pen ...
+ QPen aPen(Qt::black,2);
+ aLineItem->setPen(aPen);
+ }
+ addItem(aLineItem);
+ return aLineItem;
+}
+
+/*!
+ Add a QCanvasEllipse item for display mode DMode
+*/
+QCanvasItem* QxGraph_Prs::addEllipseItem(int theW, int theH, int theStartAngle, int theAngle, int theDMode)
+{
+ QCanvasEllipse* aEllipseItem;
+ if ( myCanvas )
+ {
+ aEllipseItem = new QCanvasEllipse(theW, theH, theStartAngle, theAngle, myCanvas);
+ aEllipseItem->setZ(0);
+ aEllipseItem->show();
+ myCanvas->update();
+
+ // test drawing features: brush, pen ...
+ QBrush aBr(SUIT_Session::session()->resourceMgr()->colorValue( "QxGraph", "NodeBody", RECTANGLE_BODY ));
+ aEllipseItem->setBrush(aBr);
+ QPen aPen(Qt::black,2);
+ aEllipseItem->setPen(aPen);
+ }
+ addItem(aEllipseItem);
+ return aEllipseItem;
+}
+
+/*!
+ Add a QCanvasText item for display mode DMode
+*/
+QCanvasItem* QxGraph_Prs::addTextItem(QString theText, int theDMode)
+{
+ QCanvasText* aTextItem;
+ if ( myCanvas )
+ {
+ aTextItem = new QCanvasText(theText, myCanvas);
+ aTextItem->setZ(0);
+ aTextItem->show();
+ myCanvas->update();
+
+ // test drawing features: font, color, text flags ...
+ aTextItem->setColor(Qt::darkBlue);
+ //aTextItem->setFont(QFont("Times"/*"Helvetica"*/, 14, QFont::Normal, true));
+ }
+ addItem(aTextItem);
+ return aTextItem;
+}
--- /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 QXGRAPH_PRS_H
+#define QXGRAPH_PRS_H
+
+#include "QxGraph.h"
+
+#include <qcanvas.h>
+#include <qmap.h>
+#include <qptrlist.h>
+
+class QxGraph_Canvas;
+
+class QXGRAPH_EXPORT QxGraph_Prs
+{
+ public:
+ QxGraph_Prs(QxGraph_Canvas*);
+ ~QxGraph_Prs();
+
+ void addItem(QCanvasItem* theItem, int theDMode = -1);
+
+ /* add items for display mode theDMode
+ if theDMode is equal to -1 add item for the current (active) display mode */
+ QCanvasItem* addRectangleItem(QRect theRect, int theDMode = -1);
+ QCanvasItem* addPolygonItem(QPointArray thePA, int theDMode = -1);
+ QCanvasItem* addLineItem(QPoint theStart, QPoint theEnd, int theDMode = -1);
+ QCanvasItem* addEllipseItem(int theW, int theH, int theStartAngle, int theAngle, int theDMode = -1);
+ QCanvasItem* addTextItem(QString theText, int theDMode = -1);
+
+ typedef QMap< int, QPtrList<QCanvasItem> > DMode2ItemList;
+
+ const DMode2ItemList& getDisplayMap() const { return myDisplayMap; }
+ const QPtrList<QCanvasItem>& getItems(int theDMode) { return myDisplayMap[theDMode]; }
+
+ void setDMode(int theDMode) { myDMode = theDMode; }
+ int getDMode() const { return myDMode; }
+
+ private:
+ QxGraph_Canvas* myCanvas;
+ DMode2ItemList myDisplayMap;
+
+ int myDMode;
+
+};
+
+#endif
#include "QxGraph_Canvas.h"
#include "QxGraph_CanvasView.h"
#include "QxGraph_Def.h"
+#include "QxGraph_Prs.h"
#include "SUIT_Desktop.h"
#include "SUIT_ViewWindow.h"
*/
QxGraph_Viewer::QxGraph_Viewer()
:SUIT_ViewModel(),
- // myCanvas(0),
+ myCanvas(0),
myCurrentView(0)
{
printf("Construct QxGraph_Viewer\n");
- myCanvases.setAutoDelete(true);
+ //myCanvases.setAutoDelete(true);
myCanvasViews.setAutoDelete(true);
}
*/
QxGraph_Viewer::~QxGraph_Viewer()
{
- //if ( myCanvas ) delete myCanvas;
- if ( !myCanvases.isEmpty() ) myCanvases.clear();
+ if ( myCanvas ) delete myCanvas;
+ //if ( !myCanvases.isEmpty() ) myCanvases.clear();
if ( !myCanvasViews.isEmpty() ) myCanvasViews.clear();
myCurrentView = 0;
}
{
view->initLayout();
+ // for debug only (CreatePrs() must be called from YACSGui_Displayer) --->
+ QxGraph_Prs* aPrs = CreatePrs();
+ //aPrs->setDMode(YACSGui_Displayer::Full); from enumeration in Displayer
+
+ /*
// test add items into the current canvas view
QRect aRect(100,200,200,100);
- QCanvasItem* aRectItem = addRectangleItem(aRect);
+ QCanvasItem* aRectItem = aPrs->addRectangleItem(aRect);
//delete aRectItem;
QPointArray aPA(6);
aPA.putPoints(0, 6, 400,100, 500,70, 600,100, 600,200, 500,230, 400,200);
- QCanvasItem* aPolyItem = addPolygonItem(aPA);
+ QCanvasItem* aPolyItem = aPrs->addPolygonItem(aPA);
//delete aPolyItem;
QPoint aStart(500,300), aEnd(700,250);
- QCanvasItem* aLineItem = addLineItem(aStart, aEnd);
+ QCanvasItem* aLineItem = aPrs->addLineItem(aStart, aEnd);
//delete aLineItem;
- QCanvasItem* aEllipseItem = addEllipseItem(200, 100, 30*16, 120*16);
+ QCanvasItem* aEllipseItem = aPrs->addEllipseItem(200, 100, 30*16, 120*16);
aEllipseItem->setX(400);
aEllipseItem->setY(400);
//delete aEllipseItem;
- QCanvasItem* aTextItem = addTextItem("This is a QCanvasText item");
+ QCanvasItem* aTextItem = aPrs->addTextItem("This is a QCanvasText item");
aTextItem->setX(100);
- aTextItem->setY(100);
+ aTextItem->setY(500);
//delete aTextItem;
+ */
}
}
}
/*!
- Add a QCanvasRectangle item into canvas (canvas view) with index theIndex
-*/
-QCanvasItem* QxGraph_Viewer::addRectangleItem(QRect theRect, int theIndex)
-{
- QCanvasRectangle* aRectItem;
-
- QCanvas* aCanvas = 0;
- if ( theIndex == -1 ) // add item into the current canvas (canvas view)
- aCanvas = myCurrentView->canvas();
- else if ( theIndex >= 0 & theIndex < myCanvasViews.count() )
- aCanvas = myCanvases.at(theIndex);
-
- if ( aCanvas )
- {
- QCanvasRectangle* aRectItem = new QCanvasRectangle(theRect, aCanvas);
- aRectItem->setZ(0);
- aRectItem->show();
- aCanvas->update();
-
- // test drawing features: brush, pen ...
- QBrush aBr(SUIT_Session::session()->resourceMgr()->colorValue( "SUPERVGraph", "NodeBody", RECTANGLE_BODY ));
- aRectItem->setBrush(aBr);
- }
-
- return aRectItem;
-}
-
-/*!
- Add a QCanvasPolygon item into canvas (canvas view) with index theIndex
-*/
-QCanvasItem* QxGraph_Viewer::addPolygonItem(QPointArray thePA, int theIndex)
-{
- QCanvasPolygon* aPolyItem;
-
- QCanvas* aCanvas = 0;
- if ( theIndex == -1 ) // add item into the current canvas (canvas view)
- aCanvas = myCurrentView->canvas();
- else if ( theIndex >= 0 & theIndex < myCanvasViews.count() )
- aCanvas = myCanvases.at(theIndex);
-
- if ( aCanvas )
- {
- aPolyItem = new QCanvasPolygon(aCanvas);
- aPolyItem->setZ(0);
- aPolyItem->setPoints(thePA);
- aPolyItem->show();
- aCanvas->update();
-
- // test drawing features: brush, pen ...
- QBrush aBr(SUIT_Session::session()->resourceMgr()->colorValue( "SUPERVGraph", "NodeBody", RECTANGLE_BODY ));
- aPolyItem->setBrush(aBr);
- QPen aPen(Qt::black,2);
- aPolyItem->setPen(aPen);
- }
-
- return aPolyItem;
-}
-
-/*!
- Add a QCanvasLine item into canvas (canvas view) with index theIndex
-*/
-QCanvasItem* QxGraph_Viewer::addLineItem(QPoint theStart, QPoint theEnd, int theIndex)
-{
- QCanvasLine* aLineItem;
-
- QCanvas* aCanvas = 0;
- if ( theIndex == -1 ) // add item into the current canvas (canvas view)
- aCanvas = myCurrentView->canvas();
- else if ( theIndex >= 0 & theIndex < myCanvasViews.count() )
- aCanvas = myCanvases.at(theIndex);
-
- if ( aCanvas )
- {
- aLineItem = new QCanvasLine(aCanvas);
- aLineItem->setZ(0);
- aLineItem->setPoints(theStart.x(), theStart.y(), theEnd.x(), theEnd.y());
- aLineItem->show();
- aCanvas->update();
-
- // test drawing features: brush, pen ...
- QPen aPen(Qt::black,2);
- aLineItem->setPen(aPen);
- }
-
- return aLineItem;
-}
-
-/*!
- Add a QCanvasEllipse item into canvas (canvas view) with index theIndex
+ Create QxGraph_Prs object for the myCanvas
*/
-QCanvasItem* QxGraph_Viewer::addEllipseItem(int theW, int theH, int theStartAngle, int theAngle, int theIndex)
+QxGraph_Prs* QxGraph_Viewer::CreatePrs()
{
- QCanvasEllipse* aEllipseItem;
-
- QCanvas* aCanvas = 0;
- if ( theIndex == -1 ) // add item into the current canvas (canvas view)
- aCanvas = myCurrentView->canvas();
- else if ( theIndex >= 0 & theIndex < myCanvasViews.count() )
- aCanvas = myCanvases.at(theIndex);
-
- if ( aCanvas )
- {
- aEllipseItem = new QCanvasEllipse(theW, theH, theStartAngle, theAngle, aCanvas);
- aEllipseItem->setZ(0);
- aEllipseItem->show();
- aCanvas->update();
-
- // test drawing features: brush, pen ...
- QBrush aBr(SUIT_Session::session()->resourceMgr()->colorValue( "SUPERVGraph", "NodeBody", RECTANGLE_BODY ));
- aEllipseItem->setBrush(aBr);
- QPen aPen(Qt::black,2);
- aEllipseItem->setPen(aPen);
- }
-
- return aEllipseItem;
-}
-
-/*!
- Add a QCanvasText item into canvas (canvas view) with index theIndex
-*/
-QCanvasItem* QxGraph_Viewer::addTextItem(QString theText, int theIndex)
-{
- QCanvasText* aTextItem;
-
- QCanvas* aCanvas = 0;
- if ( theIndex == -1 ) // add item into the current canvas (canvas view)
- aCanvas = myCurrentView->canvas();
- else if ( theIndex >= 0 & theIndex < myCanvasViews.count() )
- aCanvas = myCanvases.at(theIndex);
-
- if ( aCanvas )
- {
- aTextItem = new QCanvasText(theText, aCanvas);
- aTextItem->setZ(0);
- aTextItem->show();
- aCanvas->update();
-
- // test drawing features: font, color, text flags ...
- aTextItem->setColor(Qt::darkBlue);
- aTextItem->setFont(QFont("Times"/*"Helvetica"*/, 14, QFont::Normal, true));
- }
-
- return aTextItem;
+ return new QxGraph_Prs(myCanvas);
}
class QxGraph_Canvas;
class QxGraph_CanvasView;
class QxGraph_ViewWindow;
+class QxGraph_Prs;
class QXGRAPH_EXPORT QxGraph_Viewer: public SUIT_ViewModel
{
virtual void contextMenuPopup(QPopupMenu*);
- //QxGraph_Canvas* getCanvas() { return myCanvas; }
- //void setCanvas(QxGraph_Canvas* theCanvas) { myCanvas = theCanvas; }
- QPtrList<QxGraph_Canvas> getCanvases() { return myCanvases; }
- void setCanvases(QPtrList<QxGraph_Canvas> theCanvases) { myCanvases = theCanvases; }
+ QxGraph_Canvas* getCanvas() const { return myCanvas; }
+ void setCanvas(QxGraph_Canvas* theCanvas) { myCanvas = theCanvas; }
+ //QPtrList<QxGraph_Canvas> getCanvases() { return myCanvases; }
+ //void setCanvases(QPtrList<QxGraph_Canvas> theCanvases) { myCanvases = theCanvases; }
- void addCanvas(QxGraph_Canvas* theCanvas) { myCanvases.append(theCanvas); }
- void removeCanvas(QxGraph_Canvas* theCanvas) { myCanvases.remove(theCanvas); }
+ //void addCanvas(QxGraph_Canvas* theCanvas) { myCanvases.append(theCanvas); }
+ //void removeCanvas(QxGraph_Canvas* theCanvas) { myCanvases.remove(theCanvas); }
QPtrList<QxGraph_CanvasView> getCanvasViews() { return myCanvasViews; }
void setCanvasViews(QPtrList<QxGraph_CanvasView> theViews) { myCanvasViews = theViews; }
void addView(QxGraph_CanvasView* theView) { myCanvasViews.append(theView); }
void removeView(QxGraph_CanvasView* theView) { myCanvasViews.remove(theView); }
- QxGraph_CanvasView* getCurrentView() { return myCurrentView; }
+ QxGraph_CanvasView* getCurrentView() const { return myCurrentView; }
void setCurrentView(QxGraph_CanvasView* theView) { myCurrentView = theView; }
void setCurrentView(int theIndex);
- /* add items into canvas (canvas view) with index theIndex
- if theIndex is equal to -1 add item into current (active) canvas (canvas view) */
- QCanvasItem* addRectangleItem(QRect theRect, int theIndex = -1);
- QCanvasItem* addPolygonItem(QPointArray thePA, int theIndex = -1);
- QCanvasItem* addLineItem(QPoint theStart, QPoint theEnd, int theIndex = -1);
- QCanvasItem* addEllipseItem(int theW, int theH, int theStartAngle, int theAngle, int theIndex = -1);
- QCanvasItem* addTextItem(QString theText, int theIndex = -1);
+ QxGraph_Prs* CreatePrs();
protected:
void initView(QxGraph_ViewWindow* view);
void onChangeBgColor();
private:
- //QxGraph_Canvas* myCanvas;
- QPtrList<QxGraph_Canvas> myCanvases;
+ QxGraph_Canvas* myCanvas;
+ //QPtrList<QxGraph_Canvas> myCanvases;
QPtrList<QxGraph_CanvasView> myCanvasViews;
QxGraph_CanvasView* myCurrentView;
+
};
#endif
*/
void QxGraph_ViewWindow::initLayout()
{
- //initCanvas();
+ initCanvas();
initCanvasViews();
myToolBar = new QToolBar(this);
void QxGraph_ViewWindow::initCanvas()
{
if ( myViewModel )
- //myViewModel->setCanvas( new QxGraph_Canvas(resMgr()) );
- myViewModel->addCanvas( new QxGraph_Canvas(resMgr()) );
+ myViewModel->setCanvas( new QxGraph_Canvas(resMgr()) );
+ //myViewModel->addCanvas( new QxGraph_Canvas(resMgr()) );
}
/*!
{
for (int i = 0; i < 2; i++)
{
- QxGraph_Canvas* aCanvas = new QxGraph_Canvas(resMgr());
- myViewModel->addCanvas( aCanvas );
+ //QxGraph_Canvas* aCanvas = new QxGraph_Canvas(resMgr());
+ //myViewModel->addCanvas( aCanvas );
- //QxGraph_CanvasView* aCanvasView = new QxGraph_CanvasView( myViewModel->getCanvas(), this );
- QxGraph_CanvasView* aCanvasView = new QxGraph_CanvasView( aCanvas, this );
+ QxGraph_CanvasView* aCanvasView = new QxGraph_CanvasView( myViewModel->getCanvas(), this );
+ //QxGraph_CanvasView* aCanvasView = new QxGraph_CanvasView( aCanvas, this );
myViewModel->addView(aCanvasView);
aCanvasView->hide();