Salome HOME
updated copyright message
[modules/shaper.git] / src / ModelAPI / ModelAPI_Session.cpp
index 1a6ebf6f3d46f8616b22f0e0766186983661a99f..646379e30d76a3a239f03ed7211efa9c9a88f5d4 100644 (file)
@@ -1,6 +1,21 @@
-// File:        ModelAPI_Session.hxx
-// Created:     20 Mar 2014
-// Author:      Mikhail PONIKAROV
+// Copyright (C) 2014-2023  CEA, EDF
+//
+// 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 <ModelAPI_Session.h>
 // to avoid unresolved ModelAPI_Document()
 #include <ModelAPI_AttributeReference.h>
 #include <ModelAPI_AttributeRefAttr.h>
 #include <ModelAPI_AttributeRefList.h>
+#include <ModelAPI_AttributeBoolean.h>
+#include <ModelAPI_AttributeSelection.h>
+#include <ModelAPI_AttributeSelectionList.h>
 #include <ModelAPI_Events.h>
 #include <ModelAPI_Validator.h>
+#include <ModelAPI_ResultBody.h>
+#include <ModelAPI_ResultConstruction.h>
 
 #include <Config_ModuleReader.h>
+#include <Config_PropManager.h>
 
 #ifdef WIN32
 #include <windows.h>
 #include <dlfcn.h>
 #endif
 
-using namespace std;
-
 #ifdef _DEBUG
 #include <iostream>
 #endif
 
 /// Manager that will be initialized from Model package, one per application
-boost::shared_ptr<ModelAPI_Session> MY_MANAGER;
-
-ModelAPI_Session::ModelAPI_Session()
-{
-}
+std::shared_ptr<ModelAPI_Session> MY_MANAGER;
 
-void ModelAPI_Session::setSession(boost::shared_ptr<ModelAPI_Session> theManager)
+void ModelAPI_Session::setSession(std::shared_ptr<ModelAPI_Session> theManager)
 {
   MY_MANAGER = theManager;
 }
 
-boost::shared_ptr<ModelAPI_Session> ModelAPI_Session::get()
+std::shared_ptr<ModelAPI_Session> ModelAPI_Session::get()
 {
   if (!MY_MANAGER) {  // import Model library that implements this interface of ModelAPI
     Config_ModuleReader::loadLibrary("Model");
+
+    Config_PropManager::registerProp("Visualization", "body_deflection",
+                                     "Body deflection coefficient",
+                                     Config_Prop::Double,
+                                     ModelAPI_ResultBody::DEFAULT_DEFLECTION());
+
+    Config_PropManager::registerProp("Visualization", "construction_deflection",
+                                     "Construction deflection coefficient",
+                                     Config_Prop::Double,
+                                     ModelAPI_ResultConstruction::DEFAULT_DEFLECTION());
+
+    Config_PropManager::registerProp("Visualization", "shaper_default_transparency",
+      "Default transparency (%)", Config_Prop::IntSpin, "0", "0", "100");
+
   }
   return MY_MANAGER;
 }
 
-const ModelAPI_EventCreator* MY_API_CREATOR = 0;  ///< instance of the events creator, one pre application
+/// instance of the events creator, one pre application
+const ModelAPI_EventCreator* MY_API_CREATOR = 0;
 
 const ModelAPI_EventCreator* ModelAPI_EventCreator::get()
 {