]> SALOME platform Git repositories - modules/superv.git/commitdiff
Salome HOME
Implementation of point 2.3. from
authormkr <mkr@opencascade.com>
Tue, 28 Dec 2004 08:34:59 +0000 (08:34 +0000)
committermkr <mkr@opencascade.com>
Tue, 28 Dec 2004 08:34:59 +0000 (08:34 +0000)
"SUPERVISOR: Current status - bugs/impovements"
document : Copy/paste nodes, ports.

src/SUPERVGUI/SUPERVGUI_CanvasControlNode.cxx
src/SUPERVGUI/SUPERVGUI_CanvasControlNode.h
src/SUPERVGUI/SUPERVGUI_CanvasNode.cxx
src/SUPERVGUI/SUPERVGUI_CanvasNode.h
src/SUPERVGUI/SUPERVGUI_CanvasPort.cxx
src/SUPERVGUI/SUPERVGUI_CanvasPort.h
src/SUPERVGUI/SUPERVGUI_CanvasView.cxx
src/SUPERVGUI/SUPERVGUI_CanvasView.h
src/SUPERVGUI/SUPERVGUI_Main.cxx
src/SUPERVGUI/SUPERVGUI_Main.h
src/SUPERVGUI/SUPERV_msg_en.po

index 9a81a1802e0faeca62ebf5554089cc69505db545..f3be039fbade99b350db1968e8cbd2dffb4c6f3e 100644 (file)
@@ -118,6 +118,16 @@ void SUPERVGUI_CanvasStartNode::addOutputPort()
   SUPERVGUI_CanvasNode::addOutputPort();
   if (myCoupled) myCoupled->merge();
 }
+void SUPERVGUI_CanvasStartNode::pastePort()
+{
+  SUPERVGUI_CanvasNode::pastePort();
+  if (getMain()->getCopyPort()->IsInput() //paste input port
+      &&
+      getEngine()->IsLoop()) 
+    merge();
+  if (myCoupled) myCoupled->merge();
+}
 
 //=====================================================================
 // End control node
index d4b53241a333341829a3f3666278790f9208efd1..e159211538d25407700dca8e36bfe9d317e12998 100644 (file)
@@ -62,6 +62,7 @@ class SUPERVGUI_CanvasStartNode : public SUPERVGUI_CanvasNode {
 
     virtual void addInputPort();
     virtual void addOutputPort();
+    virtual void pastePort();
 
   protected:
     virtual SUPERVGUI_CanvasNodePrs* createPrs() const;
index fd106d08b80a78d9468e731b7052d4a77621830f..d3f1896b4afd1b71c67b0c05df0ed764f7c84049 100644 (file)
@@ -151,6 +151,8 @@ QPopupMenu* SUPERVGUI_CanvasNode::getPopupMenu(QWidget* theParent)
                              && getNodeType() != SUPERV::EndSwitchNode) {
       popup->insertItem(tr("MSG_RENAME"), this, SLOT(rename()));
       myDeleteItem = popup->insertItem(tr("MSG_DELETE"), this, SLOT(remove()));
+      // Copy Node functionality
+      popup->insertItem(tr("ITM_COPY_NODE"), this, SLOT(copy()));
       popup->insertSeparator();
     }
     popup->insertItem(tr("MSG_BROWSE"), this, SLOT(browse()));
@@ -172,6 +174,14 @@ QPopupMenu* SUPERVGUI_CanvasNode::getPopupMenu(QWidget* theParent)
        addPortMenu->insertItem( tr( "MNU_OUTPUT" ), this, SLOT(addOutputPort()));
       
       popup->insertItem( tr( "MNU_ADD_PORT" ), addPortMenu);
+
+      // Paste Port functionality
+      int aPasteItem = popup->insertItem(tr("ITM_PASTE_PORT"), this, SLOT(pastePort()));
+      if (SUPERV_isNull(myMain->getCopyPort()) || !(myMain->getCopyPort()))
+       popup->setItemEnabled(aPasteItem, false);
+      else if (getNodeType() == SUPERV::LoopNode && !myMain->getCopyPort()->IsInput())
+       popup->setItemEnabled(aPasteItem, false);
+
       popup->insertItem( tr( "MNU_MANAGE_PORTS" ), this, SLOT(managePorts()));
     }
     if ( getNodeType() != SUPERV::FactoryNode && 
@@ -361,6 +371,12 @@ void SUPERVGUI_CanvasNode::remove() {
   aCanvas->update();
 }
 
+void SUPERVGUI_CanvasNode::copy() {
+  Trace("SUPERVGUI_CanvasNode::copy()");
+  //MESSAGE(" -> SUPERVGUI_CanvasNode::copy()");
+  getMain()->setCopyNode(getEngine());
+}
+
 void SUPERVGUI_CanvasNode::suspendResume() {
   Trace("SUPERVGUI_CanvasNode::suspendResume");
   int n = queryList("SUPERVGUI_CanvasNode")->count(); 
@@ -606,6 +622,39 @@ 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 "Edit ports" popup menu command. See SUPERVGUI_ManagePortsDlg.h
  * for detailed description of the functionality
index 7233ad471fbb6f00933d7c73214b4333f36c5711..ae25e0e87465efbca5352041522deeadf50a6768 100644 (file)
@@ -80,6 +80,7 @@ class SUPERVGUI_CanvasNode : public QObject {
 
     virtual void rename();
     virtual void remove();
+    void copy();
     void changeInformation();
     void browse();
 
@@ -94,6 +95,7 @@ class SUPERVGUI_CanvasNode : public QObject {
     virtual void addInputPort();
     virtual void addOutputPort();
     virtual void editFunction();
+    virtual void pastePort();
     void managePorts();
     void exportToLib();
 
index ad6cd4dba06bd8306ed3c6fbe7e42233c6802031..18d427ba3daaa774cc3a005b26646bd323290836 100644 (file)
@@ -73,6 +73,12 @@ QPopupMenu* SUPERVGUI_CanvasPort::getPopupMenu(QWidget* theParent)
        !(myPort->Node()->Kind() == SUPERV::LoopNode && !myPort->IsInput())))) {
     popup->insertItem(tr("ITM_DEL_PORT"), this, SLOT(remove()));    
   }
+  // Copy Port functionality
+  if (myMain->isEditable() && !myPort->Node()->IsFactory()
+                           && !myPort->Node()->IsComputing()
+                           && !myPort->Node()->IsEndLoop()
+                           && !myPort->Node()->IsMacro())
+    popup->insertItem(tr("ITM_COPY_PORT"), this, SLOT(copy()));
 
   int anItem = popup->insertItem(tr("MSG_BROWSE"), this, SLOT(browse()));
 //   if (getEngine()->IsLinked())
@@ -164,6 +170,11 @@ void SUPERVGUI_CanvasPort::browse()
   QMessageBox::information(QAD_Application::getDesktop(), tr("MSG_INFO"), aMes);
 }
 
