Removing more warnings

This commit is contained in:
Alexander Bock
2017-07-17 18:03:37 -04:00
parent 7cfa358f04
commit 7737b082d9
42 changed files with 265 additions and 162 deletions

View File

@@ -263,10 +263,13 @@ void MemoryAwareTileCache::put(const ProviderTileKey& key,
}
void MemoryAwareTileCache::update() {
size_t dataSizeCPU = getCPUAllocatedDataSize();
size_t dataSizeGPU = getGPUAllocatedDataSize();
_cpuAllocatedTileData.setValue(dataSizeCPU / 1024 / 1024);
_gpuAllocatedTileData.setValue(dataSizeGPU / 1024 / 1024);
const size_t dataSizeCPU = getCPUAllocatedDataSize();
const size_t dataSizeGPU = getGPUAllocatedDataSize();
const size_t ByteToMegaByte = 1024 * 1024;
_cpuAllocatedTileData.setValue(dataSizeCPU / ByteToMegaByte);
_gpuAllocatedTileData.setValue(dataSizeGPU / ByteToMegaByte);
}
size_t MemoryAwareTileCache::getGPUAllocatedDataSize() const {

View File

@@ -33,7 +33,7 @@
namespace openspace::globebrowsing::chunklevelevaluator {
int AvailableTileData::getDesiredLevel(const Chunk& chunk, const RenderData& data) const {
int AvailableTileData::getDesiredLevel(const Chunk& chunk, const RenderData&) const {
auto layerManager = chunk.owner().chunkedLodGlobe()->layerManager();
// auto layers = layerManager->layerGroup(LayerManager::HeightLayers).activeLayers();
int currLevel = chunk.tileIndex().level;

View File

@@ -120,7 +120,7 @@ int ProjectedArea::getDesiredLevel(const Chunk& chunk, const RenderData& data) c
double scaledArea =
globe.generalProperties().lodScaleFactor * projectedChunkAreaApprox;
return chunk.tileIndex().level + round(scaledArea - 1);
return chunk.tileIndex().level + static_cast<int>(round(scaledArea - 1));
}
} // namespace openspace::globebrowsing::chunklevelevaluator

View File

@@ -69,7 +69,7 @@ bool HorizonCuller::isCullable(const Chunk& chunk, const RenderData& data) {
);
for (int i = 0; i < 4; ++i) {
float distance = glm::length(cameraPosition - corners[i]);
double distance = glm::length(cameraPosition - corners[i]);
if (distance < glm::length(cameraPosition - objectPosition)) {
objectPosition = corners[i];
}

View File

@@ -73,7 +73,7 @@ void GlobeBrowsingModule::internalInitialize() {
// Convert from MB to Bytes
GdalWrapper::create(
16ULL * 1024ULL * 1024ULL, // 16 MB
CpuCap.installedMainMemory() * 0.25 * 1024 * 1024); // 25% of total RAM
static_cast<size_t>(CpuCap.installedMainMemory() * 0.25 * 1024 * 1024)); // 25% of total RAM
addPropertySubOwner(GdalWrapper::ref());
#endif // GLOBEBROWSING_USE_GDAL
});

View File

@@ -29,20 +29,19 @@
#include <ghoul/glm.h>
#include <memory>
namespace openspace::globebrowsing {
class RenderableGlobe;
struct TileIndex;
struct Geodetic2;
struct Geodetic3;
namespace cache { class MemoryAwareTileCache; }
} // namespace openspace::globebrowsing
namespace openspace {
class Camera;
namespace globebrowsing {
class RenderableGlobe;
class TileIndex;
struct Geodetic2;
struct Geodetic3;
namespace cache {
class MemoryAwareTileCache;
}
}
class GlobeBrowsingModule : public OpenSpaceModule {
public:
constexpr static const char* Name = "GlobeBrowsing";

View File

@@ -251,10 +251,10 @@ float ChunkedLodGlobe::getHeight(glm::dvec3 position) const {
continue;
}
float sample0 = sample00 * (1.0 - samplePosFract.x) + sample10 * samplePosFract.x;
float sample1 = sample01 * (1.0 - samplePosFract.x) + sample11 * samplePosFract.x;
float sample0 = sample00 * (1.f - samplePosFract.x) + sample10 * samplePosFract.x;
float sample1 = sample01 * (1.f - samplePosFract.x) + sample11 * samplePosFract.x;
float sample = sample0 * (1.0 - samplePosFract.y) + sample1 * samplePosFract.y;
float sample = sample0 * (1.f - samplePosFract.y) + sample1 * samplePosFract.y;
// Same as is used in the shader. This is not a perfect solution but
// if the sample is actually a no-data-value (min_float) the interpolated
@@ -356,7 +356,9 @@ void ChunkedLodGlobe::debugRenderChunk(const Chunk& chunk, const glm::dmat4& mvp
}
void ChunkedLodGlobe::update(const UpdateData& data) {
setBoundingSphere(_owner.ellipsoid().maximumRadius() * data.modelTransform.scale);
setBoundingSphere(static_cast<float>(
_owner.ellipsoid().maximumRadius() * data.modelTransform.scale
));
_renderer->update();
}

View File

@@ -115,10 +115,12 @@ void PointGlobe::render(const RenderData& data) {
glm::normalize(glm::dvec3(1000000.0f) - bodyPosition));
glm::dvec3 camToBody = bodyPosition - data.camera.positionVec3();
float distanceToBody = glm::length(camToBody);
float distanceToBody = static_cast<float>(glm::length(camToBody));
float avgRadius = _owner.ellipsoid().averageRadius();
float lightIntensity = _lightIntensity.value() * data.modelTransform.scale * avgRadius / distanceToBody;
float avgRadius = static_cast<float>(_owner.ellipsoid().averageRadius());
float lightIntensity = static_cast<float>(
_lightIntensity.value() * data.modelTransform.scale * avgRadius / distanceToBody
);
float lightIntensityClamped = glm::min(lightIntensity, _intensityClamp.value());
//float lightOverflow = glm::max(lightIntensity - lightIntensityClamped, 0.0f);

View File

@@ -76,12 +76,12 @@ RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary)
glm::dvec3 radii;
dictionary.getValue(keyRadii, radii);
_ellipsoid = Ellipsoid(radii);
setBoundingSphere(_ellipsoid.maximumRadius());
setBoundingSphere(static_cast<float>(_ellipsoid.maximumRadius()));
// Ghoul can't read ints from lua dictionaries...
double patchSegmentsd;
dictionary.getValue(keySegmentsPerPatch, patchSegmentsd);
int patchSegments = patchSegmentsd;
int patchSegments = static_cast<int>(patchSegmentsd);
// Init layer manager
ghoul::Dictionary layersDictionary;
@@ -93,7 +93,10 @@ RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary)
_layerManager = std::make_shared<LayerManager>(layersDictionary);
_chunkedLodGlobe = std::make_shared<ChunkedLodGlobe>(
*this, patchSegments, _layerManager);
*this,
patchSegments,
_layerManager
);
//_pointGlobe = std::make_shared<PointGlobe>(*this);
_distanceSwitch.addSwitchValue(_chunkedLodGlobe);

