]> SALOME platform Git repositories - modules/superv.git/commitdiff
Salome HOME
Copy/Paste ports and nodes functionality was transfered to SUPERVGUI_Clipboard class...
authorasv <asv@opencascade.com>
Mon, 10 Jan 2005 06:13:52 +0000 (06:13 +0000)
committerasv <asv@opencascade.com>
Mon, 10 Jan 2005 06:13:52 +0000 (06:13 +0000)
src/SUPERVGUI/Makefile.in
src/SUPERVGUI/SUPERVGUI_CanvasControlNode.cxx
src/SUPERVGUI/SUPERVGUI_CanvasLink.cxx
src/SUPERVGUI/SUPERVGUI_CanvasNode.cxx
src/SUPERVGUI/SUPERVGUI_CanvasNode.h
src/SUPERVGUI/SUPERVGUI_CanvasPort.cxx
src/SUPERVGUI/SUPERVGUI_CanvasView.cxx
src/SUPERVGUI/SUPERVGUI_Clipboard.cxx [new file with mode: 0644]
src/SUPERVGUI/SUPERVGUI_Clipboard.h [new file with mode: 0644]
src/SUPERVGUI/SUPERVGUI_Main.cxx
src/SUPERVGUI/SUPERVGUI_Main.h

index 63787225fe381130c4d7312caefe0e7bdb69b1f8..f9d6866329571e711d9d1346c058a26e723cfa5a 100644 (file)
@@ -65,7 +65,8 @@ LIB_SRC = SUPERVGUI.cxx                      \
          SUPERVGUI_Information.cxx          \
          SUPERVGUI_Notification.cxx         \
          SUPERVGUI_ManagePortsDlg.cxx       \
-         SUPERVGUI_Library.cxx
+         SUPERVGUI_Library.cxx              \
+         SUPERVGUI_Clipboard.cxx
 
 LIB_MOC = SUPERVGUI.h                        \
          SUPERVGUI_ArrayView.h              \
@@ -82,7 +83,8 @@ LIB_MOC = SUPERVGUI.h                        \
          SUPERVGUI_Information.h            \
          SUPERVGUI_Notification.h           \
          SUPERVGUI_ManagePortsDlg.h         \
-         SUPERVGUI_Library.h
+         SUPERVGUI_Library.h                \
+         SUPERVGUI_Clipboard.h
 
 LIB_CLIENT_IDL = SALOMEDS.idl                \
                 SALOMEDS_Attributes.idl     \
index 7fe0df8492bcc76ec1162a282a50a7161a21ff3f..4f850b08243f5292beb5c8f3851b84cd7a502ddd 100644 (file)
@@ -10,6 +10,7 @@ using namespace std;
 #include "SUPERVGUI_CanvasControlNode.h"
 #include "SUPERVGUI_CanvasControlNodePrs.h"
 #include "SUPERVGUI_CanvasCellNodePrs.h"
+#include "SUPERVGUI_Clipboard.h"
 #include "SUPERVGUI_Main.h"
 #include "SUPERVGUI.h"
 #include "SUPERVGUI_Canvas.h"
@@ -87,28 +88,30 @@ void SUPERVGUI_CanvasStartNode::remove()
   SUPERVGUI_Canvas* aCanvas = getMain()->getCanvas();
 
   setDestroyed();
+  SUPERVGUI_Clipboard* aCB = SUPERVGUI_Clipboard::getClipboard();
   if (myCoupled) {
 
     //set myCopyPort from Main object to empty if engine of this port is deleted
     //check if any port of this deleted node has been copied
-    if (!SUPERV_isNull(getMain()->getCopyPort()) || getMain()->getCopyPort())
-      if ((QString(getEngine()->Name())).compare(QString(getMain()->getCopyPort()->Node()->Name())) == 0
-         ||
-         (QString(myCoupled->getEngine()->Name())).compare(QString(getMain()->getCopyPort()->Node()->Name())) == 0)
-       getMain()->setCopyPort(NULL);
+    if ( aCB->isCopyPort() )
+      if ( QString(getEngine()->Name()) == QString(aCB->getCopyPort()->Node()->Name())   ||
+          QString(myCoupled->getEngine()->Name()) == QString(aCB->getCopyPort()->Node()->Name()) )
+       aCB->setCopyPort( 0 );
     
     myCoupled->setDestroyed();
   }
 
   //set myCopyNode from Main object to empty if engine of this node is deleted
   //check if myCopyNode and this node engine is equal
-  if (!SUPERV_isNull(getMain()->getCopyNode()) || getMain()->getCopyNode())
-    if ((QString(getEngine()->Name())).compare(QString(getMain()->getCopyNode()->Name())) == 0
-      getMain()->setCopyNode(NULL);
+  if ( aCB->isCopyNode() )
+    if ( QString(getEngine()->Name()) == QString(aCB->getCopyNode()->Name()) 
+      aCB->setCopyNode( 0 );
 
   getEngine()->destroy();
 
-  if (myCoupled) delete myCoupled;
+  if (myCoupled) 
+    delete myCoupled;
+
   delete this;
 
   aCanvas->update();
@@ -138,12 +141,12 @@ void SUPERVGUI_CanvasStartNode::addOutputPort()
  
 void SUPERVGUI_CanvasStartNode::pastePort()
 {
+  SUPERVGUI_Clipboard* aCB = SUPERVGUI_Clipboard::getClipboard();
   SUPERVGUI_CanvasNode::pastePort();
-  if (getMain()->getCopyPort()->IsInput() //paste input port
-      &&
-      getEngine()->IsLoop()) 
+  if ( aCB->getCopyPort()->IsInput() && getEngine()->IsLoop() ) 
     merge();
-  if (myCoupled) myCoupled->merge();
+  if ( myCoupled )
+    myCoupled->merge();
 }
 
 //=====================================================================
index 08ad4a67e86377cee53260d75d4b6622a32bd9e1..5ae3abfdd7183e48084784b915b05155dd38615f 100644 (file)
@@ -367,20 +367,24 @@ bool SUPERVGUI_CanvasLinkBuilder::canCreateEngine(SUPERVGUI_CanvasPort* thePort)
        (aOutKind == SUPERV::DataStreamParameter && aInKind != SUPERV::DataStreamParameter))
       return false;
 
-    // connect gate port with gate or inline port
-    if (aInKind == SUPERV::GateParameter || aOutKind == SUPERV::GateParameter) {
-      if (aInKind != aOutKind && 
-         aInKind != SUPERV::InLineParameter && 
-         aOutKind != SUPERV::InLineParameter)
+    // asv : 15.12.04 : NOT allow to connect Gate-to-InLine --> it does not make sence!
+    // Out Gate port can be connected only to In Gate port 
+    if ( aOutKind == SUPERV::GateParameter && aInKind != SUPERV::GateParameter )
+      return false;
+
+    // In Gate can be connected to (receive links from) Gate port and InLine ports (important for Switch nodes)
+    if ( aInKind == SUPERV::GateParameter && aOutKind != SUPERV::GateParameter && aOutKind != SUPERV::InLineParameter )
        return false;
-    }
 
     // control if port is already linked except for input port of end switch node
     if (!(aInKind == SUPERV::EndSwitchParameter || 
          aInPort->getEngine()->Node()->Kind() == SUPERV::EndSwitchNode)) {
-      if (aInPort->getEngine()->IsLinked())
+      // asv : 15.12.04 : PAL7374, p.2.2 "Bugs and Improvements": multiple links into Gate port 
+      //                  for InGate it's OK to accept more than 1 link
+      if ( aInPort->getEngine()->IsLinked() && aInKind != SUPERV::GateParameter ) 
        return false;
     }
+
     result = true;
   }
   return result;
