X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelAPI%2FModelAPI_Session.cpp;h=7755b7bf378185b2e877594db26b184207a4df6b;hb=c02fae5493cc6d56c9a1db3bdcf6d872f88fea07;hp=db8a54ca2c32b820601dcd261c42429dd40f8633;hpb=d9db5498b576854aae37ddf8c0bb6fceb264712e;p=modules%2Fshaper.git diff --git a/src/ModelAPI/ModelAPI_Session.cpp b/src/ModelAPI/ModelAPI_Session.cpp index db8a54ca2..7755b7bf3 100644 --- a/src/ModelAPI/ModelAPI_Session.cpp +++ b/src/ModelAPI/ModelAPI_Session.cpp @@ -1,6 +1,21 @@ -// File: ModelAPI_Session.hxx -// Created: 20 Mar 2014 -// Author: Mikhail PONIKAROV +// 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 +// 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 // to avoid unresolved ModelAPI_Document() @@ -26,8 +41,11 @@ #include #include #include +#include +#include #include +#include #ifdef WIN32 #include @@ -35,33 +53,42 @@ #include #endif -using namespace std; - #ifdef _DEBUG #include #endif /// Manager that will be initialized from Model package, one per application -boost::shared_ptr MY_MANAGER; - -ModelAPI_Session::ModelAPI_Session() -{ -} +std::shared_ptr MY_MANAGER; -void ModelAPI_Session::setSession(boost::shared_ptr theManager) +void ModelAPI_Session::setSession(std::shared_ptr theManager) { MY_MANAGER = theManager; } -boost::shared_ptr ModelAPI_Session::get() +std::shared_ptr 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() {