1 // Copyright (C) 2014-2017 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #include <ModelAPI_Session.h>
22 // to avoid unresolved ModelAPI_Document()
23 #include <ModelAPI_Document.h>
24 // to avoid unresolved ModelAPI_Feature()
25 #include <ModelAPI_Feature.h>
26 #include <ModelAPI_Object.h>
27 // to avoid unresolved ModelAPI_Data()
28 #include <ModelAPI_Data.h>
29 // to avoid unresolved ModelAPI_Plugin()
30 #include <ModelAPI_Plugin.h>
31 #include <ModelAPI_Attribute.h>
32 #include <ModelAPI_AttributeDocRef.h>
33 #include <ModelAPI_AttributeDouble.h>
34 #include <ModelAPI_AttributeBoolean.h>
35 #include <ModelAPI_AttributeInteger.h>
36 #include <ModelAPI_AttributeString.h>
37 #include <ModelAPI_AttributeReference.h>
38 #include <ModelAPI_AttributeRefAttr.h>
39 #include <ModelAPI_AttributeRefList.h>
40 #include <ModelAPI_AttributeBoolean.h>
41 #include <ModelAPI_AttributeSelection.h>
42 #include <ModelAPI_AttributeSelectionList.h>
43 #include <ModelAPI_Events.h>
44 #include <ModelAPI_Validator.h>
45 #include <ModelAPI_ResultBody.h>
46 #include <ModelAPI_ResultConstruction.h>
48 #include <Config_ModuleReader.h>
49 #include <Config_PropManager.h>
61 /// Manager that will be initialized from Model package, one per application
62 std::shared_ptr<ModelAPI_Session> MY_MANAGER;
64 void ModelAPI_Session::setSession(std::shared_ptr<ModelAPI_Session> theManager)
66 MY_MANAGER = theManager;
69 std::shared_ptr<ModelAPI_Session> ModelAPI_Session::get()
71 if (!MY_MANAGER) { // import Model library that implements this interface of ModelAPI
72 Config_ModuleReader::loadLibrary("Model");
74 Config_PropManager::registerProp("Visualization", "body_deflection",
75 "Body deflection coefficient",
77 ModelAPI_ResultBody::DEFAULT_DEFLECTION());
79 Config_PropManager::registerProp("Visualization", "construction_deflection",
80 "Construction deflection coefficient",
82 ModelAPI_ResultConstruction::DEFAULT_DEFLECTION());
88 /// instance of the events creator, one pre application
89 const ModelAPI_EventCreator* MY_API_CREATOR = 0;
91 const ModelAPI_EventCreator* ModelAPI_EventCreator::get()
93 if (!MY_API_CREATOR) { // import Model library that implements this interface of ModelAPI
94 Config_ModuleReader::loadLibrary("Model");
96 return MY_API_CREATOR;
99 void ModelAPI_EventCreator::set(const ModelAPI_EventCreator* theCreator)
101 MY_API_CREATOR = theCreator;