]> Creatis software - cpPlugins.git/blobdiff - appli/cpPipelineEditor/QNEPort.h
More on graph editor
[cpPlugins.git] / appli / cpPipelineEditor / QNEPort.h
index 383167b9bfcc39d977b4024b612afa43fafaafda..e10af5ef87c1d0fcc69ac06bd01a69d8d028fe5b 100644 (file)
@@ -54,28 +54,41 @@ namespace PipelineEditor
       { return( this->m_Block ); }\r
 \r
     virtual void setName( const QString& n );\r
-    inline const QString& name( ) const\r
-      { return( this->m_Name ); }\r
-\r
-    void setPtr( quint64 p );\r
-    inline quint64 ptr( )\r
-      { return( this->m_Ptr ); }\r
+    virtual void setExtendedName( const QString& n );\r
+    inline QString name( ) const\r
+      { return( this->m_Label->toPlainText( ) ); }\r
+    inline QString extendedName( ) const\r
+      { return( this->m_ExtendedLabel->toPlainText( ) ); }\r
 \r
     inline int radius( ) const\r
       { return( this->m_Radius ); }\r
 \r
+    inline bool isExtended( ) const\r
+      { return( this->m_IsExtended ); }\r
+    virtual void setExtend( bool extend );\r
+\r
     virtual bool isConnected( QNEPort* other ) = 0;\r
     inline int type( ) const\r
       { return( this->Type ); }\r
 \r
+    virtual void paint(\r
+      QPainter* painter,\r
+      const QStyleOptionGraphicsItem* option,\r
+      QWidget* widget\r
+      );\r
+\r
+  protected:\r
+    virtual void _updateLabels( ) { }\r
+\r
   protected:\r
     QNEBlock* m_Block;\r
 \r
-    QString            m_Name;\r
+    int  m_Radius;\r
+    int  m_Margin;\r
+    bool m_IsExtended;\r
+\r
     QGraphicsTextItem* m_Label;\r
-    int                m_Radius;\r
-    int                m_Margin;\r
-    quint64            m_Ptr;\r
+    QGraphicsTextItem* m_ExtendedLabel;\r
   };\r
 \r
   /**\r
@@ -93,11 +106,12 @@ namespace PipelineEditor
     QNENamePort( QGraphicsItem* parent = NULL, QGraphicsScene* scene = NULL );\r
     virtual ~QNENamePort( );\r
 \r
-    virtual void setName( const QString& n );\r
-\r
     virtual bool isConnected( QNEPort* other );\r
     inline int type( ) const\r
       { return( this->Type ); }\r
+\r
+  protected:\r
+    virtual void _updateLabels( );\r
   };\r
 \r
   /**\r
@@ -115,11 +129,12 @@ namespace PipelineEditor
     QNETypePort( QGraphicsItem* parent = NULL, QGraphicsScene* scene = NULL );\r
     virtual ~QNETypePort( );\r
 \r
-    virtual void setName( const QString& n );\r
-\r
     virtual bool isConnected( QNEPort* other );\r
     inline int type( ) const\r
       { return( this->Type ); }\r
+\r
+  protected:\r
+    virtual void _updateLabels( );\r
   };\r
 \r
   /**\r
@@ -137,7 +152,7 @@ namespace PipelineEditor
     QNEInputPort( QGraphicsItem* parent = NULL, QGraphicsScene* scene = NULL );\r
     virtual ~QNEInputPort( );\r
 \r
-    virtual void setName( const QString& n );\r
+    virtual void setExtend( bool extend );\r
 \r
     virtual bool isConnected( QNEPort* other );\r
     inline int type( ) const\r
@@ -153,6 +168,7 @@ namespace PipelineEditor
 \r
   protected:\r
     QVariant itemChange( GraphicsItemChange change, const QVariant& value );\r
+    virtual void _updateLabels( );\r
 \r
   protected:\r
     QNEConnection* m_Connection;\r
@@ -173,7 +189,7 @@ namespace PipelineEditor
     QNEOutputPort( QGraphicsItem* parent = NULL, QGraphicsScene* scene = NULL );\r
     virtual ~QNEOutputPort( );\r
 \r
-    virtual void setName( const QString& n );\r
+    virtual void setExtend( bool extend );\r
 \r
     virtual bool isConnected( QNEPort* other );\r
     inline int type( ) const\r
@@ -186,6 +202,7 @@ namespace PipelineEditor
 \r
   protected:\r
     QVariant itemChange( GraphicsItemChange change, const QVariant& value );\r
+    virtual void _updateLabels( );\r
 \r
   protected:\r
     QVector< QNEConnection* > m_Connections;\r