AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PythonScript.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2021. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #ifndef AGXOSG_PYTHONSCRIPT_H
18 #define AGXOSG_PYTHONSCRIPT_H
19 
21 #include <agxOSG/export.h>
22 #include <string>
23 
24 #include <agx/PushDisableWarnings.h> // Disabling warnings. Include agx/PopDisableWarnings.h below!
25 #include <osgDB/ReadFile>
26 #include <agx/PopDisableWarnings.h> // End of disabled warnings.
27 
28 #include <agx/Math.h>
29 #include <agxSDK/Simulation.h>
30 
31 namespace osg {
32  class Node;
33 }
34 
35 namespace agxSDK
36 {
37  class Simulation;
38  class Assembly;
39 }
40 
41 namespace agxOSG
42 {
43  class ExampleApplication;
44  class Group;
45 
46 #if AGX_USE_PYTHON()
47 
49  bool executePythonScriptImpl(const std::string& filenameOrScript,
50  const std::string& function,
51  agxSDK::Simulation *simulation,
52  agxOSG::ExampleApplication* application,
53  osg::Group *root,
54  bool filenameGiven,
55  std::string& errorMessage);
57 
86  AGXOSG_EXPORT bool executePythonScript(const std::string& filename,
87  const std::string& function,
88  agxSDK::Simulation *simulation,
89  agxOSG::ExampleApplication* application,
90  osg::Group *root);
91 
108  AGXOSG_EXPORT bool executePythonScriptString(const std::string& script,
109  const std::string& function,
110  agxSDK::Simulation *simulation,
111  agxOSG::ExampleApplication* application,
112  osg::Group *root,
113  std::string& errorMessage);
114 
120  AGXOSG_EXPORT std::string readPythonScriptError();
121 
126 
127 #endif
128 }
129 
130 #endif /* AGXOSG_PYTHONSCRIPT_H */
#define AGXOSG_EXPORT
AGXOSG_EXPORT bool executePythonScript(const std::string &filename, const std::string &function, agxSDK::Simulation *simulation, agxOSG::ExampleApplication *application, osg::Group *root)
Execute a named function in a python script file.
AGXOSG_EXPORT void resetPythonScriptError()
Resets the script error to the empty string.
AGXOSG_EXPORT std::string readPythonScriptError()
Checks if there were any error messages when a lua script was executed.
AGXOSG_EXPORT bool executePythonScriptString(const std::string &script, const std::string &function, agxSDK::Simulation *simulation, agxOSG::ExampleApplication *application, osg::Group *root, std::string &errorMessage)
Execute a named function in a python script.
AGXCORE_EXPORT Component * root()
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: Object.h:101
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: Object.h:100