]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Module Supervision migration.
authormkr <mkr@opencascade.com>
Fri, 27 May 2005 09:34:03 +0000 (09:34 +0000)
committermkr <mkr@opencascade.com>
Fri, 27 May 2005 09:34:03 +0000 (09:34 +0000)
14 files changed:
src/Makefile.in
src/SUPERVGraph/Makefile.in
src/SUPERVGraph/SUPERVGraph.cxx
src/SUPERVGraph/SUPERVGraph.h
src/SUPERVGraph/SUPERVGraph_Graph.cxx [deleted file]
src/SUPERVGraph/SUPERVGraph_Graph.h [deleted file]
src/SUPERVGraph/SUPERVGraph_ViewFrame.cxx
src/SUPERVGraph/SUPERVGraph_ViewFrame.h
src/SUPERVGraph/SUPERVGraph_ViewManager.cxx [new file with mode: 0644]
src/SUPERVGraph/SUPERVGraph_ViewManager.h [new file with mode: 0644]
src/SUPERVGraph/SUPERVGraph_ViewModel.cxx [new file with mode: 0644]
src/SUPERVGraph/SUPERVGraph_ViewModel.h [new file with mode: 0644]
src/SalomeApp/Makefile.in
src/SalomeApp/resources/SalomeApp.xml

index 34187dc4df10c15c82cbacb83d089a1e3dd6875b..d41666b38ed62da8f71484229329ba1e3d63b1df 100755 (executable)
@@ -34,7 +34,7 @@ VPATH=.:@srcdir@
 
 SUBDIRS = Qtx SUIT STD CAF CAM SUITApp VTKViewer OCCViewer GLViewer \
           LogWindow Event Loader OBJECT Prs PyInterp PythonConsole ObjBrowser \
-          RegistryDisplay Plot2d TOOLSGUI SOCC SVTK SPlot2d SalomeApp SALOME_SWIG SALOME_PY Session 
-# excluded :  SUPERVGraph SALOME_PYQT
+          RegistryDisplay Plot2d TOOLSGUI SOCC SVTK SPlot2d SalomeApp SALOME_SWIG SALOME_PY SUPERVGraph Session
+# excluded :  SALOME_PYQT
 
 @MODULE@
index 8209a43327c2d351285fcd8d509ce60ff7c81953..433f6239f8c25b85ef9ba9a4d9d2cf878b9a9069 100755 (executable)
@@ -7,17 +7,22 @@ VPATH=.:@srcdir@:@top_srcdir@/idl
 
 @COMMENCE@
 
-EXPORT_HEADERS = \
-                 SUPERVGraph_ViewFrame.h 
+EXPORT_HEADERS = SUPERVGraph_ViewFrame.h \
+                SUPERVGraph_ViewManager.h \
+                SUPERVGraph_ViewModel.h
 
 # Libraries targets
 
 LIB = libSUPERVGraph.la
 LIB_SRC =        SUPERVGraph.cxx \
-                 SUPERVGraph_ViewFrame.cxx 
+                 SUPERVGraph_ViewFrame.cxx \
+                 SUPERVGraph_ViewManager.cxx \
+                 SUPERVGraph_ViewModel.cxx 
 
 LIB_MOC =        SUPERVGraph_moc.cxx \
-                 SUPERVGraph_ViewFrame_moc.cxx 
+                 SUPERVGraph_ViewFrame_moc.cxx \
+                 SUPERVGraph_ViewManager_moc.cxx \
+                 SUPERVGraph_ViewModel_moc.cxx 
 
 LIB_CLIENT_IDL = SALOMEDS.idl \
                 SALOME_ModuleCatalog.idl \
@@ -26,8 +31,8 @@ LIB_CLIENT_IDL = SALOMEDS.idl \
                 SALOME_GenericObj.idl
 
 
-CPPFLAGS+=$(QT_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) $(BOOST_CPPFLAGS) -I${KERNEL_ROOT_DIR}/include/salome 
-LDFLAGS+=$(QT_MT_LIBS) -L$(top_builddir)/lib -lSalomeGUI
+CPPFLAGS+=$(QT_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) $(BOOST_CPPFLAGS) -I${KERNEL_ROOT_DIR}/include/salome -I${GUI_ROOT_DIR}/include/salome
+LDFLAGS+=$(QT_MT_LIBS) -L$(top_builddir)/lib
 
 
 @CONCLUDE@
index 140853bb9302c7901a5c924bc02b047119a45efb..35105cfe8bee6d4097717efa54c6f46f0b3615f9 100755 (executable)
@@ -30,14 +30,14 @@ using namespace std;
 #include "SUPERVGraph.h"
 #include "SUPERVGraph_ViewFrame.h"
 
