mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-03 09:20:26 -05:00
Merged Master into ATM.
This commit is contained in:
@@ -30,6 +30,9 @@
|
||||
|
||||
#include <openspace/util/openspacemodule.h>
|
||||
|
||||
#include <ghoul/misc/assert.h>
|
||||
#include <algorithm>
|
||||
|
||||
namespace ghoul {
|
||||
namespace systemcapabilities {
|
||||
|
||||
@@ -83,6 +86,25 @@ public:
|
||||
* \return A list of all registered OpenSpaceModule%s
|
||||
*/
|
||||
std::vector<OpenSpaceModule*> modules() const;
|
||||
|
||||
/**
|
||||
* Get the module subclass with given template argument. Requires the module subclass
|
||||
* to have the public static member variable <code>name</code> which must be equal to
|
||||
* the name of the module used in its constructor.
|
||||
* \return a pointer to the module of the given subclass
|
||||
*/
|
||||
template <class ModuleSubClass>
|
||||
ModuleSubClass* module() const {
|
||||
auto it = std::find_if(_modules.begin(), _modules.end(),
|
||||
[](const std::unique_ptr<OpenSpaceModule>& module) {
|
||||
return module->name() == ModuleSubClass::name;
|
||||
});
|
||||
if (it != _modules.end()) {
|
||||
return dynamic_cast<ModuleSubClass*>(it->get());
|
||||
} else {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the combined minimum OpenGL version. The return value is the maximum
|
||||
|
||||
@@ -78,6 +78,7 @@ public:
|
||||
std::vector<std::string>& sgctArguments, bool& requestClose);
|
||||
static void destroy();
|
||||
static OpenSpaceEngine& ref();
|
||||
static bool isCreated();
|
||||
|
||||
double runTime();
|
||||
void setRunTime(double t);
|
||||
|
||||
@@ -60,6 +60,7 @@ public:
|
||||
private:
|
||||
void parallelConnectionChanged(const ParallelConnection::Status& status);
|
||||
void addToCommand(std::string c);
|
||||
std::string sanitizeInput(std::string str);
|
||||
|
||||
properties::BoolProperty _isVisible;
|
||||
properties::BoolProperty _remoteScripting;
|
||||
|
||||
@@ -41,10 +41,10 @@ namespace ghoul { class Dictionary; }
|
||||
|
||||
namespace openspace {
|
||||
|
||||
namespace documentation { struct Documentation; }
|
||||
|
||||
class SceneGraphNode;
|
||||
|
||||
namespace documentation { struct Documentation; }
|
||||
|
||||
// Notifications:
|
||||
// SceneGraphFinishedLoading
|
||||
class Scene : public DocumentationGenerator {
|
||||
|
||||
@@ -55,8 +55,24 @@ struct LuaLibrary {
|
||||
};
|
||||
/// The name of the library
|
||||
std::string name;
|
||||
/// The list of all functions for this library
|
||||
/// The list of all C-based callback functions for this library
|
||||
std::vector<Function> functions;
|
||||
/// A list of script files that are executed for each Lua state
|
||||
std::vector<std::string> scripts;
|
||||
|
||||
/// This struct contains information about a function or constant that is defined in
|
||||
/// a Lua script
|
||||
struct Documentation {
|
||||
/// The name of the function/variable
|
||||
std::string name;
|
||||
/// The description of the parameters for a function
|
||||
std::string parameter;
|
||||
/// The description of the function/variable
|
||||
std::string description;
|
||||
};
|
||||
/// The list of documentations will be populated automatically by parsing the Lua
|
||||
/// scripts
|
||||
std::vector<Documentation> documentations;
|
||||
|
||||
/// Comparison function that compares two LuaLibrary%s name
|
||||
bool operator<(const LuaLibrary& rhs) const;
|
||||
|
||||
@@ -101,8 +101,8 @@ public:
|
||||
static std::string OpenSpaceLibraryName;
|
||||
|
||||
private:
|
||||
bool registerLuaLibrary(lua_State* state, const LuaLibrary& library);
|
||||
void addLibraryFunctions(lua_State* state, const LuaLibrary& library, bool replace);
|
||||
bool registerLuaLibrary(lua_State* state, LuaLibrary& library);
|
||||
void addLibraryFunctions(lua_State* state, LuaLibrary& library, bool replace);
|
||||
|
||||
bool isLibraryNameAllowed(lua_State* state, const std::string& name);
|
||||
|
||||
@@ -112,7 +112,8 @@ private:
|
||||
std::string generateJson() const override;
|
||||
|
||||
ghoul::lua::LuaState _state;
|
||||
std::set<LuaLibrary> _registeredLibraries;
|
||||
std::vector<LuaLibrary> _registeredLibraries;
|
||||
|
||||
|
||||
//sync variables
|
||||
std::mutex _mutex;
|
||||
|
||||
@@ -83,10 +83,12 @@ public:
|
||||
* program.
|
||||
* OBS! Users must ensure bind has been called before using this method.
|
||||
*/
|
||||
void setValue(ghoul::opengl::ProgramObject* program, std::shared_ptr<ghoul::opengl::Texture> texture){
|
||||
void setValue(ghoul::opengl::ProgramObject* program, ghoul::opengl::Texture* texture){
|
||||
_texUnit = std::make_unique<ghoul::opengl::TextureUnit>();
|
||||
_texUnit->activate();
|
||||
texture->bind();
|
||||
if (texture) {
|
||||
texture->bind();
|
||||
}
|
||||
program->setUniform(_uniformLocation, *_texUnit);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user