]> Creatis software - cpPlugins.git/blobdiff - lib/cpPipelineEditor/Port.cxx
...
[cpPlugins.git] / lib / cpPipelineEditor / Port.cxx
index ab478c298343960aa6bd064649c0fef71a5d4869..b447b0ac41a64e4b34f0aa5d3ba862b8d4af37d8 100644 (file)
@@ -1,8 +1,12 @@
 #include "Port.h"\r
 #include "Connection.h"\r
+#include "Block.h"\r
+#include "Editor.h"\r
 \r
 #include <QGraphicsScene>\r
+#include <QGraphicsSceneContextMenuEvent>\r
 #include <QFontMetrics>\r
+#include <QMenu>\r
 #include <QPainter>\r
 #include <QPen>\r
 \r
@@ -120,37 +124,6 @@ isConnected( Port* other )
   return( false );\r
 }\r
 \r
-// -------------------------------------------------------------------------\r
-cpPipelineEditor::TypePort::\r
-TypePort( QGraphicsItem* parent, QGraphicsScene* scene )\r
-  : Superclass( parent, scene )\r
-{\r
-}\r
-\r
-// -------------------------------------------------------------------------\r
-cpPipelineEditor::TypePort::\r
-~TypePort( )\r
-{\r
-}\r
-\r
-// -------------------------------------------------------------------------\r
-void cpPipelineEditor::TypePort::\r
-_updateLabels( )\r
-{\r
-  QFont font( this->scene( )->font( ) );\r
-  font.setItalic( true );\r
-  this->m_Label->setFont( font );\r
-  this->m_ExtendedLabel->setFont( font );\r
-  this->setPath( QPainterPath( ) );\r
-}\r
-\r
-// -------------------------------------------------------------------------\r
-bool cpPipelineEditor::TypePort::\r
-isConnected( Port* other )\r
-{\r
-  return( false );\r
-}\r
-\r
 // -------------------------------------------------------------------------\r
 cpPipelineEditor::InputPort::\r
 InputPort( QGraphicsItem* parent, QGraphicsScene* scene )\r
@@ -292,4 +265,28 @@ itemChange( GraphicsItemChange change, const QVariant& value )
   return( value );\r
 }\r
 \r
+// -------------------------------------------------------------------------\r
+void cpPipelineEditor::OutputPort::\r
+contextMenuEvent( QGraphicsSceneContextMenuEvent* evt )\r
+{\r
+  if( this->m_Block == NULL )\r
+    return;\r
+  \r
+  QMenu menu;\r
+  QAction* showAction = menu.addAction( "Show" );\r
+  QAction* hideAction = menu.addAction( "Hide" );\r
+  QAction* selectedAction = menu.exec( evt->screenPos( ) );\r
+\r
+  if( selectedAction == showAction )\r
+  {\r
+    this->m_Block->editor( )->showOutputData(\r
+      this->m_Block->namePort( ).toStdString( ),\r
+      this->name( ).toStdString( )\r
+      );\r
+  }\r
+  else if( selectedAction == hideAction )\r
+  {\r
+  } // fi\r
+}\r
+\r
 // eof - $RCSfile$\r