diff --git a/modules/base/rendering/modelgeometry.cpp b/modules/base/rendering/modelgeometry.cpp index 38288d425e..28e90ed083 100644 --- a/modules/base/rendering/modelgeometry.cpp +++ b/modules/base/rendering/modelgeometry.cpp @@ -35,8 +35,8 @@ namespace { const std::string _loggerCat = "ModelGeometry"; const std::string keyGeomModelFile = "GeometryFile"; const int8_t CurrentCacheVersion = 3; - const std::string keyType = "Type"; - const std::string keyName = "Name"; + const char* keyType = "Type"; + const char* keyName = "Name"; } namespace openspace { diff --git a/modules/base/rendering/multimodelgeometry.cpp b/modules/base/rendering/multimodelgeometry.cpp index fd05e38772..7d427edf46 100644 --- a/modules/base/rendering/multimodelgeometry.cpp +++ b/modules/base/rendering/multimodelgeometry.cpp @@ -35,66 +35,53 @@ namespace { } namespace openspace { - namespace modelgeometry { +namespace modelgeometry { - MultiModelGeometry::MultiModelGeometry(const ghoul::Dictionary& dictionary) - : ModelGeometry(dictionary) - { - loadObj(_file); - } +MultiModelGeometry::MultiModelGeometry(const ghoul::Dictionary& dictionary) + : ModelGeometry(dictionary) +{ + loadObj(_file); +} - bool MultiModelGeometry::initialize(Renderable* parent) - { - bool success = ModelGeometry::initialize(parent); - return success; - } +bool MultiModelGeometry::initialize(Renderable* parent) { + bool success = ModelGeometry::initialize(parent); + return success; +} - void MultiModelGeometry::deinitialize() - { - ModelGeometry::deinitialize(); - } +void MultiModelGeometry::deinitialize() { + ModelGeometry::deinitialize(); +} - bool MultiModelGeometry::loadModel(const std::string& filename) - { - try { - ghoul::io::ModelReaderMultiFormat modelReader; +bool MultiModelGeometry::loadModel(const std::string& filename) { + ghoul::io::ModelReaderMultiFormat modelReader; - std::vector vertices; - std::vector indices; + std::vector vertices; + std::vector indices; - modelReader.loadModel(filename, vertices, indices); + modelReader.loadModel(filename, vertices, indices); - _vertices.reserve(vertices.size()); - for (const auto & v : vertices) - { - psc p = PowerScaledCoordinate::CreatePowerScaledCoordinate( - v.location[0], - v.location[1], - v.location[2] - ); + _vertices.reserve(vertices.size()); + for (const auto & v : vertices) { + psc p = PowerScaledCoordinate::CreatePowerScaledCoordinate( + v.location[0], + v.location[1], + v.location[2] + ); - Vertex vv; - memcpy(vv.location, v.location, sizeof(GLfloat) * 3); - vv.location[3] = 1.0; - //memcpy(vv.location, glm::value_ptr(p.vec4()), sizeof(GLfloat) * 4); - memcpy(vv.tex, v.tex, sizeof(GLfloat) * 2); - memcpy(vv.normal, v.normal, sizeof(GLfloat) * 3); - _vertices.push_back(vv); - } + Vertex vv; + memcpy(vv.location, v.location, sizeof(GLfloat) * 3); + vv.location[3] = 1.0; + //memcpy(vv.location, glm::value_ptr(p.vec4()), sizeof(GLfloat) * 4); + memcpy(vv.tex, v.tex, sizeof(GLfloat) * 2); + memcpy(vv.normal, v.normal, sizeof(GLfloat) * 3); + _vertices.push_back(vv); + } - _indices.resize(indices.size()); - std::copy(indices.begin(), indices.end(), _indices.begin()); - } - catch (ghoul::io::ModelReaderBase::ModelReaderException & e) - { - // Log error reading geometry file. - LERROR(e.message); - return false; - } + _indices.resize(indices.size()); + std::copy(indices.begin(), indices.end(), _indices.begin()); - return true; - } + return true; +} - - } // namespace modelgeometry +} // namespace modelgeometry } // namespace openspace diff --git a/modules/base/rendering/planetgeometry.cpp b/modules/base/rendering/planetgeometry.cpp index a876bbf041..0065e91703 100644 --- a/modules/base/rendering/planetgeometry.cpp +++ b/modules/base/rendering/planetgeometry.cpp @@ -29,7 +29,7 @@ namespace { const std::string _loggerCat = "PlanetGeometry"; - const std::string KeyType = "Type"; + const char* KeyType = "Type"; } namespace openspace { diff --git a/modules/base/rendering/renderableconstellationbounds.cpp b/modules/base/rendering/renderableconstellationbounds.cpp index ea7b07c85c..735bac4408 100644 --- a/modules/base/rendering/renderableconstellationbounds.cpp +++ b/modules/base/rendering/renderableconstellationbounds.cpp @@ -40,11 +40,11 @@ namespace { const std::string _loggerCat = "RenderableConstellationBounds"; - const std::string keyVertexFile = "File"; - const std::string keyConstellationFile = "ConstellationFile"; - const std::string keyReferenceFrame = "ReferenceFrame"; + const char* keyVertexFile = "File"; + const char* keyConstellationFile = "ConstellationFile"; + const char* keyReferenceFrame = "ReferenceFrame"; - const std::string defaultReferenceFrame = "J2000"; + const char* defaultReferenceFrame = "J2000"; float deg2rad(float deg) { return static_cast((deg / 360.f) * 2.f * M_PI); diff --git a/modules/base/rendering/renderablecrawlingline.cpp b/modules/base/rendering/renderablecrawlingline.cpp index 0500781d21..15866f580f 100644 --- a/modules/base/rendering/renderablecrawlingline.cpp +++ b/modules/base/rendering/renderablecrawlingline.cpp @@ -33,11 +33,11 @@ namespace { const std::string _loggerCat = "RenderableCrawlingLine"; - const std::string KeySource = "Source"; - const std::string KeyTarget = "Target"; - const std::string KeyInstrument = "Instrument"; - const std::string KeyReferenceFrame = "Frame"; - const std::string keyColor = "RGB"; + const char* KeySource = "Source"; + const char* KeyTarget = "Target"; + const char* KeyInstrument = "Instrument"; + const char* KeyReferenceFrame = "Frame"; + const char* keyColor = "RGB"; static const int SourcePosition = 0; static const int TargetPosition = 1; diff --git a/modules/base/rendering/renderablemodel.cpp b/modules/base/rendering/renderablemodel.cpp index 1c908c5299..aab085b9ae 100644 --- a/modules/base/rendering/renderablemodel.cpp +++ b/modules/base/rendering/renderablemodel.cpp @@ -42,13 +42,13 @@ namespace { const std::string _loggerCat = "RenderableModel"; - const std::string keyGeometry = "Geometry"; - const std::string keyBody = "Body"; - const std::string keyStart = "StartTime"; - const std::string keyEnd = "EndTime"; - const std::string keyFading = "Shading.Fadeable"; + const char* keyGeometry = "Geometry"; + const char* keyBody = "Body"; + const char* keyStart = "StartTime"; + const char* keyEnd = "EndTime"; + const char* keyFading = "Shading.Fadeable"; - const std::string keyModelTransform = "Rotation.ModelTransform"; + const char* keyModelTransform = "Rotation.ModelTransform"; //const std::string keyGhosting = "Shading.Ghosting"; } diff --git a/modules/base/rendering/renderablepath.cpp b/modules/base/rendering/renderablepath.cpp index be5547aefd..b94d02f178 100644 --- a/modules/base/rendering/renderablepath.cpp +++ b/modules/base/rendering/renderablepath.cpp @@ -42,16 +42,16 @@ namespace { const std::string _loggerCat = "RenderableTrail"; //constants - const std::string keyName = "Name"; - const std::string keyBody = "Body"; - const std::string keyObserver = "Observer"; - const std::string keyFrame = "Frame"; - const std::string keyPathModule = "ModulePath"; - const std::string keyColor = "RGB"; - const std::string keyTimeSteps = "TimeSteps"; - const std::string keyPointSteps = "PointSteps"; - const std::string keyDrawLine = "DrawLine"; - const std::string keRenderDistanceInterval = "RenderDistanceInterval"; + const char* keyName = "Name"; + const char* keyBody = "Body"; + const char* keyObserver = "Observer"; + const char* keyFrame = "Frame"; + const char* keyPathModule = "ModulePath"; + const char* keyColor = "RGB"; + const char* keyTimeSteps = "TimeSteps"; + const char* keyPointSteps = "PointSteps"; + const char* keyDrawLine = "DrawLine"; + const char* keRenderDistanceInterval = "RenderDistanceInterval"; } diff --git a/modules/base/rendering/renderableplane.cpp b/modules/base/rendering/renderableplane.cpp index 3d43ee6c66..3c88efce3a 100644 --- a/modules/base/rendering/renderableplane.cpp +++ b/modules/base/rendering/renderableplane.cpp @@ -38,14 +38,14 @@ #include namespace { - const std::string _loggerCat = "RenderablePlane"; + static const std::string _loggerCat = "RenderablePlane"; - const std::string keyFieldlines = "Fieldlines"; - const std::string keyFilename = "File"; - const std::string keyHints = "Hints"; - const std::string keyShaders = "Shaders"; - const std::string keyVertexShader = "VertexShader"; - const std::string keyFragmentShader = "FragmentShader"; + const char* keyFieldlines = "Fieldlines"; + const char* keyFilename = "File"; + const char* keyHints = "Hints"; + const char* keyShaders = "Shaders"; + const char* keyVertexShader = "VertexShader"; + const char* keyFragmentShader = "FragmentShader"; } namespace openspace { diff --git a/modules/base/rendering/renderableplanet.cpp b/modules/base/rendering/renderableplanet.cpp index bedd4ca84b..1a4ae0d7a9 100644 --- a/modules/base/rendering/renderableplanet.cpp +++ b/modules/base/rendering/renderableplanet.cpp @@ -48,17 +48,17 @@ namespace { - const std::string _loggerCat = "RenderablePlanet"; + static const std::string _loggerCat = "RenderablePlanet"; - const std::string keyFrame = "Frame"; - const std::string keyGeometry = "Geometry"; - const std::string keyRadius = "Radius"; - const std::string keyShading = "PerformShading"; - const std::string keyShadowGroup = "Shadow_Group"; - const std::string keyShadowSource = "Source"; - const std::string keyShadowCaster = "Caster"; - const std::string keyPlanetRadius = "PlanetRadius"; - const std::string keyBody = "Body"; + const char* keyFrame = "Frame"; + const char* keyGeometry = "Geometry"; + const char* keyRadius = "Radius"; + const char* keyShading = "PerformShading"; + const char* keyShadowGroup = "Shadow_Group"; + const char* keyShadowSource = "Source"; + const char* keyShadowCaster = "Caster"; + const char* keyPlanetRadius = "PlanetRadius"; + const char* keyBody = "Body"; } namespace openspace { diff --git a/modules/base/rendering/renderablerings.cpp b/modules/base/rendering/renderablerings.cpp index 6ee8ed363f..c225968011 100644 --- a/modules/base/rendering/renderablerings.cpp +++ b/modules/base/rendering/renderablerings.cpp @@ -36,9 +36,9 @@ #include namespace { - const std::string KeyTexture = "Texture"; - const std::string KeySize = "Size"; - const std::string KeyOffset = "Offset"; + const char* KeyTexture = "Texture"; + const char* KeySize = "Size"; + const char* KeyOffset = "Offset"; } namespace openspace { diff --git a/modules/base/rendering/renderablesphere.cpp b/modules/base/rendering/renderablesphere.cpp index fb619e8255..ce5049df5a 100644 --- a/modules/base/rendering/renderablesphere.cpp +++ b/modules/base/rendering/renderablesphere.cpp @@ -36,12 +36,12 @@ #include namespace { - const std::string _loggerCat = "RenderableSphere"; + static const std::string _loggerCat = "RenderableSphere"; - const std::string keySize = "Size"; - const std::string keySegments = "Segments"; - const std::string keyTexture = "Texture"; - const std::string keyOrientation = "Orientation"; + const char* keySize = "Size"; + const char* keySegments = "Segments"; + const char* keyTexture = "Texture"; + const char* keyOrientation = "Orientation"; enum Orientation { Outside = 1, diff --git a/modules/base/rendering/renderablesphericalgrid.cpp b/modules/base/rendering/renderablesphericalgrid.cpp index b1f62cdb87..6fc2743814 100644 --- a/modules/base/rendering/renderablesphericalgrid.cpp +++ b/modules/base/rendering/renderablesphericalgrid.cpp @@ -32,13 +32,13 @@ #include namespace { - const std::string _loggerCat = "RenderableSphericalGrid"; - const std::string KeyGridType = "GridType"; - const std::string KeyGridColor = "GridColor"; - const std::string KeyGridMatrix = "GridMatrix"; - const std::string KeyGridSegments = "GridSegments"; - const std::string KeyGridRadius = "GridRadius"; - const std::string KeyGridParentsRotation = "ParentsRotation"; + static const std::string _loggerCat = "RenderableSphericalGrid"; + const char* KeyGridType = "GridType"; + const char* KeyGridColor = "GridColor"; + const char* KeyGridMatrix = "GridMatrix"; + const char* KeyGridSegments = "GridSegments"; + const char* KeyGridRadius = "GridRadius"; + const char* KeyGridParentsRotation = "ParentsRotation"; } namespace openspace { diff --git a/modules/base/rendering/renderablestars.cpp b/modules/base/rendering/renderablestars.cpp index a4a3c6b882..60d999b5a3 100644 --- a/modules/base/rendering/renderablestars.cpp +++ b/modules/base/rendering/renderablestars.cpp @@ -41,11 +41,11 @@ #include namespace { - const std::string _loggerCat = "RenderableStars"; + static const std::string _loggerCat = "RenderableStars"; - const std::string KeyFile = "File"; - const std::string KeyTexture = "Texture"; - const std::string KeyColorMap = "ColorMap"; + const char* KeyFile = "File"; + const char* KeyTexture = "Texture"; + const char* KeyColorMap = "ColorMap"; const int8_t CurrentCacheVersion = 1; diff --git a/modules/base/rendering/renderabletrail.cpp b/modules/base/rendering/renderabletrail.cpp index 9ca1e97652..b150cbb871 100644 --- a/modules/base/rendering/renderabletrail.cpp +++ b/modules/base/rendering/renderabletrail.cpp @@ -30,13 +30,13 @@ #include namespace { - static const char* KeyTranslation = "Translation"; - static const char* KeyColor = "Color"; - static const char* KeyEnableFade = "EnableFade"; - static const char* KeyFade = "Fade"; - static const char* KeyLineWidth = "LineWidth"; - static const char* KeyPointSize = "PointSize"; - static const char* KeyRendering = "Rendering"; + const char* KeyTranslation = "Translation"; + const char* KeyColor = "Color"; + const char* KeyEnableFade = "EnableFade"; + const char* KeyFade = "Fade"; + const char* KeyLineWidth = "LineWidth"; + const char* KeyPointSize = "PointSize"; + const char* KeyRendering = "Rendering"; // The possible values for the _renderingModes property enum RenderingMode { diff --git a/modules/base/rendering/screenspaceframebuffer.cpp b/modules/base/rendering/screenspaceframebuffer.cpp index e2a8fa1a9d..812a1831a4 100644 --- a/modules/base/rendering/screenspaceframebuffer.cpp +++ b/modules/base/rendering/screenspaceframebuffer.cpp @@ -33,10 +33,11 @@ #include namespace openspace { + ScreenSpaceFramebuffer::ScreenSpaceFramebuffer(const ghoul::Dictionary& dictionary) - :ScreenSpaceRenderable(dictionary) - ,_size("size", "Size", glm::vec4(0), glm::vec4(0), glm::vec4(2000)) - ,_framebuffer(nullptr) + : ScreenSpaceRenderable(dictionary) + , _size("size", "Size", glm::vec4(0), glm::vec4(0), glm::vec4(2000)) + , _framebuffer(nullptr) { _id = id(); setName("ScreenSpaceFramebuffer" + std::to_string(_id)); diff --git a/modules/base/rendering/screenspaceimage.cpp b/modules/base/rendering/screenspaceimage.cpp index fa208ee104..d68bd151c0 100644 --- a/modules/base/rendering/screenspaceimage.cpp +++ b/modules/base/rendering/screenspaceimage.cpp @@ -35,9 +35,9 @@ namespace { const std::string _loggerCat = "ScreenSpaceImage"; - const std::string KeyName = "Name"; - const std::string KeyTexturePath = "TexturePath"; - const std::string KeyUrl = "URL"; + const char* KeyName = "Name"; + const char* KeyTexturePath = "TexturePath"; + const char* KeyUrl = "URL"; } namespace openspace { diff --git a/modules/base/rendering/simplespheregeometry.cpp b/modules/base/rendering/simplespheregeometry.cpp index 36ac52afb5..3bb4358f03 100644 --- a/modules/base/rendering/simplespheregeometry.cpp +++ b/modules/base/rendering/simplespheregeometry.cpp @@ -34,8 +34,8 @@ namespace openspace { namespace constants { namespace simplespheregeometry { -const std::string keyRadius = "Radius"; -const std::string keySegments = "Segments"; + const char* keyRadius = "Radius"; + const char* keySegments = "Segments"; } // namespace simplespheregeometry } diff --git a/modules/base/rendering/wavefrontgeometry.cpp b/modules/base/rendering/wavefrontgeometry.cpp index 8125e73dd2..c24014f7ee 100644 --- a/modules/base/rendering/wavefrontgeometry.cpp +++ b/modules/base/rendering/wavefrontgeometry.cpp @@ -28,7 +28,7 @@ #include namespace { - const std::string _loggerCat = "WavefrontGeometry"; + static const std::string _loggerCat = "WavefrontGeometry"; } namespace openspace { diff --git a/modules/base/rotation/spicerotation.cpp b/modules/base/rotation/spicerotation.cpp index d671f76d6c..76aaf6dbf3 100644 --- a/modules/base/rotation/spicerotation.cpp +++ b/modules/base/rotation/spicerotation.cpp @@ -33,9 +33,9 @@ namespace { const std::string _loggerCat = "SpiceRotation"; //const std::string keyGhosting = "EphmerisGhosting"; - const std::string KeySourceFrame = "SourceFrame"; - const std::string KeyDestinationFrame = "DestinationFrame"; - const std::string KeyKernels = "Kernels"; + const char* KeySourceFrame = "SourceFrame"; + const char* KeyDestinationFrame = "DestinationFrame"; + const char* KeyKernels = "Kernels"; } namespace openspace { diff --git a/modules/base/rotation/staticrotation.cpp b/modules/base/rotation/staticrotation.cpp index 85e528060b..5c645d4143 100644 --- a/modules/base/rotation/staticrotation.cpp +++ b/modules/base/rotation/staticrotation.cpp @@ -27,7 +27,7 @@ #include namespace { - const std::string KeyRotation = "Rotation"; + const char* KeyRotation = "Rotation"; } namespace openspace { diff --git a/modules/base/scale/staticscale.cpp b/modules/base/scale/staticscale.cpp index c80a27f992..b868291e43 100644 --- a/modules/base/scale/staticscale.cpp +++ b/modules/base/scale/staticscale.cpp @@ -27,8 +27,8 @@ #include namespace { - const std::string _loggerCat = "StaticScale"; - const std::string KeyValue = "Scale"; + const char* _loggerCat = "StaticScale"; + const char* KeyValue = "Scale"; } namespace openspace { diff --git a/modules/base/translation/statictranslation.cpp b/modules/base/translation/statictranslation.cpp index 1b6bb288ce..e0e3e85b42 100644 --- a/modules/base/translation/statictranslation.cpp +++ b/modules/base/translation/statictranslation.cpp @@ -27,7 +27,7 @@ #include namespace { - const std::string KeyPosition = "Position"; + const char* KeyPosition = "Position"; } namespace openspace { diff --git a/modules/globebrowsing/chunk/chunkrenderer.cpp b/modules/globebrowsing/chunk/chunkrenderer.cpp index 7d7cc560fe..8696ecf39d 100644 --- a/modules/globebrowsing/chunk/chunkrenderer.cpp +++ b/modules/globebrowsing/chunk/chunkrenderer.cpp @@ -47,11 +47,11 @@ namespace { const std::string _loggerCat = "PatchRenderer"; - const std::string keyFrame = "Frame"; - const std::string keyGeometry = "Geometry"; - const std::string keyShading = "PerformShading"; + const char* keyFrame = "Frame"; + const char* keyGeometry = "Geometry"; + const char* keyShading = "PerformShading"; - const std::string keyBody = "Body"; + const char* keyBody = "Body"; } namespace openspace { diff --git a/modules/globebrowsing/chunk/culling.cpp b/modules/globebrowsing/chunk/culling.cpp index c281f6d7cb..33bf13a7c4 100644 --- a/modules/globebrowsing/chunk/culling.cpp +++ b/modules/globebrowsing/chunk/culling.cpp @@ -22,10 +22,6 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ - - - - #include #include #include diff --git a/modules/globebrowsing/geometry/aabb.cpp b/modules/globebrowsing/geometry/aabb.cpp index 43fe4154fd..a572969bd3 100644 --- a/modules/globebrowsing/geometry/aabb.cpp +++ b/modules/globebrowsing/geometry/aabb.cpp @@ -22,7 +22,6 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ - #include #include diff --git a/modules/globebrowsing/geometry/geodetic2.cpp b/modules/globebrowsing/geometry/geodetic2.cpp index 4b0eb79519..abceb33ab7 100644 --- a/modules/globebrowsing/geometry/geodetic2.cpp +++ b/modules/globebrowsing/geometry/geodetic2.cpp @@ -28,8 +28,6 @@ #include - - namespace { const std::string _loggerCat = "Geodetic2"; } diff --git a/modules/globebrowsing/globes/renderableglobe.cpp b/modules/globebrowsing/globes/renderableglobe.cpp index 52b5f012b0..362c1832aa 100644 --- a/modules/globebrowsing/globes/renderableglobe.cpp +++ b/modules/globebrowsing/globes/renderableglobe.cpp @@ -39,27 +39,22 @@ // ghoul includes #include - namespace { const std::string _loggerCat = "RenderableGlobe"; // Keys for the dictionary - const std::string keyFrame = "Frame"; - const std::string keyRadii = "Radii"; - const std::string keyInteractionDepthBelowEllipsoid = "InteractionDepthBelowEllipsoid"; - const std::string keyCameraMinHeight = "CameraMinHeight"; - const std::string keySegmentsPerPatch = "SegmentsPerPatch"; - const std::string keyTextureInitData = "TextureInitData"; - const std::string keyTextures = "Textures"; - const std::string keyColorTextures = "ColorTextures"; - const std::string keyHeightMaps = "HeightMaps"; + const char* keyFrame = "Frame"; + const char* keyRadii = "Radii"; + const char* keyInteractionDepthBelowEllipsoid = "InteractionDepthBelowEllipsoid"; + const char* keyCameraMinHeight = "CameraMinHeight"; + const char* keySegmentsPerPatch = "SegmentsPerPatch"; + const char* keyTextureInitData = "TextureInitData"; + const char* keyTextures = "Textures"; + const char* keyColorTextures = "ColorTextures"; + const char* keyHeightMaps = "HeightMaps"; } - - namespace openspace { - - RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary) : _isEnabled(properties::BoolProperty("Enabled", "Enabled", true)) , _toggleEnabledEveryFrame(properties::BoolProperty("Toggle enabled every frame", "Toggle enabled every frame", false)) diff --git a/modules/globebrowsing/tile/tileprovider/cachingtileprovider.cpp b/modules/globebrowsing/tile/tileprovider/cachingtileprovider.cpp index 377d34c924..34966599a8 100644 --- a/modules/globebrowsing/tile/tileprovider/cachingtileprovider.cpp +++ b/modules/globebrowsing/tile/tileprovider/cachingtileprovider.cpp @@ -35,11 +35,11 @@ namespace { const std::string _loggerCat = "CachingTileProvider"; - const std::string KeyDoPreProcessing = "DoPreProcessing"; - const std::string KeyMinimumPixelSize = "MinimumPixelSize"; - const std::string KeyFilePath = "FilePath"; - const std::string KeyCacheSize = "CacheSize"; - const std::string KeyFlushInterval = "FlushInterval"; + const char* KeyDoPreProcessing = "DoPreProcessing"; + const char* KeyMinimumPixelSize = "MinimumPixelSize"; + const char* KeyFilePath = "FilePath"; + const char* KeyCacheSize = "CacheSize"; + const char* KeyFlushInterval = "FlushInterval"; } namespace openspace { @@ -54,7 +54,7 @@ namespace openspace { // 1. Get required Keys std::string filePath; if (!dictionary.getValue(KeyFilePath, filePath)) { - throw std::runtime_error("Must define key '" + KeyFilePath + "'"); + throw std::runtime_error(std::string("Must define key '") + KeyFilePath + "'"); } // 2. Initialize default values for any optional Keys diff --git a/modules/globebrowsing/tile/tileprovider/singleimageprovider.cpp b/modules/globebrowsing/tile/tileprovider/singleimageprovider.cpp index e88464c5c0..f20837db84 100644 --- a/modules/globebrowsing/tile/tileprovider/singleimageprovider.cpp +++ b/modules/globebrowsing/tile/tileprovider/singleimageprovider.cpp @@ -35,7 +35,7 @@ namespace { const std::string _loggerCat = "SingleImageProvider"; - const std::string KeyFilePath = "FilePath"; + const char* KeyFilePath = "FilePath"; } namespace openspace { @@ -43,7 +43,7 @@ namespace openspace { SingleImageProvider::SingleImageProvider(const ghoul::Dictionary& dictionary) { // Required input if (!dictionary.getValue(KeyFilePath, _imagePath)) { - throw std::runtime_error("Must define key '" + KeyFilePath + "'"); + throw std::runtime_error(std::string("Must define key '") + KeyFilePath + "'"); } reset(); diff --git a/modules/globebrowsing/tile/tileprovider/temporaltileprovider.cpp b/modules/globebrowsing/tile/tileprovider/temporaltileprovider.cpp index 2cdbefd741..3dca224978 100644 --- a/modules/globebrowsing/tile/tileprovider/temporaltileprovider.cpp +++ b/modules/globebrowsing/tile/tileprovider/temporaltileprovider.cpp @@ -48,11 +48,11 @@ namespace { const std::string _loggerCat = "TemporalTileProvider"; - const std::string KeyDoPreProcessing = "DoPreProcessing"; - const std::string KeyMinimumPixelSize = "MinimumPixelSize"; - const std::string KeyFilePath = "FilePath"; - const std::string KeyCacheSize = "CacheSize"; - const std::string KeyFlushInterval = "FlushInterval"; + const char* KeyDoPreProcessing = "DoPreProcessing"; + const char* KeyMinimumPixelSize = "MinimumPixelSize"; + const char* KeyFilePath = "FilePath"; + const char* KeyCacheSize = "CacheSize"; + const char* KeyFlushInterval = "FlushInterval"; } @@ -71,7 +71,7 @@ namespace openspace { { if (!dictionary.getValue(KeyFilePath, _datasetFile)) { - throw std::runtime_error("Must define key '" + KeyFilePath + "'"); + throw std::runtime_error(std::string("Must define key '") + KeyFilePath + "'"); } diff --git a/modules/globebrowsing/tile/tileprovider/tileprovider.cpp b/modules/globebrowsing/tile/tileprovider/tileprovider.cpp index f47121ec71..09fea2169a 100644 --- a/modules/globebrowsing/tile/tileprovider/tileprovider.cpp +++ b/modules/globebrowsing/tile/tileprovider/tileprovider.cpp @@ -32,7 +32,7 @@ namespace { const std::string _loggerCat = "TileProvider"; - const std::string KeyType = "Type"; + const char* KeyType = "Type"; } diff --git a/modules/newhorizons/rendering/renderablecrawlingline.cpp b/modules/newhorizons/rendering/renderablecrawlingline.cpp index 1c0035e086..7a78fa451c 100644 --- a/modules/newhorizons/rendering/renderablecrawlingline.cpp +++ b/modules/newhorizons/rendering/renderablecrawlingline.cpp @@ -32,11 +32,11 @@ namespace { const std::string _loggerCat = "RenderableCrawlingLine"; - const std::string KeySource = "Source"; - const std::string KeyTarget = "Target"; - const std::string KeyInstrument = "Instrument"; - const std::string KeyReferenceFrame = "Frame"; - const std::string keyColor = "RGB"; + const char* KeySource = "Source"; + const char* KeyTarget = "Target"; + const char* KeyInstrument = "Instrument"; + const char* KeyReferenceFrame = "Frame"; + const char* KeyColor = "RGB"; static const int SourcePosition = 0; static const int TargetPosition = 1; @@ -59,10 +59,12 @@ RenderableCrawlingLine::RenderableCrawlingLine(const ghoul::Dictionary& dictiona dictionary.getValue(KeyReferenceFrame, _referenceFrame); - if (dictionary.hasKeyAndValue(keyColor)) - dictionary.getValue(keyColor, _lineColor); - else + if (dictionary.hasKeyAndValue(KeyColor)) { + dictionary.getValue(KeyColor, _lineColor); + } + else { _lineColor = glm::vec3(1); + } } bool RenderableCrawlingLine::isReady() const { diff --git a/modules/newhorizons/rendering/renderablefov.cpp b/modules/newhorizons/rendering/renderablefov.cpp index eb7d419780..1ecf156eeb 100644 --- a/modules/newhorizons/rendering/renderablefov.cpp +++ b/modules/newhorizons/rendering/renderablefov.cpp @@ -38,15 +38,15 @@ namespace { const std::string _loggerCat = "RenderableFov"; - const std::string keyBody = "Body"; - const std::string keyFrame = "Frame"; - const std::string keyPathModule = "ModulePath"; - const std::string keyColor = "RGB"; - const std::string keyInstrument = "Instrument.Name"; - const std::string keyInstrumentMethod = "Instrument.Method"; - const std::string keyInstrumentAberration = "Instrument.Aberration"; - const std::string keyPotentialTargets = "PotentialTargets"; - const std::string keyFrameConversions = "FrameConversions"; + const char* keyBody = "Body"; + const char* keyFrame = "Frame"; + const char* keyPathModule = "ModulePath"; + const char* keyColor = "RGB"; + const char* keyInstrument = "Instrument.Name"; + const char* keyInstrumentMethod = "Instrument.Method"; + const char* keyInstrumentAberration = "Instrument.Aberration"; + const char* keyPotentialTargets = "PotentialTargets"; + const char* keyFrameConversions = "FrameConversions"; const int InterpolationSteps = 10; const int Stride = 8; diff --git a/modules/newhorizons/rendering/renderablemodelprojection.cpp b/modules/newhorizons/rendering/renderablemodelprojection.cpp index 76dc7dd40a..383eb707f5 100644 --- a/modules/newhorizons/rendering/renderablemodelprojection.cpp +++ b/modules/newhorizons/rendering/renderablemodelprojection.cpp @@ -37,15 +37,15 @@ namespace { const std::string _loggerCat = "RenderableModelProjection"; - const std::string keySource = "Rotation.Source"; - const std::string keyDestination = "Rotation.Destination"; - const std::string keyGeometry = "Geometry"; - const std::string keyProjection = "Projection"; - const std::string keyBoundingSphereRadius = "BoundingSphereRadius"; + const char* keySource = "Rotation.Source"; + const char* keyDestination = "Rotation.Destination"; + const char* keyGeometry = "Geometry"; + const char* keyProjection = "Projection"; + const char* keyBoundingSphereRadius = "BoundingSphereRadius"; - const std::string keyTextureColor = "Textures.Color"; + const char* keyTextureColor = "Textures.Color"; - const std::string _destination = "GALACTIC"; + const char* _destination = "GALACTIC"; } namespace openspace { diff --git a/modules/newhorizons/rendering/renderableplaneprojection.cpp b/modules/newhorizons/rendering/renderableplaneprojection.cpp index aebafda854..cdbd805b26 100644 --- a/modules/newhorizons/rendering/renderableplaneprojection.cpp +++ b/modules/newhorizons/rendering/renderableplaneprojection.cpp @@ -41,13 +41,13 @@ namespace { const std::string _loggerCat = "RenderablePlaneProjection"; - const std::string KeySpacecraft = "Spacecraft"; - const std::string KeyInstrument = "Instrument"; - const std::string KeyMoving = "Moving"; - const std::string KeyTexture = "Texture"; - const std::string KeyName = "Name"; - const std::string KeyTarget = "DefaultTarget"; - const std::string GalacticFrame = "GALACTIC"; + const char* KeySpacecraft = "Spacecraft"; + const char* KeyInstrument = "Instrument"; + const char* KeyMoving = "Moving"; + const char* KeyTexture = "Texture"; + const char* KeyName = "Name"; + const char* KeyTarget = "DefaultTarget"; + const char* GalacticFrame = "GALACTIC"; const double REALLY_FAR = 99999999999; } diff --git a/modules/newhorizons/rendering/renderableplanetprojection.cpp b/modules/newhorizons/rendering/renderableplanetprojection.cpp index 7c23587503..56c82c0c4e 100644 --- a/modules/newhorizons/rendering/renderableplanetprojection.cpp +++ b/modules/newhorizons/rendering/renderableplanetprojection.cpp @@ -46,15 +46,14 @@ namespace { const std::string _loggerCat = "RenderablePlanetProjection"; - const std::string keyGeometry = "Geometry"; - const std::string keyProjection = "Projection"; - const std::string keyColorTexture = "Textures.Color"; - const std::string keyHeightTexture = "Textures.Height"; + const char* keyGeometry = "Geometry"; + const char* keyProjection = "Projection"; + const char* keyColorTexture = "Textures.Color"; + const char* keyHeightTexture = "Textures.Height"; - - const std::string keyRadius = "Geometry.Radius"; - const std::string keyShading = "PerformShading"; - const std::string _mainFrame = "GALACTIC"; + const char* keyRadius = "Geometry.Radius"; + const char* keyShading = "PerformShading"; + const char* _mainFrame = "GALACTIC"; } namespace openspace { diff --git a/modules/newhorizons/rendering/renderableshadowcylinder.cpp b/modules/newhorizons/rendering/renderableshadowcylinder.cpp index 6e4b9930cd..1064230acf 100644 --- a/modules/newhorizons/rendering/renderableshadowcylinder.cpp +++ b/modules/newhorizons/rendering/renderableshadowcylinder.cpp @@ -35,13 +35,13 @@ namespace { const std::string _loggerCat = "RenderablePlane"; - const std::string KeyType = "TerminatorType"; - const std::string KeyLightSource = "LightSource"; - const std::string KeyObserver = "Observer"; - const std::string KeyBody = "Body"; - const std::string KeyBodyFrame = "BodyFrame"; - const std::string KeyMainFrame = "MainFrame"; - const std::string KeyAberration = "Aberration"; + const char* KeyType = "TerminatorType"; + const char* KeyLightSource = "LightSource"; + const char* KeyObserver = "Observer"; + const char* KeyBody = "Body"; + const char* KeyBodyFrame = "BodyFrame"; + const char* KeyMainFrame = "MainFrame"; + const char* KeyAberration = "Aberration"; } namespace openspace { diff --git a/modules/newhorizons/util/decoder.cpp b/modules/newhorizons/util/decoder.cpp index 74e1c9b87a..c6a7a600f2 100644 --- a/modules/newhorizons/util/decoder.cpp +++ b/modules/newhorizons/util/decoder.cpp @@ -30,7 +30,7 @@ #include namespace { -const std::string _loggerCat = "Decoder"; + const std::string _loggerCat = "Decoder"; } namespace openspace { diff --git a/modules/newhorizons/util/hongkangparser.cpp b/modules/newhorizons/util/hongkangparser.cpp index bd8a20b7ac..bc2fa7dd73 100644 --- a/modules/newhorizons/util/hongkangparser.cpp +++ b/modules/newhorizons/util/hongkangparser.cpp @@ -42,7 +42,7 @@ namespace { const std::string _loggerCat = "HongKangParser"; - const std::string keyTranslation = "DataInputTranslation"; + const char* keyTranslation = "DataInputTranslation"; const std::string PlaybookIdentifierName = "HongKang"; } diff --git a/modules/newhorizons/util/imagesequencer.cpp b/modules/newhorizons/util/imagesequencer.cpp index e5e1f5233e..dd83e9f2dc 100644 --- a/modules/newhorizons/util/imagesequencer.cpp +++ b/modules/newhorizons/util/imagesequencer.cpp @@ -37,7 +37,7 @@ #include namespace { -const std::string _loggerCat = "ImageSequencer"; + const std::string _loggerCat = "ImageSequencer"; } namespace openspace { diff --git a/modules/newhorizons/util/instrumentdecoder.cpp b/modules/newhorizons/util/instrumentdecoder.cpp index b575f0cf32..e4cc9d07eb 100644 --- a/modules/newhorizons/util/instrumentdecoder.cpp +++ b/modules/newhorizons/util/instrumentdecoder.cpp @@ -29,9 +29,9 @@ namespace { const std::string _loggerCat = "InstrumentDecoder"; - const std::string keyDetector = "DetectorType"; - const std::string keySpice = "Spice"; - const std::string keyStopCommand = "StopCommand"; + const char* keyDetector = "DetectorType"; + const char* keySpice = "Spice"; + const char* keyStopCommand = "StopCommand"; } namespace openspace { diff --git a/modules/newhorizons/util/instrumenttimesparser.cpp b/modules/newhorizons/util/instrumenttimesparser.cpp index 92765eb190..973c7c425c 100644 --- a/modules/newhorizons/util/instrumenttimesparser.cpp +++ b/modules/newhorizons/util/instrumenttimesparser.cpp @@ -39,11 +39,11 @@ namespace { const std::string _loggerCat = "InstrumentTimesParser"; - const std::string PlaybookIdentifierName = "InstrumentTimesParser"; - const std::string KeyTargetBody = "Target.Body"; - const std::string KeyInstruments = "Instruments"; - const std::string KeyInstrument = "Instrument"; - const std::string KeyInstrumentFiles = "Files"; + const char* PlaybookIdentifierName = "InstrumentTimesParser"; + const char* KeyTargetBody = "Target.Body"; + const char* KeyInstruments = "Instruments"; + const char* KeyInstrument = "Instrument"; + const char* KeyInstrumentFiles = "Files"; } namespace openspace { diff --git a/modules/newhorizons/util/labelparser.cpp b/modules/newhorizons/util/labelparser.cpp index bccdb49ff6..a3f9279cee 100644 --- a/modules/newhorizons/util/labelparser.cpp +++ b/modules/newhorizons/util/labelparser.cpp @@ -39,13 +39,12 @@ #include #include - namespace { const std::string _loggerCat = "LabelParser"; - const std::string keySpecs = "Read"; - const std::string keyConvert = "Convert"; + const char* keySpecs = "Read"; + const char* keyConvert = "Convert"; - const std::string PlaybookIdentifierName = "LabelParser"; + const char* PlaybookIdentifierName = "LabelParser"; } namespace openspace { diff --git a/modules/newhorizons/util/projectioncomponent.cpp b/modules/newhorizons/util/projectioncomponent.cpp index e8ee1be4b2..e013c2c7e8 100644 --- a/modules/newhorizons/util/projectioncomponent.cpp +++ b/modules/newhorizons/util/projectioncomponent.cpp @@ -40,34 +40,34 @@ #include namespace { - const std::string keyPotentialTargets = "PotentialTargets"; + const char* keyPotentialTargets = "PotentialTargets"; - const std::string keyInstrument = "Instrument.Name"; - const std::string keyInstrumentFovy = "Instrument.Fovy"; - const std::string keyInstrumentAspect = "Instrument.Aspect"; + const char* keyInstrument = "Instrument.Name"; + const char* keyInstrumentFovy = "Instrument.Fovy"; + const char* keyInstrumentAspect = "Instrument.Aspect"; - const std::string keyTranslation = "DataInputTranslation"; + const char* keyTranslation = "DataInputTranslation"; - const std::string keyProjObserver = "Observer"; - const std::string keyProjTarget = "Target"; - const std::string keyProjAberration = "Aberration"; + const char* keyProjObserver = "Observer"; + const char* keyProjTarget = "Target"; + const char* keyProjAberration = "Aberration"; - const std::string keySequenceDir = "Sequence"; - const std::string keySequenceType = "SequenceType"; + const char* keySequenceDir = "Sequence"; + const char* keySequenceType = "SequenceType"; - const std::string keyNeedsTextureMapDilation = "TextureMap"; - const std::string keyNeedsShadowing = "ShadowMap"; - const std::string keyTextureMapAspectRatio = "AspectRatio"; + const char* keyNeedsTextureMapDilation = "TextureMap"; + const char* keyNeedsShadowing = "ShadowMap"; + const char* keyTextureMapAspectRatio = "AspectRatio"; - const std::string sequenceTypeImage = "image-sequence"; - const std::string sequenceTypePlaybook = "playbook"; - const std::string sequenceTypeHybrid = "hybrid"; - const std::string sequenceTypeInstrumentTimes = "instrument-times"; + const char* sequenceTypeImage = "image-sequence"; + const char* sequenceTypePlaybook = "playbook"; + const char* sequenceTypeHybrid = "hybrid"; + const char* sequenceTypeInstrumentTimes = "instrument-times"; - const std::string placeholderFile = + const char* placeholderFile = "${OPENSPACE_DATA}/scene/common/textures/placeholder.png"; - const std::string _loggerCat = "ProjectionComponent"; + const char* _loggerCat = "ProjectionComponent"; } namespace openspace { diff --git a/modules/newhorizons/util/sequenceparser.cpp b/modules/newhorizons/util/sequenceparser.cpp index 6e36361fa6..9ed8e0f95f 100644 --- a/modules/newhorizons/util/sequenceparser.cpp +++ b/modules/newhorizons/util/sequenceparser.cpp @@ -32,9 +32,9 @@ namespace { const std::string _loggerCat = "SequenceParser"; - const std::string keyTranslation = "DataInputTranslation"; + const char* keyTranslation = "DataInputTranslation"; - const std::string PlaybookIdentifierName = "Playbook"; + const char* PlaybookIdentifierName = "Playbook"; } namespace openspace { @@ -79,7 +79,7 @@ void writeToBuffer(std::vector& buffer, size_t& currentWriteL } void SequenceParser::sendPlaybookInformation(const std::string& name) { - std::string fullName = PlaybookIdentifierName + "_" + name; + std::string fullName = std::string(PlaybookIdentifierName) + "_" + name; _messageIdentifier = OsEng.networkEngine().identifier(fullName); std::vector buffer(1024); diff --git a/modules/onscreengui/src/gui.cpp b/modules/onscreengui/src/gui.cpp index f84877c944..d0802a4a9d 100644 --- a/modules/onscreengui/src/gui.cpp +++ b/modules/onscreengui/src/gui.cpp @@ -44,8 +44,8 @@ namespace { const std::string _loggerCat = "GUI"; -const std::string configurationFile = "imgui.ini"; -const std::string GuiFont = "${FONTS}/Roboto/Roboto-Regular.ttf"; +const char* configurationFile = "imgui.ini"; +const char* GuiFont = "${FONTS}/Roboto/Roboto-Regular.ttf"; const ImVec2 size = ImVec2(350, 500); //GLuint fontTex = 0; diff --git a/modules/toyvolume/rendering/toyvolumeraycaster.cpp b/modules/toyvolume/rendering/toyvolumeraycaster.cpp index ef4c46fea8..66944a1fbe 100644 --- a/modules/toyvolume/rendering/toyvolumeraycaster.cpp +++ b/modules/toyvolume/rendering/toyvolumeraycaster.cpp @@ -33,9 +33,9 @@ #include namespace { - const std::string GlslRaycastPath = "${MODULES}/toyvolume/shaders/raycast.glsl"; - const std::string GlslBoundsVsPath = "${MODULES}/toyvolume/shaders/boundsvs.glsl"; - const std::string GlslBoundsFsPath = "${MODULES}/toyvolume/shaders/boundsfs.glsl"; + const char* GlslRaycastPath = "${MODULES}/toyvolume/shaders/raycast.glsl"; + const char* GlslBoundsVsPath = "${MODULES}/toyvolume/shaders/boundsvs.glsl"; + const char* GlslBoundsFsPath = "${MODULES}/toyvolume/shaders/boundsfs.glsl"; } namespace openspace {