View File

@@ -63,7 +63,7 @@ int BasicGrid::ySegments() const {
return _ySegments;
}
void BasicGrid::validate(int xSegments, int ySegments) {
void BasicGrid::validate(int, int) {
ghoul_assert(
xSegments > 0 && ySegments > 0,
std::string("Resolution must be at least 1x1. (") +

View File

@@ -60,10 +60,11 @@ int SkirtedGrid::ySegments() const {
return _ySegments;
}
void SkirtedGrid::validate(int xSegments, int ySegments) {
void SkirtedGrid::validate(int, int) {
ghoul_assert(
xSegments > 0 && ySegments > 0,
"Resolution must be at least 1x1. (" + std::to_string(xSegments) + ", " + std::to_string(ySegments) + ")"
"Resolution must be at least 1x1. (" + std::to_string(xSegments) + ", " +
std::to_string(ySegments) + ")"
);
}

View File

@@ -165,7 +165,12 @@ void TriangleSoup::drawUsingActiveProgram() {
}
glBindVertexArray(_vaoID);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _elementBufferID);
glDrawElements(GL_TRIANGLES, _elementData.size(), GL_UNSIGNED_INT, 0);
glDrawElements(
GL_TRIANGLES,
static_cast<GLsizei>(_elementData.size()),
GL_UNSIGNED_INT,
nullptr
);
glBindVertexArray(0);
}

View File

@@ -202,8 +202,9 @@ void ChunkRenderer::renderChunkGlobally(const Chunk& chunk, const RenderData& da
glm::dmat4 inverseModelTransform = chunk.owner().inverseModelTransform();
glm::dvec3 cameraPosition = glm::dvec3(
inverseModelTransform * glm::dvec4(data.camera.positionVec3(), 1));
float distanceScaleFactor = chunk.owner().generalProperties().lodScaleFactor *
ellipsoid.minimumRadius();
float distanceScaleFactor = static_cast<float>(
chunk.owner().generalProperties().lodScaleFactor * ellipsoid.minimumRadius()
);
programObject->setUniform("cameraPosition", glm::vec3(cameraPosition));
programObject->setUniform("distanceScaleFactor", distanceScaleFactor);
programObject->setUniform("chunkLevel", chunk.tileIndex().level);
@@ -277,8 +278,11 @@ void ChunkRenderer::renderChunkLocally(const Chunk& chunk, const RenderData& dat
if (_layerManager->hasAnyBlendingLayersEnabled()) {
float distanceScaleFactor = chunk.owner().generalProperties().lodScaleFactor *
chunk.owner().ellipsoid().minimumRadius();
float distanceScaleFactor = static_cast<float>(
chunk.owner().generalProperties().lodScaleFactor *
chunk.owner().ellipsoid().minimumRadius()
);
programObject->setUniform("distanceScaleFactor", distanceScaleFactor);
programObject->setUniform("chunkLevel", chunk.tileIndex().level);
}

View File

@@ -31,7 +31,7 @@ namespace ghoul::opengl { class ProgramObject; }
namespace openspace::globebrowsing {
struct LayerAdjustment;
class LayerAdjustment;
class GPULayerAdjustment{
public:

View File

@@ -51,7 +51,12 @@ void GPULayerManager::bind(ghoul::opengl::ProgramObject* programObject,
for (size_t i = 0; i < layerGroups.size(); ++i) {
const std::string& nameBase = layergroupid::LAYER_GROUP_NAMES[i];
_gpuLayerGroups[i]->bind(programObject, *layerGroups[i], nameBase, i);
_gpuLayerGroups[i]->bind(
programObject,
*layerGroups[i],
nameBase,
static_cast<int>(i)
);
}
}

View File

@@ -78,7 +78,15 @@ LayerShaderManager::LayerShaderPreprocessingData
const LayerGroup& layerGroup = layerManager->layerGroup(i);
std::vector<std::shared_ptr<Layer>> layers = layerGroup.activeLayers();
layeredTextureInfo.lastLayerIdx = layerGroup.activeLayers().size() - 1;
// This check was implicit before; not sure if it will fire or will be handled
// elsewhere
ghoul_assert(
!layerGroup.activeLayers().empty(),
"If activeLayers is empty the following line will lead to an overflow"
);
layeredTextureInfo.lastLayerIdx = static_cast<int>(
layerGroup.activeLayers().size() - 1
);
layeredTextureInfo.layerBlendingEnabled = layerGroup.layerBlendingEnabled();
for (const std::shared_ptr<Layer>& layer : layers) {

View File

@@ -257,13 +257,15 @@ PixelRegion::PixelCoordinate PixelRegion::end() const {
bool PixelRegion::lineIntersect(Side side, int p) {
switch (side) {
case Side::LEFT:
case Side::RIGHT:
return start.x <= p && p <= (start.x + numPixels.x);
case Side::LEFT:
case Side::RIGHT:
return start.x <= p && p <= (start.x + numPixels.x);
case Side::TOP:
case Side::BOTTOM:
return start.y <= p && p <= (start.y + numPixels.y);
case Side::TOP:
case Side::BOTTOM:
return start.y <= p && p <= (start.y + numPixels.y);
default:
throw ghoul::MissingCaseException();
}
}

View File

@@ -55,11 +55,11 @@ SingleImageProvider::SingleImageProvider(const std::string& imagePath)
reset();
}
Tile SingleImageProvider::getTile(const TileIndex& tileIndex) {
Tile SingleImageProvider::getTile(const TileIndex&) {
return _tile;
}
Tile::Status SingleImageProvider::getTileStatus(const TileIndex& index) {
Tile::Status SingleImageProvider::getTileStatus(const TileIndex&) {
return _tile.status();
}

View File

@@ -47,7 +47,7 @@ SizeReferenceTileProvider::SizeReferenceTileProvider(const ghoul::Dictionary& di
, _backgroundTile(Tile::TileUnavailable)
{
_fontSize = 50;
_font = OsEng.fontManager().font("Mono", _fontSize);
_font = OsEng.fontManager().font("Mono", static_cast<float>(_fontSize));
glm::dvec3 radii(1,1,1);
dictionary.getValue(KeyRadii, radii);

View File

@@ -25,48 +25,49 @@
include(${OPENSPACE_CMAKE_EXT_DIR}/module_definition.cmake)
set(HEADER_FILES
${CMAKE_CURRENT_SOURCE_DIR}/util/iswamanager.h
${CMAKE_CURRENT_SOURCE_DIR}/util/dataprocessor.h
${CMAKE_CURRENT_SOURCE_DIR}/util/dataprocessortext.h
${CMAKE_CURRENT_SOURCE_DIR}/util/dataprocessorjson.h
${CMAKE_CURRENT_SOURCE_DIR}/util/dataprocessorkameleon.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/iswacygnet.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/dataplane.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/textureplane.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/kameleonplane.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/datasphere.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/screenspacecygnet.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/iswabasegroup.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/iswadatagroup.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/iswakameleongroup.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/texturecygnet.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/datacygnet.h
${CMAKE_CURRENT_SOURCE_DIR}/ext/json.h
${CMAKE_CURRENT_SOURCE_DIR}/util/iswamanager.h
${CMAKE_CURRENT_SOURCE_DIR}/util/dataprocessor.h
${CMAKE_CURRENT_SOURCE_DIR}/util/dataprocessortext.h
${CMAKE_CURRENT_SOURCE_DIR}/util/dataprocessorjson.h
${CMAKE_CURRENT_SOURCE_DIR}/util/dataprocessorkameleon.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/iswacygnet.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/dataplane.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/textureplane.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/kameleonplane.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/datasphere.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/screenspacecygnet.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/iswabasegroup.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/iswadatagroup.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/iswakameleongroup.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/texturecygnet.h
${CMAKE_CURRENT_SOURCE_DIR}/rendering/datacygnet.h
)
source_group("Header Files" FILES ${HEADER_FILES})
set(SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/util/iswamanager.cpp
${CMAKE_CURRENT_SOURCE_DIR}/util/dataprocessor.cpp
${CMAKE_CURRENT_SOURCE_DIR}/util/dataprocessortext.cpp
${CMAKE_CURRENT_SOURCE_DIR}/util/dataprocessorjson.cpp
${CMAKE_CURRENT_SOURCE_DIR}/util/dataprocessorkameleon.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/iswacygnet.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/dataplane.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/textureplane.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/kameleonplane.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/datasphere.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/screenspacecygnet.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/iswabasegroup.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/iswadatagroup.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/iswakameleongroup.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/texturecygnet.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/datacygnet.cpp
${CMAKE_CURRENT_SOURCE_DIR}/util/iswamanager.cpp
${CMAKE_CURRENT_SOURCE_DIR}/util/dataprocessor.cpp
${CMAKE_CURRENT_SOURCE_DIR}/util/dataprocessortext.cpp
${CMAKE_CURRENT_SOURCE_DIR}/util/dataprocessorjson.cpp
${CMAKE_CURRENT_SOURCE_DIR}/util/dataprocessorkameleon.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/iswacygnet.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/dataplane.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/textureplane.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/kameleonplane.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/datasphere.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/screenspacecygnet.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/iswabasegroup.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/iswadatagroup.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/iswakameleongroup.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/texturecygnet.cpp
${CMAKE_CURRENT_SOURCE_DIR}/rendering/datacygnet.cpp
)
source_group("Source Files" FILES ${SOURCE_FILES})
set(SHADER_FILES
${CMAKE_CURRENT_SOURCE_DIR}/shaders/dataplane_fs.glsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/dataplane_vs.glsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/dataplane_fs.glsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/dataplane_vs.glsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/textureplane_fs.glsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/textureplane_vs.glsl
)

View File

@@ -86,9 +86,9 @@ bool DataPlane::createGeometry() {
// ============================
// GLfloat x,y, z;
float s = _data->spatialScale.x;
const GLfloat x = s*_data->scale.x/2.0;
const GLfloat y = s*_data->scale.y/2.0;
const GLfloat z = s*_data->scale.z/2.0;
const GLfloat x = s*_data->scale.x/2.f;
const GLfloat y = s*_data->scale.y/2.f;
const GLfloat z = s*_data->scale.z/2.f;
const GLfloat w = _data->spatialScale.w;
const GLfloat vertex_data[] = { // square of two triangles (sigh)

View File

@@ -25,7 +25,7 @@
#include <modules/iswa/rendering/iswabasegroup.h>
#include <fstream>
#include <modules/iswa/ext/json/json.hpp>
#include <modules/iswa/ext/json.h>
#include <modules/iswa/util/dataprocessortext.h>
#include <modules/iswa/util/dataprocessorjson.h>

View File

@@ -178,10 +178,10 @@ void IswaCygnet::render(const RenderData& data){
_shader->deactivate();
}
void IswaCygnet::update(const UpdateData& data){
if (!_enabled)
void IswaCygnet::update(const UpdateData&) {
if (!_enabled) {
return;
}
// the texture resource is downloaded ahead of time, so we need to
// now if we are going backwards or forwards
@@ -193,13 +193,14 @@ void IswaCygnet::update(const UpdateData& data){
bool timeToUpdate = (fabs(_openSpaceTime-_lastUpdateOpenSpaceTime) >= _data->updateTime &&
(_realTime.count()-_lastUpdateRealTime.count()) > _minRealTimeUpdateInterval);
if(_futureObject.valid() && DownloadManager::futureReady(_futureObject)) {
if (_futureObject.valid() && DownloadManager::futureReady(_futureObject)) {
bool success = updateTextureResource();
if(success)
if (success) {
_textureDirty = true;
}
}
if(_textureDirty && _data->updateTime != 0 && timeToUpdate) {
if (_textureDirty && _data->updateTime != 0 && timeToUpdate) {
updateTexture();
_textureDirty = false;
@@ -208,13 +209,14 @@ void IswaCygnet::update(const UpdateData& data){
_lastUpdateOpenSpaceTime =_openSpaceTime;
}
if(!_transferFunctions.empty())
for(auto tf : _transferFunctions)
if (!_transferFunctions.empty()) {
for (const std::shared_ptr<TransferFunction>& tf : _transferFunctions) {
tf->update();
}
}
}
bool IswaCygnet::destroyShader(){
bool IswaCygnet::destroyShader() {
RenderEngine& renderEngine = OsEng.renderEngine();
if (_shader) {
renderEngine.removeRenderProgram(_shader);
@@ -223,13 +225,11 @@ bool IswaCygnet::destroyShader(){
return true;
}
void IswaCygnet::registerProperties(){
}
void IswaCygnet::registerProperties() {}
void IswaCygnet::unregisterProperties(){
}
void IswaCygnet::unregisterProperties() {}
void IswaCygnet::initializeTime(){
void IswaCygnet::initializeTime() {
_openSpaceTime = OsEng.timeManager().time().j2000Seconds();
_lastUpdateOpenSpaceTime = 0.0;
@@ -239,19 +239,21 @@ void IswaCygnet::initializeTime(){
_minRealTimeUpdateInterval = 100;
}
bool IswaCygnet::createShader(){
bool IswaCygnet::createShader() {
if (_shader == nullptr) {
RenderEngine& renderEngine = OsEng.renderEngine();
_shader = renderEngine.buildRenderProgram(_programName,
_vsPath,
_fsPath
);
if (!_shader) return false;
);
if (!_shader) {
return false;
}
}
return true;
}
void IswaCygnet::initializeGroup(){
void IswaCygnet::initializeGroup() {
_group = IswaManager::ref().iswaGroup(_data->groupName);
//Subscribe to enable and delete property

View File

@@ -25,7 +25,7 @@
#include <modules/iswa/rendering/iswadatagroup.h>
#include <fstream>
#include <modules/iswa/ext/json/json.hpp>
#include <modules/iswa/ext/json.h>
#include <modules/iswa/util/dataprocessortext.h>
#include <modules/iswa/util/dataprocessorjson.h>

View File

@@ -25,7 +25,7 @@
#include <modules/iswa/rendering/iswakameleongroup.h>
#include <fstream>
#include <modules/iswa/ext/json/json.hpp>
#include <modules/iswa/ext/json.h>
#include <modules/iswa/util/dataprocessortext.h>
#include <modules/iswa/util/dataprocessorjson.h>

View File

@@ -26,7 +26,7 @@
#include <modules/iswa/rendering/kameleonplane.h>
#include <modules/iswa/util/dataprocessorkameleon.h>
#include <ghoul/filesystem/filesystem>
#include <modules/iswa/ext/json/json.hpp>
#include <modules/iswa/ext/json.h>
#include <openspace/engine/openspaceengine.h>
#include <openspace/scene/scene.h>

View File

@@ -64,9 +64,9 @@ bool TexturePlane::createGeometry() {
// ============================
float s = _data->spatialScale.x;
const GLfloat x = s*_data->scale.x/2.0;
const GLfloat y = s*_data->scale.y/2.0;
const GLfloat z = s*_data->scale.z/2.0;
const GLfloat x = s*_data->scale.x/2.f;
const GLfloat y = s*_data->scale.y/2.f;
const GLfloat z = s*_data->scale.z/2.f;
const GLfloat w = _data->spatialScale.w;
const GLfloat vertex_data[] = { // square of two triangles (sigh)

View File

@@ -26,7 +26,7 @@
#include <algorithm>
#include <iterator>
#include <modules/iswa/ext/json/json.hpp>
#include <modules/iswa/ext/json.h>
namespace {
const char* _loggerCat = "DataProcessorJson";

View File

@@ -47,7 +47,7 @@
#include <ghoul/lua/ghoul_lua.h>
#include <ghoul/lua/lua_helper.h>
#include "iswamanager_lua.inl";
#include "iswamanager_lua.inl"
namespace {
using json = nlohmann::json;
@@ -168,11 +168,17 @@ void IswaManager::addKameleonCdf(std::string groupName, int pos){
std::future<DownloadManager::MemoryFile> IswaManager::fetchImageCygnet(int id, double timestamp){
return std::move(OsEng.downloadManager().fetchFile(
iswaUrl(id, timestamp, "image"),
[id](const DownloadManager::MemoryFile& file){
LDEBUG("Download to memory finished for image cygnet with id: " + std::to_string(id));
[id](const DownloadManager::MemoryFile&) {
LDEBUG(
"Download to memory finished for image cygnet with id: " +
std::to_string(id)
);
},
[id](const std::string& err){
LDEBUG("Download to memory was aborted for image cygnet with id "+ std::to_string(id)+": " + err);
[id](const std::string& err) {
LDEBUG(
"Download to memory was aborted for image cygnet with id " +
std::to_string(id) + ": " + err
);
}
) );
}
@@ -180,20 +186,26 @@ std::future<DownloadManager::MemoryFile> IswaManager::fetchImageCygnet(int id, d
std::future<DownloadManager::MemoryFile> IswaManager::fetchDataCygnet(int id, double timestamp){
return std::move(OsEng.downloadManager().fetchFile(
iswaUrl(id, timestamp, "data"),
[id](const DownloadManager::MemoryFile& file){
LDEBUG("Download to memory finished for data cygnet with id: " + std::to_string(id));
[id](const DownloadManager::MemoryFile& ) {
LDEBUG(
"Download to memory finished for data cygnet with id: " +
std::to_string(id)
);
},
[id](const std::string& err){
LDEBUG("Download to memory was aborted for data cygnet with id " + std::to_string(id)+": " + err);
LDEBUG(
"Download to memory was aborted for data cygnet with id " +
std::to_string(id) + ": " + err
);
}
) );
}
std::string IswaManager::iswaUrl(int id, double timestamp, std::string type){
std::string url;
if(id < 0){
if (id < 0) {
url = _baseUrl + type+"/" + std::to_string(-id) + "/";
} else{
} else {
url = "http://iswa3.ccmc.gsfc.nasa.gov/IswaSystemWebApp/iSWACygnetStreamer?window=-1&cygnetId="+ std::to_string(id) +"&timestamp=";
}
@@ -215,7 +227,7 @@ std::string IswaManager::iswaUrl(int id, double timestamp, std::string type){
}
void IswaManager::registerGroup(std::string groupName, std::string type){
if(_groups.find(groupName) == _groups.end()){
if (_groups.find(groupName) == _groups.end()) {
bool dataGroup = (type == typeid(DataPlane).name()) ||
(type == typeid(DataSphere).name());

View File

@@ -44,7 +44,7 @@
#include <openspace/scripting/scriptengine.h>
#include <openspace/util/spicemanager.h>
#include <openspace/properties/selectionproperty.h>
#include <modules/iswa/ext/json/json.hpp>
#include <modules/iswa/ext/json.h>
#include <openspace/util/timemanager.h>
#include <openspace/util/time.h>

View File

@@ -33,14 +33,17 @@ int iswa_addCygnet(lua_State* L) {
std::string type = "Texture";
std::string group = "";
if(nArguments > 0)
id = lua_tonumber(L, 1);
if (nArguments > 0) {
id = static_cast<int>(lua_tonumber(L, 1));
}
if(nArguments > 1)
if (nArguments > 1) {
type = luaL_checkstring(L, 2);
}
if(nArguments > 2)
if (nArguments > 2) {
group = luaL_checkstring(L, 3);
}
IswaManager::ref().addIswaCygnet(id, type, group);
@@ -125,7 +128,7 @@ int iswa_removeCygnet(lua_State* L){
int iswa_removeScrenSpaceCygnet(lua_State* L){
static const std::string _loggerCat = "removeScreenSpaceCygnet";
int id = lua_tonumber(L, 1);
int id = static_cast<int>(lua_tonumber(L, 1));
auto cygnetInformation = IswaManager::ref().cygnetInformation();
if(cygnetInformation.find(id) == cygnetInformation.end()){

View File

@@ -26,12 +26,21 @@
#include <ghoul/logging/logmanager.h>
#include <ghoul/filesystem/filesystem.h>
#ifdef WIN32
#pragma warning (push)
#pragma warning (disable : 4619) // #pragma warning: there is no warning number '4675'
#endif // WIN32
#include <ccmc/Model.h>
#include <ccmc/BATSRUS.h>
#include <ccmc/ENLIL.h>
#include <ccmc/CCMCTime.h>
#include <ccmc/Attribute.h>
#ifdef WIN32
#pragma warning (pop)
#endif // WIN32
namespace {
const char* _loggerCat = "KameleonVolumeReader";
} // namespace
@@ -113,9 +122,22 @@ std::vector<std::string> KameleonVolumeReader::gridVariableNames() const {
std::string y = tokens.at(1);
std::string z = tokens.at(2);
std::transform(x.begin(), x.end(), x.begin(), tolower);
std::transform(y.begin(), y.end(), y.begin(), tolower);
std::transform(z.begin(), z.end(), z.begin(), tolower);
std::transform(
x.begin(),
x.end(),
x.begin(),
[](char v) { return static_cast<char>(tolower(v)); }
);
std::transform(
y.begin(),
y.end(), y.begin(),
[](char v) { return static_cast<char>(tolower(v)); }
);
std::transform(
z.begin(),
z.end(), z.begin(),
[](char v) { return static_cast<char>(tolower(v)); }
);
return std::vector<std::string>{x, y, z};
}

View File

@@ -127,7 +127,9 @@ void KameleonVolumeRaycaster::preRaycast(const RaycastData& data, ghoul::opengl:
program.setUniform("clipOffsets_" + id, clipOffsets.data(), nClips);
}
void KameleonVolumeRaycaster::postRaycast(const RaycastData& data, ghoul::opengl::ProgramObject& program) {
void KameleonVolumeRaycaster::postRaycast(const RaycastData&,
ghoul::opengl::ProgramObject&)
{
// For example: release texture units
_textureUnit = nullptr;
_tfUnit = nullptr;

View File

@@ -76,7 +76,7 @@ RenderableKameleonVolume::RenderableKameleonVolume(const ghoul::Dictionary& dict
, _gridType("gridType", "Grid Type", properties::OptionProperty::DisplayType::Dropdown)
, _autoGridType(false)
, _clipPlanes(nullptr)
, _stepSize("stepSize", "Step Size", 0.02, 0.01, 1)
, _stepSize("stepSize", "Step Size", 0.02f, 0.01f, 1.f)
, _sourcePath("sourcePath", "Source Path")
, _transferFunctionPath("transferFunctionPath", "Transfer Function Path")
, _raycaster(nullptr)
@@ -383,7 +383,7 @@ bool RenderableKameleonVolume::isReady() const {
return true;
}
void RenderableKameleonVolume::update(const UpdateData& data) {
void RenderableKameleonVolume::update(const UpdateData&) {
if (_raycaster) {
_raycaster->setStepSize(_stepSize);
}

View File

@@ -170,8 +170,8 @@ bool MultiresVolumeRaycaster::cameraIsInside(const RenderData& data,
localPosition.x < 1 && localPosition.y < 1 && localPosition.z < 1);
}
void MultiresVolumeRaycaster::postRaycast(const RaycastData& data,
ghoul::opengl::ProgramObject& program)
void MultiresVolumeRaycaster::postRaycast(const RaycastData&,
ghoul::opengl::ProgramObject&)
{
_atlasUnit = nullptr;
_tfUnit = nullptr;

View File

@@ -136,7 +136,7 @@ RenderableMultiresVolume::RenderableMultiresVolume (const ghoul::Dictionary& dic
glm::vec3 scaling, translation, rotation;
if (dictionary.getValue("ScalingExponent", scalingExponent)) {
_scalingExponent = scalingExponent;
_scalingExponent = static_cast<int>(scalingExponent);
}
if (dictionary.getValue("Scaling", scaling)) {
_scaling = scaling;
@@ -278,8 +278,14 @@ bool RenderableMultiresVolume::setSelectorType(Selector selector) {
if (!_tfBrickSelector) {
TfBrickSelector* tbs;
_errorHistogramManager = new ErrorHistogramManager(_tsp.get());
_tfBrickSelector = tbs = new TfBrickSelector(_tsp.get(), _errorHistogramManager, _transferFunction.get(), _memoryBudget, _streamingBudget);
_transferFunction->setCallback([tbs](const TransferFunction &tf) {
_tfBrickSelector = tbs = new TfBrickSelector(
_tsp.get(),
_errorHistogramManager,
_transferFunction.get(),
_memoryBudget,
_streamingBudget
);
_transferFunction->setCallback([tbs](const TransferFunction& /*tf*/) {
tbs->calculateBrickErrors();
});
if (initializeSelector()) {
@@ -293,8 +299,14 @@ bool RenderableMultiresVolume::setSelectorType(Selector selector) {
if (!_simpleTfBrickSelector) {
SimpleTfBrickSelector *stbs;
_histogramManager = new HistogramManager();
_simpleTfBrickSelector = stbs = new SimpleTfBrickSelector(_tsp.get(), _histogramManager, _transferFunction.get(), _memoryBudget, _streamingBudget);
_transferFunction->setCallback([stbs](const TransferFunction &tf) {
_simpleTfBrickSelector = stbs = new SimpleTfBrickSelector(
_tsp.get(),
_histogramManager,
_transferFunction.get(),
_memoryBudget,
_streamingBudget
);
_transferFunction->setCallback([stbs](const TransferFunction& /*tf*/) {
stbs->calculateBrickImportances();
});
if (initializeSelector()) {
@@ -308,8 +320,14 @@ bool RenderableMultiresVolume::setSelectorType(Selector selector) {
if (!_localTfBrickSelector) {
LocalTfBrickSelector* ltbs;
_localErrorHistogramManager = new LocalErrorHistogramManager(_tsp.get());
_localTfBrickSelector = ltbs = new LocalTfBrickSelector(_tsp.get(), _localErrorHistogramManager, _transferFunction.get(), _memoryBudget, _streamingBudget);
_transferFunction->setCallback([ltbs](const TransferFunction &tf) {
_localTfBrickSelector = ltbs = new LocalTfBrickSelector(
_tsp.get(),
_localErrorHistogramManager,
_transferFunction.get(),
_memoryBudget,
_streamingBudget
);
_transferFunction->setCallback([ltbs](const TransferFunction& /*tf*/) {
ltbs->calculateBrickErrors();
});
if (initializeSelector()) {

View File

@@ -119,7 +119,7 @@ RenderableModelProjection::RenderableModelProjection(const ghoul::Dictionary& di
);
std::string name;
bool success = dictionary.getValue(SceneGraphNode::KeyName, name);
dictionary.getValue(SceneGraphNode::KeyName, name);
ghoul_assert(success, "Name was not passed to RenderableModelProjection");
using ghoul::Dictionary;

View File

@@ -32,7 +32,7 @@
#include <ghoul/filesystem/filesystem>
#include <ext/json/json.hpp>
#include <modules/iswa/ext/json.h>
#include "imgui.h"

View File

@@ -35,13 +35,13 @@
using namespace TUIO;
void TuioEar::addTuioObject(TuioObject *tobj) { }
void TuioEar::addTuioObject(TuioObject*) { }
void TuioEar::updateTuioObject(TuioObject *tobj) { }
void TuioEar::updateTuioObject(TuioObject*) { }
void TuioEar::removeTuioObject(TuioObject *tobj) { }
void TuioEar::removeTuioObject(TuioObject*) { }
void TuioEar::addTuioCursor(TuioCursor *tcur) {
void TuioEar::addTuioCursor(TuioCursor* tcur) {
_mx.lock();
_tap = false;
// find same id in _list if it exists in _removeList (new input with same ID as a previously stored)
@@ -67,7 +67,7 @@ void TuioEar::addTuioCursor(TuioCursor *tcur) {
_mx.unlock();
}
void TuioEar::updateTuioCursor(TuioCursor *tcur) {
void TuioEar::updateTuioCursor(TuioCursor* tcur) {
_mx.lock();
_tap = false;
int i = tcur->getSessionID();
@@ -81,7 +81,7 @@ void TuioEar::updateTuioCursor(TuioCursor *tcur) {
}
// save id to be removed and remove it in clearInput
void TuioEar::removeTuioCursor(TuioCursor *tcur) {
void TuioEar::removeTuioCursor(TuioCursor* tcur) {
_mx.lock();
_removeList.push_back(tcur->getSessionID());
@@ -101,13 +101,13 @@ void TuioEar::removeTuioCursor(TuioCursor *tcur) {
_mx.unlock();
}
void TuioEar::addTuioBlob(TuioBlob *tblb) { }
void TuioEar::addTuioBlob(TuioBlob*) { }
void TuioEar::updateTuioBlob(TuioBlob *tblb) { }
void TuioEar::updateTuioBlob(TuioBlob*) { }
void TuioEar::removeTuioBlob(TuioBlob *tblb) { }
void TuioEar::removeTuioBlob(TuioBlob*) { }
void TuioEar::refresh(TuioTime frameTime) { } // about every 15ms
void TuioEar::refresh(TuioTime) { } // about every 15ms
std::vector<TuioCursor> TuioEar::getInput() {
return _list;

View File

@@ -93,7 +93,7 @@ void ToyVolumeRaycaster::preRaycast(const RaycastData& data, ghoul::opengl::Prog
program.setUniform(timeUniformName, static_cast<float>(std::fmod(_time, 3600.0)));
}
void ToyVolumeRaycaster::postRaycast(const RaycastData& data, ghoul::opengl::ProgramObject& program) {
void ToyVolumeRaycaster::postRaycast(const RaycastData&, ghoul::opengl::ProgramObject&) {
// For example: release texture units
}

View File

@@ -162,11 +162,11 @@ SurfacePositionHandle Renderable::calculateSurfacePositionHandle(
const glm::dvec3& targetModelSpace)
{
glm::dvec3 directionFromCenterToTarget = glm::normalize(targetModelSpace);
return {
directionFromCenterToTarget * static_cast<double>(boundingSphere()),
return {
directionFromCenterToTarget * static_cast<double>(boundingSphere()),
directionFromCenterToTarget,
0.0
};
0.0
};
}
void Renderable::setPscUniforms(ghoul::opengl::ProgramObject& program,

View File

@@ -22,8 +22,17 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#ifdef WIN32
#pragma warning (push)
#pragma warning (disable : 4619) // #pragma warning: there is no warning number '4800'
#endif // WIN32
#include "gtest/gtest.h"
#ifdef WIN32
#pragma warning (pop)
#endif // WIN32
// When running the unit tests we don't want to be asked what to do in the case of an
// assertion
#ifndef GHL_THROW_ON_ASSERT