]> Creatis software - cpPlugins.git/blobdiff - libs/cpPipelineEditor/Block.cxx
...
[cpPlugins.git] / libs / cpPipelineEditor / Block.cxx
diff --git a/libs/cpPipelineEditor/Block.cxx b/libs/cpPipelineEditor/Block.cxx
new file mode 100644 (file)
index 0000000..d750c9c
--- /dev/null
@@ -0,0 +1,43 @@
+#include <cpPipelineEditor/Block.h>
+#include <QPainter>
+
+// -------------------------------------------------------------------------
+cpPipelineEditor::Block::
+Block( QGraphicsItem* parent, QGraphicsScene* scene )
+  : Superclass( parent, scene )
+{
+  this->m_SelectedColor = Qt::darkYellow;
+  this->m_NotSelectedColor = Qt::darkGreen;
+}
+
+// -------------------------------------------------------------------------
+cpPipelineEditor::Block::
+~Block( )
+{
+}
+
+// -------------------------------------------------------------------------
+void cpPipelineEditor::Block::
+paint(
+  QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget
+  )
+{
+  Q_UNUSED( option );
+  Q_UNUSED( widget );
+
+  if( this->isSelected( ) )
+  {
+    painter->setPen( QPen( this->m_SelectedColor ) );
+    painter->setBrush( this->m_SelectedColor );
+  }
+  else
+  {
+    painter->setPen( QPen( this->m_NotSelectedColor ) );
+    painter->setBrush( this->m_NotSelectedColor );
+
+  } // fi
+  painter->drawPath( this->path( ) );
+
+}
+
+// eof - $RCSfile$