AGX Dynamics  2.37.2.0
PythonScript.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. 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 
20 #include <agx/config/AGX_USE_PYTHON.h>
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 
125  AGXOSG_EXPORT void resetPythonScriptError();
126 
127 #endif
128 }
129 
130 #endif /* AGXOSG_PYTHONSCRIPT_H */
#define AGXOSG_EXPORT
STL namespace.
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
AGXCORE_EXPORT Component * root()
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:30
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: Object.h:98
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: Object.h:97