index a8f9e6c5cfc18bbdb9bddcb07b40192815e12954..997e51a7c8cc84d4bb6cc9f96b7b0a7dc7286ab0 100644 (file)
@@ -10,6 +10,7 @@ using namespace std;
 #include "SUPERVGUI_CanvasNode.h"
 #include "SUPERVGUI_CanvasNodePrs.h"
 #include "SUPERVGUI_CanvasPort.h"
+#include "SUPERVGUI_Clipboard.h"
 #include "SUPERVGUI_Main.h"
 #include "SUPERVGUI.h"
 #include "SUPERVGUI_BrowseNodeDlg.h"
@@ -189,8 +190,8 @@ QPopupMenu* SUPERVGUI_CanvasNode::getPopupMenu(QWidget* theParent)
 
        // Paste Port functionality
        int aPasteItem = popup->insertItem(tr("ITM_PASTE_PORT"), this, SLOT(pastePort()));
-       if ( SUPERV_isNull(myMain->getCopyPort()) || !(myMain->getCopyPort()) ||
-           (type == SUPERV::LoopNode && !myMain->getCopyPort()->IsInput()) )
+       SUPERVGUI_Clipboard* aCB = SUPERVGUI_Clipboard::getClipboard();
+       if ( !aCB->isCopyPort() || (type == SUPERV::LoopNode && !aCB->getCopyPort()->IsInput()) )
          popup->setItemEnabled( aPasteItem, false );
       }
     }
