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 email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
20 #include <ModelAPI_Session.h>
21 // to avoid unresolved ModelAPI_Document()
22 #include <ModelAPI_Document.h>
23 // to avoid unresolved ModelAPI_Feature()
24 #include <ModelAPI_Feature.h>
25 #include <ModelAPI_Object.h>
26 // to avoid unresolved ModelAPI_Data()
27 #include <ModelAPI_Data.h>
28 // to avoid unresolved ModelAPI_Plugin()
29 #include <ModelAPI_Plugin.h>
30 #include <ModelAPI_Attribute.h>
31 #include <ModelAPI_AttributeDocRef.h>
32 #include <ModelAPI_AttributeDouble.h>
33 #include <ModelAPI_AttributeBoolean.h>
34 #include <ModelAPI_AttributeInteger.h>
35 #include <ModelAPI_AttributeString.h>
36 #include <ModelAPI_AttributeReference.h>
37 #include <ModelAPI_AttributeRefAttr.h>
38 #include <ModelAPI_AttributeRefList.h>
39 #include <ModelAPI_AttributeBoolean.h>
40 #include <ModelAPI_AttributeSelection.h>
41 #include <ModelAPI_AttributeSelectionList.h>
42 #include <ModelAPI_Events.h>
43 #include <ModelAPI_Validator.h>
44 #include <ModelAPI_ResultBody.h>
45 #include <ModelAPI_ResultConstruction.h>
47 #include <Config_ModuleReader.h>
48 #include <Config_PropManager.h>
60 /// Manager that will be initialized from Model package, one per application
61 std::shared_ptr<ModelAPI_Session> MY_MANAGER;
63 void ModelAPI_Session::setSession(std::shared_ptr<ModelAPI_Session> theManager)
65 MY_MANAGER = theManager;
68 std::shared_ptr<ModelAPI_Session> ModelAPI_Session::get()
70 if (!MY_MANAGER) { // import Model library that implements this interface of ModelAPI
71 Config_ModuleReader::loadLibrary("Model");
73 Config_PropManager::registerProp("Visualization", "body_deflection",
74 "Body deflection coefficient",
76 ModelAPI_ResultBody::DEFAULT_DEFLECTION());
78 Config_PropManager::registerProp("Visualization", "construction_deflection",
79 "Construction deflection coefficient",
81 ModelAPI_ResultConstruction::DEFAULT_DEFLECTION());
87 /// instance of the events creator, one pre application
88 const ModelAPI_EventCreator* MY_API_CREATOR = 0;
90 const ModelAPI_EventCreator* ModelAPI_EventCreator::get()
92 if (!MY_API_CREATOR) { // import Model library that implements this interface of ModelAPI
93 Config_ModuleReader::loadLibrary("Model");
95 return MY_API_CREATOR;
98 void ModelAPI_EventCreator::set(const ModelAPI_EventCreator* theCreator)
100 MY_API_CREATOR = theCreator;