-QAD_ViewFrame* SUPERVGraph::createView(QAD_RightFrame* parent)
+SUIT_ViewWindow* SUPERVGraph::createView(SUIT_Desktop* parent)
 {
-  return new SUPERVGraph_ViewFrame( parent, "vtkView" ); 
+  return new SUPERVGraph_ViewFrame( parent/*, "vtkView"*/ ); 
 }
 
 extern "C"
 {
-  QAD_ViewFrame* createView(QAD_RightFrame* parent)
+  SUIT_ViewWindow* createView(SUIT_Desktop* parent)
   {
     return SUPERVGraph::createView(parent);
   }
index 929fc291d8e6bbfd29c7df7846ab2cce3dea74ba..d2d83794e5153775d16272b619c3a2e495703f22 100755 (executable)
@@ -29,8 +29,8 @@
 #ifndef SUPERVGraph_HeaderFile
 #define SUPERVGraph_HeaderFile
 
-#include "QAD_RightFrame.h"
-#include "QAD_ViewFrame.h"
+#include "SUIT_Desktop.h"
+#include "SUIT_ViewWindow.h"
 
 class SUPERVGraph : public QObject
 {
@@ -38,7 +38,7 @@ class SUPERVGraph : public QObject
 
 public :
 
-    Standard_EXPORT static QAD_ViewFrame* createView ( QAD_RightFrame* parent);
+    /*Standard_EXPORT*/ static SUIT_ViewWindow* createView ( SUIT_Desktop* parent);
   
 };
 
diff --git a/src/SUPERVGraph/SUPERVGraph_Graph.cxx b/src/SUPERVGraph/SUPERVGraph_Graph.cxx
deleted file mode 100755 (executable)
index f312dbc..0000000
+++ /dev/null
@@ -1,304 +0,0 @@
-//  SALOME SUPERVGraph : 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
-//
-//
-//
-//  File   : SUPERVGraph_Graph.cxx
-//  Author : Francis KLOSS
-//  Module : SALOME
-
-using namespace std;
-#include "SUPERVGraph_Graph.h"
-
-#include "QAD_Settings.h"
-#include "QAD_Config.h"
-
-#include <qcolordialog.h>
-#include <qpopupmenu.h>
-
-
-SUPERVGraph_Graph::SUPERVGraph_Graph(QWidget* parent) : 
-  QScrollView(parent),
-  where(QPoint(0, 0))
-{
-  installEventFilter(viewport());
-  //  viewport()->setBackgroundColor(QColor(165, 255, 176));
-
-  connect(this, SIGNAL(contentsMoving(int, int)), this, SLOT(Draw(int, int)));
-  
-  popup = new QPopupMenu(viewport());
-  //      if (main->isModify()) {
-  //          pan = popup->insertItem("Add Node",            main, SLOT(addNode()));
-  //          pap = popup->insertItem("Add Point",           this, SLOT(addPoint()));
-  //          pdl = popup->insertItem("Delete Link",         this, SLOT(deleteLink()));
-  //          pif = popup->insertItem("Insert File",         main, SLOT(insertFile()));
-  //          pci = popup->insertItem("Change Informations", this, SLOT(changeInformation()));
-  //                popup->insertSeparator();
-  //      };
-  //    popup->insertItem("Add in Study",        main, SLOT(addStudy()));
-  //    popup->insertItem("Show Informations",   this, SLOT(showInformation()));
-  //    popup->insertSeparator();
-  //    popup->insertItem("Copy (Read Only)",    main, SLOT(copyReading()));
-  //    popup->insertItem("Copy (Modifiying)",   main, SLOT(copyModifying()));
-}
-
-void SUPERVGraph_Graph::sync() {
-  //   bool editing = main->getDataflow()->IsEditing();
-  //      if (main->isModify()) {
-  //          popup->setItemEnabled(pci, editing);
-  //          popup->setItemEnabled(pan, editing);
-  //          popup->setItemEnabled(pap, editing);
-  //          popup->setItemEnabled(pdl, editing);
-  //          popup->setItemEnabled(pif, editing);
-  //      };
-  
-  //      SUPERVGraph_Node* ihmNode;
-  //      QObjectList* ihmList = queryList("SUPERVGraph_Node");
-  //      SUPERV_Nodes nodes = main->getDataflow()->Nodes();
-  //      int n = nodes->length();
-
-  //      for (int i=0; i<n; i++) {
-  //          ihmNode = (SUPERVGraph_Node *)child(nodes[i]->Name(), "SUPERVGraph_Node");
-  //          if (ihmNode == NULL) {
-  //              ihmNode = new SUPERVGraph_Node(viewport(), main, nodes[i]);
-  //              addChild(ihmNode, nodes[i]->X(), nodes[i]->Y());
-  //          } else {
-  //              moveChild(ihmNode, nodes[i]->X(), nodes[i]->Y());
-  //       ihmList->removeRef(ihmNode);
-  //          };
-  //          ihmNode->sync();
-  //      };
-
-  //      QObjectListIt i(*ihmList);
-  //      while ((ihmNode=(SUPERVGraph_Node*)i.current()) != 0) {
-  //          ++i;
-  //          ihmNode->close();
-  //      };
-  //      delete ihmList;
-
-  //      SUPERVGraph_PortIn* pi;
-  //      ihmList = queryList("SUPERVGraph_PortIn");
-  //      i = *ihmList;
-  //      while ((pi=(SUPERVGraph_PortIn*)i.current()) != 0) {
-  //          ++i;
-  //          pi->sync(true);
-  //      };
-  //      delete ihmList;
-
-  //      SUPERVGraph_PortOut* po;
-  //      ihmList = queryList("SUPERVGraph_PortOut");
-  //      i = *ihmList;
-  //      while ((po=(SUPERVGraph_PortOut*)i.current()) != 0) {
-  //          ++i;
-  //          po->sync();
-  //      };
-  //      delete ihmList;
-
-  //      Draw(0, 0);
-}
-
-SUPERVGraph_Graph::~SUPERVGraph_Graph() {
-}
-
-bool SUPERVGraph_Graph::eventFilter(QObject* object, QEvent* event) {
-  if ((event->type() == QEvent::Move ) ||
-      (event->type() == QEvent::Paint) ||
-      (event->type() == QEvent::Resize) ) {
-    Draw(0, 0);
-  };
-  return(QScrollView::eventFilter(object, event));
-}
-
-void SUPERVGraph_Graph::Draw(int x, int y) {
-  QPainter p(viewport());
-  p.eraseRect(viewport()->rect());
-  p.setPen(QPen(Qt::black, 2));
-  
-  //   SUPERVGraph_Point* c;
-  //    SUPERVGraph_Point* n;
-  //    QObjectList* points = queryList("SUPERVGraph_Point");
-  //    QObjectListIt i(*points);
-  //    while ((c=(SUPERVGraph_Point*)i.current()) != 0) {
-  //      ++i;
-  //          n=c->getNext();
-  //          if (n!=c) {
-  //              p.drawLine(contentsToViewport(QPoint(c->getX()+POINT_SIZE_HALF, c->getY()+POINT_SIZE_HALF)),
-  //                         contentsToViewport(QPoint(n->getX()+POINT_SIZE_HALF, n->getY()+POINT_SIZE_HALF)) );
-  //          };
-  //      };
-  //      delete points;
-}
-
-void SUPERVGraph_Graph::contentsMousePressEvent(QMouseEvent* e) {
-  where = viewportToContents(viewport()->mapFromGlobal(e->globalPos()));
-  //   main->showPopup(popup, e);
-}
-
-void SUPERVGraph_Graph::contentsMouseReleaseEvent(QMouseEvent* e) {
-  //    main->sketchPoint(NULL);
-
- if ( e->button() == Qt::RightButton ) {
-   QPopupMenu* popup = createPopup();
-   if ( popup ) {
-     popup->exec( QCursor::pos() );
-     destroyPopup();
-   }
-   return;
- }  
-
-}
-
-void SUPERVGraph_Graph::contentsMouseMoveEvent(QMouseEvent* e) {
-  //   main->sketchMove();
-}
-
-float SUPERVGraph_Graph::distance(int xp, int yp, int xl, int yl, int xn, int yn) {
-  float r, s;
-  float a, b, c, d;
-
-  float px = (float)(xp);
-  float py = (float)(yp);
-  float lx = (float)(xl);
-  float ly = (float)(yl);
-  float nx = (float)(xn);
-  float ny = (float)(yn);
-
-  r = px - lx;
-  r = r * r;
-  s = py - ly;
-  s = s * s;
-  a = r + s;
-
-  r = px - nx;
-  r = r * r;
-  s = py - ny;
-  s = s * s;
-  b = r + s;
-
-  r = nx - lx;
-  r = r * r;
-  s = ny - ly;
-  s = s * s;
-  c = r + s;
-
-  if (c<0.001) {
-    return(a);
-  } else {
-    r = a + c - b;
-    r = r * r;
-    d = r / ( 4 * c);
-    return(a - d);
-  };
-}
-
-QPoint SUPERVGraph_Graph::getPoint() {
-  return(where);
-}
-
-//  SUPERVGraph_Point* SUPERVGraph_Graph::findPoint(int x, int y) {
-//      float            m;
-//      float            d = SCROLL_MAX;
-//      SUPERVGraph_Point* t = NULL;
-//      SUPERVGraph_Point* c;
-//      SUPERVGraph_Point* n;
-//      QObjectList* points = queryList("SUPERVGraph_Point");
-//      QObjectListIt i(*points);
-
-//      while ((c=(SUPERVGraph_Point*)i.current()) != 0) {
-//          ++i;
-//          n=c->getNext();
-//          if (n != c) {
-//              m = distance(x, y, c->getX(), c->getY(), n->getX(), n->getY());
-//              if (m < d) {
-//                  d = m;
-//                  t = c;
-//              };
-//          };
-//      };
-//      delete points;
-//      return(t);
-//  }
-
-void SUPERVGraph_Graph::addPoint() {
-  //    int              x = where.x();
-  //      int              y = where.y();
-  //      SUPERVGraph_Point* p = findPoint(x, y);
-  //      if (p == NULL) {
-  //          QMessageBox::warning(0, "Supervision Error", "No Link to Add a Point");
-  //      } else {
-  //          p->addPoint(x, y, true);
-  //      };
-}
-
-void SUPERVGraph_Graph::deleteLink() {
-  //   SUPERVGraph_Point* p = findPoint(where.x(), where.y());
-  //      if (p == NULL) {
-  //          QMessageBox::warning(0, "Supervision Error", "No Link to Delete");
-  //      } else {
-  //          SUPERV_Link l = p->getLink();
-  //          if (l == NULL) {
-  //              QMessageBox::warning(0, "Supervision Error", "No Link to Delete");
-  //          } else {
-  //              l->Destroy();
-  //              main->sync();
-  //          };
-  //      };
-}
-
-void SUPERVGraph_Graph::showInformation() {
-  //   if (Supervision.information(Engines::Node::_narrow(main->getDataflow()), false)) {
-  //          main->sync();
-  //      };
-}
-
-void SUPERVGraph_Graph::changeInformation() {
-  //    if (Supervision.information(Engines::Node::_narrow(main->getDataflow()), true)) {
-  //          main->sync();
-  //      };
-}
-
-/*!
-    Creates the popup 
-*/
-void SUPERVGraph_Graph::onCreatePopup() 
-{
-  if ( myPopup ) {                     
-//    if (myPopup->count()<1) {
-    if ( myPopup->count() > 0 )
-      myIDs.append ( myPopup->insertSeparator() );     
-    int id;
-    myIDs.append ( id = myPopup->insertItem (tr ("MEN_VP3D_CHANGEBGR")) );     
-    QAD_ASSERT ( myPopup->connectItem ( id, this, SLOT(onChangeBackgroundColor())) );
-//    }
-  }
-}
-
-void SUPERVGraph_Graph::onChangeBackgroundColor()
-{
-  QColor previousColor = viewport()->backgroundColor();
-  QColor selColor = QColorDialog::getColor ( previousColor, NULL );    
-  if ( selColor.isValid() ) 
-    viewport()->setBackgroundColor( selColor );
-  
-  QAD_CONFIG->addSetting( "SUPERVGraph:BackgroundColorRed",   selColor.red() );
-  QAD_CONFIG->addSetting( "SUPERVGraph:BackgroundColorGreen", selColor.green() );
-  QAD_CONFIG->addSetting( "SUPERVGraph:BackgroundColorBlue",  selColor.blue() );
-}
diff --git a/src/SUPERVGraph/SUPERVGraph_Graph.h b/src/SUPERVGraph/SUPERVGraph_Graph.h
deleted file mode 100755 (executable)
index ccea5c6..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-//  SALOME SUPERVGraph : 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
-//
-//
-//
-//  File   : SUPERVGraph_Graph.h
-//  Author : Francis KLOSS
-//  Module : SALOME
-
-#ifndef SUPERVGraph_Graph_HXX
-#define SUPERVGraph_Graph_HXX
-
-#include "QAD.h"
-#include "QAD_Popup.h"
-
-#include <qscrollview.h>
-#include <qpopupmenu.h>
-
-class QAD_EXPORT SUPERVGraph_Graph: public QScrollView, public QAD_PopupClientServer
-{
-  Q_OBJECT
-
-public:
-  SUPERVGraph_Graph(QWidget* parent);
-  ~SUPERVGraph_Graph();
-
-  /* popup management */
-  void onCreatePopup();
-
-  void sync();
-  void contentsMousePressEvent(QMouseEvent* e);
-  void contentsMouseReleaseEvent(QMouseEvent* e);
-  void contentsMouseMoveEvent(QMouseEvent* e);
-  
-  QPoint getPoint();
-  
-public slots:
-  void Draw(int x, int y);
-  
-private slots:
-  void addPoint();
-  void deleteLink();
-  void showInformation();
-  void changeInformation();
-
-protected slots:
-  void onChangeBackgroundColor();
-
-protected:
-  bool eventFilter(QObject* object, QEvent* event);
-  
-private:
-//    SUPERVGraph_Point* findPoint(int x, int y);
-  float distance(int xp, int yp, int xl, int yl, int xn, int yn);
-  
-//    SUPERVGraph_Main* main;
-  QPoint          where;
-  QPopupMenu*     popup;
-  int             pci;
-  int             pan;
-  int             pap;
-  int             pdl;
-  int             pif;
-};
-
-#endif
index 07ecc21cc7710a95d58632c64f7a9637d23874ae..b468104832d3fb91c0cbe56203ccd3a8da87ac77 100755 (executable)
 using namespace std;
 #include "SUPERVGraph_ViewFrame.h"
 
-#include "QAD_Settings.h"
-#include "QAD_Config.h"
-#include "QAD_Application.h"
-#include "QAD_Desktop.h"
-#include "SALOME_Selection.h"
-
 #include "utilities.h"
 
 //QT Include
@@ -42,14 +36,23 @@ using namespace std;
 #include <qcolordialog.h>
 
 
-SUPERVGraph_View::SUPERVGraph_View(QWidget* theParent): QWidget(theParent){
+SUPERVGraph_View::SUPERVGraph_View( QWidget* theParent ): QWidget( theParent )
+{
   init(theParent);
 }
-SUPERVGraph_View::SUPERVGraph_View(SUPERVGraph_View* theParent): QWidget(theParent){
-  setPopupServer(theParent->getPopupServer());
+
+SUPERVGraph_View::SUPERVGraph_View( SUPERVGraph_View* theParent ): QWidget( theParent )
+{
   init(theParent);
 }
-void SUPERVGraph_View::init(QWidget* theParent){
+
+void SUPERVGraph_View::contextMenuPopup( QPopupMenu* )
+{
+  // to be implemented
+}
+
+void SUPERVGraph_View::init( QWidget* theParent )
+{
   if ( theParent->inherits( "QMainWindow" ) ) {
     ( ( QMainWindow* )theParent )->setCentralWidget( this );
   }
@@ -59,35 +62,15 @@ void SUPERVGraph_View::init(QWidget* theParent){
   }
 
 }
-void SUPERVGraph_View::onCreatePopup(){
-  /*
-  if ( myPopup ) {     
-    QAD_Desktop*     Desktop = (QAD_Desktop*) QAD_Application::getDesktop();
-    QAD_Study*   ActiveStudy = Desktop->getActiveStudy();
-    SALOME_Selection*      Sel = SALOME_Selection::Selection( ActiveStudy->getSelection() );
-    
-    QString theContext;
-    QString theParent("Viewer");
-    QString theObject;
-    
-    Desktop->definePopup( theContext, theParent, theObject );
-    Desktop->createPopup( myPopup, theContext, theParent, theObject);
-    Desktop->customPopup( myPopup, theContext, theParent, theObject );
-    if (Sel->IObjectCount() == 0 && myPopup->count()<1) {
-      int id;
-      myIDs.append ( id = myPopup->insertItem (tr ("MEN_VP3D_CHANGEBGR")) );   
-      QAD_ASSERT ( myPopup->connectItem ( id, this, SLOT(onChangeBackgroundColor())) );
-    }
-  }
-  */
- }
+
 /*!
     Constructor
 */
-SUPERVGraph_ViewFrame::SUPERVGraph_ViewFrame(QWidget* parent, const char* name
-  : QAD_ViewFrame(parent, name)
+SUPERVGraph_ViewFrame::SUPERVGraph_ViewFrame( SUIT_Desktop* theDesktop 
+  : SUIT_ViewWindow( theDesktop )
 {
   myView = 0;
+
   //myView = new SUPERVGraph_View(this); 
   // Set BackgroundColor
   /*
@@ -96,21 +79,21 @@ SUPERVGraph_ViewFrame::SUPERVGraph_ViewFrame(QWidget* parent, const char* name)
   int B = QAD_CONFIG->getSetting("SUPERVGraph:BackgroundColorBlue").toInt();
   setBackgroundColor(QColor(R,G,B));*/
 }
-SUPERVGraph_ViewFrame::~SUPERVGraph_ViewFrame(){}
+
+SUPERVGraph_ViewFrame::~SUPERVGraph_ViewFrame() {}
 
 /*!
   Returns widget containing 3D-Viewer
 */
-SUPERVGraph_View* SUPERVGraph_ViewFrame::getViewWidget(){
+SUPERVGraph_View* SUPERVGraph_ViewFrame::getViewWidget()
+{
   return myView;
 }
 
 
-void SUPERVGraph_ViewFrame::setViewWidget(SUPERVGraph_View* theView) {
+void SUPERVGraph_ViewFrame::setViewWidget( SUPERVGraph_View* theView )
+{
   myView = theView;
-  if (myApp) {
-    myView->setPopupServer(myApp);
-  }
 }
 
 
@@ -233,7 +216,7 @@ void SUPERVGraph_ViewFrame::onViewFitAll()
 /*!
     Set background of the viewport
 */
-void SUPERVGraph_ViewFrame::setBackgroundColor( const QColor& color)
+void SUPERVGraph_ViewFrame::setBackgroundColor( const QColor& color )
 {
     if (myView)
       myView->setPaletteBackgroundColor(color);
@@ -249,13 +232,7 @@ QColor SUPERVGraph_ViewFrame::backgroundColor() const
   return QMainWindow::backgroundColor();
 }
 
-
-void SUPERVGraph_ViewFrame::SetSelectionMode( Selection_Mode mode )
-{
-  MESSAGE ( "SUPERVGraph_ViewFrame::SetSelectionMode" )
-}
-
-void SUPERVGraph_ViewFrame::onAdjustTrihedron(  )
+void SUPERVGraph_ViewFrame::onAdjustTrihedron()
 {
   MESSAGE ( "SUPERVGraph_ViewFrame::onAdjustTrihedron" )  
 }
@@ -289,22 +266,14 @@ bool SUPERVGraph_ViewFrame::isVisible( const Handle(SALOME_InteractiveObject)& I
   return false;
 }
 
-void SUPERVGraph_ViewFrame::setPopupServer( QAD_Application* App )
-{
-  myApp = App;
-  if (myView) {
-    myView->setPopupServer(myApp);
-  }
-}
-
-void SUPERVGraph_ViewFrame::undo(const _PTR(Study)& aStudy,
-                                const char* StudyFrameEntry)
+void SUPERVGraph_ViewFrame::undo( const _PTR(Study)& aStudy,
+                                 const char* StudyFrameEntry )
 {
   MESSAGE ( "SUPERVGraph_ViewFrame::undo" )
 }
 
-void SUPERVGraph_ViewFrame::redo(const _PTR(Study)& aStudy,
-                                const char* StudyFrameEntry)
+void SUPERVGraph_ViewFrame::redo( const _PTR(Study)& aStudy,
+                                 const char* StudyFrameEntry )
 {
   MESSAGE ( "SUPERVGraph_ViewFrame::redo" )
 }
index 73133bd84c732770ca80849429921d09d4cdf4e3..e6b07bb3e0da9b82608c7bf950d12d8e5d98baf7 100755 (executable)
 #ifndef SUPERVGraph_ViewFrame_H
 #define SUPERVGraph_ViewFrame_H
 
-#include "QAD.h"
-#include "QAD_ViewFrame.h"
-#include "QAD_Application.h"
-
 #include "SALOME_InteractiveObject.hxx"
-#include "SALOME_Selection.h" 
 
 #include "SALOMEDSClient.hxx"
 
-class QAD_EXPORT SUPERVGraph_View: public QWidget, public QAD_PopupClientServer{
+#include "SalomeApp_Application.h"
+#include "SUIT_PopupClient.h"
+#include "SUIT_ViewWindow.h"
+
+class /*SUPERVGRAPH_EXPORT*/ SUPERVGraph_View: public QWidget, public SUIT_PopupClient {
   Q_OBJECT;
  public:
+  static QString Type() { return "SUPERVGraphViewer"; }
+
   SUPERVGraph_View(QWidget* theParent);
   SUPERVGraph_View(SUPERVGraph_View* theParent);
 
   virtual void ActivatePanning() = 0;
   virtual void ResetView() = 0;
+
+  /* redefine functions from SUIT_PopupClient */
+  virtual QString popupClientType() const { return Type(); }
+  virtual void    contextMenuPopup( QPopupMenu* );
+  
  protected:
   void init(QWidget* theParent);
-  void onCreatePopup();
 };
 
-class QAD_EXPORT SUPERVGraph_ViewFrame : public QAD_ViewFrame {
+class /*SUPERVGRAPH_EXPORT*/ SUPERVGraph_ViewFrame : public SUIT_ViewWindow {
   Q_OBJECT
 
     public:
-  SUPERVGraph_ViewFrame(QWidget* parent, const char* name=0 );
+  SUPERVGraph_ViewFrame(SUIT_Desktop* theDesktop );
   ~SUPERVGraph_ViewFrame();
 
-  ViewType                       getTypeView() const{ return VIEW_GRAPHSUPERV;};
   SUPERVGraph_View*              getViewWidget();
   void                           setViewWidget(SUPERVGraph_View* theView);
 
   void                           setBackgroundColor( const QColor& );
   QColor                         backgroundColor() const;
   
-  void                           SetSelectionMode( Selection_Mode mode );
-
   void                           onAdjustTrihedron( );
   
-  /*  popup management */
-  void                           setPopupServer( QAD_Application* );
-
   /*  interactive object management */
   void                           highlight( const Handle(SALOME_InteractiveObject)& IObject, 
                                            bool highlight, bool immediatly = true );
@@ -85,7 +84,7 @@ class QAD_EXPORT SUPERVGraph_ViewFrame : public QAD_ViewFrame {
   void              undo(const _PTR(Study)& aStudy, const char* StudyFrameEntry);
   void              redo(const _PTR(Study)& aStudy, const char* StudyFrameEntry);
 
-
+  
   /* selection */
   Handle(SALOME_InteractiveObject) FindIObject(const char* Entry) { Handle(SALOME_InteractiveObject) o; return o; };
 
@@ -112,9 +111,9 @@ class QAD_EXPORT SUPERVGraph_ViewFrame : public QAD_ViewFrame {
   void           onViewBottom();
   void           onViewTop();
   void           onViewTrihedron(); 
+  
  private:
   SUPERVGraph_View* myView;
-  QAD_Application* myApp;
+  SalomeApp_Application* myApp;
 }; 
 #endif
diff --git a/src/SUPERVGraph/SUPERVGraph_ViewManager.cxx b/src/SUPERVGraph/SUPERVGraph_ViewManager.cxx
new file mode 100644 (file)
index 0000000..a1a4865
--- /dev/null
@@ -0,0 +1,24 @@
+#include "SUPERVGraph_ViewManager.h"
+
+SUPERVGraph_ViewManager::SUPERVGraph_ViewManager( SUIT_Study* theStudy, 
+                                                 SUIT_Desktop* theDesktop, 
+                                                 SUIT_ViewModel* theViewModel )
+  : SUIT_ViewManager( theStudy, theDesktop, theViewModel )
+{
+}
+
+SUPERVGraph_ViewManager::~SUPERVGraph_ViewManager()
+{
+}
+
+void SUPERVGraph_ViewManager::setViewName(SUIT_ViewWindow* theView)
+{
+  int aPos = myViews.find(theView);
+  theView->setCaption( QString( "SUPERVISION  - viewer:%1" ).arg(aPos+1));
+}
+
+void SUPERVGraph_ViewManager::contextMenuPopup( QPopupMenu* thePopup)
+{
+  SUIT_ViewManager::contextMenuPopup( thePopup );
+  // to be implemented
+}
diff --git a/src/SUPERVGraph/SUPERVGraph_ViewManager.h b/src/SUPERVGraph/SUPERVGraph_ViewManager.h
new file mode 100644 (file)
index 0000000..95b87b8
--- /dev/null
@@ -0,0 +1,25 @@
+#ifndef SUPERVGRAPH_VIEWMANAGER_H
+#define SUPERVGRAPH_VIEWMANAGER_H
+
+#include "SUPERVGraph_ViewModel.h"
+
+#include "SUIT_ViewManager.h"
+
+class SUIT_Desktop;
+
+class /*SUPERVGRAPH_EXPORT*/ SUPERVGraph_ViewManager : public SUIT_ViewManager
+{
+  Q_OBJECT
+
+public:
+  SUPERVGraph_ViewManager( SUIT_Study* theStudy, SUIT_Desktop* theDesktop, SUIT_ViewModel* theViewModel = 0 );
+  ~SUPERVGraph_ViewManager();
+
+  virtual void      contextMenuPopup( QPopupMenu* thePopup );
+
+protected:
+  void              setViewName(SUIT_ViewWindow* theView);
+
+};
+
+#endif
diff --git a/src/SUPERVGraph/SUPERVGraph_ViewModel.cxx b/src/SUPERVGraph/SUPERVGraph_ViewModel.cxx
new file mode 100644 (file)
index 0000000..9fab92a
--- /dev/null
@@ -0,0 +1,19 @@
+#include "SUPERVGraph_ViewModel.h"
+#include "SUPERVGraph_ViewFrame.h"
+#include "SUIT_Desktop.h"
+#include "SUIT_ViewWindow.h"
+
+SUPERVGraph_Viewer::SUPERVGraph_Viewer()
+:SUIT_ViewModel() 
+{
+}
+
+SUPERVGraph_Viewer::~SUPERVGraph_Viewer() 
+{
+}
+
+SUIT_ViewWindow* SUPERVGraph_Viewer::createView(SUIT_Desktop* theDesktop)
+{
+  SUPERVGraph_ViewFrame* aRes = new SUPERVGraph_ViewFrame( theDesktop );
+  return aRes;
+}
diff --git a/src/SUPERVGraph/SUPERVGraph_ViewModel.h b/src/SUPERVGraph/SUPERVGraph_ViewModel.h
new file mode 100644 (file)
index 0000000..ab817da
--- /dev/null
@@ -0,0 +1,20 @@
+#ifndef SUPERVGRAPH_VIEWMODEL_H
+#define SUPERVGRAPH_VIEWMODEL_H
+
+#include "SUIT_ViewModel.h"
+
+class /*SUPERVGRAPH_EXPORT*/ SUPERVGraph_Viewer: public SUIT_ViewModel
+{
+  Q_OBJECT
+
+public:
+  static QString Type() { return "SUPERVGraphViewer"; }
+
+  SUPERVGraph_Viewer();
+  virtual ~SUPERVGraph_Viewer();
+
+  virtual SUIT_ViewWindow* createView(SUIT_Desktop* theDesktop);
+
+};
+
+#endif
index 12a6c7111590a7d39008820d5d6fc639e106f95e..ab30ac389e8a2efbdb0ffa6f7da4b24cb84d3831 100755 (executable)
@@ -93,7 +93,7 @@ RESOURCES_FILES = icon_about.png \
 CPPFLAGS+=$(PYTHON_INCLUDES) $(QT_INCLUDES) $(QWT_INCLUDES) $(OCC_INCLUDES) $(VTK_INCLUDES) $(BOOST_CPPFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
 
 LDFLAGS+=$(PYTHON_LIBS) $(QT_MT_LIBS) 
-LIBS+= -L$(GUI_ROOT_DIR)/lib/salome -lsuit -lstd -lCAM -lObjBrowser -L$(KERNEL_ROOT_DIR)/lib/salome -lOpUtil -lSALOMELocalTrace $(CAS_KERNEL) -lPlot2d -lGLViewer -lOCCViewer -lVTKViewer -lSalomeObject -lSVTK -lSOCC -lPyInterp -lPythonConsole
+LIBS+= -L$(GUI_ROOT_DIR)/lib/salome -lsuit -lstd -lCAM -lObjBrowser -L$(KERNEL_ROOT_DIR)/lib/salome -lOpUtil -lSALOMELocalTrace $(CAS_KERNEL) -lPlot2d -lGLViewer -lOCCViewer -lVTKViewer -lSalomeObject -lSVTK -lSOCC -lPyInterp -lPythonConsole -lLogWindow
 
 @CONCLUDE@
 
index 9303bf4c996071c6ad3e14646ecaebc1b3fe3525..16b65befe4057253330b057c7d91c2862cc20e9b 100644 (file)
@@ -8,7 +8,7 @@
     <parameter name="xterm"      value="no"/>
     <parameter name="portkill"   value="no"/>
     <parameter name="killall"    value="no"/>
-    <parameter name="modules"    value="GEOM,SMESH"/>
+    <parameter name="modules"    value="GEOM,SMESH,SUPERV"/>
     <parameter name="pyModules"  value=""/>
     <parameter name="embedded"   value="SalomeAppEngine"/>
     <parameter name="standalone" value="pyContainer,cppContainer,registry,moduleCatalog"/>
@@ -28,6 +28,7 @@
     <parameter name="GEOM"       value="${GEOM_ROOT_DIR}/share/salome/resources"/>
     <parameter name="SMESH"      value="${SMESH_ROOT_DIR}/share/salome/resources"/>
     <parameter name="VISU"       value="${VISU_ROOT_DIR}/share/salome/resources"/>
+    <parameter name="SUPERV"     value="${SUPERV_ROOT_DIR}/share/salome/resources"/>
   </section>
   <section name="GEOM">
     <parameter name="name"       value="Geometry"/>
     <parameter name="name"       value="Post-Pro"/>
     <parameter name="icon"       value="ModuleVisu.png"/>
   </section>
+  <section name="SUPERV">
+    <parameter name="name"       value="Supervision"/>
+    <parameter name="icon"       value="ModuleSupervision.png"/>
+  </section>
 <!-- values below this line are just an example, they are not used  -->
   <section name="application">
     <parameter name="QuickDirList" value=""/>