From c1d6a3261cab3a60e9aa407a155054e58723da50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Lemaire?= Date: Wed, 30 Dec 2015 00:43:35 +0100 Subject: [PATCH] Removed global string include in system_global.h --- src/basics/SpaceSegment.cpp | 1 + src/basics/Texture2D.h | 2 ++ src/basics/Texture3D.h | 2 ++ src/basics/Texture4D.h | 2 ++ src/basics/basics_global.h | 5 +++-- src/definition/DefinitionDiff.h | 2 ++ src/definition/DefinitionNode.h | 1 + src/definition/DefinitionWatcher.h | 2 ++ src/definition/definition_global.h | 4 ++-- src/interface/modeler/ModelerCameras.cpp | 6 +++--- src/render/opengl/OpenGLRenderer.h | 1 + src/render/opengl/OpenGLShaderProgram.h | 2 ++ src/render/opengl/opengl_global.h | 4 ++-- src/render/software/Canvas.h | 1 + src/render/software/CanvasPortion.h | 2 ++ src/render/software/SoftwareCanvasRenderer.h | 1 + src/render/software/software_global.h | 4 ++-- src/system/CacheFile.h | 2 ++ src/system/DataFile.h | 2 ++ src/system/FileSystem.h | 2 ++ src/system/Logs.cpp | 6 ++++-- src/system/PictureWriter.h | 2 ++ src/system/system_global.h | 14 ++++++-------- 23 files changed, 49 insertions(+), 21 deletions(-) diff --git a/src/basics/SpaceSegment.cpp b/src/basics/SpaceSegment.cpp index 7786e57..761849a 100644 --- a/src/basics/SpaceSegment.cpp +++ b/src/basics/SpaceSegment.cpp @@ -2,6 +2,7 @@ #include #include +#include #include "SpaceGridIterator.h" using namespace std; diff --git a/src/basics/Texture2D.h b/src/basics/Texture2D.h index 133a6d7..a2eab4e 100644 --- a/src/basics/Texture2D.h +++ b/src/basics/Texture2D.h @@ -3,6 +3,8 @@ #include "basics_global.h" +#include + namespace paysages { namespace basics { diff --git a/src/basics/Texture3D.h b/src/basics/Texture3D.h index b833aba..0c765c2 100644 --- a/src/basics/Texture3D.h +++ b/src/basics/Texture3D.h @@ -3,6 +3,8 @@ #include "basics_global.h" +#include + namespace paysages { namespace basics { diff --git a/src/basics/Texture4D.h b/src/basics/Texture4D.h index 0d16907..4651751 100644 --- a/src/basics/Texture4D.h +++ b/src/basics/Texture4D.h @@ -3,6 +3,8 @@ #include "basics_global.h" +#include + namespace paysages { namespace basics { diff --git a/src/basics/basics_global.h b/src/basics/basics_global.h index 3c80e4b..1168b8c 100644 --- a/src/basics/basics_global.h +++ b/src/basics/basics_global.h @@ -4,9 +4,9 @@ #include "system_global.h" #if defined(BASICS_LIBRARY) -#define BASICSSHARED_EXPORT Q_DECL_EXPORT +#define BASICSSHARED_EXPORT DECL_EXPORT #else -#define BASICSSHARED_EXPORT Q_DECL_IMPORT +#define BASICSSHARED_EXPORT DECL_IMPORT #endif namespace paysages { @@ -33,6 +33,7 @@ class InfinitePlane; } using namespace paysages::basics; +// Some useful constants #ifndef M_PI #define M_PI 3.14159265358979323846 #endif diff --git a/src/definition/DefinitionDiff.h b/src/definition/DefinitionDiff.h index 2b9db3e..1e8a161 100644 --- a/src/definition/DefinitionDiff.h +++ b/src/definition/DefinitionDiff.h @@ -3,6 +3,8 @@ #include "definition_global.h" +#include + namespace paysages { namespace definition { diff --git a/src/definition/DefinitionNode.h b/src/definition/DefinitionNode.h index 4f69a3f..69a5a27 100644 --- a/src/definition/DefinitionNode.h +++ b/src/definition/DefinitionNode.h @@ -3,6 +3,7 @@ #include "definition_global.h" +#include #include namespace paysages { diff --git a/src/definition/DefinitionWatcher.h b/src/definition/DefinitionWatcher.h index cf6ce94..9de0940 100644 --- a/src/definition/DefinitionWatcher.h +++ b/src/definition/DefinitionWatcher.h @@ -3,6 +3,8 @@ #include "definition_global.h" +#include + namespace paysages { namespace definition { diff --git a/src/definition/definition_global.h b/src/definition/definition_global.h index 4ec2e55..1645a76 100644 --- a/src/definition/definition_global.h +++ b/src/definition/definition_global.h @@ -4,9 +4,9 @@ #include "basics_global.h" #if defined(DEFINITION_LIBRARY) -#define DEFINITIONSHARED_EXPORT Q_DECL_EXPORT +#define DEFINITIONSHARED_EXPORT DECL_EXPORT #else -#define DEFINITIONSHARED_EXPORT Q_DECL_IMPORT +#define DEFINITIONSHARED_EXPORT DECL_IMPORT #endif namespace paysages { diff --git a/src/interface/modeler/ModelerCameras.cpp b/src/interface/modeler/ModelerCameras.cpp index 2dca938..fb5c247 100644 --- a/src/interface/modeler/ModelerCameras.cpp +++ b/src/interface/modeler/ModelerCameras.cpp @@ -62,8 +62,8 @@ void ModelerCameras::startSunTool() { current->copy(tool); active = tool; - // FIXME - // parent->getScenery()->getAtmosphere()->propDayTime()->addWatcher(this, true); + startWatching(parent->getScenery(), "/atmosphere/sun/phi"); + startWatching(parent->getScenery(), "/atmosphere/sun/theta"); } void ModelerCameras::endTool() { @@ -81,7 +81,7 @@ void ModelerCameras::timerEvent(QTimerEvent *) { } void ModelerCameras::nodeChanged(const DefinitionNode *node, const DefinitionDiff *) { - if (node->getPath() == "/atmosphere/daytime" && tool_mode == TOOL_SUN) { + if (node->getPath().find("/atmosphere/sun/") == 0 and tool_mode == TOOL_SUN) { Vector3 direction = parent->getRenderer()->getAtmosphereRenderer()->getSunDirection(); tool->setTarget(tool->getLocation().add(direction)); } diff --git a/src/render/opengl/OpenGLRenderer.h b/src/render/opengl/OpenGLRenderer.h index 600545a..2040140 100644 --- a/src/render/opengl/OpenGLRenderer.h +++ b/src/render/opengl/OpenGLRenderer.h @@ -5,6 +5,7 @@ #include "SoftwareRenderer.h" +#include #include class QMatrix4x4; diff --git a/src/render/opengl/OpenGLShaderProgram.h b/src/render/opengl/OpenGLShaderProgram.h index 692ff09..c75e8f7 100644 --- a/src/render/opengl/OpenGLShaderProgram.h +++ b/src/render/opengl/OpenGLShaderProgram.h @@ -3,6 +3,8 @@ #include "opengl_global.h" +#include + class QOpenGLShaderProgram; namespace paysages { diff --git a/src/render/opengl/opengl_global.h b/src/render/opengl/opengl_global.h index 435882b..f136d83 100644 --- a/src/render/opengl/opengl_global.h +++ b/src/render/opengl/opengl_global.h @@ -4,9 +4,9 @@ #include "software_global.h" #if defined(OPENGL_LIBRARY) -#define OPENGLSHARED_EXPORT Q_DECL_EXPORT +#define OPENGLSHARED_EXPORT DECL_EXPORT #else -#define OPENGLSHARED_EXPORT Q_DECL_IMPORT +#define OPENGLSHARED_EXPORT DECL_IMPORT #endif namespace paysages { diff --git a/src/render/software/Canvas.h b/src/render/software/Canvas.h index 3b60d9b..969c910 100644 --- a/src/render/software/Canvas.h +++ b/src/render/software/Canvas.h @@ -3,6 +3,7 @@ #include "software_global.h" +#include #include namespace paysages { diff --git a/src/render/software/CanvasPortion.h b/src/render/software/CanvasPortion.h index b1695ad..b1b6323 100644 --- a/src/render/software/CanvasPortion.h +++ b/src/render/software/CanvasPortion.h @@ -3,6 +3,8 @@ #include "software_global.h" +#include + namespace paysages { namespace software { diff --git a/src/render/software/SoftwareCanvasRenderer.h b/src/render/software/SoftwareCanvasRenderer.h index 045a123..67c6f78 100644 --- a/src/render/software/SoftwareCanvasRenderer.h +++ b/src/render/software/SoftwareCanvasRenderer.h @@ -5,6 +5,7 @@ #include "SoftwareRenderer.h" +#include #include namespace paysages { diff --git a/src/render/software/software_global.h b/src/render/software/software_global.h index 8a647cb..a5682a0 100644 --- a/src/render/software/software_global.h +++ b/src/render/software/software_global.h @@ -4,9 +4,9 @@ #include "definition_global.h" #if defined(SOFTWARE_LIBRARY) -#define SOFTWARESHARED_EXPORT Q_DECL_EXPORT +#define SOFTWARESHARED_EXPORT DECL_EXPORT #else -#define SOFTWARESHARED_EXPORT Q_DECL_IMPORT +#define SOFTWARESHARED_EXPORT DECL_IMPORT #endif namespace paysages { diff --git a/src/system/CacheFile.h b/src/system/CacheFile.h index 1afa527..b4610d2 100644 --- a/src/system/CacheFile.h +++ b/src/system/CacheFile.h @@ -3,6 +3,8 @@ #include "system_global.h" +#include + namespace paysages { namespace system { diff --git a/src/system/DataFile.h b/src/system/DataFile.h index d893dbc..a0ccb7b 100644 --- a/src/system/DataFile.h +++ b/src/system/DataFile.h @@ -3,6 +3,8 @@ #include "system_global.h" +#include + class QDir; namespace paysages { diff --git a/src/system/FileSystem.h b/src/system/FileSystem.h index c313b14..5078471 100644 --- a/src/system/FileSystem.h +++ b/src/system/FileSystem.h @@ -3,6 +3,8 @@ #include "system_global.h" +#include + namespace paysages { namespace system { diff --git a/src/system/Logs.cpp b/src/system/Logs.cpp index 01efc16..e12ddc8 100644 --- a/src/system/Logs.cpp +++ b/src/system/Logs.cpp @@ -25,18 +25,20 @@ typedef basic_onullstream onullstream; static onullstream NULL_STREAM; static bool enabled = true; -ostream &Logs::debug(const string &logger) { #ifdef NDEBUG +ostream &Logs::debug(const string &) { return NULL_STREAM; +} #else +ostream &Logs::debug(const string &logger) { if (enabled) { cout << "DEBUG [" << logger << "] "; return cout; } else { return NULL_STREAM; } -#endif } +#endif ostream &Logs::warning(const string &logger) { if (enabled) { diff --git a/src/system/PictureWriter.h b/src/system/PictureWriter.h index 20391b9..8fb849d 100644 --- a/src/system/PictureWriter.h +++ b/src/system/PictureWriter.h @@ -3,6 +3,8 @@ #include "system_global.h" +#include + namespace paysages { namespace system { diff --git a/src/system/system_global.h b/src/system/system_global.h index 6fe4e02..5928da9 100644 --- a/src/system/system_global.h +++ b/src/system/system_global.h @@ -1,20 +1,18 @@ #ifndef SYSTEM_GLOBAL_H #define SYSTEM_GLOBAL_H -#include - #ifdef __MINGW32__ -#define Q_DECL_EXPORT __declspec(dllexport) -#define Q_DECL_IMPORT __declspec(dllimport) +#define DECL_EXPORT __declspec(dllexport) +#define DECL_IMPORT __declspec(dllimport) #else -#define Q_DECL_EXPORT __attribute__((visibility("default"))) -#define Q_DECL_IMPORT __attribute__((visibility("default"))) +#define DECL_EXPORT __attribute__((visibility("default"))) +#define DECL_IMPORT __attribute__((visibility("default"))) #endif #if defined(SYSTEM_LIBRARY) -#define SYSTEMSHARED_EXPORT Q_DECL_EXPORT +#define SYSTEMSHARED_EXPORT DECL_EXPORT #else -#define SYSTEMSHARED_EXPORT Q_DECL_IMPORT +#define SYSTEMSHARED_EXPORT DECL_IMPORT #endif namespace paysages {