mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-12 22:39:09 -05:00
Fix a variety of warnings
This commit is contained in:
@@ -59,10 +59,10 @@ public:
|
||||
TransformationManager();
|
||||
~TransformationManager();
|
||||
|
||||
glm::dmat3 frameTransformationMatrix(std::string from, std::string to, double ephemerisTime) const;
|
||||
glm::dmat3 frameTransformationMatrix(const std::string& from, const std::string& to, double ephemerisTime) const;
|
||||
|
||||
private:
|
||||
glm::dmat3 kameleonTransformationMatrix(std::string from, std::string to, double ephemerisTime) const;
|
||||
glm::dmat3 kameleonTransformationMatrix(const std::string& from, const std::string& to, double ephemerisTime) const;
|
||||
|
||||
#ifdef OPENSPACE_MODULE_KAMELEON_ENABLED
|
||||
std::shared_ptr<ccmc::Kameleon> _kameleon;
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
|
||||
namespace {
|
||||
const char* KeyName = "Name";
|
||||
const char* KeyUrl = "URL";
|
||||
|
||||
static const openspace::properties::Property::PropertyInfo TexturePathInfo = {
|
||||
"TexturePath",
|
||||
|
||||
@@ -654,8 +654,8 @@ void RenderableBillboardsCloud::renderLabels(const RenderData& data, const glm::
|
||||
scale = 306391534.73091 * PARSEC;
|
||||
break;
|
||||
}
|
||||
|
||||
for (const auto pair : _labelData) {
|
||||
|
||||
for (const std::pair<glm::vec3, std::string>& pair : _labelData) {
|
||||
//glm::vec3 scaledPos(_transformationMatrix * glm::dvec4(pair.first, 1.0));
|
||||
glm::vec3 scaledPos(pair.first);
|
||||
scaledPos *= scale;
|
||||
@@ -673,8 +673,7 @@ void RenderableBillboardsCloud::renderLabels(const RenderData& data, const glm::
|
||||
_renderOption.value(),
|
||||
"%s",
|
||||
pair.second.c_str());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void RenderableBillboardsCloud::render(const RenderData& data, RendererTasks&) {
|
||||
|
||||
@@ -235,15 +235,15 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary)
|
||||
, _alphaValue(TransparencyInfo, 1.f, 0.f, 1.f)
|
||||
, _scaleFactor(ScaleFactorInfo, 1.f, 0.f, 64.f)
|
||||
//, _pointColor(ColorInfo, glm::vec3(1.f, 0.4f, 0.2f), glm::vec3(0.f, 0.f, 0.f), glm::vec3(1.0f, 1.0f, 1.0f))
|
||||
, _drawLabels(DrawLabelInfo, false)
|
||||
, _textColor(
|
||||
TextColorInfo,
|
||||
glm::vec4(1.0f, 1.0, 1.0f, 1.f),
|
||||
glm::vec4(0.f),
|
||||
glm::vec4(1.f)
|
||||
)
|
||||
, _textSize(TextSizeInfo, 8.0, 0.5, 24.0)
|
||||
, _textSize(TextSizeInfo, 8.0, 0.5, 24.0)
|
||||
, _drawElements(DrawElementsInfo, true)
|
||||
, _drawLabels(DrawLabelInfo, false)
|
||||
, _renderOption(RenderOptionInfo, properties::OptionProperty::DisplayType::Dropdown)
|
||||
, _program(nullptr)
|
||||
, _fontRenderer(nullptr)
|
||||
@@ -251,10 +251,8 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary)
|
||||
, _speckFile("")
|
||||
, _labelFile("")
|
||||
, _unit(Parsec)
|
||||
, _nValuesPerAstronomicalObject(0)
|
||||
, _nValuesPerAstronomicalObject(0)
|
||||
{
|
||||
using File = ghoul::filesystem::File;
|
||||
|
||||
documentation::testSpecificationAndThrow(
|
||||
Documentation(),
|
||||
dictionary,
|
||||
@@ -382,7 +380,6 @@ void RenderableDUMeshes::initialize() {
|
||||
bool success = loadData();
|
||||
if (!success) {
|
||||
throw ghoul::RuntimeError("Error loading data");
|
||||
return;
|
||||
}
|
||||
|
||||
createMeshes();
|
||||
@@ -400,7 +397,7 @@ void RenderableDUMeshes::initialize() {
|
||||
}
|
||||
|
||||
void RenderableDUMeshes::deinitialize() {
|
||||
for (auto pair : _renderingMeshesMap) {
|
||||
for (const std::pair<int, RenderingMesh>& pair : _renderingMeshesMap) {
|
||||
for (int i = 0; i < pair.second.numU; ++i) {
|
||||
glDeleteVertexArrays(1, &pair.second.vaoArray[i]);
|
||||
glDeleteBuffers(1, &pair.second.vboArray[i]);
|
||||
@@ -414,8 +411,10 @@ void RenderableDUMeshes::deinitialize() {
|
||||
}
|
||||
}
|
||||
|
||||
void RenderableDUMeshes::renderMeshes(const RenderData& data, const glm::dmat4& modelViewMatrix,
|
||||
const glm::dmat4& projectionMatrix) {
|
||||
void RenderableDUMeshes::renderMeshes(const RenderData&,
|
||||
const glm::dmat4& modelViewMatrix,
|
||||
const glm::dmat4& projectionMatrix)
|
||||
{
|
||||
// Saving current OpenGL state
|
||||
GLboolean blendEnabled = glIsEnabled(GL_BLEND);
|
||||
GLenum blendEquationRGB;
|
||||
@@ -514,7 +513,7 @@ void RenderableDUMeshes::renderLabels(const RenderData& data, const glm::dmat4&
|
||||
break;
|
||||
}
|
||||
|
||||
for (const auto pair : _labelData) {
|
||||
for (const std::pair<glm::vec3, std::string>& pair : _labelData) {
|
||||
//glm::vec3 scaledPos(_transformationMatrix * glm::dvec4(pair.first, 1.0));
|
||||
glm::vec3 scaledPos(pair.first);
|
||||
scaledPos *= scale;
|
||||
|
||||
@@ -154,7 +154,7 @@ private:
|
||||
glm::dmat4 _transformationMatrix;
|
||||
|
||||
std::unordered_map<int, glm::vec3> _meshColorMap;
|
||||
std::unordered_map<int, RenderingMesh> _renderingMeshesMap;
|
||||
std::unordered_map<int, RenderingMesh> _renderingMeshesMap;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -278,8 +278,6 @@ RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary
|
||||
, _sluminosity(1.f)
|
||||
, _transformationMatrix(glm::dmat4(1.0))
|
||||
{
|
||||
using File = ghoul::filesystem::File;
|
||||
|
||||
documentation::testSpecificationAndThrow(
|
||||
Documentation(),
|
||||
dictionary,
|
||||
@@ -431,7 +429,6 @@ void RenderablePlanesCloud::initialize() {
|
||||
bool success = loadData();
|
||||
if (!success) {
|
||||
throw ghoul::RuntimeError("Error loading data");
|
||||
return;
|
||||
}
|
||||
|
||||
createPlanes();
|
||||
@@ -468,8 +465,10 @@ void RenderablePlanesCloud::deinitialize() {
|
||||
}
|
||||
}
|
||||
|
||||
void RenderablePlanesCloud::renderPlanes(const RenderData& data, const glm::dmat4& modelViewMatrix,
|
||||
const glm::dmat4& projectionMatrix) {
|
||||
void RenderablePlanesCloud::renderPlanes(const RenderData&,
|
||||
const glm::dmat4& modelViewMatrix,
|
||||
const glm::dmat4& projectionMatrix)
|
||||
{
|
||||
// Saving current OpenGL state
|
||||
GLboolean blendEnabled = glIsEnabled(GL_BLEND);
|
||||
GLenum blendEquationRGB;
|
||||
@@ -580,7 +579,7 @@ void RenderablePlanesCloud::renderLabels(const RenderData& data, const glm::dmat
|
||||
break;
|
||||
}
|
||||
|
||||
for (const auto pair : _labelData) {
|
||||
for (const std::pair<glm::vec3, std::string>& pair : _labelData) {
|
||||
//glm::vec3 scaledPos(_transformationMatrix * glm::dvec4(pair.first, 1.0));
|
||||
glm::vec3 scaledPos(pair.first);
|
||||
scaledPos *= scale;
|
||||
|
||||
@@ -168,6 +168,7 @@ set(SOURCE_FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rendering/layer/layer.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rendering/layer/layeradjustment.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rendering/layer/layergroup.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rendering/layer/layergroupid.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rendering/layer/layermanager.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rendering/layer/layerrendersettings.cpp
|
||||
|
||||
|
||||
@@ -221,6 +221,8 @@ int loadWMSCapabilities(lua_State* L) {
|
||||
std::move(globe),
|
||||
std::move(url)
|
||||
);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int removeWMSServer(lua_State* L) {
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
/*****************************************************************************************
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2017 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
* without restriction, including without limitation the rights to use, copy, modify, *
|
||||
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
|
||||
* permit persons to whom the Software is furnished to do so, subject to the following *
|
||||
* conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included in all copies *
|
||||
* or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
|
||||
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
|
||||
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
|
||||
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#include <modules/globebrowsing/rendering/layer/layergroupid.h>
|
||||
|
||||
namespace openspace::globebrowsing::layergroupid {
|
||||
|
||||
TypeID getTypeIDFromTypeString(const std::string& typeString) {
|
||||
for (int i = 0; i < NUM_LAYER_TYPES; ++i) {
|
||||
if (typeString == LAYER_TYPE_NAMES[i]) {
|
||||
return static_cast<TypeID>(i);
|
||||
}
|
||||
}
|
||||
return TypeID::Unknown;
|
||||
}
|
||||
|
||||
layergroupid::GroupID getGroupIDFromName(const std::string& layerGroupName) {
|
||||
for (int i = 0; i < layergroupid::NUM_LAYER_GROUPS; ++i) {
|
||||
if (layerGroupName == layergroupid::LAYER_GROUP_NAMES[i]) {
|
||||
return static_cast<layergroupid::GroupID>(i);
|
||||
}
|
||||
}
|
||||
return GroupID::Unknown;
|
||||
}
|
||||
|
||||
layergroupid::AdjustmentTypeID getAdjustmentTypeIDFromName(
|
||||
const std::string& adjustmentTypeName)
|
||||
{
|
||||
for (int i = 0; i < layergroupid::NUM_ADJUSTMENT_TYPES; ++i) {
|
||||
if (adjustmentTypeName == layergroupid::ADJUSTMENT_TYPE_NAMES[i]) {
|
||||
return static_cast<layergroupid::AdjustmentTypeID>(i);
|
||||
}
|
||||
}
|
||||
return AdjustmentTypeID::None;
|
||||
}
|
||||
|
||||
layergroupid::BlendModeID getBlendModeIDFromName(
|
||||
const std::string& blendModeName)
|
||||
{
|
||||
for (int i = 0; i < layergroupid::NUM_BLEND_MODES; ++i) {
|
||||
if (blendModeName == layergroupid::BLEND_MODE_NAMES[i]) {
|
||||
return static_cast<layergroupid::BlendModeID>(i);
|
||||
}
|
||||
}
|
||||
return BlendModeID::Normal;
|
||||
}
|
||||
|
||||
} // namespace openspace::globebrowsing::layergroupid
|
||||
@@ -110,45 +110,15 @@ enum class BlendModeID {
|
||||
Color = 4,
|
||||
};
|
||||
|
||||
static TypeID getTypeIDFromTypeString(std::string typeString) {
|
||||
for (int i = 0; i < NUM_LAYER_TYPES; ++i) {
|
||||
if (typeString == LAYER_TYPE_NAMES[i]) {
|
||||
return static_cast<TypeID>(i);
|
||||
}
|
||||
}
|
||||
return TypeID::Unknown;
|
||||
}
|
||||
TypeID getTypeIDFromTypeString(const std::string& typeString);
|
||||
|
||||
static layergroupid::GroupID getGroupIDFromName(std::string layerGroupName) {
|
||||
for (int i = 0; i < layergroupid::NUM_LAYER_GROUPS; ++i) {
|
||||
if (layerGroupName == layergroupid::LAYER_GROUP_NAMES[i]) {
|
||||
return static_cast<layergroupid::GroupID>(i);
|
||||
}
|
||||
}
|
||||
return GroupID::Unknown;
|
||||
}
|
||||
layergroupid::GroupID getGroupIDFromName(const std::string& layerGroupName);
|
||||
|
||||
static layergroupid::AdjustmentTypeID getAdjustmentTypeIDFromName(
|
||||
std::string adjustmentTypeName)
|
||||
{
|
||||
for (int i = 0; i < layergroupid::NUM_ADJUSTMENT_TYPES; ++i) {
|
||||
if (adjustmentTypeName == layergroupid::ADJUSTMENT_TYPE_NAMES[i]) {
|
||||
return static_cast<layergroupid::AdjustmentTypeID>(i);
|
||||
}
|
||||
}
|
||||
return AdjustmentTypeID::None;
|
||||
}
|
||||
layergroupid::AdjustmentTypeID getAdjustmentTypeIDFromName(
|
||||
const std::string& adjustmentTypeName);
|
||||
|
||||
static layergroupid::BlendModeID getBlendModeIDFromName(
|
||||
std::string blendModeName)
|
||||
{
|
||||
for (int i = 0; i < layergroupid::NUM_BLEND_MODES; ++i) {
|
||||
if (blendModeName == layergroupid::BLEND_MODE_NAMES[i]) {
|
||||
return static_cast<layergroupid::BlendModeID>(i);
|
||||
}
|
||||
}
|
||||
return BlendModeID::Normal;
|
||||
}
|
||||
layergroupid::BlendModeID getBlendModeIDFromName(
|
||||
const std::string& blendModeName);
|
||||
|
||||
} // namespace openspace::globebrowsing::layergroupid
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace openspace::globebrowsing {
|
||||
/**
|
||||
* Function for passing GDAL error messages to the GHOUL logging system.
|
||||
*/
|
||||
static void gdalErrorHandler(CPLErr eErrClass, int errNo, const char* msg);
|
||||
void gdalErrorHandler(CPLErr eErrClass, int errNo, const char* msg);
|
||||
|
||||
/**
|
||||
* Singleton class interfacing with global GDAL functions.
|
||||
|
||||
@@ -64,7 +64,6 @@ void GuiGlobeBrowsingComponent::render() {
|
||||
using Layer = GlobeBrowsingModule::Layer;
|
||||
|
||||
bool e = _isEnabled;
|
||||
e = e;
|
||||
|
||||
ImGui::Begin("Globe Browsing", &e, WindowSize, 0.5f);
|
||||
_isEnabled = e;
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace {
|
||||
openspace::MissionPhase::Trace t = mission.phaseTrace(currentTime, 0);
|
||||
|
||||
int treeOption = t.empty() ? 0 : ImGuiTreeNodeFlags_DefaultOpen;
|
||||
if (ImGui::TreeNodeEx(("%s" + missionHashname).c_str(), treeOption, mission.name().c_str())) {
|
||||
if (ImGui::TreeNodeEx(("%s" + missionHashname).c_str(), treeOption, "%s", mission.name().c_str())) {
|
||||
if (!mission.description().empty()) {
|
||||
ImGui::Text("%s", mission.description().c_str());
|
||||
}
|
||||
|
||||
@@ -147,8 +147,8 @@ namespace openspace::gui {
|
||||
GuiPropertyComponent::GuiPropertyComponent(std::string name, UseTreeLayout useTree, IsTopLevelWindow topLevel)
|
||||
: GuiComponent(std::move(name))
|
||||
, _useTreeLayout(useTree)
|
||||
, _isTopLevel(topLevel)
|
||||
, _currentUseTreeLayout(useTree)
|
||||
, _isTopLevel(topLevel)
|
||||
{}
|
||||
|
||||
void GuiPropertyComponent::setSource(SourceFunction function) {
|
||||
|
||||
@@ -262,13 +262,6 @@ void GuiSpaceTimeComponent::render() {
|
||||
);
|
||||
}
|
||||
|
||||
auto setDeltaTime = [](std::chrono::seconds dt) {
|
||||
OsEng.scriptEngine().queueScript(
|
||||
"openspace.time.setDeltaTime(" + std::to_string(dt.count()) + ")",
|
||||
scripting::ScriptEngine::RemoteScripting::Yes
|
||||
);
|
||||
};
|
||||
|
||||
bool minusDs = ImGui::Button("-1d/s");
|
||||
if (minusDs) {
|
||||
OsEng.scriptEngine().queueScript(
|
||||
|
||||
@@ -34,14 +34,6 @@ namespace openspace::properties {
|
||||
|
||||
namespace {
|
||||
const char* _loggerCat = "PropertyOwner";
|
||||
|
||||
bool propertyLess(Property* lhs, Property* rhs) {
|
||||
return lhs->identifier() < rhs->identifier();
|
||||
}
|
||||
|
||||
bool subOwnerLess(PropertyOwner* lhs, PropertyOwner* rhs) {
|
||||
return lhs->name() < rhs->name();
|
||||
}
|
||||
} // namespace
|
||||
|
||||
|
||||
|
||||
@@ -34,8 +34,6 @@
|
||||
#include <openspace/util/factorymanager.h>
|
||||
|
||||
namespace {
|
||||
const char* _loggerCat = "ScreenSpaceRenderable";
|
||||
|
||||
const char* KeyType = "Type";
|
||||
const char* KeyTag = "Tag";
|
||||
const float PlaneDepth = -2.f;
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace openspace {
|
||||
std::vector<std::unique_ptr<Task>> TaskLoader::tasksFromDictionary(const ghoul::Dictionary& tasksDictionary) {
|
||||
std::vector<std::unique_ptr<Task>> tasks;
|
||||
std::vector<std::string> keys = tasksDictionary.keys();
|
||||
for (const std::string key : keys) {
|
||||
for (const std::string& key : keys) {
|
||||
std::string taskName;
|
||||
ghoul::Dictionary subTask;
|
||||
if (tasksDictionary.getValue(key, taskName)) {
|
||||
@@ -52,7 +52,7 @@ std::vector<std::unique_ptr<Task>> TaskLoader::tasksFromDictionary(const ghoul::
|
||||
} else if (tasksDictionary.getValue(key, subTask)) {
|
||||
std::string taskType = subTask.value<std::string>("Type");
|
||||
std::unique_ptr<Task> task = Task::createFromDictionary(subTask);
|
||||
if (task == nullptr) {
|
||||
if (!task) {
|
||||
LERROR("Failed to create a Task object of type '" << taskType << "'");
|
||||
}
|
||||
tasks.push_back(std::move(task));
|
||||
|
||||
@@ -114,10 +114,10 @@ void TimeManager::consumeKeyframes(double dt) {
|
||||
double parameter = (t1 - t0) / (t2 - t0);
|
||||
|
||||
double y0 = time().j2000Seconds();
|
||||
double yPrime0 = time().deltaTime();
|
||||
// double yPrime0 = time().deltaTime();
|
||||
|
||||
double y2 = nextTime.j2000Seconds();
|
||||
double yPrime2 = nextTime.deltaTime();
|
||||
// double yPrime2 = nextTime.deltaTime();
|
||||
|
||||
double y1 = (1 - parameter) * y0 + parameter * y2;
|
||||
double y1Prime = (y1 - y0) / dt;
|
||||
|
||||
@@ -26,9 +26,6 @@
|
||||
#include <openspace/util/spicemanager.h>
|
||||
#include <ghoul/logging/logmanager.h>
|
||||
|
||||
#define _USE_MATH_DEFINES
|
||||
#include <math.h>
|
||||
|
||||
namespace {
|
||||
const char* _loggerCat = "TransformationManager";
|
||||
} // namespace
|
||||
@@ -53,9 +50,10 @@ TransformationManager::~TransformationManager(){
|
||||
#endif
|
||||
}
|
||||
|
||||
glm::dmat3 TransformationManager::kameleonTransformationMatrix(std::string from,
|
||||
std::string to,
|
||||
double ephemerisTime) const
|
||||
glm::dmat3 TransformationManager::kameleonTransformationMatrix(
|
||||
[[maybe_unused]] const std::string& from,
|
||||
[[maybe_unused]] const std::string& to,
|
||||
[[maybe_unused]] double ephemerisTime) const
|
||||
{
|
||||
#ifdef OPENSPACE_MODULE_KAMELEON_ENABLED
|
||||
ccmc::Position in0 = {1.f, 0.f, 0.f};
|
||||
@@ -80,9 +78,10 @@ glm::dmat3 TransformationManager::kameleonTransformationMatrix(std::string from,
|
||||
#endif
|
||||
}
|
||||
|
||||
glm::dmat3 TransformationManager::frameTransformationMatrix(std::string from,
|
||||
std::string to,
|
||||
double ephemerisTime) const
|
||||
glm::dmat3 TransformationManager::frameTransformationMatrix(
|
||||
[[maybe_unused]] const std::string& from,
|
||||
[[maybe_unused]] const std::string& to,
|
||||
[[maybe_unused]] double ephemerisTime) const
|
||||
{
|
||||
#ifdef OPENSPACE_MODULE_KAMELEON_ENABLED
|
||||
auto fromit = _kameleonFrames.find(from);
|
||||
|
||||
Reference in New Issue
Block a user