Merge branch 'master' into feature/loadingscreen-refactor

# Conflicts:
#	modules/base/rendering/renderabletrailorbit.h
#	modules/digitaluniverse/rendering/renderablebillboardscloud.cpp
#	modules/digitaluniverse/rendering/renderableplanescloud.cpp
#	modules/digitaluniverse/rendering/renderablepoints.cpp
#	modules/galaxy/rendering/renderablegalaxy.cpp
#	modules/galaxy/rendering/renderablegalaxy.h
#	modules/kameleonvolume/rendering/renderablekameleonvolume.cpp
#	modules/kameleonvolume/rendering/renderablekameleonvolume.h
#	modules/spacecraftinstruments/rendering/renderablefov.h
#	modules/spacecraftinstruments/rendering/renderableplaneprojection.h
#	modules/toyvolume/rendering/renderabletoyvolume.cpp
#	modules/toyvolume/rendering/renderabletoyvolume.h
#	modules/volume/rendering/renderabletimevaryingvolume.cpp
#	modules/volume/rendering/renderabletimevaryingvolume.h
This commit is contained in:
Alexander Bock
2017-11-08 19:10:59 -06:00
380 changed files with 1913 additions and 2014 deletions

View File

@@ -67,8 +67,8 @@ target_link_libraries(
#####
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
SET(LIBTORRENT_encryption OFF)
SET(LIBTORRENT_shared OFF)
SET(LIBTORRENT_encryption OFF CACHE BOOL "Use OpenSSL Encryption" FORCE)
SET(LIBTORRENT_shared OFF CACHE BOOL "Use Libtorrent as shared library" FORCE)
include_external_library(
Launcher

View File

@@ -64,9 +64,9 @@ namespace {
class QLog : public ghoul::logging::Log {
public:
void log(
ghoul::logging::LogLevel level,
const std::string& category,
const std::string& message
[[maybe_unused]] ghoul::logging::LogLevel level,
[[maybe_unused]] const std::string& category,
[[maybe_unused]] const std::string& message
) {
//qDebug() << QString::fromStdString(category) << ": " << QString::fromStdString(message);
}
@@ -84,10 +84,10 @@ MainWindow::MainWindow()
setObjectName("MainWindow");
setFixedSize(WindowSize);
//setContentsMargins(0, 0, 0, 0);
QGridLayout* layout = new QGridLayout;
layout->setContentsMargins(0, 0, 0, 0);
QLabel* image = new QLabel;
//image->setContentsMargins(0, 0, 0, 0);
image->setObjectName("Image");
@@ -95,7 +95,6 @@ MainWindow::MainWindow()
image->setPixmap(p);
layout->addWidget(image, 0, 0, 1, 2);
_informationWidget = new QTextEdit(this);
_informationWidget->setReadOnly(true);
//_informationWidget->setEnabled(false);
@@ -107,7 +106,7 @@ MainWindow::MainWindow()
QWidget* container = new QWidget;
{
QGridLayout* innerLayout = new QGridLayout;
//QLabel* shortcutLabel = new QLabel("Keyboard Shortcuts:");
//innerLayout->addWidget(shortcutLabel, 0, 0);
//QPushButton* shortcutButton = new QPushButton("Open...");
@@ -122,47 +121,47 @@ MainWindow::MainWindow()
innerLayout->addWidget(configurationSelectionLabel, 2, 0);
_configurations = new QComboBox;
innerLayout->addWidget(_configurations, 2, 1);
QLabel* sceneSelectionLabel = new QLabel("Scenes:");
innerLayout->addWidget(sceneSelectionLabel, 3, 0);
_scenes = new QComboBox;
innerLayout->addWidget(_scenes, 3, 1);
container->setLayout(innerLayout);
}
layout->addWidget(container, 1, 1);
container = new QWidget;
{
QBoxLayout* innerLayout = new QHBoxLayout;
QPushButton* cancelButton = new QPushButton("Exit");
QObject::connect(
cancelButton, SIGNAL(clicked(bool)),
QApplication::instance(), SLOT(quit())
);
innerLayout->addWidget(cancelButton);
QPushButton* syncButton = new QPushButton("Sync");
QObject::connect(
syncButton, SIGNAL(clicked(bool)),
this, SLOT(syncButtonPressed())
);
innerLayout->addWidget(syncButton);
QPushButton* startButton = new QPushButton("Start");
QObject::connect(
startButton, SIGNAL(clicked(bool)),
this, SLOT(startButtonPressed())
);
innerLayout->addWidget(startButton);
container->setLayout(innerLayout);
}
layout->addWidget(container, 2, 1);
setLayout(layout);
initialize();
}
@@ -244,7 +243,7 @@ void MainWindow::initialize() {
// Get the news information
QNetworkRequest request;
request.setUrl(QUrl(NewsURL));
_newsReply = _networkManager.get(request);
QObject::connect(_newsReply, SIGNAL(finished()),
this, SLOT(newsReadyRead())

View File

@@ -53,7 +53,7 @@ private slots:
void shortcutButtonPressed();
void syncButtonPressed();
void startButtonPressed();
void newsNetworkError();
void newsReadyRead();
@@ -64,7 +64,7 @@ private:
void configureLogging();
QNetworkReply* _newsReply;
QTextEdit* _informationWidget;
QComboBox* _configurations;
@@ -72,7 +72,7 @@ private:
QComboBox* _scenes;
QMap<QString, QString> _sceneFiles;
ShortcutWidget* _shortcutWidget;
SyncWidget* _syncWidget;

View File

@@ -281,7 +281,7 @@ void SyncWidget::handleDirectFiles() {
void SyncWidget::handleFileRequest() {
LDEBUG("File Requests");
for (const FileRequest& f : _fileRequests) {
LDEBUG(f.identifier.toStdString() << " (" << f.version << ") -> " << f.destination.toStdString());
@@ -405,18 +405,18 @@ void SyncWidget::syncButtonPressed() {
for (int i = 1; i <= modules.size(); ++i) {
std::string module = modules.value<std::string>(std::to_string(i));
std::string shortModule = module;
std::string::size_type pos = module.find_last_of(FileSys.PathSeparator);
if (pos != std::string::npos) {
shortModule = module.substr(pos+1);
}
QString m = QString::fromStdString(module);
QString dataFile = sceneDir.absoluteFilePath(
QString::fromStdString(module) + "/" + QString::fromStdString(shortModule) + ".data"
);
if (QFileInfo(dataFile).exists()) {
modulesList.append({
QString::fromStdString(module),
@@ -427,13 +427,13 @@ void SyncWidget::syncButtonPressed() {
else {
QDir metaModuleDir = sceneDir;
metaModuleDir.cd(QString::fromStdString(module));
QDirIterator it(metaModuleDir.absolutePath(), QStringList() << "*.data", QDir::Files, QDirIterator::Subdirectories);
while (it.hasNext()) {
QString v = it.next();
QDir d(v);
d.cdUp();
modulesList.append({
d.dirName(),
v,
@@ -533,7 +533,7 @@ void SyncWidget::syncButtonPressed() {
continue;
}
std::string file = d.value<std::string>(FileKey);
std::string dest;
if (d.hasKeyAndValue<std::string>(DestinationKey))
dest = d.value<std::string>(DestinationKey);

View File

@@ -52,7 +52,7 @@ Q_OBJECT
public:
SyncWidget(QWidget* parent, Qt::WindowFlags f = 0);
~SyncWidget();
void setSceneFiles(QMap<QString, QString> sceneFiles);
private slots:

View File

@@ -66,7 +66,7 @@
#define DEVELOPER_MODE
namespace {
const char* _loggerCat = "main";
sgct::Engine* SgctEngine;
@@ -79,7 +79,6 @@ LONG WINAPI generateMiniDump(EXCEPTION_POINTERS* exceptionPointers) {
SYSTEMTIME stLocalTime;
GetLocalTime(&stLocalTime);
LFATAL("Printing Stack Trace that lead to the crash:");
std::vector<std::string> stackTrace = ghoul::stackTrace();
for (const std::string& s : stackTrace) {
@@ -139,7 +138,7 @@ LONG WINAPI generateMiniDump(EXCEPTION_POINTERS* exceptionPointers) {
}
#endif // WIN32
#ifdef OPENVR_SUPPORT
sgct::SGCTWindow* FirstOpenVRWindow = nullptr;
#endif
@@ -172,7 +171,6 @@ std::vector<SpoutWindow> SpoutWindows;
#endif // OPENSPACE_HAS_SPOUT
std::pair<int, int> supportedOpenGLVersion() {
// Just create a window in order to retrieve the available OpenGL version before we
// create the real window
@@ -188,9 +186,9 @@ std::pair<int, int> supportedOpenGLVersion() {
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
#endif
glfwWindowHint(GLFW_VISIBLE, GL_FALSE);
// By creating an offscreen window, the user will not know that we created this window
GLFWwindow* offscreen = glfwCreateWindow(128, 128, "", nullptr, nullptr);
glfwMakeContextCurrent(offscreen);
@@ -203,7 +201,7 @@ std::pair<int, int> supportedOpenGLVersion() {
// And get rid of the window again
glfwDestroyWindow(offscreen);
glfwWindowHint(GLFW_VISIBLE, GL_TRUE);
return { major, minor };
}
@@ -217,14 +215,14 @@ void mainInitFunc() {
LDEBUG("Initializing OpenGL in OpenSpace Engine started");
OsEng.initializeGL();
LDEBUG("Initializing OpenGL in OpenSpace Engine finished");
// Find if we have at least one OpenVR window
// Save reference to first OpenVR window, which is the one we will copy to the HMD.
for (size_t i = 0; i < SgctEngine->getNumberOfWindows(); ++i) {
if (SgctEngine->getWindowPtr(i)->checkIfTagExists(OpenVRTag)) {
#ifdef OPENVR_SUPPORT
FirstOpenVRWindow = SgctEngine->getWindowPtr(i);
// If we have an OpenVRWindow, initialize OpenVR.
sgct::SGCTOpenVR::initialize(
SgctEngine->getNearClippingPlane(), SgctEngine->getFarClippingPlane()
@@ -305,7 +303,7 @@ void mainInitFunc() {
LWARNING(
"Spout was requested, but OpenSpace was compiled without Spout support."
);
#endif // OPENSPACE_HAS_SPOUT
}
LTRACE("main::mainInitFunc(end)");
@@ -480,7 +478,7 @@ void mainLogCallback(const char* msg) {
int main_main(int argc, char** argv) {
std::pair<int, int> glVersion = supportedOpenGLVersion();
// Create the OpenSpace engine and get arguments for the SGCT engine
// @CLEANUP: Replace the return valua with throwing an exception --abock
std::vector<std::string> sgctArguments;
@@ -491,37 +489,37 @@ int main_main(int argc, char** argv) {
sgctArguments,
requestQuit
);
if (requestQuit) {
return EXIT_SUCCESS;
}
LINFO("Detected OpenGL version: " << glVersion.first << "." << glVersion.second);
// Create sgct engine c arguments
int newArgc = static_cast<int>(sgctArguments.size());
char** newArgv = new char*[newArgc];
for (int i = 0; i < newArgc; ++i) {
newArgv[i] = const_cast<char*>(sgctArguments.at(i).c_str());
}
// Need to set this before the creation of the sgct::Engine
sgct::MessageHandler::instance()->setLogToConsole(false);
sgct::MessageHandler::instance()->setShowTime(false);
sgct::MessageHandler::instance()->setLogToCallback(true);
sgct::MessageHandler::instance()->setLogCallback(mainLogCallback);
#ifdef __APPLE__
glfwWindowHint(GLFW_STENCIL_BITS, 8);
#endif
LDEBUG("Creating SGCT Engine");
SgctEngine = new sgct::Engine(newArgc, newArgv);
// Deallocate sgct c arguments
delete[] newArgv;
// Bind functions
SgctEngine->setInitOGLFunction(mainInitFunc);
SgctEngine->setPreSyncFunction(mainPreSyncFunc);
@@ -534,17 +532,17 @@ int main_main(int argc, char** argv) {
SgctEngine->setMouseScrollCallbackFunction(mainMouseScrollCallback);
SgctEngine->setExternalControlCallback(mainExternalControlCallback);
SgctEngine->setCharCallbackFunction(mainCharCallback);
// Disable the immediate exit of the application when the ESC key is pressed
SgctEngine->setExitKey(SGCT_KEY_UNKNOWN);
sgct::MessageHandler::instance()->setNotifyLevel(sgct::MessageHandler::NOTIFY_ALL);
// Set encode and decode functions
// NOTE: starts synchronizing before init functions
sgct::SharedData::instance()->setEncodeFunction(mainEncodeFun);
sgct::SharedData::instance()->setDecodeFunction(mainDecodeFun);
// Try to open a window
LDEBUG("Initialize SGCT Engine");
std::map<std::pair<int, int>, sgct::Engine::RunMode> versionMapping = {
@@ -561,17 +559,17 @@ int main_main(int argc, char** argv) {
versionMapping.find(glVersion) != versionMapping.end(),
"Unknown OpenGL version. Missing statement in version mapping map"
);
auto cleanup = [&](){
OsEng.deinitialize();
// Clear function bindings to avoid crash after destroying the OpenSpace Engine
sgct::MessageHandler::instance()->setLogToCallback(false);
sgct::MessageHandler::instance()->setLogCallback(nullptr);
LDEBUG("Destroying OpenSpaceEngine");
openspace::OpenSpaceEngine::destroy();
LDEBUG("Destroying SGCT Engine");
delete SgctEngine;
@@ -594,26 +592,26 @@ int main_main(int argc, char** argv) {
}
#endif // OPENSPACE_HAS_SPOUT
};
bool initSuccess = SgctEngine->init(versionMapping[glVersion]);
if (!initSuccess) {
LFATAL("Initializing failed");
cleanup();
return EXIT_FAILURE;
}
// Main loop
LDEBUG("Starting rendering loop");
SgctEngine->render();
LDEBUG("Ending rendering loop");
cleanup();
// Exit program
exit(EXIT_SUCCESS);
}
} // namespace
int main(int argc, char** argv) {

View File

@@ -177,7 +177,6 @@ ControlWidget::ControlWidget(QWidget* parent)
_setDelta->setObjectName("background");
layout->addWidget(_setDelta, 4, 0, 1, 2);
QWidget* controlContainer = new QWidget;
controlContainer->setObjectName("background");

View File

@@ -228,7 +228,7 @@ void MainWindow::readTcpData() {
fullyConnected();
continuousData.clear();
break;
default:
qDebug() << QString(data);
}
@@ -309,7 +309,7 @@ QByteArray MainWindow::handlePlaybook(QByteArray data) {
image.beginningString = readFromBuffer<std::string>(buffer, currentReadLocation);
image.endingString = readFromBuffer<std::string>(buffer, currentReadLocation);
uint8_t targetId = readFromBuffer<uint8_t>(buffer, currentReadLocation);
uint16_t instrumentId = readFromBuffer<uint16_t>(buffer, currentReadLocation);
image.target = targetMap[targetId];

View File

@@ -65,7 +65,7 @@ private:
ControlWidget* _timeControlWidget;
InformationWidget* _informationWidget;
TimelineWidget* _timelineWidget;
QTcpSocket* _socket;
bool _isConnected = false;

View File

@@ -35,7 +35,7 @@
namespace {
static const int LegendHeight = 105;
static const int TimeWidth = 200;
static const int TextOffset = 5;
QMap<QString, QColor> InstrumentColors = {
@@ -127,7 +127,7 @@ void TimelineWidget::setData(std::vector<Image> images, std::map<uint8_t, std::s
void TimelineWidget::drawContent(QPainter& painter, QRectF rect) {
QRectF timelineRect(0, 0, rect.width() - TimeWidth, rect.height());
QRectF dateRect(rect.width() - TimeWidth, 0, TimeWidth, rect.height());
// Draw background
//painter.setBrush(QBrush(Qt::lightGray)); painter.drawRect(timelineRect);
painter.setBrush(QBrush(QColor(85, 85, 85))); painter.drawRect(timelineRect);

View File

@@ -1,7 +1,7 @@
return {
FileRequest = {
{ Identifier = "stars_textures", Destination = "textures", Version = 1 },
{ Identifier = "stars_du", Destination = "speck", Version = 1 },
{ Identifier = "stars_du", Destination = "speck", Version = 2 },
{ Identifier = "stars_colormap", Destination = ".", Version = 1 },
},
}

View File

@@ -68,7 +68,7 @@ struct TestResult {
/// The Reason that caused this offense
Reason reason;
};
/**
* A warning is some value that that does not exactly adhere to the specification, but
* that also does not violate so badly to warrant an Offense. This, for example, could

View File

@@ -29,7 +29,7 @@
#include <vector>
namespace openspace {
/*
* This abstract class is used for instances when another class has the ability to
* generate a Handlebar generated documentation file that contains valuable information
@@ -51,7 +51,7 @@ public:
std::string name; ///< The name of the Handlebar template defined in \m filename
std::string filename; ///< The filename referenced in the \m name
};
/**
* The constructor that is used to set the member variables later used in the
* writeDocumentation method.
@@ -72,7 +72,7 @@ public:
/// Default constructor
virtual ~DocumentationGenerator() = default;
/**
* Create the documentation into the provided filename. Any existing file will be
* silently overwritten. This method will call the generateJson method that can be
@@ -81,7 +81,7 @@ public:
* \param filename The filename in which the documentation is written
*/
void writeDocumentation(const std::string& filename);
protected:
/**
* This abstract method is used by concrete subclasses to provide the actual data that
@@ -92,14 +92,13 @@ protected:
* DocumentationGenerator constructor
*/
virtual std::string generateJson() const = 0;
private:
const std::string _name;
const std::string _jsonName;
const std::vector<HandlebarTemplate> _handlebarTemplates;
const std::string _javascriptFile;
};
/**
* This function takes a \p text and escapes all necessary characters () that JSON

View File

@@ -182,7 +182,7 @@ public:
* \throw ghoul::RuntimeError If the configuration could not be found
*/
static std::string findConfiguration(const std::string& filename);
/**
* Load the provided configuration file (\p filename) into this Dictionary. All paths
* that are specified in the configuration file will automatically be registered in

View File

@@ -57,7 +57,7 @@ public:
* name
*/
void initialize();
/**
* Deinitializes all of the contained OpenSpaceModule%s by calling the
* OpenSpaceModule::deinitialize methods.
@@ -73,14 +73,14 @@ public:
* \pre \p module must not be nullptr
*/
void registerModule(std::unique_ptr<OpenSpaceModule> module);
/**
* Returns a list of all registered OpenSpaceModule%s that have been registered with
* this ModuleEngine. All returned OpenSpaceModule%s are guaranteed to be initialized.
* \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

View File

@@ -99,7 +99,7 @@ public:
void decode();
void scheduleLoadScene(std::string scenePath);
void writeDocumentation();
void toggleShutdownMode();
@@ -125,7 +125,7 @@ public:
scripting::ScriptScheduler& scriptScheduler();
VirtualPropertyManager& virtualPropertyManager();
// This method is only to be called from Modules
enum class CallbackOption {
Initialize = 0, // Callback for the end of the initialization
@@ -137,14 +137,14 @@ public:
Render, // Callback for the end of the render function
PostDraw // Callback for the end of the post-draw function
};
// Registers a callback for a specific CallbackOption
void registerModuleCallback(CallbackOption option, std::function<void()> function);
// Registers a callback that is called when a new keyboard event is received
void registerModuleKeyboardCallback(
std::function<bool (Key, KeyModifier, KeyAction)> function);
// Registers a callback that is called when a new character event is received
void registerModuleCharCallback(
std::function<bool (unsigned int, KeyModifier)> function);
@@ -152,16 +152,16 @@ public:
// Registers a callback that is called when a new mouse button is received
void registerModuleMouseButtonCallback(
std::function<bool (MouseButton, MouseAction)> function);
// Registers a callback that is called when a new mouse movement is received
void registerModuleMousePositionCallback(
std::function<void (double, double)> function);
// Registers a callback that is called when a scroll wheel change is received
void registerModuleMouseScrollWheelCallback(
std::function<bool (double, double)> function
);
/**
* Returns the Lua library that contains all Lua functions available to affect the
* application.
@@ -177,7 +177,7 @@ private:
void loadFonts();
void runPreInitializationScripts(const std::string& sceneDescription);
void configureLogging();
// Components
std::unique_ptr<ConfigurationManager> _configurationManager;
std::unique_ptr<SceneManager> _sceneManager;
@@ -208,30 +208,30 @@ private:
properties::StringProperty versionString;
properties::StringProperty sourceControlInformation;
} _versionInformation;
bool _scheduledSceneSwitch;
std::string _scenePath;
struct {
std::vector<std::function<void()>> initialize;
std::vector<std::function<void()>> deinitialize;
std::vector<std::function<void()>> initializeGL;
std::vector<std::function<void()>> deinitializeGL;
std::vector<std::function<void()>> preSync;
std::vector<std::function<void()>> postSyncPreDraw;
std::vector<std::function<void()>> render;
std::vector<std::function<void()>> postDraw;
std::vector<std::function<bool (Key, KeyModifier, KeyAction)>> keyboard;
std::vector<std::function<bool (unsigned int, KeyModifier)>> character;
std::vector<std::function<bool (MouseButton, MouseAction)>> mouseButton;
std::vector<std::function<void (double, double)>> mousePosition;
std::vector<std::function<bool (double, double)>> mouseScrollWheel;
} _moduleCallbacks;
// Structure that is responsible for the delayed shutdown of the application
struct {
// Whether the application is currently in shutdown mode (i.e. counting down the

View File

@@ -34,7 +34,7 @@
#include <vector>
namespace openspace {
class OpenSpaceModule;
class SettingsEngine : public properties::PropertyOwner {
@@ -42,7 +42,7 @@ public:
SettingsEngine();
void initialize();
void setModules(const std::vector<OpenSpaceModule*>& modules);
private:

View File

@@ -71,7 +71,7 @@ public:
* Invokes the postsync method of all added Syncables
*/
void postSynchronization(IsMaster isMaster);
/**
* Add a Syncable to be synchronized over the SGCT cluster.
* \pre syncable must not be nullptr

View File

@@ -64,14 +64,14 @@ public:
bool isMaster() const override;
bool isUsingSwapGroups() const override;
bool isSwapGroupMaster() const override;
glm::mat4 viewProjectionMatrix() const override;
glm::mat4 modelMatrix() const override;
void setNearFarClippingPlane(float near, float far) override;
void setEyeSeparationDistance(float distance) override;
glm::ivec4 viewportPixelCoordinates() const override;
bool isExternalControlConnected() const override;
void sendMessageToExternalControl(const std::vector<char>& message) const override;

View File

@@ -76,7 +76,7 @@ public:
* disables it
*/
virtual void setSynchronization(bool enabled);
/**
* This method clears all the rendering windows with the specified \p clearColor. In
* most OpenGL cases, this will end up with one or mode <code>glClear</code> calls.
@@ -84,7 +84,7 @@ public:
* \param clearColor The color with which to clear all windows
*/
virtual void clearAllWindows(const glm::vec4& clearColor);
/**
* Returns whether the current window has been resized recently. On default, this
* method always returns <code>false</code>.
@@ -119,7 +119,7 @@ public:
* \return The location of the mouse cursor in pixel screen coordinates
*/
virtual glm::vec2 mousePosition() const;
/**
* Returns a bitmask of the status of all available mouse buttons. Bit <code>i</code>
* is <code>1</code> if mouse button <code>i</code> is pressed down;
@@ -129,28 +129,28 @@ public:
* \return A bitmask showing the status of all mouse buttons (up to \p maxNumber)
*/
virtual uint32_t mouseButtons(int maxNumber = 8) const;
/**
* Returns the size of the currently active window in pixel coordinates. On default,
* this method returns a window size of <code>0,0</code>.
* \return The size of the currently active window in pixel coordinates
*/
virtual glm::ivec2 currentWindowSize() const;
/**
* Returns the resolution of the currently active window in pixel coordinates. On
* default, this method returns the same size as #currentWindowSize.
* \return The resolution of the currently active window in pixel coordinates
*/
virtual glm::ivec2 currentWindowResolution() const;
/**
* Returns the resolution of the currently active framebuffer in pixel coordinates.
* On default, this method returns the same size as #currentWindowSize.
* \return The resolution of the currently active window in pixel coordinates
*/
virtual glm::ivec2 currentDrawBufferResolution() const;
/**
* Returns the DPI scaling factor for the current window. This is normally 1 on all
* regular monitors and 2 on Retina screens.
@@ -187,7 +187,7 @@ public:
* \return Whether the current rendering window is GUI-only
*/
virtual bool isGuiWindow() const;
/**
* Returns <code>true</code> if this application is the master for a clustered
* environment.
@@ -218,7 +218,7 @@ public:
* \return The currently employed model matrix
*/
virtual glm::mat4 modelMatrix() const;
/**
* Sets the near and far clipping planes of the rendering window. This method defaults
* to a no-op.
@@ -226,7 +226,7 @@ public:
* \param far The far clipping plane
*/
virtual void setNearFarClippingPlane(float near, float far);
/**
* Sets the stereo eye separation distance for the render engine.
* \param distance The distance between eyes for stereo rendering.
@@ -241,7 +241,7 @@ public:
* \return The location and size of the current viewport
*/
virtual glm::ivec4 viewportPixelCoordinates() const;
/**
* Returns <code>true</code> if there is an external control connected, i.e., an
* application that can receive control commands. On default, this method will return
@@ -249,13 +249,13 @@ public:
* \return If there is an external control connected
*/
virtual bool isExternalControlConnected() const;
/**
* Sends a \p message to an external control. This method defaults to a no-op.
* \param message The message to be sent
*/
virtual void sendMessageToExternalControl(const std::vector<char>& message) const;
/**
* Returns <code>true</code> if the rendering is a single viewport with an single
* window; <code>false</code> otherwise. On default, this method returns

View File

@@ -39,7 +39,7 @@ public:
Controller() :
_handler(nullptr)
{}
void setHandler(NavigationHandler* handler);
protected:

View File

@@ -44,7 +44,7 @@ public:
void setTransferFunction(std::function<T(float)> transferFunction);
void setInterpolationTime(float interpolationTime);
void step();
float deltaTimeScaled() const;
T value() const;
bool isInterpolating() const;

View File

@@ -42,7 +42,7 @@ class KeyBindingManager : public DocumentationGenerator {
public:
KeyBindingManager();
~KeyBindingManager() = default;
void resetKeyBindings();
void bindKeyLocal(
@@ -72,7 +72,7 @@ private:
Synchronized synchronization;
std::string documentation;
};
std::string generateJson() const override;
std::multimap<KeyWithModifier, KeyInformation> _keyLua;

View File

@@ -36,7 +36,7 @@ struct MouseState {
MouseState(double scaleFactor);
void setFriction(double friction);
void setVelocityScaleFactor(double scaleFactor);
glm::dvec2 previousPosition;
DelayedVariable<glm::dvec2, double> velocity;
};

View File

@@ -58,7 +58,7 @@ public:
void resetCameraDirection();
void setCameraStateFromDictionary(const ghoul::Dictionary& cameraDict);
void updateCamera(double deltaTime);
// Accessors

View File

@@ -89,7 +89,7 @@ private:
SceneGraphNode* _focusNode = nullptr;
glm::dvec3 _previousFocusNodePosition;
glm::dquat _previousFocusNodeRotation;
Interpolator<double> _rotateToFocusNodeInterpolator;
Interpolator<double> _followRotationInterpolator;
@@ -117,14 +117,14 @@ private:
*/
glm::dquat rotateLocally(double deltaTime,
const glm::dquat& localCameraRotation) const;
/**
* Interpolates the local rotation towards a 0 rotation.
* \returns a modified local rotation interpolated towards 0.
*/
glm::dquat interpolateLocalRotation(double deltaTime,
const glm::dquat& localCameraRotation);
/**
* Translates the horizontal direction. If far from the focus object, this will
* result in an orbital rotation around the object. This function does not affect the

View File

@@ -114,7 +114,7 @@ protected:
* \pre maxDepth must not be negative
*/
void phaseTrace(double time, Trace& trace, int maxDepth) const;
/// The name of the MissionPhase
std::string _name;
/// The description of the MissionPhase

View File

@@ -51,14 +51,14 @@ struct CameraKeyframe {
std::string _focusNode;
double _timestamp;
void serialize(std::vector<char> &buffer){
// Add position
buffer.insert(buffer.end(), reinterpret_cast<char*>(&_position), reinterpret_cast<char*>(&_position) + sizeof(_position));
// Add orientation
buffer.insert(buffer.end(), reinterpret_cast<char*>(&_rotation), reinterpret_cast<char*>(&_rotation) + sizeof(_rotation));
// Follow focus node rotation?
buffer.insert(buffer.end(), reinterpret_cast<char*>(&_followNodeRotation), reinterpret_cast<char*>(&_followNodeRotation) + sizeof(_followNodeRotation));
@@ -71,11 +71,11 @@ struct CameraKeyframe {
// Add timestamp
buffer.insert(buffer.end(), reinterpret_cast<char*>(&_timestamp), reinterpret_cast<char*>(&_timestamp) + sizeof(_timestamp));
};
void deserialize(const std::vector<char> &buffer){
int offset = 0;
int size = 0;
// Position
size = sizeof(_position);
memcpy(&_position, buffer.data() + offset, size);
@@ -99,13 +99,13 @@ struct CameraKeyframe {
size = nodeNameLength;
_focusNode = std::string(buffer.data() + offset, buffer.data() + offset + size);
offset += size;
// Timestamp
size = sizeof(_timestamp);
memcpy(&_timestamp, buffer.data() + offset, size);
};
};
struct TimeKeyframe {
TimeKeyframe() {}
TimeKeyframe(const std::vector<char> &buffer) {
@@ -117,43 +117,43 @@ struct TimeKeyframe {
bool _paused;
bool _requiresTimeJump;
double _timestamp;
void serialize(std::vector<char> &buffer){
// Add current time
buffer.insert(buffer.end(), reinterpret_cast<char*>(&_time), reinterpret_cast<char*>(&_time) + sizeof(_time));
// Add delta time
buffer.insert(buffer.end(), reinterpret_cast<char*>(&_dt), reinterpret_cast<char*>(&_dt) + sizeof(_dt));
// Add whether time is paused or not
buffer.insert(buffer.end(), reinterpret_cast<char*>(&_paused), reinterpret_cast<char*>(&_paused) + sizeof(_paused));
// Add whether a time jump is necessary (recompute paths etc)
buffer.insert(buffer.end(), reinterpret_cast<char*>(&_requiresTimeJump), reinterpret_cast<char*>(&_requiresTimeJump) + sizeof(_requiresTimeJump));
// Add timestamp
buffer.insert(buffer.end(), reinterpret_cast<char*>(&_timestamp), reinterpret_cast<char*>(&_timestamp) + sizeof(_timestamp));
};
void deserialize(const std::vector<char> &buffer){
int offset = 0;
int size = 0;
// Current time
size = sizeof(_time);
memcpy(&_time, buffer.data() + offset, size);
offset += size;
// Delta time
size = sizeof(_dt);
memcpy(&_dt, buffer.data() + offset, size);
offset += size;
// Is time paused?
size = sizeof(_paused);
memcpy(&_paused, buffer.data() + offset, size);
offset += sizeof(_paused);
// Is a time jump required?
size = sizeof(_requiresTimeJump);
memcpy(&_requiresTimeJump, buffer.data() + offset, size);
@@ -165,7 +165,7 @@ struct TimeKeyframe {
offset += size;
};
};
struct ScriptMessage {
ScriptMessage() {}
ScriptMessage(const std::vector<char> &buffer) {
@@ -173,16 +173,16 @@ struct ScriptMessage {
}
std::string _script;
void serialize(std::vector<char> &buffer){
buffer.insert(buffer.end(), _script.begin(), _script.end());
};
void deserialize(const std::vector<char> &buffer){
_script.assign(buffer.begin(), buffer.end());
};
};
} // namespace openspace::messagestructures
#endif // __OPENSPACE_CORE___MESSAGESTRUCTURES___H__

View File

@@ -125,8 +125,7 @@ class ParallelConnection : public properties::PropertyOwner {
int nConnections();
std::shared_ptr<ghoul::Event<>> connectionEvent();
private:
//@TODO change this into the ghoul hasher for client AND server
uint32_t hash(const std::string &val);
@@ -171,7 +170,7 @@ private:
double _lastTimeKeyframeTimestamp;
double _lastCameraKeyframeTimestamp;
_SOCKET _clientSocket;
std::atomic<bool> _isConnected;
@@ -186,14 +185,14 @@ private:
std::condition_variable _disconnectCondition;
std::mutex _disconnectMutex;
std::condition_variable _sendCondition;
std::deque<Message> _sendBuffer;
std::mutex _sendBufferMutex;
std::deque<Message> _receiveBuffer;
std::mutex _receiveBufferMutex;
std::atomic<bool> _timeJumped;
std::mutex _latencyMutex;
std::deque<double> _latencyDiffs;

View File

@@ -43,19 +43,19 @@ class PerformanceManager {
public:
static void createGlobalSharedMemory();
static void destroyGlobalSharedMemory();
PerformanceManager(std::string loggingDirectory = "${BASE_PATH}",
std::string prefix = "PM-");
~PerformanceManager();
void resetPerformanceMeasurements();
bool isMeasuringPerformance() const;
void storeIndividualPerformanceMeasurement(std::string identifier, long long nanoseconds);
void storeScenePerformanceMeasurements(const std::vector<SceneGraphNode*>& sceneNodes);
void outputLogs();
void writeData(std::ofstream& out, const std::vector<float>& data);
@@ -83,13 +83,13 @@ private:
std::string _prefix;
std::string _suffix;
std::string _ext;
std::map<std::string, size_t> individualPerformanceLocations;
std::unique_ptr<ghoul::SharedMemory> _performanceMemory;
size_t _tick;
void tick();
bool createLogDir();
};

View File

@@ -46,7 +46,7 @@ private:
std::chrono::high_resolution_clock::time_point _startTime;
};
#define __MERGE(a,b) a##b
#define __LABEL(a) __MERGE(unique_name_, a)
@@ -57,7 +57,7 @@ private:
(name), \
OsEng.renderEngine().performanceManager() \
)
} // namespace openspace::performance
#endif // __OPENSPACE_CORE___PERFORMANCEMEASUREMENT___H__

View File

@@ -232,7 +232,7 @@ const std::string NumericalProperty<T>::SteppingValueKey = "SteppingValue";
// Delegating constructors are necessary; automatic template deduction cannot
// deduce template argument for 'U' if 'default' methods are used as default values in
// a single constructor
template <typename T>
NumericalProperty<T>::NumericalProperty(Property::PropertyInfo info)
: NumericalProperty<T>(

View File

@@ -148,7 +148,7 @@ public:
* \return The type that is requested by this Property's Property::set method
*/
virtual const std::type_info& type() const;
/**
* This method encodes the encapsulated value of this Property at the top of the Lua
* stack. The specific details of this serialization is up to the property developer
@@ -237,7 +237,7 @@ public:
* \return The unique identifier of this Property
*/
const std::string& identifier() const;
/**
* Returns the fully qualified name for this Property that uniquely identifies this
* Property within OpenSpace. It consists of the <code>identifier</code> preceded by
@@ -260,7 +260,7 @@ public:
* \param owner The new PropertyOwner for this Property
*/
void setPropertyOwner(PropertyOwner* owner);
/**
* Returns the human-readable GUI name for this Property that has been set in the
* constructor. This method returns the same value as accessing the metaData object

View File

@@ -56,7 +56,7 @@ public:
std::string name;
std::string description = "";
};
/// The constructor initializing the PropertyOwner's name to <code>""</code>
PropertyOwner(PropertyOwnerInfo info);
@@ -85,7 +85,6 @@ public:
void setDescription(std::string description);
std::string description() const;
/**
* Returns a list of all Propertys directly owned by this PropertyOwner. This list not
@@ -123,7 +122,7 @@ public:
* <code>false</code> otherwise.
*/
bool hasProperty(const std::string& URI) const;
void setPropertyOwner(PropertyOwner* owner) { _owner = owner; }
PropertyOwner* owner() const { return _owner; }
@@ -171,7 +170,7 @@ public:
* <code>groupID</code>
*/
std::string propertyGroupName(const std::string& groupID) const;
/**
* Assigns the Property <code>prop</code> to this PropertyOwner. This method will
* check if the name of the Property is unique amongst Propertys and sub-owners in
@@ -180,10 +179,10 @@ public:
* \param prop The Property whose ownership is changed.
*/
void addProperty(Property* prop);
/// \see Property::addProperty(Property*)
void addProperty(Property& prop);
/**
* Adds the provided PropertyOwner to the list of sub-owners for this PropertyOwner.
* This means that the name of the <code>owner</code> has to be unique amonst the
@@ -206,7 +205,7 @@ public:
/// \see PropertyOwner::removeProperty(Property*)
void removeProperty(Property& prop);
/**
* Removes the sub-owner from this PropertyOwner.
* \param owner The PropertyOwner that should be removed

View File

@@ -32,7 +32,7 @@
* @{
* \addtogroup properties
* @{
* \class BoolProperty
* This class is a concrete implementation of openspace::properties::TemplateProperty with
* the type <code>bool</code>.

View File

@@ -32,7 +32,7 @@
* @{
* \addtogroup properties
* @{
* \class CharProperty
* This class is a concrete implementation of openspace::properties::TemplateProperty with
* the type <code>char</code>.

View File

@@ -32,7 +32,7 @@
* @{
* \addtogroup properties
* @{
* \class DoubleProperty
* This class is a concrete implementation of openspace::properties::TemplateProperty with
* the type <code>double</code>.

View File

@@ -32,7 +32,7 @@
* @{
* \addtogroup properties
* @{
* \class FloatProperty
* This class is a concrete implementation of openspace::properties::TemplateProperty with
* the type <code>float</code>.

View File

@@ -32,7 +32,7 @@
* @{
* \addtogroup properties
* @{
* \class IntProperty
* This class is a concrete implementation of openspace::properties::TemplateProperty with
* the type <code>int</code>.

View File

@@ -32,7 +32,7 @@
* @{
* \addtogroup properties
* @{
* \class LongDoubleProperty
* This class is a concrete implementation of openspace::properties::TemplateProperty with
* the type <code>long double</code>.

View File

@@ -32,7 +32,7 @@
* @{
* \addtogroup properties
* @{
* \class LongLongProperty
* This class is a concrete implementation of openspace::properties::TemplateProperty with
* the type <code>long long</code>.

View File

@@ -32,7 +32,7 @@
* @{
* \addtogroup properties
* @{
* \class LongProperty
* This class is a concrete implementation of openspace::properties::TemplateProperty with
* the type <code>long</code>.

View File

@@ -32,7 +32,7 @@
* @{
* \addtogroup properties
* @{
* \class ShortProperty
* This class is a concrete implementation of openspace::properties::TemplateProperty with
* the type <code>short</code>.

View File

@@ -32,7 +32,7 @@
* @{
* \addtogroup properties
* @{
* \class SignedCharProperty
* This class is a concrete implementation of openspace::properties::TemplateProperty with
* the type <code>signed char</code>.

View File

@@ -32,7 +32,7 @@
* @{
* \addtogroup properties
* @{
* \class UCharProperty
* This class is a concrete implementation of openspace::properties::TemplateProperty with
* the type <code>unsigned char</code>.

View File

@@ -32,7 +32,7 @@
* @{
* \addtogroup properties
* @{
* \class UIntProperty
* This class is a concrete implementation of openspace::properties::TemplateProperty with
* the type <code>unsigned int</code>.

View File

@@ -32,7 +32,7 @@
* @{
* \addtogroup properties
* @{
* \class ULongLongProperty
* This class is a concrete implementation of openspace::properties::TemplateProperty with
* the type <code>unsigned long long</code>.

View File

@@ -32,7 +32,7 @@
* @{
* \addtogroup properties
* @{
* \class ULongProperty
* This class is a concrete implementation of openspace::properties::TemplateProperty with
* the type <code>unsigned long</code>.

View File

@@ -32,7 +32,7 @@
* @{
* \addtogroup properties
* @{
* \class UShortProperty
* This class is a concrete implementation of openspace::properties::TemplateProperty with
* the type <code>unsigned short</code>.

View File

@@ -32,7 +32,7 @@
* @{
* \addtogroup properties
* @{
* \class WCharProperty
* This class is a concrete implementation of openspace::properties::TemplateProperty with
* the type <code>wchar_t</code>.

View File

@@ -39,7 +39,7 @@ public:
};
SelectionProperty(Property::PropertyInfo info);
void addOption(Option option);
void removeOptions();
const std::vector<Option>& options() const;

View File

@@ -42,7 +42,7 @@
#include <openspace/util/updatestructures.h>
namespace ghoul {
namespace filesystem { class File; }
namespace opengl {
@@ -57,7 +57,7 @@ namespace openspace {
class RenderableVolume;
class Camera;
class Scene;
class ABufferRenderer : public Renderer, public RaycasterListener {
public:
ABufferRenderer();
@@ -71,7 +71,9 @@ public:
void setResolution(glm::ivec2 res) override;
void setNAaSamples(int nAaSamples) override;
using Renderer::preRaycast;
void preRaycast(const RaycasterTask& raycasterTask);
using Renderer::postRaycast;
void postRaycast(const RaycasterTask& raycasterTask);
void update() override;
@@ -85,12 +87,11 @@ public:
virtual void raycastersChanged(VolumeRaycaster& raycaster, bool attached) override;
private:
void clear();
void updateResolution();
void updateRaycastData();
void updateResolveDictionary();
Camera* _camera;
Scene* _scene;
glm::ivec2 _resolution;
@@ -99,9 +100,9 @@ private:
bool _dirtyRendererData;
bool _dirtyRaycastData;
bool _dirtyResolveDictionary;
std::unique_ptr<ghoul::opengl::ProgramObject> _resolveProgram;
/**
* When a volume is attached or detached from the scene graph,
* the resolve program needs to be recompiled.

View File

@@ -48,7 +48,7 @@ namespace openspace {
class Camera;
class Scene;
class FramebufferRenderer : public Renderer, public RaycasterListener {
public:
FramebufferRenderer();
@@ -59,7 +59,7 @@ public:
void updateResolution();
void updateRaycastData();
void setCamera(Camera* camera) override;
void setScene(Scene* scene) override;
void setResolution(glm::ivec2 res) override;
@@ -67,7 +67,7 @@ public:
void update() override;
void render(float blackoutFactor, bool doPerformanceMeasurements) override;
/**
* Update render data
* Responsible for calling renderEngine::setRenderData

View File

@@ -85,10 +85,10 @@ public:
bool matchesRenderBinMask(int binMask);
bool isVisible() const;
bool hasTimeInterval();
bool getInterval(double& start, double& end);
void onEnabledChange(std::function<void(bool)> callback);
static void setPscUniforms(ghoul::opengl::ProgramObject& program, const Camera& camera, const PowerScaledCoordinate& position);
@@ -97,7 +97,7 @@ public:
protected:
properties::BoolProperty _enabled;
private:
RenderBin _renderBin;
float _boundingSphere;

View File

@@ -71,7 +71,7 @@ public:
RenderEngine();
~RenderEngine();
void initialize();
void initializeGL();
void deinitialize();
@@ -85,8 +85,6 @@ public:
RendererImplementation rendererImplementation() const;
RaycasterManager& raycasterManager();
// sgct wrapped functions
void updateShaderPrograms();
void updateFade();
@@ -154,13 +152,13 @@ public:
* as a 'rendererData' variable in the dictionary.
*/
void setRendererData(const ghoul::Dictionary& rendererData);
/**
* Lets the renderer update the data to be brought into the post rendererer programs
* as a 'resolveData' variable in the dictionary.
*/
void setResolveData(const ghoul::Dictionary& resolveData);
/**
* Returns the Lua library that contains all Lua functions available to affect the
* rendering.
@@ -174,7 +172,7 @@ public:
glm::ivec2 fontResolution() const;
std::vector<Syncable*> getSyncables();
private:
void setRenderer(std::unique_ptr<Renderer> renderer);
RendererImplementation rendererFromString(const std::string& method) const;
@@ -203,7 +201,7 @@ private:
properties::BoolProperty _showLog;
properties::BoolProperty _showVersionInfo;
properties::BoolProperty _showCameraInfo;
properties::TriggerProperty _takeScreenshot;
bool _shouldTakeScreenshot;
properties::BoolProperty _applyWarping;
@@ -220,7 +218,7 @@ private:
std::vector<ghoul::opengl::ProgramObject*> _programs;
std::vector<std::shared_ptr<ScreenSpaceRenderable>> _screenSpaceRenderables;
std::shared_ptr<ghoul::fontrendering::Font> _fontBig = nullptr;
std::shared_ptr<ghoul::fontrendering::Font> _fontInfo = nullptr;
std::shared_ptr<ghoul::fontrendering::Font> _fontDate = nullptr;

View File

@@ -44,14 +44,14 @@ namespace openspace {
class RenderableVolume;
class Camera;
class Scene;
class Renderer {
public:
virtual ~Renderer() = default;
virtual void initialize() = 0;
virtual void deinitialize() = 0;
virtual void setCamera(Camera* camera) = 0;
virtual void setScene(Scene* scene) = 0;
virtual void setResolution(glm::ivec2 res) = 0;
@@ -69,13 +69,13 @@ public:
virtual void update() = 0;
virtual void render(float blackoutFactor, bool doPerformanceMeasurements) = 0;
/**
* Update render data
* Responsible for calling renderEngine::setRenderData
*/
virtual void updateRendererData() = 0;
};
} // openspace

View File

@@ -21,7 +21,7 @@
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#ifndef __OPENSPACE_CORE___SCREENSPACERENDERABLE___H__
#define __OPENSPACE_CORE___SCREENSPACERENDERABLE___H__
@@ -58,7 +58,7 @@ public:
virtual ~ScreenSpaceRenderable() = default;
virtual void render();
virtual bool initialize();
virtual bool initializeGL();
virtual bool deinitialize();
@@ -67,11 +67,11 @@ public:
virtual void update() = 0;
virtual bool isReady() const;
bool isEnabled() const;
glm::vec3 euclideanPosition() const;
glm::vec3 sphericalPosition() const;
float depth() const;
static documentation::Documentation Documentation();
protected:

View File

@@ -56,7 +56,7 @@ public:
* Render the volume's exit points (back face of the bounding geometry)
*/
//virtual void renderExitPoints(const RenderData& data, ghoul::opengl::ProgramObject* program) = 0;
/**
* Prepare the volume for the ABuffer's resolve step.
* Make sure textures are up to date, bind them to texture units, set program uniforms etc.
@@ -93,7 +93,7 @@ public:
* A #{namespace} variable (unique per helper file)
*/
//virtual std::string getBoundsFsPath() = 0;
/**
* Return a path to a file with all the uniforms, functions etc
* required to perform ray casting through this volume.

View File

@@ -55,7 +55,7 @@ public:
* Render the volume's exit points (back face of the bounding geometry)
*/
virtual void renderExitPoints(const RenderData& /*data*/, ghoul::opengl::ProgramObject& /*program*/) = 0;
/**
* Prepare the volume for the ABuffer's resolve step.
* Make sure textures are up to date, bind them to texture units, set program uniforms etc.
@@ -73,6 +73,7 @@ public:
* Also set localPosition to the camera position in the volume's local coordainte system.
*/
virtual bool cameraIsInside(const RenderData& /*data*/, glm::vec3& /*localPosition*/) { return false; };
/**
* Return a path the file to use as vertex shader
*
@@ -92,7 +93,7 @@ public:
* A #{namespace} variable (unique per helper file)
*/
virtual std::string getBoundsFsPath() const = 0 ;
/**
* Return a path to a file with all the uniforms, functions etc
* required to perform ray casting through this volume.

View File

@@ -21,7 +21,7 @@
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#ifndef __OPENSPACE_CORE___SCENE___H__
#define __OPENSPACE_CORE___SCENE___H__

View File

@@ -21,7 +21,7 @@
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#ifndef __OPENSPACE_CORE___SCENEGRAPHNODE___H__
#define __OPENSPACE_CORE___SCENEGRAPHNODE___H__
@@ -69,7 +69,7 @@ public:
static const std::string KeyParentName;
static const std::string KeyDependencies;
static const std::string KeyTag;
SceneGraphNode();
~SceneGraphNode();

View File

@@ -21,7 +21,7 @@
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#ifndef __OPENSPACE_CORE___SCENELICENSE___H__
#define __OPENSPACE_CORE___SCENELICENSE___H__
@@ -39,20 +39,20 @@ namespace openspace {
struct SceneLicense {
// module must not be empty
SceneLicense(const ghoul::Dictionary& dictionary, std::string module);
std::string module;
std::string name;
std::string attribution;
std::string url;
std::string licenseText;
static documentation::Documentation Documentation();
};
void writeSceneLicenseDocumentation(const std::vector<SceneLicense>& licenses,
const std::string& file, const std::string& type);
} // namespace openspace
#endif // __OPENSPACE_CORE___SCENELICENSE___H__

View File

@@ -21,7 +21,7 @@
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#ifndef __OPENSPACE_CORE___SCENELICENSEWRITER___H__
#define __OPENSPACE_CORE___SCENELICENSEWRITER___H__

View File

@@ -61,18 +61,18 @@ public:
* \throw LuaRuntimeException If the creation of the new Lua state fails
*/
void initialize();
/**
* Cleans the internal Lua state and leaves the ScriptEngine in a state to be newly
* initialize%d.
*/
void deinitialize();
void initializeLuaState(lua_State* state);
void addLibrary(LuaLibrary library);
bool hasLibrary(const std::string& name);
bool runScript(const std::string& script);
bool runScriptFile(const std::string& filename);
@@ -90,35 +90,35 @@ public:
std::vector<std::string> cachedScripts();
std::vector<std::string> allLuaFunctions() const;
//parallel functions
//bool parseLibraryAndFunctionNames(std::string &library, std::string &function, const std::string &script);
//bool shouldScriptBeSent(const std::string &library, const std::string &function);
//void cacheScript(const std::string &library, const std::string &function, const std::string &script);
static std::string OpenSpaceLibraryName;
private:
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);
void addBaseLibrary();
void remapPrintFunction();
std::string generateJson() const override;
ghoul::lua::LuaState _state;
std::vector<LuaLibrary> _registeredLibraries;
//sync variables
std::mutex _mutex;
std::vector<std::pair<std::string, bool>> _queuedScripts;
std::vector<std::string> _receivedScripts;
std::string _currentSyncedScript;
//parallel variables
//std::map<std::string, std::map<std::string, std::string>> _cachedScripts;
//std::mutex _cachedScriptsMutex;

View File

@@ -45,13 +45,12 @@ public:
struct ScheduledScript {
ScheduledScript() = default;
ScheduledScript(const ghoul::Dictionary& dict);
double time;
std::string forwardScript;
std::string backwardScript;
};
/**
* Load a schedule from a ghoul::Dictionary \p dictionary and adds the
* ScheduledScript%s to the list of stored scripts.
@@ -95,7 +94,7 @@ public:
std::pair<
std::vector<std::string>::const_iterator, std::vector<std::string>::const_iterator
> progressTo(double newTime);
/**
* Returns the the j2000 time value that the script scheduler is currently at
*/
@@ -108,17 +107,16 @@ public:
static LuaLibrary luaLibrary();
static documentation::Documentation Documentation();
private:
std::vector<double> _timings;
std::vector<std::string> _forwardScripts;
std::vector<std::string> _backwardScripts;
int _currentIndex = 0;
double _currentTime;
};
} // namespace openspace::scripting

View File

@@ -38,7 +38,7 @@ public:
bool initialize();
void render();
GLuint _vaoId;
GLuint _vBufferId;
glm::vec3 _size;

View File

@@ -124,7 +124,7 @@ public:
void serialize(std::ostream& os) const;
void deserialize(std::istream& is);
/**
Handles SGCT's internal matrices. Also caches a calculated viewProjection
matrix. This is the data that is different for different cameras within

View File

@@ -53,20 +53,20 @@ public:
* \pre \p type must not be empty
*/
explicit FactoryNotFoundError(std::string type);
/// The type describing the ghoul::TemplateFactory that could not be found
std::string type;
};
FactoryManager();
/**
* Static initializer that initializes the static member. This needs to be done before
* the FactoryManager can be used.
* \pre The FactoryManager must not have been initialized before
*/
static void initialize();
/**
* Deinitializes the static member and all the registered ghoul::TemplateFactory%s.
* \pre The FactoryManager must have been initialized before
@@ -79,7 +79,7 @@ public:
* \return The initialization status of the static FactoryManager
*/
static bool isInitialized();
/**
* This method returns a reference to the initialized FactoryManager.
* \return An initialized reference to the singleton manager

View File

@@ -30,7 +30,7 @@ ghoul::TemplateFactory<T>* FactoryManager::factory() const {
if (f.factory->baseClassType() == typeid(T))
return dynamic_cast<ghoul::TemplateFactory<T>*>(f.factory.get());
}
throw FactoryNotFoundError(typeid(T).name());
}

View File

@@ -45,12 +45,12 @@ public:
* in the provided shader program.
*/
void bind(ghoul::opengl::ProgramObject* program, const std::string& name);
protected:
GLint _uniformLocation = -1;
};
/**
* Manages a GPU representation of the templated data type T.
* This class provides a simple interface setting the value of
@@ -59,7 +59,6 @@ protected:
template<typename T>
class GPUData : public UniformLocation{
public:
/**
* Sets the value of T to its corresponding GPU value.
* OBS! Users must ensure bind has been called before using this method
@@ -77,7 +76,6 @@ public:
*/
class GPUTexture : public UniformLocation{
public:
/**
* Sets and assignes a texture unit within the provided shader
* program.
@@ -86,20 +84,18 @@ public:
void setValue(ghoul::opengl::ProgramObject* program, ghoul::opengl::Texture* texture){
_texUnit = std::make_unique<ghoul::opengl::TextureUnit>();
_texUnit->activate();
if (texture) {
texture->bind();
}
if (texture) {
texture->bind();
}
program->setUniform(_uniformLocation, *_texUnit);
}
void deactivate(){
void deactivate() {
_texUnit = nullptr;
}
private:
std::unique_ptr<ghoul::opengl::TextureUnit> _texUnit;
};
} // namespace openspace

View File

@@ -209,7 +209,7 @@ enum class Key {
Menu = 348,
Last = Menu
};
struct KeyWithModifier {
Key key;
KeyModifier modifier;
@@ -359,13 +359,13 @@ static const std::map<std::string, Key> KeyMapping = {
};
} // namespace openspace
namespace std {
std::string to_string(openspace::Key key);
std::string to_string(openspace::KeyModifier mod);
std::string to_string(openspace::KeyWithModifier key);
} // namespace std
#endif // __OPENSPACE_CORE___KEYS___H__

View File

@@ -74,7 +74,7 @@ enum class MouseAction {
#undef Button4
#undef Button5
#endif // unix
enum class MouseButton {
Button1 = 0,
Button2 = 1,

View File

@@ -51,7 +51,7 @@ public:
* \pre \p name must not be empty
*/
OpenSpaceModule(std::string name);
/// Default destructor
virtual ~OpenSpaceModule() = default;
@@ -62,7 +62,7 @@ public:
* internalInitialize method for further customization for each subclass.
*/
void initialize();
/**
* Empty deinitialization method that will call the internalDeinitialize method for
* module-specific customization.
@@ -74,7 +74,7 @@ public:
* \return A list of Documentation classes that are valid for this OpenSapceModule
*/
virtual std::vector<documentation::Documentation> documentations() const;
/**
* Returns the Lua library with functions defined by this OpenSpaceModule. The default
* implementation returns an empty library.
@@ -95,13 +95,13 @@ protected:
* by the initiailze method.
*/
virtual void internalInitialize();
/**
* Customization point for each derived class. The internalDeinitialize method is
* called by the deinitialize method.
*/
virtual void internalDeinitialize();
/**
* Returns the path for this module, possibly containing ghoul::filesystem::FileSystem
* path tokens.

View File

@@ -65,7 +65,7 @@ public:
bool operator>(const PowerScaledScalar& other) const;
bool operator<=(const PowerScaledScalar& other) const;
bool operator>=(const PowerScaledScalar& other) const;
bool operator==(double other) const;
bool operator<(double other) const;
bool operator>(double other) const;
@@ -75,20 +75,19 @@ public:
// glm integration
PowerScaledScalar& operator=(const glm::vec2& rhs);
PowerScaledScalar& operator=(float rhs);
friend std::ostream& operator<<(std::ostream& os, const PowerScaledScalar& rhs);
// allow the power scaled coordinates to access private members
friend class PowerScaledCoordinate;
private:
// float vector used when returning float values
glm::vec2 _data;
};
typedef PowerScaledScalar pss;
} // namespace openspace
#endif // __OPENSPACE_CORE___POWERSCALEDSCALAR___H__

View File

@@ -29,6 +29,7 @@
#include <chrono>
#include <vector>
#include <mutex>
namespace openspace {
@@ -43,7 +44,7 @@ class ScreenLog : public ghoul::logging::Log {
public:
/// Just a shortcut for the LogLevel access
using LogLevel = ghoul::logging::LogLevel;
/**
* This struct stores the incoming log entries with their #level, #timeString,
* #category, #message, and the generated #timeStamp used for the expiry calculation.
@@ -51,16 +52,16 @@ public:
struct LogEntry {
/// The ghoul::logging::LogLevel of the log message
LogLevel level;
/// The timepoint when the log message arrived at the ScreenLog
std::chrono::time_point<std::chrono::steady_clock> timeStamp;
/// The time string as retrieved from the log message
std::string timeString;
/// The category as retrieved from the log message
std::string category;
/// The actual message of the log entry
std::string message;
};
@@ -90,7 +91,7 @@ public:
*/
void log(ghoul::logging::LogLevel level, const std::string& category,
const std::string& message) override;
/**
* This method removes all the stored LogEntry%s that have expired, calculated by
* their <code>timeStamp</code> and the #_timeToLive value.
@@ -99,12 +100,12 @@ public:
* time when this method was last called
*/
void removeExpiredEntries();
/**
* Returns the list of all stored LogEntry%s.
* \return The list of all stored LogEntry%s
*/
const std::vector<LogEntry>& entries() const;
std::vector<LogEntry> entries() const;
private:
/// The list of all LogEntry%s stored by this ScreenLog
@@ -113,11 +114,14 @@ private:
/// The time-to-live for the LogEntry%s in this ScreenLog. Is used by the
/// #removeExpiredEntries method to remove expired entries.
std::chrono::seconds _timeToLive;
/// The minimum LogLevel of messages
LogLevel _logLevel;
/// A mutex to ensure thread-safety
mutable std::mutex _mutex;
};
} // namespace openspace
#endif // __OPENSPACE_CORE___SCREENLOG___H__

View File

@@ -47,11 +47,11 @@ public:
using TransformMatrix = std::array<double, 36>;
using UseException = ghoul::Boolean;
using KernelHandle = unsigned int;
struct SpiceException : public ghoul::RuntimeError {
explicit SpiceException(const std::string& msg);
};
/**
* Specifies the aberration correction method for the #targetPosition function.
* \sa http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/spkpos_c.html
@@ -77,7 +77,7 @@ public:
* Direction::Reception
*/
AberrationCorrection() = default;
/**
* Constructor initializing the AberrationCorrection to the provided \p type and
* \p direction
@@ -85,7 +85,7 @@ public:
* \param direction The used direction (AberrationCorrection::Direction)
*/
AberrationCorrection(Type type, Direction direction);
/**
* Converts one of the valid aberration correction strings into its enumeration
* format. The valid strings are:
@@ -109,13 +109,13 @@ public:
/// The direction of the aberration correction
Direction direction = Direction::Reception;
};
/// The possible values for the method parameter of the targetInFieldOfView method
enum class FieldOfViewMethod {
Ellipsoid = 0,
Point
};
/**
* Returns the FieldOfViewMethod for the passed string. The allowed strings are
* <code>ELLIPSOID</code> and <code>POINT</code>. All other values will result in an
@@ -126,13 +126,13 @@ public:
* \return The field of view method enum
*/
static FieldOfViewMethod fieldOfViewMethodFromString(const std::string& method);
/// The possible values for terminator type method of the terminatorEllipse method
enum class TerminatorType {
Umbral = 0,
Penumbral
};
/**
* Returns the TerminatorType for the passed string. The allowed strings are
* <code>UMBRAL</code> and <code>PENUMBRAL</code>. All other values will result in an
@@ -176,7 +176,7 @@ public:
* \sa http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/unload_c.html
*/
void unloadKernel(KernelHandle kernelId);
/**
* Unloads a SPICE kernel identified by the \p filePath which was used in the
* loading call to #loadKernel. The unloading is done by calling the
@@ -189,7 +189,7 @@ public:
* \sa http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/unload_c.html
*/
void unloadKernel(std::string filePath);
/**
* Returns whether a given \p target has an Spk kernel covering it at the designated
* \p et ephemeris time.
@@ -216,7 +216,7 @@ public:
* \pre \p target must not be empty.
*/
bool hasCkCoverage(const std::string& frame, double et) const;
/**
* Determines whether values exist for some \p item for any body, identified by its
* \p naifId, in the kernel pool by passing it to the <code>bodfnd_c</code> function.
@@ -263,7 +263,7 @@ public:
* \pre \p body must not be empty.
*/
bool hasNaifId(const std::string& body) const;
/**
* Returns the NAIF ID for a specific frame using <code>namfrm_c</code>.
* \param frame The frame name that should be retrieved
@@ -283,7 +283,7 @@ public:
* \pre \p frame must not be empty.
*/
bool hasFrameId(const std::string& frame) const;
/**
* Retrieves a single \p value for a certain \p body. This method succeeds iff \p body
* is the name of a valid body, \p value is a value associated with the body, and the
@@ -323,7 +323,6 @@ public:
*/
void getValue(const std::string& body, const std::string& value, glm::dvec2& v) const;
/**
* Retrieves a \p value with three components for a certain \p body. This method
* succeeds iff \p body is the name of a valid body, \p value is a value associated
@@ -511,24 +510,24 @@ public:
* relative to the reference frame.
*/
glm::dvec3 surfaceIntercept;
/**
* If the aberration correction is not AberrationCorrection::Type::None, this
* value contains the time for which the intercept was computed. Otherwise it is
* the same as the ephemerisTime.
*/
double interceptEpoch;
/**
* The vector from the observer's position to the \p surfaceIntercept position in
* the provided reference frame.
*/
glm::dvec3 surfaceVector;
/// <code>true</code> if the ray intersects the body, <code>false</code> otherwise
bool interceptFound;
};
/**
* Given an \p observer and a probing direction vector \p directionVector defining a
* ray, compute the surface intercept of the ray on a \p target body at a specified
@@ -589,7 +588,7 @@ public:
const std::string& referenceFrame, const std::string& instrument,
FieldOfViewMethod method, AberrationCorrection aberrationCorrection,
double& ephemerisTime) const;
/**
* Determine whether a specific \p target is in the field-of-view of a specified
* \p instrument or an \p observer at a given time. The reference frame used is
@@ -616,20 +615,20 @@ public:
bool isTargetInFieldOfView(const std::string& target, const std::string& observer,
const std::string& instrument, FieldOfViewMethod method,
AberrationCorrection aberrationCorrection, double& ephemerisTime) const;
/// Struct that is used as the return value from the #targetState method
struct TargetStateResult {
/// The target position
glm::dvec3 position;
/// The target velocity
glm::dvec3 velocity;
/// One-way light time between <code>target</code> and <code>observer</code> if
/// the aberration correction is enabled
double lightTime;
};
/**
* Returns the state vector (position and velocity) of a \p target body relative to an
* \p observer in a specific \p referenceFrame, optionally corrected for aberration
@@ -725,19 +724,20 @@ public:
Circle, ///< The shape is circular
Ellipse ///< The shape is an ellipse
};
/// The shape of the returned field of view
Shape shape;
/// The name of the reference frame in which the #bounds are defined
std::string frameName;
/// The direction towards the center of the field of view
glm::dvec3 boresightVector;
/// The corners of the field of view's bounding box, not necessarily unit vectors
std::vector<glm::dvec3> bounds;
};
/**
* This method returns the field-of-view (FOV) parameters for a specified
* \p instrument.
@@ -763,21 +763,21 @@ public:
* \sa http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/getfov_c.html
*/
FieldOfViewResult fieldOfView(int instrument) const;
/// The structure retuned by the #terminatorEllipse method
struct TerminatorEllipseResult {
/// The vector from the target body at #targetEphemerisTime to the observer at
/// the original time
glm::dvec3 observerPosition;
/// The full list of terminator points specified in the original reference frame
std::vector<glm::dvec3> terminatorPoints;
/// The local ephemeris time at the target, determined by the original
/// <code>aberrationCorrection</code> factor
double targetEphemerisTime;
};
/**
* This method computes a set of points on the umbral or penumbral terminator of
* a specified \p target, where SPICE models the target shape as an ellipsoid.
@@ -813,7 +813,7 @@ public:
const std::string& lightSource, TerminatorType terminatorType,
AberrationCorrection aberrationCorrection, double ephemerisTime,
int numberOfTerminatorPoints);
/**
* This function adds a frame to a body
* \param body - the name of the body
@@ -846,7 +846,7 @@ public:
* \return The current exception handling strategy.
*/
UseException exceptionHandling() const;
static scripting::LuaLibrary luaLibrary();
private:
@@ -862,10 +862,10 @@ private:
SpiceManager(const SpiceManager& c) = delete;
SpiceManager& operator=(const SpiceManager& r) = delete;
SpiceManager(SpiceManager&& r) = delete;
/// Default destructor that resets the SPICE settings
~SpiceManager();
/**
* Function to find and store the intervals covered by a ck file, this is done
* by using mainly the <code>ckcov_c</code> and <code>ckobj_c</code> functions.
@@ -877,7 +877,7 @@ private:
* \post Coverage times are stored only if loading was successful
*/
void findCkCoverage(const std::string& path);
/**
* Function to find and store the intervals covered by a spk file, this is done
* by using mainly the <code>spkcov_c</code> and <code>spkobj_c</code> functions.
@@ -889,7 +889,7 @@ private:
* \post Coverage times are stored only if loading was successful
*/
void findSpkCoverage(const std::string& path);
/**
* If a position is requested for an uncovered time in the SPK kernels, this function
* will return an estimated position. If the coverage has not yet started, the first
@@ -917,7 +917,7 @@ private:
const std::string& observer, const std::string& referenceFrame,
AberrationCorrection aberrationCorrection, double ephemerisTime,
double& lightTime) const;
/**
* If a transform matrix is requested for an uncovered time in the CK kernels, this
* function will an estimated matrix. If the coverage has not yet started, the first
@@ -936,11 +936,11 @@ private:
*/
glm::dmat3 getEstimatedTransformMatrix(const std::string& fromFrame,
const std::string& toFrame, double time) const;
/// A list of all loaded kernels
std::vector<KernelInformation> _loadedKernels;
// Map: id, vector of pairs. Pair: Start time, end time;
std::map<int, std::vector< std::pair<double, double>>> _ckIntervals;
std::map<int, std::vector< std::pair<double, double>>> _spkIntervals;
@@ -951,7 +951,7 @@ private:
/// Stores whether the SpiceManager throws exceptions (Yes) or fails silently (No)
UseException _useExceptions;
/// The last assigned kernel-id, used to determine the next free kernel id
KernelHandle _lastAssignedKernel = KernelHandle(0);
};

View File

@@ -41,7 +41,7 @@ public:
virtual ~Task() = default;
virtual void perform(const ProgressCallback& onProgress) = 0;
virtual std::string description() = 0;
static std::unique_ptr<Task> createFromDictionary(
const ghoul::Dictionary& dictionary
);

View File

@@ -66,7 +66,7 @@ public:
* \pre \p timeString must not be empty
*/
static double convertTime(const std::string& time);
Time(double secondsJ2000 = -1);
Time(const Time& other);
@@ -87,7 +87,6 @@ public:
static Time now();
/**
* Sets the current time to the specified value in seconds past the J2000 epoch. This
* value can be negative to represent dates before the epoch.
@@ -128,7 +127,7 @@ public:
* \return The current time as a ISO 8601 formatted string
*/
std::string ISO8601() const;
/**
* Sets the delta time value that is the number of seconds that should pass for each
* real-time second. This value is used in the advanceTime(double) method to easily
@@ -177,7 +176,7 @@ public:
bool timeJumped() const;
void setTimeJumped(bool jumped);
bool paused() const;
/**
@@ -197,7 +196,7 @@ private:
double _time;
double _dt;
bool _timeJumped;
bool _timePaused = false;
bool _timePaused = false;
};
} // namespace openspace

View File

@@ -42,7 +42,7 @@ struct TimeRange {
* is OK.
*/
TimeRange(double startTime, double endTime);
/**
* Throws exception if unable to parse the provided \class ghoul::Dictionary
*/
@@ -56,7 +56,7 @@ struct TimeRange {
void include(double val);
void include(const TimeRange& other);
double duration() const;
bool isDefined() const;

View File

@@ -78,7 +78,7 @@ std::unique_ptr<ModelGeometry> ModelGeometry::createFromDictionary(
}
const std::string geometryType = dictionary.value<std::string>(KeyType);
auto factory = FactoryManager::ref().factory<ModelGeometry>();
return factory->create(geometryType, dictionary);;
}
@@ -134,7 +134,7 @@ bool ModelGeometry::initialize(Renderable* parent) {
if (_vertices.empty()) {
return false;
}
glGenVertexArrays(1, &_vaoID);
glGenBuffers(1, &_vbo);
glGenBuffers(1, &_ibo);

View File

@@ -53,11 +53,11 @@ public:
ModelGeometry(const ghoul::Dictionary& dictionary);
virtual ~ModelGeometry() = default;
virtual bool initialize(Renderable* parent);
virtual void deinitialize();
void render();
virtual bool loadModel(const std::string& filename) = 0;
void changeRenderMode(const GLenum mode);
//bool getVertices(std::vector<Vertex>* vertexList);

View File

@@ -40,7 +40,7 @@ bool MultiModelGeometry::loadModel(const std::string& filename) {
std::vector<ghoul::io::ModelReaderBase::Vertex> vertices;
std::vector<int> indices;
ghoul::io::ModelReaderMultiFormat().loadModel(filename, vertices, indices);
_vertices.reserve(vertices.size());
for (const ghoul::io::ModelReaderBase::Vertex& v : vertices) {
Vertex vv;

View File

@@ -183,7 +183,7 @@ void RenderableModel::deinitializeGL() {
void RenderableModel::render(const RenderData& data, RendererTasks&) {
_programObject->activate();
// Model transform and view transform needs to be in double precision
glm::dmat4 modelTransform =
glm::translate(glm::dmat4(1.0), data.modelTransform.translation) * // Translation

View File

@@ -107,7 +107,6 @@ documentation::Documentation RenderablePlane::Documentation() {
};
}
RenderablePlane::RenderablePlane(const ghoul::Dictionary& dictionary)
: Renderable(dictionary)
, _texturePath(TextureInfo)
@@ -237,7 +236,7 @@ void RenderablePlane::render(const RenderData& data, RendererTasks&) {
_shader->setUniform("modelViewProjectionTransform",
data.camera.projectionMatrix() * glm::mat4(modelViewTransform));
ghoul::opengl::TextureUnit unit;
unit.activate();
_texture->bind();
@@ -330,7 +329,7 @@ void RenderablePlane::createPlane() {
sizeof(GLfloat) * 6,
nullptr
);
glEnableVertexAttribArray(1);
glVertexAttribPointer(
1,

View File

@@ -259,13 +259,13 @@ void RenderableSphere::render(const RenderData& data, RendererTasks&) {
if (_fadeOutThreshold > -1.0) {
float distCamera = glm::distance(data.camera.positionVec3(), data.position.dvec3());
double term = std::exp((-distCamera + _size * _fadeOutThreshold) / (_size * _fadeOutThreshold));
_shader->setUniform("alpha", _transparency * static_cast<float>(term / (term + 1.0)));
}
else {
_shader->setUniform("alpha", _transparency);
}
ghoul::opengl::TextureUnit unit;
unit.activate();
_texture->bind();
@@ -273,7 +273,7 @@ void RenderableSphere::render(const RenderData& data, RendererTasks&) {
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
bool usingFramebufferRenderer =
OsEng.renderEngine().rendererImplementation() == RenderEngine::RendererImplementation::Framebuffer;

View File

@@ -266,7 +266,7 @@ void RenderableTrail::render(const RenderData& data, RendererTasks&) {
bool usingFramebufferRenderer =
OsEng.renderEngine().rendererImplementation() ==
RenderEngine::RendererImplementation::Framebuffer;
if (usingFramebufferRenderer) {
glDepthMask(false);
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
@@ -394,7 +394,7 @@ void RenderableTrail::render(const RenderData& data, RendererTasks&) {
if (renderPoints) {
glDisable(GL_PROGRAM_POINT_SIZE);
}
glBindVertexArray(0);
if (usingFramebufferRenderer) {

View File

@@ -91,7 +91,7 @@ protected:
/// Returns the documentation entries that the con
static documentation::Documentation Documentation();
/// The layout of the VBOs
struct TrailVBOLayout {
float x, y, z;

View File

@@ -382,7 +382,7 @@ RenderableTrailOrbit::UpdateReport RenderableTrailOrbit::updateTrails(
// The previously oldest permanent point has been moved nNewPoints steps into the
// future
_firstPointTime += nNewPoints * secondsPerPoint;
return { true, nNewPoints };
}
else {

View File

@@ -87,7 +87,7 @@ namespace openspace {
documentation::Documentation RenderableTrailTrajectory::Documentation() {
using namespace documentation;
documentation::Documentation doc {
"RenderableTrailTrajectory",
"base_renderable_renderabletrailtrajectory",
@@ -244,7 +244,7 @@ void RenderableTrailTrajectory::update(const UpdateData& data) {
glEnableVertexAttribArray(0);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, nullptr);
// We clear the indexArray just in case. The base class will take care not to use
// it if it is empty
_indexArray.clear();
@@ -252,7 +252,7 @@ void RenderableTrailTrajectory::update(const UpdateData& data) {
_subsamplingIsDirty = true;
_needsFullSweep = false;
}
// This has to be done every update step;
if (_renderFullTrail) {
// If the full trail should be rendered at all times, we can directly render the
@@ -280,7 +280,7 @@ void RenderableTrailTrajectory::update(const UpdateData& data) {
_vertexArray[_primaryRenderInformation.count - 1].y,
_vertexArray[_primaryRenderInformation.count - 1].z
);
// And get the current location of the object
glm::dvec3 p = _translation->position(data.time.j2000Seconds());
glm::dvec3 v1 = { p.x, p.y, p.z };

View File

@@ -57,7 +57,7 @@ public:
void deinitializeGL() override;
void update(const UpdateData& data) override;
static documentation::Documentation Documentation();
private:

View File

@@ -107,7 +107,7 @@ void ScreenSpaceFramebuffer::render() {
);
GLint defaultFBO = _framebuffer->getActiveObject();
_framebuffer->activate();
glClearColor (0.0f, 0.0f, 0.0f, 0.0f);
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glEnable(GL_ALPHA_TEST);
@@ -123,7 +123,7 @@ void ScreenSpaceFramebuffer::render() {
static_cast<GLsizei>(resolution.x),
static_cast<GLsizei>(resolution.y)
);
glm::mat4 rotation = rotationMatrix();
glm::mat4 translation = translationMatrix();
glm::mat4 scale = scaleMatrix();

View File

@@ -54,7 +54,7 @@ public:
void setSize(glm::vec4);
void addRenderFunction(std::shared_ptr<std::function<void()>> renderFunction);
void removeAllRenderFunctions();
static documentation::Documentation Documentation();
private:

View File

@@ -30,9 +30,9 @@
#include <openspace/properties/stringproperty.h>
#include <ghoul/opengl/texture.h>
namespace openspace {
namespace documentation { struct Documentation; }
class ScreenSpaceImageLocal : public ScreenSpaceRenderable {

View File

@@ -31,9 +31,9 @@
#include <openspace/properties/stringproperty.h>
#include <ghoul/opengl/texture.h>
namespace openspace {
namespace documentation { struct Documentation; }
class ScreenSpaceImageOnline : public ScreenSpaceRenderable {

View File

@@ -107,7 +107,6 @@ bool WavefrontGeometry::loadModel(const std::string& filename) {
_vertices[j + currentPosition].tex[0] = shapes[i].mesh.texcoords[2 * j + 0];
_vertices[j + currentPosition].tex[1] = shapes[i].mesh.texcoords[2 * j + 1];
}
}
currentPosition += shapes[i].mesh.positions.size() / 3;

View File

@@ -112,7 +112,7 @@ void LuaRotation::update(const UpdateData& data) {
_state,
duration_cast<milliseconds>(now.time_since_epoch()).count()
);
// Execute the scaling function
int success = lua_pcall(_state, 2, 9, 0);
if (success != 0) {

View File

@@ -32,9 +32,9 @@
#include <ghoul/lua/luastate.h>
namespace openspace {
namespace documentation { struct Documentation; }
class LuaRotation : public Rotation {
public:
LuaRotation();

View File

@@ -30,9 +30,9 @@
#include <openspace/properties/matrix/dmat3property.h>
namespace openspace {
namespace documentation { struct Documentation; }
class StaticRotation : public Rotation {
public:
StaticRotation();
@@ -43,7 +43,7 @@ public:
private:
properties::DMat3Property _rotationMatrix;
};
} // namespace openspace
#endif // __OPENSPACE_MODULE_BASE___STATICROTATION___H__

View File

@@ -103,7 +103,7 @@ void LuaScale::update(const UpdateData& data) {
_state,
duration_cast<milliseconds>(now.time_since_epoch()).count()
);
// Execute the scaling function
int success = lua_pcall(_state, 2, 1, 0);
if (success != 0) {

View File

@@ -32,9 +32,9 @@
#include <ghoul/lua/luastate.h>
namespace openspace {
namespace documentation { struct Documentation; }
class LuaScale : public Scale {
public:
LuaScale();

Some files were not shown because too many files have changed in this diff Show More