<parameter name="parametric_precision" value="-6" />
<parameter name="area_precision" value="-6" />
<parameter name="vol_precision" value="-6" />
+ <parameter name="selection_increment" value="0" />
+ <parameter name="controls_increment" value="2" />
</section>
<section name="smesh_help" >
<parameter name="User's Guide/Mesh module/User's Guide" value="%SMESH_ROOT_DIR%/share/doc/salome/gui/SMESH/index.html"/>
SMESH_Actor.h
SMESH_Object.h
SMESH_ObjectDef.h
+ SMESH_ActorProps.h
SMESH_ActorUtils.h
SMESH_ActorDef.h
SMESH_DeviceActor.h
SMESH_Object.cxx
SMESH_DeviceActor.cxx
SMESH_Actor.cxx
+ SMESH_ActorProps.cxx
SMESH_PreviewActorsCollection.cxx
SMESH_ExtractGeometry.cxx
SMESH_ActorUtils.cxx
#include "SMESH_ActorDef.h"
#include "SMDS_UnstructuredGrid.hxx"
+#include "SMESH_ActorProps.h"
#include "SMESH_ActorUtils.h"
#include "SMESH_CellLabelActor.h"
#include "SMESH_ControlsDef.hxx"
static int MYDEBUG = 0;
#endif
-static int aLineWidthInc = 2;
-
-
SMESH_ActorDef* SMESH_ActorDef::New(){
return new SMESH_ActorDef();
}
myIsFacesOriented = false;
+ int controlsIncrement = SMESH_ActorProps::props()->controlsIncrement();
+ int selectionIncrement = SMESH_ActorProps::props()->selectionIncrement();
+
myControlsPrecision = -1;
SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();
anRGB[0] = 1 - anRGB[0];
anRGB[1] = 1 - anRGB[1];
anRGB[2] = 1 - anRGB[2];
+ my2DExtProp->SetLineWidth(aLineWidth + controlsIncrement);
my2DExtProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
my2DExtActor = SMESH_DeviceActor::New();
anRGB[0] = 1 - anRGB[0];
anRGB[1] = 1 - anRGB[1];
anRGB[2] = 1 - anRGB[2];
+ my3DExtProp->SetLineWidth(aLineWidth + controlsIncrement);
my3DExtProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
my3DExtActor = SMESH_DeviceActor::New();
my1DProp = vtkProperty::New();
my1DProp->DeepCopy(myEdgeProp);
- my1DProp->SetLineWidth(aLineWidth + aLineWidthInc);
+ my1DProp->SetLineWidth(aLineWidth + controlsIncrement);
my1DProp->SetPointSize(aElem0DSize);
my1DExtProp = vtkProperty::New();
anRGB[1] = 1 - anRGB[1];
anRGB[2] = 1 - anRGB[2];
my1DExtProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
- my1DExtProp->SetLineWidth(aLineWidth + aLineWidthInc);
+ my1DExtProp->SetLineWidth(aLineWidth + controlsIncrement);
my1DExtProp->SetPointSize(aElem0DSize);
// my1DExtActor is used to show filtered edges or links between nodes
SMESH::GetColor( "SMESH", "selection_object_color", anRGB[0], anRGB[1], anRGB[2], QColor( 255, 255, 255 ) );
myHighlightProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
myHighlightProp->SetPointSize(aElem0DSize); // ??
- myHighlightProp->SetLineWidth(aLineWidth);
+ myHighlightProp->SetLineWidth(aLineWidth + selectionIncrement);
myHighlightProp->SetRepresentation(1);
myOutLineProp = vtkProperty::New();
SMESH::GetColor( "SMESH", "highlight_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 255, 255 ) );
myPreselectProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
myPreselectProp->SetPointSize(aElem0DSize); // ??
- myPreselectProp->SetLineWidth(aLineWidth);
+ myPreselectProp->SetLineWidth(aLineWidth + selectionIncrement);
myPreselectProp->SetRepresentation(1);
myHighlitableActor = SMESH_DeviceActor::New();
::GetColor(myBallProp,r,g,b);
}
-void SMESH_ActorDef::SetHighlightColor(double r,double g,double b)
-{
- myHighlightProp->SetColor(r,g,b);
- Modified();
-}
-
-void SMESH_ActorDef::GetHighlightColor(double& r,double& g,double& b)
-{
- ::GetColor(myHighlightProp,r,g,b);
-}
-
-void SMESH_ActorDef::SetPreHighlightColor(double r,double g,double b)
-{
- myPreselectProp->SetColor(r,g,b);
+void SMESH_ActorDef::UpdateSelectionProps()
+{
+ QColor selectionColor = SMESH_ActorProps::props()->selectionColor();
+ QColor highlightColor = SMESH_ActorProps::props()->highlightColor();
+ int selectionIncrement = SMESH_ActorProps::props()->selectionIncrement();
+ double width = GetLineWidth();
+ myHighlightProp->SetColor(selectionColor.redF(), selectionColor.greenF(), selectionColor.blueF());
+ myHighlightProp->SetLineWidth(width + selectionIncrement);
+ myPreselectProp->SetColor(highlightColor.redF(), highlightColor.greenF(), highlightColor.blueF());
+ myPreselectProp->SetLineWidth(width + selectionIncrement);
Modified();
}
-void SMESH_ActorDef::GetPreHighlightColor(double& r,double& g,double& b)
-{
- ::GetColor(myPreselectProp,r,g,b);
-}
-
-
double SMESH_ActorDef::GetLineWidth()
{
return myEdgeProp->GetLineWidth();
void SMESH_ActorDef::SetLineWidth(double theVal)
{
+ int controlsIncrement = SMESH_ActorProps::props()->controlsIncrement();
+ int selectionIncrement = SMESH_ActorProps::props()->selectionIncrement();
+
myEdgeProp->SetLineWidth(theVal);
- my1DProp->SetLineWidth(theVal + aLineWidthInc);
- my1DExtProp->SetLineWidth(theVal + aLineWidthInc);
- my2DExtProp->SetLineWidth(theVal + aLineWidthInc);
- my3DExtProp->SetLineWidth(theVal + aLineWidthInc);
- myOutLineProp->SetLineWidth(theVal);
- myHighlightProp->SetLineWidth(theVal);
- myPreselectProp->SetLineWidth(theVal);
+ my1DProp->SetLineWidth(theVal + controlsIncrement);
+ my1DExtProp->SetLineWidth(theVal + controlsIncrement);
+ my2DExtProp->SetLineWidth(theVal + controlsIncrement);
+ my3DExtProp->SetLineWidth(theVal + controlsIncrement);
+ myHighlightProp->SetLineWidth(theVal + selectionIncrement);
+ myPreselectProp->SetLineWidth(theVal + selectionIncrement);
Modified();
}
virtual void SetBallColor(double r,double g,double b) = 0;
virtual void GetBallColor(double& r,double& g,double& b) = 0;
- virtual void SetHighlightColor(double r,double g,double b) = 0;
- virtual void GetHighlightColor(double& r,double& g,double& b) = 0;
-
- virtual void SetPreHighlightColor(double r,double g,double b) = 0;
- virtual void GetPreHighlightColor(double& r,double& g,double& b) = 0;
-
+ virtual void UpdateSelectionProps() = 0;
+
virtual double GetLineWidth() = 0;
virtual void SetLineWidth(double theVal) = 0;
virtual void SetBallColor(double r,double g,double b);
virtual void GetBallColor(double& r,double& g,double& b);
- virtual void SetHighlightColor(double r,double g,double b);
- virtual void GetHighlightColor(double& r,double& g,double& b);
-
- virtual void SetPreHighlightColor(double r,double g,double b);
- virtual void GetPreHighlightColor(double& r,double& g,double& b);
+ virtual void UpdateSelectionProps();
virtual double GetLineWidth();
virtual void SetLineWidth(double theVal);
--- /dev/null
+// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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, or (at your option) any later version.
+//
+// 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
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "SMESH_ActorProps.h"
+
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+
+SMESH_ActorProps* SMESH_ActorProps::props()
+{
+ static SMESH_ActorProps* g_props = 0;
+ if (!g_props)
+ g_props = new SMESH_ActorProps();
+ return g_props;
+}
+
+void SMESH_ActorProps::reset()
+{
+ props()->initialize();
+}
+
+SMESH_ActorProps::SMESH_ActorProps()
+{
+ initialize();
+}
+
+void SMESH_ActorProps::initialize()
+{
+ SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();
+ m_selection_color = mgr->colorValue("SMESH", "selection_object_color", Qt::white);
+ m_highlight_color = mgr->colorValue("SMESH", "highlight_color", Qt::cyan);
+ m_selection_increment = qBound(0, mgr->integerValue("SMESH", "selection_increment", 0), 5);
+ m_controls_increment = qBound(0, mgr->integerValue("SMESH", "controls_increment", 2), 5);
+}
+
+QColor SMESH_ActorProps::selectionColor() const
+{
+ return m_selection_color;
+}
+
+QColor SMESH_ActorProps::highlightColor() const
+{
+ return m_highlight_color;
+}
+
+int SMESH_ActorProps::selectionIncrement() const
+{
+ return m_selection_increment;
+}
+
+int SMESH_ActorProps::controlsIncrement() const
+{
+ return m_controls_increment;
+}
--- /dev/null
+// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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, or (at your option) any later version.
+//
+// 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
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef SMESH_ACTORPROPS_H
+#define SMESH_ACTORPROPS_H
+
+#include "SMESH_Object.h"
+#include <QColor>
+
+class SMESHOBJECT_EXPORT SMESH_ActorProps
+{
+public:
+ static SMESH_ActorProps* props();
+ static void reset();
+
+ QColor selectionColor() const;
+ QColor highlightColor() const;
+ int selectionIncrement() const;
+ int controlsIncrement() const;
+
+private:
+ SMESH_ActorProps();
+ void initialize();
+
+ QColor m_selection_color, m_highlight_color;
+ int m_selection_increment, m_controls_increment;
+};
+
+#endif //SMESH_ACTORPROPS_H
setPreferenceProperty( doubleNodesTol, "max", 1000000.0 );
setPreferenceProperty( doubleNodesTol, "step", 0.0000001 );
+ /*
+ int cinc = addPreference(tr("PREF_CONTROLS_INCREMENT"), qaGroup, LightApp_Preferences::IntSpin, "SMESH", "controls_increment");
+ setPreferenceProperty( cinc, "min", 0 );
+ setPreferenceProperty( cinc, "max", 5 );
+ */
int exportgroup = addPreference( tr( "PREF_GROUP_EXPORT" ), genTab );
setPreferenceProperty( exportgroup, "columns", 2 );
addPreference( tr( "PREF_ELEMENTS" ), precSelGroup, LightApp_Preferences::Double, "SMESH", "selection_precision_element" );
addPreference( tr( "PREF_OBJECTS" ), precSelGroup, LightApp_Preferences::Double, "SMESH", "selection_precision_object" );
+ int sinc = addPreference(tr("PREF_SELECTION_INCREMENT"), selTab, LightApp_Preferences::IntSpin, "SMESH", "selection_increment");
+ setPreferenceProperty( sinc, "min", 0 );
+ setPreferenceProperty( sinc, "max", 5 );
+
// Scalar Bar tab ------------------------------------------------------------------------
int sbarTab = addPreference( tr( "SMESH_SCALARBAR" ) );
int fontGr = addPreference( tr( "SMESH_FONT_SCALARBAR" ), sbarTab );
name== "highlight_color" ||
name=="selection_precision_node" ||
name=="selection_precision_element" ||
- name=="selection_precision_object" )
+ name=="selection_precision_object" ||
+ name=="selection_increment")
{
SMESH::UpdateSelectionProp( this );
}
#include "SMESHGUI_Utils.h"
#include "SMDS_Mesh.hxx"
#include "SMESH_Actor.h"
+#include "SMESH_ActorProps.h"
#include "SMESH_ActorUtils.h"
#include "SMESH_CellLabelActor.h"
#include "SMESH_ControlsDef.hxx"
return;
}
+ SMESH_ActorProps::props()->reset();
+
QColor
aHiColor = mgr->colorValue( "SMESH", "selection_object_color", Qt::white ),
aSelColor = mgr->colorValue( "SMESH", "selection_element_color", Qt::yellow ),
aCollection->InitTraversal();
while ( vtkActor *anAct = aCollection->GetNextActor() ) {
if ( SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct) ) {
- anActor->SetHighlightColor(aHiColor.red()/255.,
- aHiColor.green()/255.,
- aHiColor.blue()/255.);
- anActor->SetPreHighlightColor(aPreColor.red()/255.,
- aPreColor.green()/255.,
- aPreColor.blue()/255.);
+ anActor->UpdateSelectionProps();
}
}
}
<source>PREF_OBJECTS</source>
<translation>Objects</translation>
</message>
+ <message>
+ <source>PREF_SELECTION_INCREMENT</source>
+ <translation>Elements width increment</translation>
+ </message>
<message>
<source>PREF_OBJECT_COLOR</source>
<translation>Object color</translation>
<source>PREF_OBJECTS</source>
<translation>Objets</translation>
</message>
+ <message>
+ <source>PREF_SELECTION_INCREMENT</source>
+ <translation type="unfinished">Elements width increment</translation>
+ </message>
<message>
<source>PREF_OBJECT_COLOR</source>
<translation>Couleur d'objet</translation>
<source>PREF_OBJECTS</source>
<translation>オブジェクト</translation>
</message>
+ <message>
+ <source>PREF_SELECTION_INCREMENT</source>
+ <translation type="unfinished">Elements width increment</translation>
+ </message>
<message>
<source>PREF_OBJECT_COLOR</source>
<translation>オブジェクトの色</translation>