Salome HOME
Issue #2998: Add help description for automatic creation of constraints
[modules/shaper.git] / src / XGUI / XGUI_CustomPrs.cpp
index fe9fbfcdcca1d35c1e1f0cc282f3f7c7fe78fa0c..f3bd68300687122be19c59e1401ffa328eb69b85 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  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
 //
 // 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
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <XGUI_CustomPrs.h>
@@ -120,23 +119,21 @@ double XGUI_CustomPrs::getDefaultDeflection(const ObjectPtr& theObject)
 
 double getTransparency(const ResultPtr& theResult)
 {
-  double aDeflection = -1;
+  double aTransparency = -1;
   // get transparency from the attribute of the result
   if (theResult.get() != NULL &&
       theResult->data()->attribute(ModelAPI_Result::TRANSPARENCY_ID()).get() != NULL) {
     AttributeDoublePtr aDoubleAttr = theResult->data()->real(ModelAPI_Result::TRANSPARENCY_ID());
     if (aDoubleAttr.get() && aDoubleAttr->isInitialized()) {
-      double aValue = aDoubleAttr->value();
-      if (aValue > 0) /// zero value should not be used as a transparency(previous studies)
-        aDeflection = aDoubleAttr->value();
+      aTransparency = aDoubleAttr->value();
     }
   }
-  return aDeflection;
+  return aTransparency;
 }
 
 double getDefaultTransparency(const ResultPtr& theResult)
 {
-  return 0;
+  return Config_PropManager::integer("Visualization", "shaper_default_transparency") / 100.;
 }
 
 XGUI_CustomPrs::XGUI_CustomPrs(XGUI_Workshop* theWorkshop)