+void SUPERVGUI_CanvasPort::copy()
+{
+  //MESSAGE(" -> SUPERVGUI_CanvasPort::copy()");
+  getMain()->setCopyPort(getEngine());
+}
 
 //***********************************************************
 // Input Port
index c7f81a44329b86981849ad92403e968046711f85..0d964ed9b9fadfcf3d347c54339b9641e7cf8b3f 100644 (file)
@@ -46,6 +46,7 @@ class SUPERVGUI_CanvasPort : public QObject {
     void sketchLink();
     virtual void remove();
     void browse();
+    void copy();
 
   protected:
     virtual SUPERVGUI_CanvasPortPrs* createPrs() const;
index 1960a1cbdde039e5766b4caa3c93c491246c2a30..465d9f178eacad57d7ffb9feee4859015ac12551 100644 (file)
@@ -99,6 +99,10 @@ SUPERVGUI_CanvasView::SUPERVGUI_CanvasView(SUPERVGUI_Canvas* theCanvas, SUPERVGU
   const bool isEdit = myMain->isEditable();
   if (isEdit) {
     myPopup->insertItem(tr("MSG_ADD_NODE"), myMain, SLOT(addNode()));
+
+    // Paste Node functionality
+    myPasteNodeItem = myPopup->insertItem(tr("ITM_PASTE_NODE"), myMain, SLOT(pasteNode()));
+
     myPopup->insertItem(tr("MSG_INS_FILE"), myMain, SLOT(insertFile()));
     myPopup->insertSeparator();
   }
@@ -217,6 +221,11 @@ 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);
     myMain->showPopup(myPopup, theEvent);
     return;
   }
index e50ef7bbb477871c35a2e248e4fdec1a61482f98..52b5b5f2e323e05eb45603e08a153a271379ecdb 100644 (file)
@@ -67,6 +67,7 @@ class SUPERVGUI_CanvasView: public QCanvasView {
     SUPERVGUI_Main* myMain;
     QPopupMenu*     myPopup;
     int             myAddStudyItem;
+    int             myPasteNodeItem;
     QPopupMenu*     mySketchPopup;
     int             myDelPntItem;
     int             myOrtoItem;
index e4541436f320dd8fb059d59d4c955c34b834cb01..da4bc7ed8247a06dee73f5034e4ed25f32093f16 100644 (file)
@@ -70,6 +70,10 @@ 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)) {
@@ -610,6 +614,280 @@ 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();
+      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();
+      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();
+      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();
+      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 18e9a4fdb28aa7b0a92e939fdf022b492d8a6fcf..8ff308e12b55924b5f9d39d09fa10d15218b5a23 100644 (file)
@@ -126,6 +126,12 @@ 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 ->
@@ -141,6 +147,7 @@ class SUPERVGUI_Main: public SUPERVGraph_View {
     bool addStudy();
     void insertFile();
     void addNode();
+    void pasteNode();
     void changeInformation();
     void copy();
 
@@ -172,6 +179,11 @@ class SUPERVGUI_Main: public SUPERVGraph_View {
     QAD_Study*              study;
     QAD_ObjectBrowser*      objectBrowser;
     QAD_Message*            message;
+
+    SUPERV_Port             myCopyPort;
+    SUPERV_CNode            myCopyNode;
+    int                     myXCopyNode;
+    int                     myYCopyNode;
     
     GraphViewType   myCurrentView;
     SUPERVGUI_CanvasArray*  myArray;
index aca9bf91740f891f44346b965d0221d96c2dd839..ce4b85243ab831dcbad593ef3423761ac6ebf665 100644 (file)
@@ -687,6 +687,18 @@ msgstr "Node type"
 msgid "ITM_DEL_PORT"
 msgstr "Delete"
 
+msgid "ITM_COPY_PORT"
+msgstr "Copy"
+
+msgid "ITM_PASTE_PORT"
+msgstr "Paste Port"
+
+msgid "ITM_COPY_NODE"
+msgstr "Copy Node"
+
+msgid "ITM_PASTE_NODE"
+msgstr "Paste Node"
+
 msgid "MSG_CANT_CREATE_NODE"
 msgstr "Can't create node"