AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LuaScript.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_LUASCRIPT_H
18 #define AGXOSG_LUASCRIPT_H
19 
20 #include <agx/config/AGX_USE_LUA.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_LUA()
47 
49  bool executeScriptImpl(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 
73  AGXOSG_EXPORT bool executeScript(const std::string& filename,
74  const std::string& function,
75  agxSDK::Simulation *simulation,
76  agxOSG::ExampleApplication* application,
77  osg::Group *root);
78 
93  AGXOSG_EXPORT bool executeScriptString(const std::string& script,
94  const std::string& function,
95  agxSDK::Simulation *simulation,
96  agxOSG::ExampleApplication* application,
97  osg::Group *root,
98  std::string& errorMessage);
99 
105  AGXOSG_EXPORT std::string readScriptError();
106 
111 
112 #endif
113 }
114 
115 #endif /* AGXOSG_LUASCRIPT_H */
#define AGXOSG_EXPORT
AGXOSG_EXPORT bool executeScriptString(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 lua script.
AGXOSG_EXPORT std::string readScriptError()
Checks if there were any error messages when a lua script was executed.
AGXOSG_EXPORT void resetScriptError()
Resets the script error to the empty string.
AGXCORE_EXPORT Component * root()
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: Object.h:101
AGXOSG_EXPORT bool executeScript(const std::string &filename, const std::string &function, agxSDK::Simulation *simulation, agxOSG::ExampleApplication *application, osg::Group *root)
Execute a named function in a lua script file.
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: Object.h:100