Merge branch 'feature/iSWA' of github.com:OpenSpace/OpenSpace-Development into feature/iSWA

This commit is contained in:
Michael Nilsson
2016-06-03 16:27:00 -04:00
7 changed files with 39 additions and 81 deletions
+5 -3
View File
@@ -34,7 +34,7 @@ DataPlane::DataPlane(const ghoul::Dictionary& dictionary)
:DataCygnet(dictionary)
,_useLog("useLog","Use Logarithm", false)
,_useHistogram("useHistogram", "Auto Contrast", false)
,_autoFilter("autoFilter", "Auto Filter", false)
,_autoFilter("autoFilter", "Auto Filter", true)
,_normValues("normValues", "Normalize Values", glm::vec2(1.0,1.0), glm::vec2(0), glm::vec2(5.0))
,_backgroundValues("backgroundValues", "Background Values", glm::vec2(0.0), glm::vec2(0), glm::vec2(1.0))
,_transferFunctionsFile("transferfunctions", "Transfer Functions", "${SCENE}/iswa/tfs/default.tf")
@@ -136,9 +136,9 @@ bool DataPlane::createGeometry() {
// x y z w s t
-x, -y, -z, w, 0, 1,
x, y, z, w, 1, 0,
-x, ((x>1)?y:-y), z, w, 0, 0,
-x, ((x>0)?y:-y), z, w, 0, 0,
-x, -y, -z, w, 0, 1,
x, ((x>1)?-y:y), -z, w, 1, 1,
x, ((x>0)?-y:y), -z, w, 1, 1,
x, y, z, w, 1, 0,
};
@@ -246,6 +246,8 @@ void DataPlane::subscribeToGroup(){
groupEvent->subscribe(name(), "updateGroup", [&](ghoul::Dictionary dict){
LDEBUG(name() + " Event updateGroup");
if(_autoFilter.value())
_backgroundValues.setValue(_dataProcessor->filterValues());
updateTexture();
});
}
+2
View File
@@ -66,7 +66,9 @@ bool IswaBaseGroup::isType(std::string type){
}
void IswaBaseGroup::updateGroup(){
LDEBUG("Group " + name() + " published updateGroup");
_groupEvent->publish("updateGroup", ghoul::Dictionary());
}
void IswaBaseGroup::clearGroup(){
+1 -1
View File
@@ -42,7 +42,7 @@ namespace {
namespace openspace{
IswaKameleonGroup::IswaKameleonGroup(std::string name, std::string type)
:IswaDataGroup(name, type)
,_resolution("resolution", "Resolution%", 1.0f, 0.1, 2.0f)
,_resolution("resolution", "Resolution%", 100.0f, 10.0f, 200.0f)
,_fieldlines("fieldlineSeedsIndexFile", "Fieldline Seedpoints")
,_fieldlineIndexFile("")
,_kameleonPath("")
+10 -3
View File
@@ -46,7 +46,7 @@ KameleonPlane::KameleonPlane(const ghoul::Dictionary& dictionary)
,_backgroundValues("backgroundValues", "Background Values", glm::vec2(0.0), glm::vec2(0), glm::vec2(1.0))
,_transferFunctionsFile("transferfunctions", "Transfer Functions", "${SCENE}/iswa/tfs/default.tf")
,_fieldlines("fieldlineSeedsIndexFile", "Fieldline Seedpoints")
,_resolution("resolution", "Resolution%", 1.0f, 0.1, 2.0f)
,_resolution("resolution", "Resolution%", 100.0f, 10.0f, 200.0f)
,_slice("slice", "Slice", 0.0, 0.0, 1.0)
{
@@ -188,6 +188,11 @@ bool KameleonPlane::initialize(){
std::dynamic_pointer_cast<DataProcessorKameleon>(_dataProcessor)->dimensions(_dimensions);
_dataProcessor->addDataValues(_kwPath, _dataOptions);
// if this datacygnet has added new values then reload texture
// for the whole group, including this datacygnet, and return after.
if(_group){
_group->updateGroup();
}
updateTextureResource();
return true;
@@ -365,6 +370,8 @@ void KameleonPlane::subscribeToGroup(){
groupEvent->subscribe(name(), "updateGroup", [&](ghoul::Dictionary dict){
LDEBUG(name() + " Event updateGroup");
if(_autoFilter.value())
_backgroundValues.setValue(_dataProcessor->filterValues());
updateTexture();
});
@@ -392,8 +399,8 @@ void KameleonPlane::subscribeToGroup(){
void KameleonPlane::setDimensions(){
// the cdf files has an offset of 0.5 in normali resolution.
// with lower resolution the offset increases.
_data->offset = _origOffset - 0.5f*(1.0f/_resolution.value());
_dimensions = glm::size3_t(_data->scale*(float)_resolution.value());
_data->offset = _origOffset - 0.5f*(100.0f/_resolution.value());
_dimensions = glm::size3_t(_data->scale*((float)_resolution.value()/100.f));
_dimensions[_cut] = 1;
if(_cut == 0){
+11 -11
View File
@@ -70,21 +70,21 @@ void GuiIswaComponent::render() {
bool iondatavalue = _iondata;
ImGui::Begin("ISWA", &_isEnabled, size, 0.5f);
ImGui::Text("Global Magnetosphere");
ImGui::Checkbox("Gm From Data", &_gmdata); ImGui::SameLine();
ImGui::Checkbox("Gm From Images", &_gmimage);
// ImGui::Text("Global Magnetosphere");
// ImGui::Checkbox("Gm From Data", &_gmdata); ImGui::SameLine();
// ImGui::Checkbox("Gm From Images", &_gmimage);
ImGui::Text("Ionosphere");
ImGui::Checkbox("Ion From Data", &_iondata);
// ImGui::Text("Ionosphere");
// ImGui::Checkbox("Ion From Data", &_iondata);
ImGui::Spacing();
static const int addCygnetBufferSize = 256;
static char addCygnetBuffer[addCygnetBufferSize];
ImGui::InputText("addCynget", addCygnetBuffer, addCygnetBufferSize);
// ImGui::Spacing();
// static const int addCygnetBufferSize = 256;
// static char addCygnetBuffer[addCygnetBufferSize];
// ImGui::InputText("addCynget", addCygnetBuffer, addCygnetBufferSize);
if(ImGui::SmallButton("Add Cygnet"))
OsEng.scriptEngine().queueScript("openspace.iswa.addCygnet("+std::string(addCygnetBuffer)+");");
// if(ImGui::SmallButton("Add Cygnet"))
// OsEng.scriptEngine().queueScript("openspace.iswa.addCygnet("+std::string(addCygnetBuffer)+");");
if(_gmdata != gmdatavalue){
if(_gmdata){