mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-02 00:44:43 -05:00
Merge branch 'feature/iSWA' of github.com:OpenSpace/OpenSpace-Development into feature/iSWA
This commit is contained in:
+1
-1
Submodule ext/ghoul updated: 5c9f358af8...764f918d81
@@ -1,26 +1,26 @@
|
||||
// /*****************************************************************************************
|
||||
// * *
|
||||
// * OpenSpace *
|
||||
// * *
|
||||
// * Copyright (c) 2014-2016 *
|
||||
// * *
|
||||
// * 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. *
|
||||
// ****************************************************************************************/
|
||||
/*****************************************************************************************
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2016 *
|
||||
* *
|
||||
* 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/iswa/rendering/dataplane.h>
|
||||
|
||||
#include <fstream>
|
||||
@@ -113,6 +113,16 @@ bool DataPlane::initialize(){
|
||||
setTransferFunctions(_transferFunctionsFile.value());
|
||||
});
|
||||
|
||||
// IswaManager::ref().eventHandler().subscribe(name(), "ValueChanged", [](std::string message, int v){
|
||||
// std::cout << message << v << std::endl;
|
||||
// });
|
||||
|
||||
// IswaManager::ref().eventHandler().publish("ValueChanged", "High", 5);
|
||||
|
||||
// IswaManager::ref().eventHandler().unsubscribe(name());
|
||||
|
||||
// IswaManager::ref().eventHandler().publish("ValueChanged", "High", 5);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -178,6 +178,7 @@ bool KameleonPlane::initialize(){
|
||||
});
|
||||
|
||||
updateTexture();
|
||||
return true;
|
||||
}
|
||||
|
||||
void KameleonPlane::useLog(bool useLog){ _useLog.setValue(useLog); };
|
||||
|
||||
@@ -50,7 +50,9 @@ namespace {
|
||||
|
||||
namespace openspace{
|
||||
|
||||
IswaManager::IswaManager(){
|
||||
IswaManager::IswaManager()
|
||||
: _iswaEvent()
|
||||
{
|
||||
_month["JAN"] = "01";
|
||||
_month["FEB"] = "02";
|
||||
_month["MAR"] = "03";
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#define __ISWAMANAGER_H__
|
||||
|
||||
#include <ghoul/designpattern/singleton.h>
|
||||
#include <ghoul/designpattern/event.h>
|
||||
|
||||
#include <memory>
|
||||
#include <map>
|
||||
@@ -93,6 +94,10 @@ public:
|
||||
|
||||
static scripting::ScriptEngine::LuaLibrary luaLibrary();
|
||||
|
||||
ghoul::Event<std::string, int>& iswaEvent(){
|
||||
return _iswaEvent;
|
||||
}
|
||||
|
||||
private:
|
||||
std::shared_ptr<MetadataFuture> downloadMetadata(int id);
|
||||
std::string jsonPlaneToLuaTable(std::shared_ptr<MetadataFuture> data);
|
||||
@@ -115,6 +120,9 @@ private:
|
||||
|
||||
std::map<std::string, std::shared_ptr<IswaGroup>> _groups;
|
||||
std::map<int, std::shared_ptr<CygnetInfo>> _cygnetInformation;
|
||||
|
||||
ghoul::Event<std::string, int> _iswaEvent;
|
||||
|
||||
};
|
||||
|
||||
} //namespace openspace
|
||||
|
||||
@@ -112,7 +112,7 @@ bool Histogram::add(float value, float repeat) {
|
||||
}
|
||||
|
||||
float normalizedValue = (value - _minValue) / (_maxValue - _minValue); // [0.0, 1.0]
|
||||
int binIndex = std::min( floor(normalizedValue * _numBins), _numBins - 1.0 ); // [0, _numBins - 1]
|
||||
int binIndex = std::min( (float)floor(normalizedValue * _numBins), _numBins - 1.0f ); // [0, _numBins - 1]
|
||||
|
||||
_data[binIndex] += repeat;
|
||||
_numValues += repeat;
|
||||
|
||||
Reference in New Issue
Block a user