@@ -366,15 +367,16 @@ void SUPERVGUI_CanvasNode::remove() {
 
   //set myCopyPort from Main object to empty if engine of this port is deleted
   //check if any port of this deleted node has been copied
-  if (!SUPERV_isNull(getMain()->getCopyPort()) || getMain()->getCopyPort())
-    if ((QString(myNode->Name())).compare(QString(getMain()->getCopyPort()->Node()->Name())) == 0)
-      getMain()->setCopyPort(NULL);
+  SUPERVGUI_Clipboard* aCB = SUPERVGUI_Clipboard::getClipboard();
+  if ( aCB->isCopyPort() )
+    if ( QString(myNode->Name()) == QString(aCB->getCopyPort()->Node()->Name()) )
+      aCB->setCopyPort( 0 );
 
   //set myCopyNode from Main object to empty if engine of this node is deleted
   //check if myCopyNode and this node engine is equal
-  if (!SUPERV_isNull(getMain()->getCopyNode()) || getMain()->getCopyNode())
-    if ((QString(myNode->Name())).compare(QString(getMain()->getCopyNode()->Name())) == 0
-      getMain()->setCopyNode(NULL);
+  if ( aCB->isCopyNode() )
+    if ( QString(myNode->Name()) == QString(aCB->getCopyNode()->Name()) 
+      aCB->setCopyNode( 0 );
       
   Trace("SUPERVGUI_CanvasNode::remove");
   SUPERVGUI_Canvas* aCanvas = myMain->getCanvas();
@@ -386,13 +388,12 @@ void SUPERVGUI_CanvasNode::remove() {
 
 void SUPERVGUI_CanvasNode::copy() {
   Trace("SUPERVGUI_CanvasNode::copy()");
-  //MESSAGE(" -> SUPERVGUI_CanvasNode::copy()");
-  if (getNodeType() == SUPERV::EndLoopNode
-      ||
-      getNodeType() == SUPERV::EndSwitchNode)
-    getMain()->setCopyNode(SUPERV::CNode::_duplicate(SUPERV::GNode::_narrow(getEngine())->Coupled()));
+  SUPERVGUI_Clipboard* aCB = SUPERVGUI_Clipboard::getClipboard();
+  const int aKind = getNodeType(); 
+  if ( aKind == SUPERV::EndLoopNode || aKind == SUPERV::EndSwitchNode )
+    aCB->setCopyNode( SUPERV::CNode::_duplicate(SUPERV::GNode::_narrow(getEngine())->Coupled()) );
   else
-    getMain()->setCopyNode(SUPERV::CNode::_duplicate(getEngine()));
+    aCB->setCopyNode( SUPERV::CNode::_duplicate( getEngine() ) );
 }
 
 void SUPERVGUI_CanvasNode::suspendResume() {
@@ -640,37 +641,11 @@ void SUPERVGUI_CanvasNode::editFunction()  {
   }
 }
 
-void SUPERVGUI_CanvasNode::pastePort()
-{
-  //MESSAGE(" -> SUPERVGUI_CanvasNode::pastePort()");
-  
-  SUPERV_Port aPort = myMain->getCopyPort();
-  if (!SUPERV_isNull(aPort)) {
-    SUPERV_INode aNode = getInlineNode();
-    if (!SUPERV_isNull(aNode)) {
-      QString aName = aPort->Name();
-      QString aType = aPort->Type();
-      SUPERV_Port aPastePort;
-      if (aPort->IsInput()) {
-       //check if port with such name is alredy exists
-       QStringList aNames = getPortsNamesIN(aNode, true);
-       if (aNames.contains(aName))
-         QMessageBox::warning( QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_PORT_EXIST") );
-       else
-         aPastePort = aNode->InPort(aName.latin1(), aType.latin1());
-      }
-      else {
-       //check if port with such name is already exists
-       QStringList aNames = getPortsNamesIN(aNode, false);
-       if (aNames.contains(aName))
-         QMessageBox::warning( QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_PORT_EXIST") );
-       else
-         aPastePort = aNode->OutPort(aName.latin1(), aType.latin1());
-      }
-      if (!SUPERV_isNull(aPastePort))
-       createPort(aPastePort.in());
-    }
-  }
+/** 
+ * Called on "Paste port" command of popup menu
+ */
+void SUPERVGUI_CanvasNode::pastePort() {
+  SUPERVGUI_Clipboard::getClipboard()->pastePort( this );
 }
 
 /** 
index ae25e0e87465efbca5352041522deeadf50a6768..acead4ec3b09127e020e60179994d01e66ce9ddc 100644 (file)
@@ -19,6 +19,7 @@ class SUPERVGUI_CanvasNodePrs;
 
 class SUPERVGUI_CanvasNode : public QObject {
   friend class SUPERVGUI_ManagePortsDlg;
+  friend class SUPERVGUI_Clipboard;
 
   Q_OBJECT
 
index 6a10fa2421f9a67fef84f5afbc4aade4eb542670..39577fc69fe2182cb60c4ab41d378101ed102c11 100644 (file)
@@ -11,6 +11,7 @@ using namespace std;
 #include "SUPERVGUI_CanvasNode.h"
 #include "SUPERVGUI_CanvasLink.h"
 #include "SUPERVGUI_CanvasNodePrs.h"
+#include "SUPERVGUI_Clipboard.h"
 #include "SUPERVGUI_Main.h"
 #include "SUPERVGUI.h"
 #include "SUPERVGUI_BrowseNodeDlg.h"
@@ -127,13 +128,12 @@ void SUPERVGUI_CanvasPort::remove() {
 
   //set myCopyPort from Main object to empty if engine of this port is deleted
   //check if myCopyPort and this port engine is equal
-  if (!SUPERV_isNull(getMain()->getCopyPort()) || getMain()->getCopyPort())
-    if ((QString(myPort->Node()->Name())).compare(QString(getMain()->getCopyPort()->Node()->Name())) == 0
-       &&
-       (QString(myPort->Name())).compare(QString(getMain()->getCopyPort()->Name())) == 0
-       &&
-       myPort->IsInput() == getMain()->getCopyPort()->IsInput())
-       getMain()->setCopyPort(NULL);
+  SUPERVGUI_Clipboard* aCB = SUPERVGUI_Clipboard::getClipboard();
+  if ( aCB->isCopyPort() )
+    if ( QString(myPort->Node()->Name()) == QString(aCB->getCopyPort()->Node()->Name()) &&
+        QString(myPort->Name()) == QString(aCB->getCopyPort()->Name()) &&
+        myPort->IsInput() == aCB->getCopyPort()->IsInput() )
+       aCB->setCopyPort( 0 );
 
   Trace("SUPERVGUI_CanvasPort::remove");
   myPort->destroy();
@@ -181,8 +181,8 @@ void SUPERVGUI_CanvasPort::browse()
 
 void SUPERVGUI_CanvasPort::copy()
 {
-  //MESSAGE(" -> SUPERVGUI_CanvasPort::copy()");
-  getMain()->setCopyPort(SUPERV::Port::_duplicate(getEngine()));
+  SUPERVGUI_Clipboard* aCB = SUPERVGUI_Clipboard::getClipboard();
+  aCB->setCopyPort(SUPERV::Port::_duplicate(getEngine()));
 }
 
 //***********************************************************
index 465d9f178eacad57d7ffb9feee4859015ac12551..d86b9cc5aa9aab97ea9ff839553cf39247c9abd0 100644 (file)
@@ -16,6 +16,7 @@ using namespace std;
 #include "SUPERVGUI_CanvasPort.h"
 #include "SUPERVGUI_CanvasLink.h"
 #include "SUPERVGUI_CanvasNodePrs.h"
+#include "SUPERVGUI_Clipboard.h"
 
 #include "QAD_Config.h"
 #include "QAD_MessageBox.h"
@@ -101,7 +102,8 @@ SUPERVGUI_CanvasView::SUPERVGUI_CanvasView(SUPERVGUI_Canvas* theCanvas, SUPERVGU
     myPopup->insertItem(tr("MSG_ADD_NODE"), myMain, SLOT(addNode()));
 
     // Paste Node functionality
-    myPasteNodeItem = myPopup->insertItem(tr("ITM_PASTE_NODE"), myMain, SLOT(pasteNode()));
+    SUPERVGUI_Clipboard* aCB = SUPERVGUI_Clipboard::getClipboard();
+    myPasteNodeItem = myPopup->insertItem(tr("ITM_PASTE_NODE"), aCB, SLOT(pasteNode()));
 
     myPopup->insertItem(tr("MSG_INS_FILE"), myMain, SLOT(insertFile()));
     myPopup->insertSeparator();
@@ -222,10 +224,8 @@ void SUPERVGUI_CanvasView::contentsMousePressEvent(QMouseEvent* theEvent)
        
     myPopup->setItemEnabled(myAddStudyItem, !myMain->isFromStudy());
     // Paste Node functionality
-    if (SUPERV_isNull(myMain->getCopyNode()) || !(myMain->getCopyNode()))
-      myPopup->setItemEnabled(myPasteNodeItem, false);
-    else
-      myPopup->setItemEnabled(myPasteNodeItem, true);
+    SUPERVGUI_Clipboard* aCB = SUPERVGUI_Clipboard::getClipboard(); 
+    myPopup->setItemEnabled(myPasteNodeItem, aCB->isCopyNode() );
     myMain->showPopup(myPopup, theEvent);
     return;
   }
diff --git a/src/SUPERVGUI/SUPERVGUI_Clipboard.cxx b/src/SUPERVGUI/SUPERVGUI_Clipboard.cxx
new file mode 100644 (file)
index 0000000..6b2f500
--- /dev/null
@@ -0,0 +1,309 @@
+//  SUPERV SUPERVGUI : GUI for Supervisor component
+//
+//  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   : SUPERVGUI_Clipboard.cxx
+//  Author : Alexander SLADKOV
+//  Module : SUPERV
+
+
+#include "SUPERVGUI_Clipboard.h"
+#include "SUPERVGUI_CanvasNode.h"
+#include "SUPERVGUI.h"
+
+
+SUPERVGUI_Clipboard* SUPERVGUI_Clipboard::myCB = 0;
+
+
+/**
+ * Compute the next valid name for a Python function (add "_N" if a function with given name already exists)
+ */
+QString getNewName( QStringList& allNames, const QString& oldName ) {
+  QString newName;
+  int id = 1; //increment index
+  newName = oldName + QString("_") + QString::number( id );
+  while ( allNames.contains( newName ) )
+    newName = oldName + QString("_") + QString::number( ++id );
+  
+  return newName;
+}
+
+/**
+ * Replaces "def*origName*" string with "def*newName*" string 
+ */
+bool replaceName( SUPERV::ListOfStrings_var& theFunc, const QString& origName, const QString& newName ) {
+  // asv : 30.12.04 : it's a mistake to replace all function_name-s in all function_strings.  
+  // must be only in "def XXX():", with "do-while" I want to skip all empty and comment lines..
+  int i( 0 ), index( -1 );
+  do {
+    QString aLine( theFunc[i] );
+    index = aLine.find(origName);
+    if ( index >= 0 && aLine.startsWith( "def" ) ) { // looking for "def*origName*"
+      theFunc[i] = aLine.replace( index, origName.length(), newName ).latin1();
+      return true;
+    }
+    i++;
+  }
+  while ( i < theFunc->length() );
+  return false;
+}
+
+/**
+ * "Copies" all ports from fromNode to toNode: creates the sames ports in toNode in fact
+ */
+void copyPorts( const SUPERV::CNode_var& fromNode, const SUPERV::INode_var& toNode ) {
+  if ( CORBA::is_nil( fromNode ) || CORBA::is_nil( toNode ) )
+    return;
+  SUPERV::ListOfPorts_var aPList = fromNode->Ports();
+  QString aName, aType;
+  for (int i = 0; i < aPList->length(); i++) {
+    aName = aPList[i].in()->Name();
+    aType = aPList[i].in()->Type();
+    if ( aPList[i].in()->IsInput() )
+      toNode->InPort( aName.latin1(), aType.latin1() );
+    else
+      toNode->OutPort( aName.latin1(), aType.latin1() );
+  }
+}
+
+/**
+ * Called on Paste Node command.  Inserts a new node to the dataflow equal to the copied node.
+ * For InLine nodes the Python function name is changed ("_N" added).
+ */
+void SUPERVGUI_Clipboard::pasteNode() {
+  Trace("SUPERVGUI_Main::pasteNode");
+  SUPERV::CNode_var aNode = getCopyNode();
+  if ( !CORBA::is_nil( aNode ) ) {
+
+    //collect all python functions names of allready exist InLine nodes 
+    //in QStringList for automatic change of function's name on Paste of InLine node
+    QStringList aFuncNames;
+    SUPERV::Graph_var dataflow = Supervision.getMain()->getDataflow();
+    SUPERV::ListOfNodes_var nodes = dataflow->Nodes();
+    //InLine nodes
+    for(int i = 0; i < nodes->INodes.length(); i++)
+      aFuncNames.append(nodes->INodes[i]->PyFuncName());
+    //Loop nodes
+    for(int i = 0; i < nodes->LNodes.length(); i++) {
+      aFuncNames.append(nodes->LNodes[i]->PyInitName());
+      aFuncNames.append(nodes->LNodes[i]->PyMoreName());
+      aFuncNames.append(nodes->LNodes[i]->PyNextName());
+    }
+    //Switch nodes
+    for(int i = 0; i < nodes->SNodes.length(); i++)
+      aFuncNames.append(nodes->SNodes[i]->PyFuncName());
+    //GOTO nodes
+    for(int i = 0; i < nodes->GNodes.length(); i++)
+      aFuncNames.append(nodes->GNodes[i]->PyFuncName());
+
+    int id, fid;
+    QString aOriginalName;
+
+    // automatic change of function_name and function_strings ( +"_N" )
+    QString aFName, aInitFName, aMoreFName, aNextFName;
+    SUPERV::ListOfStrings_var aFunc, aInitFunc, aMoreFunc, aNextFunc;    
+
+    const int aKind = aNode->Kind();
+
+    if ( aKind == SUPERV::InLineNode || aKind == SUPERV::GOTONode || aKind == SUPERV::SwitchNode ) {
+      // "fix" Main function_name and Main function_strings
+      aOriginalName = SUPERV::INode::_narrow(aNode)->PyFuncName();
+      if ( !aOriginalName.isEmpty() ) {
+       aFName = getNewName( aFuncNames, aOriginalName );
+       aFunc = SUPERV::INode::_narrow(aNode)->PyFunction();
+       replaceName( aFunc, aOriginalName, aFName );
+      }
+    }
+    else if (aNode->Kind() == SUPERV::LoopNode) {
+
+      // "fix" Init function_name and Init function_strings
+      aOriginalName = SUPERV::LNode::_narrow(aNode)->PyInitName();
+      if (!aOriginalName.isEmpty()) {
+       aInitFName = getNewName( aFuncNames, aOriginalName );
+       aInitFunc = SUPERV::LNode::_narrow(aNode)->PyInit();
+       replaceName( aInitFunc, aOriginalName, aInitFName );
+      }
+
+      // "fix" More function_name and More function_strings
+      aOriginalName = SUPERV::LNode::_narrow(aNode)->PyMoreName();
+      if (!aOriginalName.isEmpty()) {
+       aMoreFName = getNewName( aFuncNames, aOriginalName );
+       aMoreFunc = SUPERV::LNode::_narrow(aNode)->PyMore();
+       replaceName( aMoreFunc, aOriginalName, aMoreFName );
+      }
+
+      // "fix" Next function_name and Next function_strings
+      aOriginalName = SUPERV::LNode::_narrow(aNode)->PyNextName();
+      if (!aOriginalName.isEmpty()) {
+       aNextFName = getNewName( aFuncNames, aOriginalName );
+       aNextFunc = SUPERV::LNode::_narrow(aNode)->PyNext();
+       replaceName( aNextFunc, aOriginalName, aNextFName );
+      }
+    }
+    
+    int cx, cy;
+    //2.8 point of improvements: Adding node to graph window with taking into account zoom factor
+    SUPERVGUI_CanvasView* aCanvasView = Supervision.getMain()->getCanvasView();
+    QWMatrix aWM = aCanvasView->worldMatrix();
+    switch (aNode->Kind()) {
+    case SUPERV::FactoryNode : 
+      {
+       SUPERV::FNode_var aFNode = dataflow->FNode( SUPERV::FNode::_narrow(aNode)->GetComponentName(),
+                                              SUPERV::FNode::_narrow(aNode)->GetInterfaceName(),
+                                              *SUPERV::FNode::_narrow(aNode)->Service() );
+       if (CORBA::is_nil(aFNode)) {
+         QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
+         return;
+       }
+
+       SUPERV::INode_var aDummyEndNode;
+       Supervision.getBrowser()->addNode(SUPERV::CNode::_narrow(aFNode), aDummyEndNode, myXCopyNode, myYCopyNode);
+      }
+      break;
+    case SUPERV::ComputingNode : 
+      {
+       SUPERV::CNode_var aCNode = dataflow->CNode(*SUPERV::CNode::_narrow(aNode)->Service());
+       if (CORBA::is_nil(aCNode)) {
+         QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
+         return;
+       }
+       
+       SUPERV::INode_var aDummyEndNode;
+       Supervision.getBrowser()->addNode(aCNode, aDummyEndNode, myXCopyNode, myYCopyNode);
+      }
+      break;
+    case SUPERV::InLineNode : 
+      {
+       SUPERV::INode_var aINode = dataflow->INode( aFName, aFunc );
+
+       if (CORBA::is_nil(aINode)) {
+         QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
+         return;
+       }
+       copyPorts( aNode, aINode );
+
+       SUPERV::INode_var aDummyEndNode;
+       Supervision.getBrowser()->addNode(SUPERV::CNode::_narrow(aINode), aDummyEndNode, myXCopyNode, myYCopyNode);
+      }
+      break;
+    case SUPERV::LoopNode :
+      {
+       SUPERV::INode_var aEndNode;
+       SUPERV::LNode_var aStartNode = dataflow->LNode(aInitFName, aInitFunc, aMoreFName, aMoreFunc, aNextFName, aNextFunc, aEndNode);
+       if (CORBA::is_nil(aStartNode) || CORBA::is_nil(aEndNode)) {
+         QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
+         return;
+       }
+       copyPorts( aNode, SUPERV::INode::_narrow( aStartNode ) );
+
+       Supervision.getBrowser()->addNode(SUPERV::CNode::_narrow(aStartNode), aEndNode, myXCopyNode, myYCopyNode);
+      }
+      break;
+    case SUPERV::SwitchNode :
+      {
+       SUPERV::INode_var aEndNode;
+       SUPERV::SNode_var aStartNode = dataflow->SNode(aFName, aFunc, aEndNode);
+       if (CORBA::is_nil(aStartNode) || CORBA::is_nil(aEndNode)) {
+         QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
+         return;
+       }
+       copyPorts( aNode, SUPERV::INode::_narrow( aStartNode ) );
+       SUPERV::INode_var aNodeEnd = SUPERV::SNode::_narrow(aNode)->Coupled();
+       copyPorts( SUPERV::CNode::_narrow( aNodeEnd ), aEndNode );
+
+       Supervision.getBrowser()->addNode(SUPERV::CNode::_narrow(aStartNode), aEndNode, myXCopyNode, myYCopyNode);
+      }
+      break;
+    case SUPERV::GOTONode :
+      {
+       SUPERV::GNode_var aGNode = dataflow->GNode(aFName, aFunc, "");
+       if (CORBA::is_nil(aGNode)) {
+         QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
+         return;
+       }
+       copyPorts( aNode, SUPERV::INode::_narrow( aGNode ) );
+
+       SUPERV::INode_var aDummyEndNode;
+       Supervision.getBrowser()->addNode(SUPERV::CNode::_narrow(aGNode), aDummyEndNode, myXCopyNode, myYCopyNode);
+      }
+      break;
+    case SUPERV::MacroNode :
+      {
+       /* to implement in the future */
+       /*
+       //get SubGraph from MacroNode
+       SUPERV::Graph_var aMacro = SUPERV::Graph::_narrow(aNode);
+       SUPERV::Graph_var aGraph;
+       if (aMacro->IsStreamMacro())
+         aGraph = aMacro->StreamObjRef();
+       else
+         aGraph = aMacro->FlowObjRef();
+       SUPERV::Graph_var aMacroNode = dataflow->GraphMNode(aGraph);
+       
+       if (CORBA::is_nil(aMacroNode)) {
+         QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
+         return;
+       }
+
+       SUPERV::INode_var aDummyEndNode;
+       Supervision.getBrowser()->addNode(SUPERV::CNode::_narrow(aMacroNode), aDummyEndNode, myXCopyNode, myYCopyNode);
+       */
+      }
+      break;
+    }
+  }
+}
+
+
+/** 
+ * Called from CanvasNode on "Paste port" command of popup menu
+ */
+void SUPERVGUI_Clipboard::pastePort( SUPERVGUI_CanvasNode* node )
+{
+  SUPERV::Port_var aPort = getCopyPort();
+  if ( !CORBA::is_nil(aPort) ) {
+    SUPERV::INode_var aNode = node->getInlineNode();
+    if (!CORBA::is_nil(aNode)) {
+      QString aName = aPort->Name();
+      QString aType = aPort->Type();
+      SUPERV::Port_var aPastePort;
+      if (aPort->IsInput()) {
+       //check if port with such name is alredy exists
+       QStringList aNames = node->getPortsNamesIN(aNode, true);
+       if (aNames.contains(aName))
+         QMessageBox::warning( QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_PORT_EXIST") );
+       else
+         aPastePort = aNode->InPort(aName.latin1(), aType.latin1());
+      }
+      else {
+       //check if port with such name is already exists
+       QStringList aNames = node->getPortsNamesIN(aNode, false);
+       if (aNames.contains(aName))
+         QMessageBox::warning( QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_PORT_EXIST") );
+       else
+         aPastePort = aNode->OutPort(aName.latin1(), aType.latin1());
+      }
+      if ( !CORBA::is_nil(aPastePort) )
+       node->createPort( aPastePort.in() );
+    }
+  }
+}
diff --git a/src/SUPERVGUI/SUPERVGUI_Clipboard.h b/src/SUPERVGUI/SUPERVGUI_Clipboard.h
new file mode 100644 (file)
index 0000000..b40e979
--- /dev/null
@@ -0,0 +1,77 @@
+//  SUPERV SUPERVGUI : GUI for Supervisor component
+//
+//  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   : SUPERVGUI_Clipboard.h
+//  Author : Alexander SLADKOV
+//  Module : SUPERV
+
+#ifndef SUPERVGUI_Clipboard_H
+#define SUPERVGUI_Clipboard_H
+
+#include <qobject.h>
+
+#include "utilities.h"
+#include "SALOME_LifeCycleCORBA.hxx"
+#include CORBA_CLIENT_HEADER(SUPERV)
+
+class SUPERVGUI_CanvasNode;
+
+class SUPERVGUI_Clipboard : public QObject {
+
+Q_OBJECT
+
+protected:
+  // constructor made protected.  Access via getClipboard() member function.
+  SUPERVGUI_Clipboard();
+  virtual ~SUPERVGUI_Clipboard();
+
+public:
+
+  static SUPERVGUI_Clipboard* getClipboard() {
+    if ( !myCB )
+      myCB = new SUPERVGUI_Clipboard();
+    return myCB;
+  }
+
+  bool isCopyPort() const { return ( myCopyPort && !CORBA::is_nil( myCopyPort ) ); }
+  SUPERV::Port_var getCopyPort() const            { return myCopyPort;   }
+  void setCopyPort( SUPERV::Port_var theObj )     { myCopyPort = theObj; }
+
+  bool isCopyNode() const { return ( myCopyNode && !CORBA::is_nil( myCopyNode ) ); }
+  SUPERV::CNode_var getCopyNode() const           { return myCopyNode;   }
+  void setCopyNode( SUPERV::CNode_var theObj )    { myCopyNode = theObj; }
+
+public slots:
+  void pasteNode();
+  void pastePort( SUPERVGUI_CanvasNode* node );
+
+private:
+  static SUPERVGUI_Clipboard* myCB;
+
+  SUPERV::Port_var        myCopyPort;
+  SUPERV::CNode_var       myCopyNode;
+  int                     myXCopyNode;
+  int                     myYCopyNode;
+};
+
+#endif
index fb305bca14022ed13a06a1f8310bbfcadde0d656..e4541436f320dd8fb059d59d4c955c34b834cb01 100644 (file)
@@ -70,10 +70,6 @@ SUPERVGUI_Main::SUPERVGUI_Main(SUPERVGraph_ViewFrame* theParent, QAD_Desktop* th
        myGUIEventLoopFinished( true )
 {
   Trace("SUPERVGUI_Main::SUPERVGUI_Main (copy)");
-  myCopyPort = 0;
-  myCopyNode = 0;
-  myXCopyNode = 0;
-  myYCopyNode = 0;
   theParent->setViewWidget(this);  
   dataflow = theDataFlow;
   if (SUPERV_isNull(dataflow)) {
@@ -614,288 +610,6 @@ void SUPERVGUI_Main::addNode() {
   Supervision.getBrowser()->choose();
 }
 
-void SUPERVGUI_Main::pasteNode() {
-  Trace("SUPERVGUI_Main::pasteNode");
-  //MESSAGE(" -> SUPERVGUI_Main::pasteNode()");
-  SUPERV_CNode aNode = getCopyNode();
-  if (!SUPERV_isNull(aNode)) {
-
-    //collect all python functions names of allready exist InLine nodes 
-    //in QStringList for automatic change of function's name on Paste of InLine node
-    QStringList aFuncNames;
-    SUPERV_Nodes nodes = dataflow->Nodes();
-    //InLine nodes
-    for(int i = 0; i < nodes->INodes.length(); i++)
-      aFuncNames.append(nodes->INodes[i]->PyFuncName());
-    //Loop nodes
-    for(int i = 0; i < nodes->LNodes.length(); i++) {
-      aFuncNames.append(nodes->LNodes[i]->PyInitName());
-      aFuncNames.append(nodes->LNodes[i]->PyMoreName());
-      aFuncNames.append(nodes->LNodes[i]->PyNextName());
-    }
-    //Switch nodes
-    for(int i = 0; i < nodes->SNodes.length(); i++)
-      aFuncNames.append(nodes->SNodes[i]->PyFuncName());
-    //GOTO nodes
-    for(int i = 0; i < nodes->GNodes.length(); i++)
-      aFuncNames.append(nodes->GNodes[i]->PyFuncName());
-
-    int id, fid;
-    QString aOriginalName;
-    //automatic change of function's name on Paste of InLine node
-    QString aFName;
-    SUPERV::ListOfStrings aFunc;
-    if (aNode->Kind() == SUPERV::InLineNode
-       ||
-       aNode->Kind() == SUPERV::GOTONode
-       ||
-       aNode->Kind() == SUPERV::SwitchNode) {
-      //original name of the function
-      aOriginalName = SUPERV::INode::_narrow(aNode)->PyFuncName();
-      if (!aOriginalName.isEmpty()) {
-       id = 1; //increment index
-       aFName = aOriginalName + QString("_") + QString::number(id);
-       while (aFuncNames.contains(aFName))
-         aFName = aOriginalName + QString("_") + QString::number(id++);
-       
-       //correct python function
-       aFunc = *SUPERV::INode::_narrow(aNode)->PyFunction();
-       for (int i=0; i < aFunc.length(); i++) {
-         fid = QString(aFunc[i]).find(aOriginalName);
-         if (fid >= 0)
-           aFunc[i] = QString(aFunc[i]).replace(fid, aOriginalName.length(), aFName);
-       }
-      }
-    }
-    QString aInitFName, aMoreFName, aNextFName;
-    SUPERV::ListOfStrings aInitFunc, aMoreFunc, aNextFunc;    
-    if (aNode->Kind() == SUPERV::LoopNode) {
-      //original name of the Init function
-      aOriginalName = SUPERV::LNode::_narrow(aNode)->PyInitName();
-      if (!aOriginalName.isEmpty()) {
-       id = 1; //increment index
-       aInitFName = aOriginalName + QString("_") + QString::number(id);
-       while (aFuncNames.contains(aInitFName))
-         aInitFName = aOriginalName + QString("_") + QString::number(id++);
-       
-       //correct python Init function
-       aInitFunc = *SUPERV::LNode::_narrow(aNode)->PyInit();
-       for (int i=0; i < aInitFunc.length(); i++) {
-         fid = QString(aInitFunc[i]).find(aOriginalName);
-         if (fid >= 0)
-           aInitFunc[i] = QString(aInitFunc[i]).replace(fid, aOriginalName.length(), aInitFName);
-       }
-      }
-
-      //original name of the More function
-      aOriginalName = SUPERV::LNode::_narrow(aNode)->PyMoreName();
-      if (!aOriginalName.isEmpty()) {
-       id = 1; //increment index
-       aMoreFName = aOriginalName + QString("_") + QString::number(id);
-       while (aFuncNames.contains(aMoreFName))
-         aMoreFName = aOriginalName + QString("_") + QString::number(id++);
-       
-       //correct python More function
-       aMoreFunc = *SUPERV::LNode::_narrow(aNode)->PyMore();
-       for (int i=0; i < aMoreFunc.length(); i++) {
-         fid = QString(aMoreFunc[i]).find(aOriginalName);
-         if (fid >= 0)
-           aMoreFunc[i] = QString(aMoreFunc[i]).replace(fid, aOriginalName.length(), aMoreFName);
-       }
-      }
-
-      //original name of the Next function
-      aOriginalName = SUPERV::LNode::_narrow(aNode)->PyNextName();
-      if (!aOriginalName.isEmpty()) {
-       id = 1; //increment index
-       aNextFName = aOriginalName + QString("_") + QString::number(id);
-       while (aFuncNames.contains(aNextFName))
-         aNextFName = aOriginalName + QString("_") + QString::number(id++);
-       
-       //correct python Init function
-       aNextFunc = *SUPERV::LNode::_narrow(aNode)->PyNext();
-       for (int i=0; i < aNextFunc.length(); i++) {
-         fid = QString(aNextFunc[i]).find(aOriginalName);
-         if (fid >= 0)
-           aNextFunc[i] = QString(aNextFunc[i]).replace(fid, aOriginalName.length(), aNextFName);
-       }
-      }
-    }
-    
-    int cx, cy;
-    //2.8 point of improvements: Adding node to graph window with taking into account zoom factor
-    QWMatrix aWM = myCanvasView->worldMatrix();
-    switch (aNode->Kind()) {
-    case 0: // Factory Node
-      {
-       SUPERV_FNode aFNode = dataflow->FNode(SUPERV::FNode::_narrow(aNode)->GetComponentName(),
-                                             SUPERV::FNode::_narrow(aNode)->GetInterfaceName(),
-                                             *SUPERV::FNode::_narrow(aNode)->Service());
-       if (SUPERV_isNull(aFNode)) {
-         QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
-         return;
-       }
-
-       SUPERV_INode aDummyEndNode;
-       Supervision.getBrowser()->addNode(SUPERV::CNode::_narrow(aFNode), aDummyEndNode, myXCopyNode, myYCopyNode);
-      }
-      break;
-    case 2: // Computing Node
-      {
-       SUPERV_CNode aCNode = dataflow->CNode(*SUPERV::CNode::_narrow(aNode)->Service());
-       if (SUPERV_isNull(aCNode)) {
-         QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
-         return;
-       }
-       
-       SUPERV_INode aDummyEndNode;
-       Supervision.getBrowser()->addNode(aCNode, aDummyEndNode, myXCopyNode, myYCopyNode);
-      }
-      break;
-    case 3: //InLineNode
-      {
-       SUPERV_INode aINode = dataflow->INode(aFName,
-                                             aFunc);
-
-       if (SUPERV_isNull(aINode)) {
-         QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
-         return;
-       }
-       //add all ports of coping node to the new node, which will be paste
-       SUPERV_Ports aPList = aNode->Ports();
-       QString aName, aType;
-       for (int i = 0; i < aPList->length(); i++) {
-         aName = aPList[i].in()->Name();
-         aType = aPList[i].in()->Type();
-         if (aPList[i].in()->IsInput())
-           aINode->InPort(aName.latin1(), aType.latin1());
-         else
-           aINode->OutPort(aName.latin1(), aType.latin1());
-       }
-
-       SUPERV_INode aDummyEndNode;
-       Supervision.getBrowser()->addNode(SUPERV::CNode::_narrow(aINode), aDummyEndNode, myXCopyNode, myYCopyNode);
-      }
-      break;
-    case 4: //LoopNode
-      {
-       SUPERV_INode aEndNode;
-       SUPERV_LNode aStartNode = dataflow->LNode(aInitFName,
-                                                 aInitFunc,
-                                                 aMoreFName,
-                                                 aMoreFunc,
-                                                 aNextFName,
-                                                 aNextFunc,
-                                                 aEndNode);
-       if (SUPERV_isNull(aStartNode) || SUPERV_isNull(aEndNode)) {
-         QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
-         return;
-       }
-       //add all ports of coping node to the new node, which will be paste
-       SUPERV_Ports aPList = aNode->Ports();
-       QString aName, aType;
-       for (int i = 0; i < aPList->length(); i++) {
-         aName = aPList[i].in()->Name();
-         aType = aPList[i].in()->Type();
-         if (aPList[i].in()->IsInput())
-           aStartNode->InPort(aName.latin1(), aType.latin1());
-         else
-           aStartNode->OutPort(aName.latin1(), aType.latin1());
-       }
-
-       Supervision.getBrowser()->addNode(SUPERV::CNode::_narrow(aStartNode), aEndNode, myXCopyNode, myYCopyNode);
-      }
-      break;
-    case 6: //SwitchNode
-      {
-       SUPERV_INode aEndNode;
-       SUPERV_SNode aStartNode = dataflow->SNode(aFName,
-                                                 aFunc,
-                                                 aEndNode);
-       if (SUPERV_isNull(aStartNode) || SUPERV_isNull(aEndNode)) {
-         QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
-         return;
-       }
-       //add all ports of coping start switch node to the new start node, which will be paste
-       SUPERV_Ports aPList = aNode->Ports();
-       QString aName, aType;
-       for (int i = 0; i < aPList->length(); i++) {
-         aName = aPList[i].in()->Name();
-         aType = aPList[i].in()->Type();
-         if (aPList[i].in()->IsInput())
-           aStartNode->InPort(aName.latin1(), aType.latin1());
-         else
-           aStartNode->OutPort(aName.latin1(), aType.latin1());
-       }
-       //add all ports of coping end switch node to the new end node, which will be paste
-       SUPERV_INode aNodeEnd = SUPERV::SNode::_narrow(aNode)->Coupled();
-       if (!SUPERV_isNull(aNodeEnd)) {
-         aPList = aNodeEnd->Ports();
-         for (int i = 0; i < aPList->length(); i++) {
-           //createPort(aPList[i].in());
-           aName = aPList[i].in()->Name();
-           aType = aPList[i].in()->Type();
-           if (aPList[i].in()->IsInput())
-             aEndNode->InPort(aName.latin1(), aType.latin1());
-           else
-             aEndNode->OutPort(aName.latin1(), aType.latin1());
-         }
-       }
-
-       Supervision.getBrowser()->addNode(SUPERV::CNode::_narrow(aStartNode), aEndNode, myXCopyNode, myYCopyNode);
-      }
-      break;
-    case 8: //GotoNode
-      {
-       SUPERV_GNode aGNode = dataflow->GNode(aFName,
-                                             aFunc, "");
-       if (SUPERV_isNull(aGNode)) {
-         QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
-         return;
-       }
-       //add all ports of coping node to the new node, which will be paste
-       SUPERV_Ports aPList = aNode->Ports();
-       QString aName, aType;
-       for (int i = 0; i < aPList->length(); i++) {
-         aName = aPList[i].in()->Name();
-         aType = aPList[i].in()->Type();
-         if (aPList[i].in()->IsInput())
-           aGNode->InPort(aName.latin1(), aType.latin1());
-         else
-           aGNode->OutPort(aName.latin1(), aType.latin1());
-       }
-
-       SUPERV_INode aDummyEndNode;
-       Supervision.getBrowser()->addNode(SUPERV::CNode::_narrow(aGNode), aDummyEndNode, myXCopyNode, myYCopyNode);
-      }
-      break;
-    case 10: //MacroNode
-      {
-       /* to implement in the future */
-       /*
-       //get SubGraph from MacroNode
-       SUPERV_Graph aMacro = SUPERV::Graph::_narrow(aNode);
-       SUPERV_Graph aGraph;
-       if (aMacro->IsStreamMacro())
-         aGraph = aMacro->StreamObjRef();
-       else
-         aGraph = aMacro->FlowObjRef();
-       SUPERV_Graph aMacroNode = dataflow->GraphMNode(aGraph);
-       
-       if (SUPERV_isNull(aMacroNode)) {
-         QMessageBox::warning(QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_CANT_CREATE_NODE"));
-         return;
-       }
-
-       SUPERV_INode aDummyEndNode;
-       Supervision.getBrowser()->addNode(SUPERV::CNode::_narrow(aMacroNode), aDummyEndNode, myXCopyNode, myYCopyNode);
-       */
-      }
-      break;
-    }
-  }
-}
-
 /**
  * Add Computation node
  */
index 8ff308e12b55924b5f9d39d09fa10d15218b5a23..03f240f2d7d1e1fc080293fac866cada10217458 100644 (file)
@@ -126,12 +126,6 @@ class SUPERVGUI_Main: public SUPERVGraph_View {
 
     bool eventFilter( QObject* o, QEvent* e);
 
-    SUPERV_Port getCopyPort() { return myCopyPort; }
-    void setCopyPort(SUPERV_Port theObj) { myCopyPort = theObj; }
-
-    SUPERV_CNode getCopyNode() { return myCopyNode; }
-    void setCopyNode(SUPERV_CNode theObj) { myCopyNode = theObj; }
-
     bool IsGUIEventLoopFinished() const { return myGUIEventLoopFinished; }
 
     void Editing(); // any Editing operation is to be performed ->
@@ -147,7 +141,6 @@ class SUPERVGUI_Main: public SUPERVGraph_View {
     bool addStudy();
     void insertFile();
     void addNode();
-    void pasteNode();
     void changeInformation();
     void copy();
 
@@ -180,11 +173,6 @@ class SUPERVGUI_Main: public SUPERVGraph_View {
     QAD_ObjectBrowser*      objectBrowser;
     QAD_Message*            message;
 
-    SUPERV_Port             myCopyPort;
-    SUPERV_CNode            myCopyNode;
-    int                     myXCopyNode;
-    int                     myYCopyNode;
-    
     GraphViewType   myCurrentView;
     SUPERVGUI_CanvasArray*  myArray;
     SUPERVGUI_ArrayView*    myArrayView;