1 // Copyright (C) 2007-2019 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #include "SMESH_ActorProps.h"
25 #include <SUIT_ResourceMgr.h>
26 #include <SUIT_Session.h>
28 SMESH_ActorProps* SMESH_ActorProps::props()
30 static SMESH_ActorProps* g_props = 0;
32 g_props = new SMESH_ActorProps();
36 void SMESH_ActorProps::reset()
38 props()->initialize();
41 SMESH_ActorProps::SMESH_ActorProps()
46 void SMESH_ActorProps::initialize()
48 SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();
49 m_selection_color = mgr->colorValue("SMESH", "selection_object_color", Qt::white);
50 m_highlight_color = mgr->colorValue("SMESH", "highlight_color", Qt::cyan);
51 m_selection_increment = qBound(0, mgr->integerValue("SMESH", "selection_increment", 0), 5);
52 m_controls_increment = qBound(0, mgr->integerValue("SMESH", "controls_increment", 2), 5);
55 QColor SMESH_ActorProps::selectionColor() const
57 return m_selection_color;
60 QColor SMESH_ActorProps::highlightColor() const
62 return m_highlight_color;
65 int SMESH_ActorProps::selectionIncrement() const
67 return m_selection_increment;
70 int SMESH_ActorProps::controlsIncrement() const
72 return m_controls_increment;