Salome HOME
Merge from V6_main_20120808 08Aug12
[modules/yacs.git] / src / genericgui / SceneCtrlLinkItem.cxx
index 3888d0b4d2580977ee11c298c9862abc1047a7a5..f8d96450766bb63b319fa2d3749af15a2f41c54b 100644 (file)
@@ -1,27 +1,29 @@
-//  Copyright (C) 2006-2008  CEA/DEN, EDF R&D
+// Copyright (C) 2006-2012  CEA/DEN, EDF R&D
 //
-//  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 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.
+// 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
+// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "SceneCtrlLinkItem.hxx"
 #include "SceneCtrlPortItem.hxx"
 #include "SceneElementaryNodeItem.hxx"
 #include "SceneHeaderNodeItem.hxx"
 #include "Scene.hxx"
 #include "Menus.hxx"
+#include "Resource.hxx"
 
 #include <QPointF>
 
@@ -37,10 +39,10 @@ SceneCtrlLinkItem::SceneCtrlLinkItem(QGraphicsScene *scene, SceneItem *parent,
                                      QString label, Subject *subject)
   : SceneLinkItem(scene, parent, from, to, label, subject)
 {
-  _penColor     = QColor( 96,    0,  96);
-  _hiPenColor   = QColor( 128,   0, 128);
-  _brushColor   = QColor( 192,   0, 192);
-  _hiBrushColor = QColor( 255, 192, 255);
+  _penColor     = Resource::control_link_draw_color.darker(Resource::link_pen_darkness);
+  _hiPenColor   = Resource::control_link_select_color.darker(Resource::link_pen_darkness);
+  _brushColor   = Resource::control_link_draw_color;
+  _hiBrushColor = Resource::control_link_select_color;
 }
 
 SceneCtrlLinkItem::~SceneCtrlLinkItem()
@@ -62,3 +64,17 @@ QPointF SceneCtrlLinkItem::goal()
   DEBTRACE("localTo(" << localTo.x() << "," << localTo.y() << ")");
   return mapFromItem(dpit, localTo);
 }
+
+QColor SceneCtrlLinkItem::getPenColor()
+{
+  _penColor     = Resource::control_link_draw_color.darker(Resource::link_pen_darkness);
+  _hiPenColor   = Resource::control_link_select_color.darker(Resource::link_pen_darkness);
+  return SceneObserverItem::getPenColor();
+}
+
+QColor SceneCtrlLinkItem::getBrushColor()
+{
+  _brushColor   = Resource::control_link_draw_color;
+  _hiBrushColor = Resource::control_link_select_color;
+  return SceneObserverItem::getBrushColor();
+}